From 5425eb2a5ef6df5787d8c2af58854620d8e7c6ef Mon Sep 17 00:00:00 2001 From: short <> Date: Sun, 23 May 2004 19:15:52 +0000 Subject: [PATCH] Proper dependencies of mandatory/optional bundle rebuild whether Perl is found. --- configure.ac | 22 +++++++++++++++++----- src/Makefile.am | 13 +++++++++---- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index ac82242..57f0a5b 100644 --- a/configure.ac +++ b/configure.ac @@ -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" ]) diff --git a/src/Makefile.am b/src/Makefile.am index dfba9e5..fdadb7d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -38,9 +38,8 @@ endif if ENABLE_BUNDLE -nodist_udpgate_SOURCES=bundle.c - BUNDLE_SRCS= \ + bundle.c \ bundle.h \ bundle-util.c \ bundle-util.h @@ -48,12 +47,18 @@ BUNDLE_SRCS= \ EXTRA_DIST+= \ bundle.pl +if HAVE_PERL # FIXME: GNU make(1) dependency by $(addprefix ...) -bundle_files=$(top_srcdir)/init.d/$(PACKAGE).init $(addprefix $(top_builddir)/$(POSUB)/,$(CATALOGS)) +po_files=$(addprefix $(top_builddir)/$(POSUB)/,$(CATALOGS)) +bundle_files=$(top_srcdir)/init.d/$(PACKAGE).init $(po_files) bundle.c: bundle.pl $(bundle_files) - $(PERL) bundle.pl $(bundle_files) >$@ + $(PERL) bundle.pl $(bundle_files) >$@ + +$(po_files): + $(MAKE) -C $(top_builddir)/$(POSUB) endif +endif udpgate_SOURCES= \ configuration.c \ -- 1.8.3.1