From 57f2a8e9215daf83616bb05b3b134e5544f7d808 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dejan=20Jovanovi=C4=87?= Date: Fri, 3 Feb 2012 23:17:30 +0000 Subject: [PATCH] updating configure to use python-config for building python bindings --- config/bindings.m4 | 20 +++++++++++++++++--- configure.ac | 2 +- src/bindings/Makefile.am | 1 + 3 files changed, 19 insertions(+), 4 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]) diff --git a/configure.ac b/configure.ac index 729544391..4a8d19433 100644 --- a/configure.ac +++ b/configure.ac @@ -829,7 +829,7 @@ AC_LIB_ANTLR # build support. The arg list is the default set if unspecified by # the user (the actual built set is the subset that appears to be # supported by the build host). -CVC4_CHECK_BINDINGS([c java])dnl csharp perl php python ruby tcl ocaml]) +CVC4_CHECK_BINDINGS([c java]) # Checks for header files. AC_CHECK_HEADERS([getopt.h unistd.h]) diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am index b4e45c592..74a9934e7 100644 --- a/src/bindings/Makefile.am +++ b/src/bindings/Makefile.am @@ -95,6 +95,7 @@ phpdata_DATA += php/CVC4.php endif if CVC4_LANGUAGE_BINDING_PYTHON pythonlib_LTLIBRARIES += python/CVC4.la +python_CVC4_la_CXXFLAGS = $(PYTHON_CXXFLAGS) python_CVC4_la_LDFLAGS = \ -module \ -version-info $(LIBCVC4BINDINGS_VERSION) -- 2.30.2