diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2012-11-01 08:58:13 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2012-11-13 02:32:56 +0100 |
commit | 568c7e02372ff7b8eb41172ad7c3a426723512f8 (patch) | |
tree | b5b33c6d07f28a66c1d253845973c79c059d8045 /configure.ac | |
parent | 0c0271841ab45595f71528c50bcf1904d4b841d5 (diff) |
systemd-python: use python${PYTHON_VERSION}-config as python-config
This is the usual setup, where pythonX.Y and pythonX.Y-config go
together. Using python-config with python3 will only lead to
confusion.
--libs is changed to --ldflags, since the latter also includes other
required flags like -L<dir>.
The tests for HAVE_PYTHON and HAVE_PYTHON_DEVEL are separated. It is
possible to have python development libraries installed without the
binary (or to want to build python modules without using python during
the build).
A line is added to the output, to show what flags will be used for
python.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index d0ce504bc5..c4638d15a1 100644 --- a/configure.ac +++ b/configure.ac @@ -100,21 +100,20 @@ AC_ARG_WITH([python], AS_IF([test "x$with_python" != "xno"], [ AM_PATH_PYTHON(,, [:]) - if test "$PYTHON" != : ; then - have_python=yes - AC_PATH_PROG([PYTHON_CONFIG], python-config) - - if test -n "$PYTHON_CONFIG" ; then - have_python_devel=yes - PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags`" - PYTHON_LIBS="`$PYTHON_CONFIG --libs`" - AC_SUBST(PYTHON_CFLAGS) - AC_SUBST(PYTHON_LIBS) - fi - fi + AS_IF([test "$PYTHON" != :], [have_python=yes]) ]) - AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"]) + +AS_IF([test "x$with_python" != "xno"], [ + AC_PATH_PROG(PYTHON_CONFIG, python${PYTHON_VERSION}-config) + AS_IF([test -n "$PYTHON_CONFIG"], [ + have_python_devel=yes + PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags`" + PYTHON_LIBS="`$PYTHON_CONFIG --ldflags`" + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + ]) +]) AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"]) CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ @@ -877,4 +876,6 @@ AC_MSG_RESULT([ CFLAGS: ${OUR_CFLAGS} ${CFLAGS} CPPLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS} + PYTHON_CFLAGS: ${PYTHON_CFLAGS} + PYTHON_LIBS: ${PYTHON_LIBS} ]) |