automake
[Top][All Lists]
Advanced

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

Re: [PATCH] etags support


From: Derek R. Price
Subject: Re: [PATCH] etags support
Date: Thu, 21 Dec 2000 17:47:45 -0500

"Derek R. Price" wrote:

> > > I added a macro to test for the presence of etags and whether it
> > > supports "--etags-include=<file>" or "-i <file>" for includes.

Okay, one more try.  I hadn't added etags.m4 to the Makefile.am so it wasn't 
being
installed and I also tweaked the AM_PROG_ETAGS macro to call
AM_MISSING_PROG(ETAGS, etags) when it can't find a working version of etags.

I'm including the entire new patch.

Derek

--
Derek Price                      CVS Solutions Architect ( http://CVSHome.org )
mailto:address@hidden     OpenAvenue ( http://OpenAvenue.com )
--
106.  Charlie was a Chemist, but Charlie is no more.
      What Charlie thought was H20 was H2SO4.


Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.916
diff -u -r1.916 ChangeLog
--- ChangeLog   2000/12/21 06:07:14     1.916
+++ ChangeLog   2000/12/21 18:07:02
@@ -1,3 +1,10 @@
+2000-12-21  Derek Price  <address@hidden>
+
+       * m4/etags.m4: Discover the etags implementation
+       * m4/init.m4: Require AM_PROG_ETAGS
+       * tags.am: add support for AM_PROG_ETAGS & don't assume
+       @CONFIG@ is present in the build directory
+
 2000-12-20  Marc Espie <address@hidden>
 
        * automake.in (handle_texinfo): Make path of $vtexi explicit in
Index: tags.am
===================================================================
RCS file: /cvs/automake/automake/tags.am,v
retrieving revision 1.24
diff -u -r1.24 tags.am
--- tags.am     2000/10/16 09:01:36     1.24
+++ tags.am     2000/12/21 18:07:02
@@ -36,17 +36,17 @@
 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 && tags="$$tags 
$(ETAGS_INCLUDE_OPTION)$$here/$$subdir/TAGS"; \
 SUBDIRS   fi; \
 SUBDIRS        done; \
 ## Make sure the list of sources is unique.
        list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
+       unique=`for i in $$list @CONFIG@; do \
 ## Handle VPATH correctly.
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
 ## Make sure we have something to run etags on.
-       test -z "$(ETAGS_ARGS)@address@hidden(LISP)$$tags" \
-         || etags $(ETAGS_ARGS) $$tags @CONFIG@ $$unique $(LISP)
+       test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+         || $(ETAGS) $(ETAGS_ARGS) $$tags $$unique $(LISP)
Index: m4/init.m4
===================================================================
RCS file: /cvs/automake/automake/m4/init.m4,v
retrieving revision 1.20
diff -u -r1.20 m4/init.m4
--- m4/init.m4  2000/10/10 00:18:52     1.20
+++ m4/init.m4  2000/12/21 18:07:02
@@ -54,6 +54,7 @@
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_PROG_ETAGS])
 AC_REQUIRE([AM_DEP_TRACK])dnl
 AC_REQUIRE([AM_SET_DEPDIR])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CC],
Index: tests/ChangeLog
===================================================================
RCS file: /cvs/automake/automake/tests/ChangeLog,v
retrieving revision 1.309
diff -u -r1.309 tests/ChangeLog
--- tests/ChangeLog     2000/12/17 21:32:57     1.309
+++ tests/ChangeLog     2000/12/21 18:07:02
@@ -1,3 +1,8 @@
+2000-12-21  Derek Price  <address@hidden>
+
+       * etags.test: New file
+       * Makefile.am (TESTS): added etags.test
+
 2000-12-17  Tom Tromey  <address@hidden>
 
        * Makefile.am (XFAIL_TESTS): Don't mention ldflags.test.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.240
diff -u -r1.240 tests/Makefile.am
--- tests/Makefile.am   2000/12/17 21:32:57     1.240
+++ tests/Makefile.am   2000/12/21 18:07:02
@@ -97,6 +98,7 @@
 empty3.test \
 empty4.test \
 error.test \
+etags.test \
 exdir.test \
 exdir2.test \
 exsource.test \
--- /dev/null   Thu Aug 24 05:00:32 2000
+++ tests/etags.test    Wed Dec 20 19:24:26 2000
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+# Test to make sure depcomp is installed and found properly
+# when required for multiple directories
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(Makefile.am)
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AM_PROG_ETAGS
+AC_OUTPUT(Makefile)
+END
+
+: > Makefile.am
+
+# Fail gracefully if no autoconf.
+(autoconf --version) > /dev/null 2>&1 || exit 77
+
+$ACLOCAL || exit 1
+autoconf || exit 1
+$AUTOMAKE || exit 1
+./configure || exit 1
+
+egrep '^ETAGS = ..*$' Makefile >/dev/null 2>&1 || exit 1
+egrep '^ETAGS_INCLUDE_OPTION = ..*$' Makefile >/dev/null 2>&1 || exit 1
+
+exit 0
Index: m4/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/m4/Makefile.am,v
retrieving revision 1.28
diff -u -r1.28 m4/Makefile.am
--- m4/Makefile.am      1999/11/22 19:22:02     1.28
+++ m4/Makefile.am      2000/12/21 22:21:40
@@ -7,6 +7,7 @@
 m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
 error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \
 minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 \
-python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
+python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4 \
+etags.m4
 
 EXTRA_DIST = $(m4data_DATA)
--- /dev/null   Thu Aug 24 05:00:32 2000
+++ m4/etags.m4 Thu Dec 21 17:32:23 2000
@@ -0,0 +1,61 @@
+#
+# Find some information about the etags program
+#
+# Sets
+#      ETAGS = path to etags
+#      ETAGS_INCLUDE_OPTION = option to pass to etags with arg for includes
+#
+
+AC_DEFUN([AM_PROG_ETAGS],
+[AC_BEFORE([$0], AM_PROG_ETAGS_WORKS)
+AC_CHECK_PROG(ETAGS, etags, etags)
+if test -z "$ETAGS"; then
+  AC_CHECK_PROG(ETAGS, ctags, ctags -e)
+fi
+if test -n "$ETAGS"; then
+       AM_PROG_ETAGS_WORKS
+       if test "$am_cv_prog_etags_works" = yes ; then
+               AM_PROG_ETAGS_INCLUDE_OPTION
+       else
+               AM_MISSING_PROG(ETAGS, etags)
+       fi
+else
+       AM_MISSING_PROG(ETAGS, etags)
+fi])
+
+
+AC_DEFUN([AM_PROG_ETAGS_WORKS],
+[AC_CACHE_CHECK([whether etags works], [am_cv_prog_etags_works],
+[cat >conftest.c <<EOF
+int globalvar;
+EOF
+if AC_TRY_COMMAND(${ETAGS-etags} -f - conftest.c) |egrep "^int globalvar;" 
>/dev/null 2>&1; then
+       am_cv_prog_etags_works=yes
+else
+       am_cv_prog_etags_works=no
+fi
+rm -f conftest.c])])
+
+AC_DEFUN([AM_PROG_ETAGS_INCLUDE_OPTION],
+[AC_REQUIRE([AM_PROG_ETAGS_WORKS])
+if test "$am_cv_prog_etags_works" = yes ; then
+       AC_CACHE_CHECK([for etags include option],
+       [am_cv_prog_etags_include_option],
+       [cat >conftest.c <<EOF
+int globalvar;
+EOF
+       if AC_TRY_COMMAND(${ETAGS-etags} --etags-include=TAGS.inc -f - 
conftest.c) \
+                       |egrep '^TAGS.inc,include$' >/dev/null 2>&1; then
+               am_cv_prog_etags_include_option=--etags-include=
+       elif AC_TRY_COMMAND(${ETAGS-etags} -i TAGS.inc -f - conftest.c) \
+                       |egrep '^TAGS.inc,include$' >/dev/null 2>&1; then
+               am_cv_prog_etags_include_option='"-i "'
+       else :
+               # AC_MSG_ERROR(unfamiliar etags implementation)
+       fi
+       rm -f conftest.c])
+else
+       :
+fi
+ETAGS_INCLUDE_OPTION="$am_cv_prog_etags_include_option"
+AC_SUBST(ETAGS_INCLUDE_OPTION)])

reply via email to

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