From f1075c2272062a581dabbc4fb4411c5d1f97acc5 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 16 Apr 2008 18:53:30 +0200 Subject: [PATCH] configure: Build perl bindings only if a perl interpreter is available. For this purpose a check for the perl interpreter has been added. As the check for libperl requires a perl interpreter as well (to get the compiler and linker flags) the perl module will be disabled as well if a perl interpreter is not available. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- configure.in | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index d9fc92da..046b174f 100644 --- a/configure.in +++ b/configure.in @@ -1411,9 +1411,19 @@ AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to l with_libperl="yes" ]) +AC_MSG_CHECKING([for perl]) +perl_interpreter=`which "$perl_interpreter" 2> /dev/null` +if test -x "$perl_interpreter" +then + AC_MSG_RESULT([yes]) +else + perl_interpreter="" + AC_MSG_RESULT([no]) +fi + AC_SUBST(PERL, "$perl_interpreter") -if test "x$with_libperl" = "xyes" +if test "x$with_libperl" = "xyes" -a -n "$perl_interpreter" then SAVE_CFLAGS=$CFLAGS SAVE_LDFLAGS=$LDFLAGS @@ -1453,7 +1463,10 @@ then CFLAGS=$SAVE_CFLAGS LDFLAGS=$SAVE_LDFLAGS -fi +else if test -z "$perl_interpreter"; then + with_libperl="no (no perl interpreter found)" + have_libperl="no" +fi; fi AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes") AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], @@ -2123,7 +2136,12 @@ AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@ ], [ PERL_BINDINGS_OPTIONS="" - with_perl_bindings="yes" + if test -n "$perl_interpreter" + then + with_perl_bindings="yes" + else + with_perl_bindings="no (no perl interpreter found)" + fi ]) if test "x$with_perl_bindings" = "xyes" then -- 2.11.0