automake-patches
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] Re: CVS Bug? or User error?


From: Derek Robert Price
Subject: Re: [Bug-gnulib] Re: CVS Bug? or User error?
Date: Fri, 30 Jul 2004 09:40:46 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexandre Duret-Lutz wrote:

>Here is my proposal.
>
>The repeated occurrences of
>
>?GENERIC?    $(am__skiplex) \
>?!GENERIC??DIST_SOURCE?    $(am__skiplex)\
>
>in yacc.am are ugly, but I wouldn't worry about it.  Akim
>suggested some months ago to remove the !MORE-THAN-ONE part of
>yacc.am and lex.am and always use depcomp to simplify Automake
>and limit the code duplication.  I plan to do this; so that will
>remove all this cruft.
>
>2004-07-29  Alexandre Duret-Lutz  <address@hidden>
>        Derek R. Price  <address@hidden>
>
>    Disable Lex and Yacc rules whenever possible if AM_MAINTAINER_MODE
>    is used and maintainer-mode disabled.
>    * automake.in (Automake::struct): Define nodist_specific.
>    Set it in languages yacc, yaccxx, lex, and lexxx.
>    (register_language): Default nodist_specific to 0.
>    (handle_single_transform): Honor nodist_specific.
>    * lib/am/yacc.am (am__skipyacc): Define this in maintainer mode.
>    (%EXT%%DERIVED-EXT%, %OBJ%): Use $(am__skipyacc) to disable these
>    rules when needed.
>    * lib/am/lex.am (am__skiplex): Define this in maintainer mode.
>    (%EXT%%DERIVED-EXT%, %OBJ%): Use $(am__skiplex) to disable these
>    rules when needed.
>    * tests/mmodely.test: New file.
>    * tests/pr204.test: Augment to check AM_MAINTAINER_MODE and nodist_
>    parsers.
>    * tests/Makefile.am (TESTS): Add mmodely.test.
>    * doc/automake.texi (Yacc and Lex): Note dependence on maintainer
mode.


This mostly looks good, but I was wondering why you "required='bison
flex'" in tests/mmodely.test when YACC and LEX are overridden to be
either "false" or "echo >..." every time they are run?

Glancing at the other tests, it looks like "required=gcc" would be
approproiate, since some C sources are compiled, but no real lex or
yacc is ever run.

>Index: tests/mmodely.test
>===================================================================
>RCS file: tests/mmodely.test
>diff -N tests/mmodely.test
>--- /dev/null    1 Jan 1970 00:00:00 -0000
>+++ tests/mmodely.test    29 Jul 2004 21:31:33 -0000
>@@ -0,0 +1,79 @@
>+#! /bin/sh
>+# Copyright (C) 2004  Free Software Foundation, Inc.
>+#
>+# This file is part of GNU Automake.
>+#
>+# GNU Automake is free software; you can redistribute it and/or modify
>+# it under the terms of the GNU General Public License as published by
>+# the Free Software Foundation; either version 2, or (at your option)
>+# any later version.
>+#
>+# GNU Automake is distributed in the hope that it will be useful,
>+# but WITHOUT ANY WARRANTY; without even the implied warranty of
>+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>+# GNU General Public License for more details.
>+#
>+# You should have received a copy of the GNU General Public License
>+# along with Automake; see the file COPYING.  If not, write to
>+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
>+# Boston, MA 02111-1307, USA.
>+
>+# Verify that intermediate files are only built from Yacc and Lex
>+# sources in maintainer mode.
>+# From Derek R. Price.
>+
>+required='bison flex'
>+. ./defs || exit 1
>+
>+set -e
>+
>+cat >> configure.in << 'END'
>+AM_MAINTAINER_MODE
>+AC_PROG_CC
>+AM_PROG_LEX
>+AC_PROG_YACC
>+AC_OUTPUT
>+END
>+
>+cat > Makefile.am <<'END'
>+YACC = false
>+LEX = false
>+bin_PROGRAMS = zardoz
>+zardoz_SOURCES = zardoz.y joe.l
>+LDADD = @LEXLIB@
>+END
>+
>+# The point of this test is that it is not dependant on a working
lex or yacc.
>+cat > joe.c <<EOF
>+int joe (int arg)
>+{
>+    return arg * 2;
>+}
>+EOF
>+cat > zardoz.c <<EOF
>+int joe (int arg);
>+int main (int argc, char **argv)
>+{
>+    exit (joe (argc));
>+}
>+EOF
>+
>+# Ensure a later timestamp for our Lex & Yacc sources.
>+$sleep
>+: > joe.l
>+: > zardoz.y
>+
>+$ACLOCAL
>+$AUTOCONF
>+$AUTOMAKE
>+
>+./configure
>+$MAKE
>+
>+# make maintainer-clean; ./configure; make should always work,
>+# per GNU Standard.
>+$MAKE maintainer-clean
>+./configure
>+YACC='echo>y.tab.c' LEX='echo>lex.yy.c' $MAKE -e zardoz.c joe.c
>+grep zardoz.y zardoz.c
>+grep joe.l joe.c


Cheers,

Derek

- --
                *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBCk/dLD1OTBfyMaQRAnNWAKCF6wOpMPkY/bZHnWX+Hm8GzFPCkQCfUfb2
DadVcCL3jazNwmgtwzqkE/k=
=b3pC
-----END PGP SIGNATURE-----





reply via email to

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