configure.ac: Add a --without-python option.
Being able to be explicit about Python support (in addition to the default of auto-detecting it) and acting upon the result, specifying it as an option gains us more control about both dependencies and the resulting build. Furthermore, relying purely on auto-detection can lead to problems for source-based distros. E. g. systemd being built before *both* 32-bit & 64-bit ABIs are installed will lead to build failures as systemd's build system will pick up either 32-/64-bit Python, conclude both are available and fail if that's not the case.
This commit is contained in:
parent
fd59a381e3
commit
78fbaacac0
29
configure.ac
29
configure.ac
|
@ -92,19 +92,26 @@ fi
|
||||||
# we use python to build the man page index, and for systemd-python
|
# we use python to build the man page index, and for systemd-python
|
||||||
have_python=no
|
have_python=no
|
||||||
have_python_devel=no
|
have_python_devel=no
|
||||||
AM_PATH_PYTHON(,, [:])
|
|
||||||
if test "$PYTHON" != : ; then
|
|
||||||
have_python=yes
|
|
||||||
AC_PATH_PROG([PYTHON_CONFIG], python-config)
|
|
||||||
|
|
||||||
if test -n "$PYTHON_CONFIG" ; then
|
AC_ARG_WITH([python],
|
||||||
have_python_devel=yes
|
[AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
|
||||||
PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags`"
|
|
||||||
PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
|
AS_IF([test "x$with_python" != "xno"], [
|
||||||
AC_SUBST(PYTHON_CFLAGS)
|
AM_PATH_PYTHON(,, [:])
|
||||||
AC_SUBST(PYTHON_LIBS)
|
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
|
fi
|
||||||
fi
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"])
|
AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"])
|
||||||
AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
|
AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue