Just discovered that $srcdir is available in the configure script for checking
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Thu, 11 Jun 2009 00:44:06 +0000 (00:44 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Thu, 11 Jun 2009 00:44:06 +0000 (00:44 +0000)
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

Makefile.am
configure.in

index 7ab5f42..ca0cf6e 100644 (file)
@@ -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
+
index 8df27b2..f944cb6 100644 (file)
@@ -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.