From: Alexandre Duret-Lutz Date: Sun, 23 Mar 2003 20:37:20 +0000 (+0000) Subject: * lib/am/tags.am (TAGS): Use --etags-include instead of --include, X-Git-Tag: Release-1-7-3b~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7e4205df79fa64295409b6cdc9edbb689b52332;p=thirdparty%2Fautomake.git * lib/am/tags.am (TAGS): Use --etags-include instead of --include, when supported by etags (Exuberant Ctags). * tests/tagsub.test: Rewrite to _run_ the `tags' rule. --- diff --git a/ChangeLog b/ChangeLog index 451746b44..5526aec29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-03-23 Akim Demaille + Alexandre Duret-Lutz + + * lib/am/tags.am (TAGS): Use --etags-include instead of --include, + when supported by etags (Exuberant Ctags). + * tests/tagsub.test: Rewrite to _run_ the `tags' rule. + 2003-03-20 Alexandre Duret-Lutz For Debian Bug #185388: diff --git a/lib/am/tags.am b/lib/am/tags.am index b34641d09..10d06644e 100644 --- a/lib/am/tags.am +++ b/lib/am/tags.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -50,10 +50,19 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ here=`pwd`; \ ## It is tempting to use if/endif here, but don't: the previous ## backslash will cause bad results (automake doesn't `see' the `if'). +## Exuberant Ctags wants --etags-include, +## GNU Etags --include +?SUBDIRS? if (etags --etags-include --version) >/dev/null 2>&1; then \ +?SUBDIRS? include_option=--etags-include; \ +?SUBDIRS? else \ +?SUBDIRS? include_option=--include; \ +?SUBDIRS? fi; \ ?SUBDIRS? list='$(SUBDIRS)'; for subdir in $$list; do \ ## Do nothing if we're trying to look in `.'. ?SUBDIRS? if test "$$subdir" = .; then :; else \ -?SUBDIRS? test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ +?SUBDIRS? test -f $$subdir/TAGS && \ +## Note that the = is mandatory for --etags-include. +?SUBDIRS? tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ ?SUBDIRS? fi; \ ?SUBDIRS? done; \ ## Make sure the list of sources is unique. diff --git a/tests/tagsub.test b/tests/tagsub.test index d5da79687..cfb9b9ee5 100755 --- a/tests/tagsub.test +++ b/tests/tagsub.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -19,29 +20,34 @@ # Boston, MA 02111-1307, USA. # Test to make sure tags and subdirs work correctly. Bug report by -# François Pinard. +# François Pinard, and later by Akim Demaille. +required=etags . ./defs || exit 1 -cat > Makefile.am << 'END' -SUBDIRS = sub -END - -mkdir sub +set -e -cat > sub/Makefile.am << 'END' -noinst_HEADERS = iguana.h +cat >> configure.in << 'END' +AC_CONFIG_FILES([sub/Makefile]) +AC_OUTPUT END +echo 'SUBDIRS = sub' > Makefile.am +mkdir sub +echo 'noinst_HEADERS = iguana.h' > sub/Makefile.am : > sub/iguana.h -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) -AC_OUTPUT(Makefile sub/Makefile) -END +$ACLOCAL +$AUTOCONF +$AUTOMAKE -$ACLOCAL || exit 1 -$AUTOMAKE || exit 1 +./configure +$MAKE tags +test -f sub/TAGS +test -f TAGS +$FGREP sub/TAGS TAGS +$FGREP iguana.h sub/TAGS -grep '^TAGS:.*tags-recursive' Makefile.in +$MAKE distclean +test ! -f sub/TAGS +test ! -f TAGS