[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: test-suite and doc update for ctags/etags issue
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: test-suite and doc update for ctags/etags issue |
Date: |
01 Jan 2000 01:24:58 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
I'm checking this in, as announced in the target-clash patch.
(Finally I've opted for false/true instead of egrep/fgrep)
2002-09-13 Alexandre Duret-Lutz <address@hidden>
* automake.texi (Building ctags and etags): Rename and adjust as ...
(Building true and false): ... this.
* tests/targetclash.test: New file.
* tests/specflags7.test, tests/specflags8.test: Adjust to build
true and false.
* tests/Makefile.am (TESTS): Add targetclash.test.
(XFAIL_TESTS): Remove specflags7.test and specflags8.test.
Index: automake.texi
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020913-1432/automake.texi,v
retrieving revision 1.1
diff -u -r1.1 automake.texi
--- automake.texi 13 Sep 2002 12:33:13 -0000 1.1
+++ automake.texi 13 Sep 2002 12:59:24 -0000
@@ -611,7 +611,7 @@
@menu
* Complete:: A simple example, start to finish
* Hello:: A classic program
-* etags:: Building etags and ctags
+* true:: Building true and false
@end menu
@@ -681,7 +681,7 @@
you're done!
address@hidden Hello, etags, Complete, Examples
address@hidden Hello, true, Complete, Examples
@section A classic program
@cindex Example, GNU Hello
@@ -794,54 +794,54 @@
@end example
address@hidden etags, , Hello, Examples
address@hidden Building etags and ctags
address@hidden true, , Hello, Examples
address@hidden Building true and false
address@hidden Example, ctags and etags
address@hidden ctags Example
address@hidden etags Example
address@hidden Example, false and true
address@hidden false Example
address@hidden true Example
Here is another, trickier example. It shows how to generate two
-programs (@code{ctags} and @code{etags}) from the same source file
-(@file{etags.c}). The difficult part is that each compilation of
address@hidden requires different @code{cpp} flags.
+programs (@code{true} and @code{false}) from the same source file
+(@file{true.c}). The difficult part is that each compilation of
address@hidden requires different @code{cpp} flags.
@example
-bin_PROGRAMS = etags ctags
-ctags_SOURCES =
-ctags_LDADD = ctags.o
+bin_PROGRAMS = true false
+false_SOURCES =
+false_LDADD = false.o
-etags.o: etags.c
- $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true.o: true.c
+ $(COMPILE) -DEXIT_CODE=0 -c true.c
-ctags.o: etags.c
- $(COMPILE) -DCTAGS -o ctags.o -c etags.c
+false.o: true.c
+ $(COMPILE) -DEXIT_CODE=1 -o false.o -c true.c
@end example
-Note that there is no @code{etags_SOURCES} definition. Automake will
-implicitly assume that there is a source file named @file{etags.c}, and
-define rules to compile @file{etags.o} and link @file{etags}. The
address@hidden: etags.c} rule supplied by the above @file{Makefile.am},
-will override the Automake generated rule to build @file{etags.o}.
+Note that there is no @code{true_SOURCES} definition. Automake will
+implicitly assume that there is a source file named @file{true.c}, and
+define rules to compile @file{true.o} and link @file{true}. The
address@hidden: true.c} rule supplied by the above @file{Makefile.am},
+will override the Automake generated rule to build @file{true.o}.
address@hidden is defined to be empty---that way no implicit value
address@hidden is defined to be empty---that way no implicit value
is substituted. Because we have not listed the source of
address@hidden, we have to tell Automake how to link the program. This is
-the purpose of the @code{ctags_LDADD} line. A @code{ctags_DEPENDENCIES}
-variable, holding the dependencies of the @file{ctags} target will be
address@hidden, we have to tell Automake how to link the program. This is
+the purpose of the @code{false_LDADD} line. A @code{false_DEPENDENCIES}
+variable, holding the dependencies of the @file{false} target will be
automatically generated by Automake from the contant of
address@hidden
address@hidden
The above rules won't work if your compiler doesn't accept both
@samp{-c} and @samp{-o}. The simplest fix for this is to introduce a
bogus dependency (to avoid problems with a parallel @code{make}):
@example
-etags.o: etags.c ctags.o
- $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true.o: true.c false.o
+ $(COMPILE) -DEXIT_CODE=0 -c true.c
-ctags.o: etags.c
- $(COMPILE) -DCTAGS -c etags.c && mv etags.o ctags.o
+false.o: true.c
+ $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true.o false.o
@end example
Also, these explicit rules do not work if the de-ANSI-fication feature
@@ -849,33 +849,33 @@
more work:
@example
-etags._o: etags._c ctags.o
- $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true._o: true._c false.o
+ $(COMPILE) -DEXIT_CODE=0 -c true.c
-ctags._o: etags._c
- $(COMPILE) -DCTAGS -c etags.c && mv etags._o ctags.o
+false._o: true._c
+ $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true._o false.o
@end example
As it turns out, there is also a much easier way to do this same task.
Some of the above techniques are useful enough that we've kept the
-example in the manual. However if you were to build @code{etags} and
address@hidden in real life, you would probably use per-program
+example in the manual. However if you were to build @code{true} and
address@hidden in real life, you would probably use per-program
compilation flags, like so:
@example
-bin_PROGRAMS = ctags etags
+bin_PROGRAMS = false true
-ctags_SOURCES = etags.c
-ctags_CPPFLAGS = -DCTAGS
+false_SOURCES = true.c
+false_CPPFLAGS = -DEXIT_CODE=1
-etags_SOURCES = etags.c
-etags_CPPFLAGS = -DETAGS_REGEXPS
+true_SOURCES = true.c
+true_CPPFLAGS = -DEXIT_CODE=0
@end example
-In this case Automake will cause @file{etags.c} to be compiled twice,
+In this case Automake will cause @file{true.c} to be compiled twice,
with different flags. De-ANSI-fication will work automatically. In
this instance, the names of the object files would be chosen by
-automake; they would be @file{ctags-etags.o} and @file{etags-etags.o}.
+automake; they would be @file{false-true.o} and @file{true-true.o}.
(The name of the object files rarely matters.)
@@ -1097,6 +1097,8 @@
* Requirements:: Configuration requirements
* Optional:: Other things Automake recognizes
* Invoking aclocal:: Auto-generating aclocal.m4
+* aclocal options:: aclocal command line arguments
+* Macro search path:: Modifying aclocal's search path
* Macros:: Autoconf macros supplied with Automake
* Extending aclocal:: Writing your own aclocal macros
@end menu
@@ -1283,7 +1285,7 @@
@end table
address@hidden Invoking aclocal, Macros, Optional, configure
address@hidden Invoking aclocal, aclocal options, Optional, configure
@section Auto-generating aclocal.m4
@cindex Invoking aclocal
@@ -1322,7 +1324,7 @@
* Macro search path:: How aclocal finds .m4 files
@end menu
address@hidden aclocal options, Macro search path, Invoking aclocal, Invoking
aclocal
address@hidden aclocal options, Macro search path, Invoking aclocal, configure
@section aclocal options
@cindex aclocal, Options
@@ -1365,7 +1367,7 @@
Print the version number of Automake and exit.
@end table
address@hidden Macro search path, , aclocal options, Invoking aclocal
address@hidden Macro search path, Macros, aclocal options, configure
@section Macro search path
@cindex Macro search path
@@ -1507,7 +1509,7 @@
copy Automake on your account and want @command{aclocal} to look for
macros installed at other places on the system.
address@hidden Macros, Extending aclocal, Invoking aclocal, configure
address@hidden Macros, Extending aclocal, Macro search path, configure
@section Autoconf macros supplied with Automake
Automake ships with several Autoconf macros that you can use from your
Index: stamp-vti
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020913-1432/stamp-vti,v
retrieving revision 1.1
diff -u -r1.1 stamp-vti
--- stamp-vti 13 Sep 2002 12:33:13 -0000 1.1
+++ stamp-vti 13 Sep 2002 12:59:31 -0000
@@ -1,4 +1,4 @@
address@hidden UPDATED 9 September 2002
address@hidden UPDATED 13 September 2002
@set UPDATED-MONTH September 2002
@set EDITION 1.6c
@set VERSION 1.6c
Index: version.texi
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020913-1432/version.texi,v
retrieving revision 1.1
diff -u -r1.1 version.texi
--- version.texi 13 Sep 2002 12:33:13 -0000 1.1
+++ version.texi 13 Sep 2002 12:46:05 -0000
@@ -1,4 +1,4 @@
address@hidden UPDATED 9 September 2002
address@hidden UPDATED 13 September 2002
@set UPDATED-MONTH September 2002
@set EDITION 1.6c
@set VERSION 1.6c
Index: tests/Makefile.am
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020913-1432/tests/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- tests/Makefile.am 13 Sep 2002 12:33:14 -0000 1.1
+++ tests/Makefile.am 13 Sep 2002 12:56:39 -0000
@@ -380,6 +380,7 @@
tagsub.test \
target.test \
target-cflags.test \
+targetclash.test \
texinfo.test \
texinfo2.test \
texinfo3.test \
Index: tests/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020913-1432/tests/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- tests/Makefile.in 13 Sep 2002 12:33:14 -0000 1.1
+++ tests/Makefile.in 13 Sep 2002 12:57:56 -0000
@@ -472,6 +472,7 @@
tagsub.test \
target.test \
target-cflags.test \
+targetclash.test \
texinfo.test \
texinfo2.test \
texinfo3.test \
@@ -523,7 +524,7 @@
mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
CONFIG_CLEAN_FILES = defs
DIST_SOURCES =
-DIST_COMMON = Makefile.am Makefile.in configure.in defs.in
+DIST_COMMON = Makefile.am Makefile.in defs.in
all: all-am
.SUFFIXES:
Index: tests/specflags7.test
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020913-1432/tests/specflags7.test,v
retrieving revision 1.1
diff -u -r1.1 specflags7.test
--- tests/specflags7.test 13 Sep 2002 12:33:20 -0000 1.1
+++ tests/specflags7.test 13 Sep 2002 12:50:37 -0000
@@ -18,7 +18,7 @@
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-# The ctags/etags example from the manual, plus a check for _SHORTNAME.
+# The true/false example from the manual, plus a check for _SHORTNAME.
required=gcc
. ./defs || exit 1
@@ -31,24 +31,24 @@
END
cat > Makefile.am << 'END'
-bin_PROGRAMS = etags ctags
-ctags_SOURCES = etags.c
-ctags_CFLAGS = -DCTAGS
-ctags_SHORTNAME = c
-# No etags_SOURCES definition. Use the default source.
-etags_CFLAGS = -DETAGS
-etags_SHORTNAME = e
+bin_PROGRAMS = false true
+true_SOURCES = false.c
+true_CFLAGS = -DTRUE
+true_SHORTNAME = t
+# No false_SOURCES definition. Use the default source.
+false_CFLAGS = -DFALSE
+false_SHORTNAME = f
END
-cat > etags.c << 'END'
+cat > false.c << 'END'
#include <stdio.h>
int
main (int argc, char *argv[])
{
-#ifdef CTAGS
- puts ("ctags");
+#ifdef TRUE
+ puts ("true");
#else
- puts ("etags");
+ puts ("false");
#endif
return 0;
}
@@ -60,7 +60,7 @@
./configure
$MAKE
-./ctags | grep ctags
-./etags | grep etags
-test -f ./c-etags.o
-test -f ./e-etags.o
+./true | grep true
+./false | grep false
+test -f ./t-false.o
+test -f ./f-false.o
Index: tests/specflags8.test
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020913-1432/tests/specflags8.test,v
retrieving revision 1.1
diff -u -r1.1 specflags8.test
--- tests/specflags8.test 13 Sep 2002 12:33:20 -0000 1.1
+++ tests/specflags8.test 13 Sep 2002 12:49:31 -0000
@@ -18,7 +18,7 @@
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-# Like the ctags/etags example from the manual,
+# Like the true/false example from the manual,
# with one extra indirection in the sources (PR/315), and
# use of _CPPFLAGS (PR/337).
@@ -37,23 +37,23 @@
# different flags.
cat > Makefile.am << 'END'
-ETAGSSOURCE = etags.c
-bin_PROGRAMS = etags ctags
-ctags_SOURCES = $(ETAGSSOURCE)
-ctags_CPPFLAGS = -DCTAGS
-etags_SOURCES = $(ETAGSSOURCE)
-etags_CPPFLAGS = -DETAGS
+FALSESOURCE = false.c
+bin_PROGRAMS = false true
+true_SOURCES = $(FALSESOURCE)
+true_CPPFLAGS = -DTRUE
+false_SOURCES = $(FALSESOURCE)
+false_CPPFLAGS = -DFALSE
END
-cat > etags.c << 'END'
+cat > false.c << 'END'
#include <stdio.h>
int
main (int argc, char *argv[])
{
-#ifdef CTAGS
- puts ("ctags");
+#ifdef TRUE
+ puts ("true");
#else
- puts ("etags");
+ puts ("false");
#endif
return 0;
}
@@ -65,5 +65,5 @@
./configure
$MAKE
-./ctags | grep ctags
-./etags | grep etags
+./true | grep true
+./false | grep false
Index: tests/targetclash.test
===================================================================
RCS file: tests/targetclash.test
diff -N tests/targetclash.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/targetclash.test 13 Sep 2002 12:54:20 -0000
@@ -0,0 +1,40 @@
+#! /bin/sh
+# Copyright (C) 2002 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 autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check that target clashes are diagnosed.
+
+required=gcc
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = ctags
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a 2>stderr && exit 1
+cat stderr
+grep 'redefinition.*ctags' stderr
--
Alexandre Duret-Lutz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: test-suite and doc update for ctags/etags issue,
Alexandre Duret-Lutz <=