From: thurston Date: Thu, 11 Jun 2009 00:44:06 +0000 (+0000) Subject: Just discovered that $srcdir is available in the configure script for checking X-Git-Tag: 2.0_alpha~14 X-Git-Url: http://review.tizen.org/git/?p=external%2Fragel.git;a=commitdiff_plain;h=02f6c93dd625d38cd2b220a58f1375a35ccded57 Just discovered that $srcdir is available in the configure script for checking for the existence of a file created by dist-hook. This lets us write a test that knows the difference between a distribution tarball and something from the repos. The building of the parsers and the manual can now be automatically turned off in a make dist tarball. git-svn-id: http://svn.complang.org/ragel/trunk@903 052ea7fc-9027-0410-9066-f65837a77df0 --- diff --git a/Makefile.am b/Makefile.am index 7ab5f42..ca0cf6e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,3 +5,8 @@ DIST_SUBDIRS = $(SUBDIRS) contrib examples test doc dist_doc_DATA = CREDITS ChangeLog EXTRA_DIST = ragel.vim +# This file is checked for by the configure script and its existence causes the +# parsers and the manual to not be built when the distribution is built. +dist-hook: + echo "This is a distribution of Ragel $(VERSION)." > $(distdir)/DIST + diff --git a/configure.in b/configure.in index 8df27b2..f944cb6 100644 --- a/configure.in +++ b/configure.in @@ -25,14 +25,18 @@ AM_INIT_AUTOMAKE AC_SUBST(PUBDATE) AC_CONFIG_HEADER(ragel/config.h) +dnl Choose defaults for the build_parsers and build_manual vars. If the dist +dnl file is present in the root then default to no, otherwise go for it. +AC_CHECK_FILES( $srcdir/DIST, + [ build_parsers=no; build_manual=no; ], + [ build_parsers=yes; build_manual=yes; ] ) + dnl Set to true if the build system should generate parsers from ragel and kelbt dnl sources. Set to false if generated files are included and not to be built dnl (production). -build_parsers=yes; AM_CONDITIONAL(BUILD_PARSERS, [test "x$build_parsers" = "xyes"]) dnl Set to true if the manual should be built. -build_manual=yes; AM_CONDITIONAL(BUILD_MANUAL, [test "x$build_manual" = "xyes"]) dnl Checks for programs.