pandora_with_python3.m4 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
  2. dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
  3. dnl
  4. dnl pandora-build: A pedantic build system
  5. dnl Copyright (C) 2009 Sun Microsystems, Inc.
  6. dnl This file is free software; Sun Microsystems
  7. dnl gives unlimited permission to copy and/or distribute it,
  8. dnl with or without modifications, as long as this notice is preserved.
  9. dnl
  10. dnl From Monty Taylor
  11. AC_DEFUN([PANDORA_WITH_PYTHON3], [
  12. AC_REQUIRE([PANDORA_SWIG])
  13. AC_ARG_WITH([python3],
  14. [AS_HELP_STRING([--with-python3],
  15. [Build Python3 Bindings @<:@default=yes@:>@])],[
  16. with_python3=$withval
  17. python3_requested=$withval
  18. ],[
  19. with_python3=yes
  20. python3_requested=no
  21. ])
  22. AS_IF([test "x$ac_cv_swig_has_python3_" != "xyes"],[
  23. with_python3=no
  24. ],[
  25. AS_IF([test "x$with_python3" != "xno"],[
  26. AS_IF([test "x$with_python3" != "xyes"],
  27. [PYTHON3=$with_python3],[
  28. AC_PATH_PROG([PYTHON3],[python3],[no])
  29. PANDORA_PYTHON3_DEVEL()
  30. AS_IF([test "x$python3exists" = "xno"],[with_python="no"])
  31. ])
  32. ])
  33. ])
  34. AS_IF([test "x$with_python3" = "xno" -a "$python3_requested" = "yes"],[
  35. PANDORA_MSG_ERROR([Python3 support was explicity requested, but Python3 support
  36. was not found. Please correct your build environment and try
  37. again])
  38. ])
  39. AM_CONDITIONAL(BUILD_PYTHON3, [test "$with_python3" = "yes"])
  40. ])