[systemd-devel] [PATCH] configure.ac: Add a --with-python option.
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Mon Oct 8 05:34:12 PDT 2012
On Sat, Oct 06, 2012 at 03:20:12PM +0200, Wulf C. Krueger wrote:
> From: "Wulf C. Krueger" <philantrop at exherbo.org>
>
> Being explicit about Python support rather than 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.
Hi,
nowhere in this explanation is the most important change mentioned:
the default is changed to disabled. This does not seem to be right:
people normally want to maximize available features.
Second change in your patch is the addition of --with-python. The same
could already be achieved by setting PYTHON=:, but I guess that an
explicit switch is nice.
I think that a patch which adds the explicit switch, but leaves the
default as autodetect, would be welcome.
Zbyszek
> Signed-off-by: Wulf C. Krueger <philantrop at exherbo.org>
> ---
> configure.ac | 31 +++++++++++++++++++------------
> 1 file changed, 19 insertions(+), 12 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 5d7d0c2..6308270 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -90,19 +90,26 @@ fi
> # we use python to build the man page index, and for systemd-python
> have_python=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
> - have_python_devel=yes
> - PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags`"
> - PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
> - AC_SUBST(PYTHON_CFLAGS)
> - AC_SUBST(PYTHON_LIBS)
> +
> +AC_ARG_WITH([python],
> + [AS_HELP_STRING([--with-python], [Build the man page index and systemd-python (default: disabled)])])
> +
> +AS_IF([test "x$with_python" = "xyes"], [
> + 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
> -fi
> +])
> +
> AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"])
> AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
>
> --
> 1.7.12.2
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
More information about the systemd-devel
mailing list