diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2012-02-03 23:17:30 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2012-02-03 23:17:30 +0000 |
commit | 57f2a8e9215daf83616bb05b3b134e5544f7d808 (patch) | |
tree | 3da28276007bf233dbb6835fab6f51800a02c0cc /config/bindings.m4 | |
parent | f7eb28b85addc21ad55952c0cb00b9e5127beced (diff) |
updating configure to use python-config for building python bindings
Diffstat (limited to 'config/bindings.m4')
-rw-r--r-- | config/bindings.m4 | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/config/bindings.m4 b/config/bindings.m4 index 61b93a8cb..29f9f5705 100644 --- a/config/bindings.m4 +++ b/config/bindings.m4 @@ -91,9 +91,23 @@ else ;; python) AC_MSG_RESULT([python support will be built]) - AC_ARG_VAR(PYTHON_CPPFLAGS, [flags to pass to compiler when building Python bindings]) - CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" - AC_CHECK_HEADER([Python.h], [cvc4_build_python_bindings=yes], [binding_error=yes]) + AM_PATH_PYTHON([2.5], [cvc4_build_python_bindings=yes], [binding_error=yes]) + AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) + AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) + AS_IF([test -z "$PYTHON_INCLUDE"], [ + AS_IF([test -z "$PYTHON_CONFIG"], [ + AC_PATH_PROGS([PYTHON_CONFIG], + [python$PYTHON_VERSION-config python-config], + [no] + ) + AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON.])]) + ]) + AC_MSG_CHECKING([python include flags]) + AC_SUBST(PYTHON_CXXFLAGS, `$PYTHON_CONFIG --includes`) + AC_MSG_RESULT([$PYTHON_CXXFLAGS]) + ]) + CPPFLAGS="$CPPFLAGS $PYTHON_CXXFLAGS" + AC_CHECK_HEADER([Python.h], [cvc4_build_python_bindings=yes], [binding_error=yes]) ;; ruby) AC_MSG_RESULT([ruby support will be built]) |