configure: Build perl bindings only if a perl interpreter is available.
authorSebastian Harl <sh@tokkee.org>
Wed, 16 Apr 2008 16:53:30 +0000 (18:53 +0200)
committerFlorian Forster <octo@verplant.org>
Wed, 16 Apr 2008 21:22:42 +0000 (23:22 +0200)
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 <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@verplant.org>
configure.in

index d9fc92d..046b174 100644 (file)
@@ -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