bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] make perl & examples optional


From: Akim Demaille
Subject: Re: [PATCH] make perl & examples optional
Date: Tue, 6 Nov 2018 08:56:21 +0100


> Le 3 avr. 2015 à 09:02, Mike Frysinger <address@hidden> a écrit :
> 
> The normal bison program does not require perl to build or run, so lets
> soften that requirement in the configure script.  We now warn if its not
> found, and we make the examples logic depend on that.
> 
> * configure.ac: Change AC_MSG_ERROR to AC_MSG_WARN for perl.
> Add an --enable-examples flag.
> * Makefile.am: Only include examples/local.mk when ENABLE_EXAMPLES.

Hi Mike,

You are right, this is a useless requirement.  I have chosen
a different approach though.  Perl will be needed if the user
changes bison.texi, but then she should expect that, as she’s
taken the role of a contributor.

Cheers!

commit 5a270262cb120ef19c21d6da1413eeecde210c0c
Author: Akim Demaille <address@hidden>
Date:   Tue Nov 6 07:41:58 2018 +0100

    examples: ship them
    
    Currently, the examples are extracted on the user's side.
    Unfortunately, that requires that the user has Perl, which is
    otherwise not needed for Bison.  Let's ship the examples instead.
    
    The examples were handled this way so that the examples could depend
    on configure flags: if --enable-gcc-warnings was passed, it is
    understood as "I'm a maintainer", so the examples are generated with
    that for regular users.
    
    Reported by Mike Frysinger.
    https://lists.gnu.org/archive/html/bison-patches/2015-04/msg00000.html
    
    * examples/local.mk: Ship all the extracted files.
    (examples-unline): New.
    Make sure that the generated tarballs do not contain the #lines.

diff --git a/THANKS b/THANKS
index 3ce973fe..d24f0d93 100644
--- a/THANKS
+++ b/THANKS
@@ -106,6 +106,7 @@ Michel d'Hooge            address@hidden
 Michiel De Wilde          address@hidden
 Mickael Labau             address@hidden
 Mike Castle               address@hidden
+Mike Frysinger            address@hidden
 Mike Sullivan             address@hidden
 Nate Guerin               address@hidden
 Neil Booth                address@hidden
diff --git a/examples/local.mk b/examples/local.mk
index c2a2ba28..738293d6 100644
--- a/examples/local.mk
+++ b/examples/local.mk
@@ -30,7 +30,8 @@ EXTEXIFLAGS = --synclines
 endif
 extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(EXTEXIFLAGS) $(doc) --
 extracted =
-CLEANFILES += $(extracted) %D%/extracted.stamp
+EXTRA_DIST += $(extracted)
+MAINTAINERCLEANFILES += $(extracted) %D%/extracted.stamp
 %D%/extracted.stamp: $(doc) $(extexi)
        $(AM_V_GEN)rm -f $@ address@hidden
        $(AM_V_at)$(MKDIR_P) %D%
@@ -42,11 +43,33 @@ $(extracted): %D%/extracted.stamp
        @test -f $@ || rm -f %D%/extracted.stamp
        @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/extracted.stamp
 
+
+## ------ ##
+## Dist.  ##
+## ------ ##
+
+# Ship the stamp file, otherwise it will be recreated, which is what
+# we want to avoid.
+EXTRA_DIST += %D%/extracted.stamp
+
+# Suppress the #lines from the examples when rolling the tarball, so
+# that regular users have readable examples even before installing
+# Bison.
+dist-hook: examples-unline
+.PHOMY: examples-unline
+examples-unline:
+       for e in $(extracted);                  \
+       do                                      \
+         e=$(distdir)/$$e;                     \
+         sed -e '/#line/d' $$e >$$e.tmp;       \
+         mv -f $$e.tmp $$e;                    \
+       done
+
+
 ## ---------- ##
 ## Examples.  ##
 ## ---------- ##
 
-
 examplesdir = $(docdir)/examples
 dist_examples_DATA = %D%/README
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]