Proper dependencies of mandatory/optional bundle rebuild whether Perl is found.
[udpgate.git] / configure.ac
index ac82242..57f0a5b 100644 (file)
@@ -62,16 +62,28 @@ AC_ARG_ENABLE(bundle,
                [  --enable-bundle                  Build single binary containing locale and init.d files (def.=no)],,enable_bundle=no)
 
 
+PERL=
+AC_PATH_PROGS(PERL,perl5 perl)
+AM_CONDITIONAL(HAVE_PERL,test -n "$PERL")
+
 AM_CONDITIONAL(ENABLE_BUNDLE,[ test "x$enable_bundle" = "xyes" ])
 if test "x$enable_bundle" = "xyes"
 then
-       AC_DEFINE(ENABLE_BUNDLE,,[Build single binary containing locale and init.d files.])
+       if test -f src/bundle.c
+       then
+               AC_DEFINE(ENABLE_BUNDLE,,[Build single binary containing locale and init.d files.])
+               if test -z "$PERL"
+               then
+                       AC_MSG_WARN([Perl not found (see above). The --enable-bundle files cannot be updated yourself.])
+               fi
+       else
+               if test -z "$PERL"
+               then
+                       AC_MSG_ERROR([Perl not found (see above). --enable-bundle is not possible as src/bundle.c is missing.])
+               fi
+       fi
 fi
 
-PERL=
-AC_PATH_PROGS(PERL,perl5 perl)
-AM_CONDITIONAL(HAVE_PERL,test -n "$PERL")
-
 POD2MAN=
 AC_PATH_PROGS(POD2MAN,pod2man)
 AM_CONDITIONAL(HAVE_POD2MAN,[ test -n "$POD2MAN" ])