pandora_with_python.m4 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_PYTHON], [
  12. AC_ARG_WITH([python],
  13. [AS_HELP_STRING([--with-python],
  14. [Build Python Bindings @<:@default=yes@:>@])],
  15. [with_python=$withval
  16. python_requested=$withval
  17. ],
  18. [with_python=yes
  19. python_requested=no
  20. ])
  21. AS_IF([test "x$with_python" != "xno"],[
  22. AS_IF([test "x$with_python" != "xyes"],[PYTHON=$with_python])
  23. AM_PATH_PYTHON([2.4],,[with_python="no"])
  24. AC_PYTHON_DEVEL()
  25. AS_IF([test "x$pythonexists" = "xno"],[with_python="no"])
  26. ])
  27. AS_IF([test "x$with_python" = "xno" -a "$python_requested" = "yes"],[
  28. PANDORA_MSG_ERROR([Python support was explicity requested, but Python support
  29. was not found. Please correct your build environment and try
  30. again])
  31. ])
  32. AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" = "yes"])
  33. ])