automake-patches
[Top][All Lists]
Advanced

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

Re: Exhuberant Tags and make tags


From: Alexandre Duret-Lutz
Subject: Re: Exhuberant Tags and make tags
Date: Sun, 23 Mar 2003 21:37:30 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux)

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:

>>> "Akim" == Akim Demaille <address@hidden> writes:
 adl> Hmm...  Seems like switching to --etags-include would just break
 adl> GNU etags.

 Akim> Arg, thanks.  How about this then?

 Akim> 2003-03-01  Akim Demaille  <address@hidden>

 Akim> * lib/am/tags.am (TAGS): Use --etags-include instead of --include,
 Akim> when supported by etags (Exuberant Ctags).

 adl> This looks nice to me (except I'd have added a test case, but I
 adl> can do this later next week if you don't have the time).

 adl> Could you install this on branch-1-7 too?

I've installed the following on HEAD and branch-1-7.

2003-03-23  Akim Demaille  <address@hidden>
            Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: lib/am/tags.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/tags.am,v
retrieving revision 1.38
diff -u -r1.38 tags.am
--- lib/am/tags.am      10 Jul 2002 05:36:46 -0000      1.38
+++ lib/am/tags.am      23 Mar 2003 20:35:55 -0000
@@ -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 @@
        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.
Index: tests/tagsub.test
===================================================================
RCS file: /cvs/automake/automake/tests/tagsub.test,v
retrieving revision 1.8
diff -u -r1.8 tagsub.test
--- tests/tagsub.test   8 Sep 2002 13:07:56 -0000       1.8
+++ tests/tagsub.test   23 Mar 2003 20:35:56 -0000
@@ -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 || exit 1
-$AUTOMAKE || exit 1
-
-grep '^TAGS:.*tags-recursive' Makefile.in
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE tags
+test -f sub/TAGS
+test -f TAGS
+$FGREP sub/TAGS TAGS
+$FGREP iguana.h sub/TAGS
+
+$MAKE distclean
+test ! -f sub/TAGS
+test ! -f TAGS


-- 
Alexandre Duret-Lutz





reply via email to

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