Re: [PATCH] etags support

2000-12-22 Thread Derek R. Price

Tom Tromey wrote:

> > "Derek" == Derek R Price <[EMAIL PROTECTED]> writes:
>
> Hmm.  I'm running RH 6.2 and /usr/bin/etags is the GNU version:

I just looked into it and it looks like etags was distributed with the
version of emacs (20.5) that was distributed with RedHat 6.2.  They've
removed it from the emacs package since and by default install the ctags
package which contains Exuberent ctags, which doubles as an etags
implementation.  It turns out I upgraded to RedHat 7.0 and forgot.  :)


> I don't mind supporting some other version of tags, but I think it
> would be easiest if we just introduced a new target.

[snip]


> The `--lang=none' thing is definitely specific to the Emacs etags.
> That must appear in your Makefile.am though -- meaning that your
> Makefile.am was written to work with the Emacs etags.  This isn't an
> uncommon practice, either.

'--lang=' isn't though.  Exuberent ctags looks like it was trying to
mimic the original.  Not sure why there are differences.


> Adding configure machinery for this seems like overkill.

I'm still not so sure about that.  The targets are extremely similiar and
the output file has the same name and is in the same format.  In theory,
both programs should produce identical output, with the '--lang=none'
exception noted above.

Derek
--
Derek Price  CVS Solutions Architect (
http://CVSHome.org )
mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
--
Always glad to share my ignorance - I've got plenty.






Re: [PATCH] etags support

2000-12-22 Thread Thomas E. Dickey

On 21 Dec 2000, Tom Tromey wrote:

> > "Derek" == Derek R Price <[EMAIL PROTECTED]> writes:
> 
> creche. etags --version
> etags (GNU Emacs 20.5)
> Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold
> This program is distributed under the same terms as Emacs
> 
> 
> It is pretty lame that the exuberant tags people chose to use the name
> `etags' for their program.  The Emacs etags has been around since 1984

actually (it's been quite a while since I looked for variants - 1994 - to
find a good version, though at that time, I chose one of them), there's
been more than one program named 'etags' (ditto for tags++).  exuberant
tags is doing what some others do: when invoked by that name, it handles
the corresponding format.

-- 
T.E.Dickey <[EMAIL PROTECTED]>
http://dickey.his.com
ftp://dickey.his.com





Re: [PATCH] etags support

2000-12-22 Thread Akim Demaille


 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])

Missing a dnl here.

  --- /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)

You must quote AM_PROG_ETAGS_WORKS here.  And dnl too :)

  +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],

Internal macros such as this one should be named _AM_ something.


  +[AC_CACHE_CHECK([whether etags works], [am_cv_prog_etags_works],
  +[cat >conftest.c &1; then

Using AC_TRY_COMMAND is excellent, but I'd either use it several
times, or for the whole command:

if AC_TRY_COMMAND([${ETAGS-etags} -f - conftest.c]) |
   AC_TRY_COMMAND([egrep "^int globalvar;" >&2]); then

or

if AC_TRY_COMMAND([${ETAGS-etags} -f - conftest.c |
egrep "^int globalvar;" >&2]); then

so that CVS Autoconf report some logs.  That's also why I sent it to
stderr (which is logged) instead of /dev/null.

FYI:

| /tmp % cat configure.in
| AC_INIT
| AC_TRY_COMMAND([echo toto]) | AC_TRY_COMMAND([grep toto >&2])
| AC_TRY_COMMAND([echo toto; exit 1]) | AC_TRY_COMMAND([grep toto >&2])
| AC_TRY_COMMAND([echo toto]) | AC_TRY_COMMAND([grep ta >&2])
| /tmp % ace 
| /tmp % ./configure 
| /tmp % cat config.log
| This file contains any messages produced by compilers while
| running configure, to aid debugging if configure makes a mistake.
| 
| It was created by configure 2.49c, executed with
|  > ./configure 
| 
| ## -- ##
| ## Platform.  ##
| ## -- ##
| 
| hostname = nostromo
| uname -m = i686
| uname -r = 2.2.17
| uname -s = Linux
| uname -v = #1 Sat Sep 9 12:42:22 EST 2000
| 
| /usr/bin/uname -p = 
| /bin/uname -X = 
| 
| /bin/arch  = i686
| /usr/bin/arch -k   = 
| /usr/convex/getsysinfo = 
| hostinfo   = 
| /bin/machine   = 
| /usr/bin/oslevel   = 
| /bin/universe  = 
| 
| PATH = 
|/tmp/lt/bin/:/usr/local/bin/akim:/home/lrde/prof/akim/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/X11R6/bin:/usr/local/kde/bin
| 
| ##  ##
| ## Core tests.  ##
| ##  ##
| 
| configure:833: echo toto
| configure:836: $? = 0
| configure:837: grep toto >&2
| toto
| configure:840: $? = 0
| configure:842: echo toto; exit 1
| configure:845: $? = 1
| configure:846: grep toto >&2
| toto
| configure:849: $? = 0
| configure:851: echo toto
| configure:855: grep ta >&2
| configure:854: $? = 0
| configure:858: $? = 1
| configure: exit 1




Re: [PATCH] etags support

2000-12-21 Thread Tom Tromey

> "Derek" == Derek R Price <[EMAIL PROTECTED]> writes:

Derek> I added rudimentary support for different implementations of
Derek> etags (read the one Automake expects and Exuberent etags) since
Derek> they take slightly different options.  Exuberent etags is the
Derek> version distributed with RedHat Linux 6.2 & I believe Debian
Derek> and a few others.

Hmm.  I'm running RH 6.2 and /usr/bin/etags is the GNU version:

creche. etags --version
etags (GNU Emacs 20.5)
Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold
This program is distributed under the same terms as Emacs


It is pretty lame that the exuberant tags people chose to use the name
`etags' for their program.  The Emacs etags has been around since 1984
(though maybe it wasn't called "etags" until some time later; it
definitely was by 1990 though).  Surely they could have picked some
name that wasn't already in use.

I don't mind supporting some other version of tags, but I think it
would be easiest if we just introduced a new target.

Derek> This was enough to get the TAGS target working with CVS, but
Derek> what it probably still needs is a test for support for
Derek> "--lang=none" and a hook like @AMDEP@ to comment out the TAGS
Derek> target or support in missing for when the user doesn't have
Derek> etags installed or configure can't figure out how it works.

The `--lang=none' thing is definitely specific to the Emacs etags.
That must appear in your Makefile.am though -- meaning that your
Makefile.am was written to work with the Emacs etags.  This isn't an
uncommon practice, either.

I don't want to add missing support for etags.  tags is a developer's
target.  If a developer wants to use it, he should (1) know what etags
is, and (2) have it installed.

Adding configure machinery for this seems like overkill.

It's true that we do this for the C compiler, but the situations
aren't really analogous.

Tom




Re: [PATCH] etags support

2000-12-21 Thread Derek R. Price

"Derek R. Price" wrote:

> > > I added a macro to test for the presence of etags and whether it
> > > supports "--etags-include=" or "-i " 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:[EMAIL PROTECTED] 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  <[EMAIL PROTECTED]>
+
+   * 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 <[EMAIL PROTECTED]>
 
* 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 @@
 SUBDIRSlist='$(SUBDIRS)'; for subdir in $$list; do \
 ## Do nothing if we're trying to look in `.'.
 SUBDIRS   if test "$$subdir" = .; then :; else \
-SUBDIRStest -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+SUBDIRStest -f $$subdir/TAGS && tags="$$tags 
+$(ETAGS_INCLUDE_OPTION)$$here/$$subdir/TAGS"; \
 SUBDIRS   fi; \
 SUBDIRSdone; \
 ## 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)@CONFIG@$$unique$(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  <[EMAIL PROTECTED]>
+
+   * etags.test: New file
+   * Makefile.am (TESTS): added etags.test
+
 2000-12-17  Tom Tromey  <[EMAIL PROTECTED]>
 
* 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.testWed 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: 

Re: [PATCH] etags support

2000-12-21 Thread Derek R. Price

Raja R Harinath wrote:

> > I added a macro to test for the presence of etags and whether it
> > supports "--etags-include=" or "-i " for includes.
>
> If Exuberent etags is supposed to be a drop-in replacement for Emacs
> etags, it should support the same options.  Otherwise, it is a bug in
> the distribution if it gives you a "non-standard" etags (you can call
> the Emacs etags the "standard").

Well, there is a precedent in the support for different compiler options and
I don't want to waste the time of potential CVS developers because they
couldn't get their TAGS file built.  A lot of CVS users are installing on
RedHat Linux at the moment.

Derek

--
Derek Price  CVS Solutions Architect ( http://CVSHome.org )
mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
--
Were it left for me to decide whether we should have a government without
newspapers, or newspapers without a government, I should not hesitate a moment
to prefer the latter.
- Thomas Jefferson
(appeared http://hotwired.lycos.com/special/lawsuit/ )







Re: [PATCH] etags support

2000-12-21 Thread Raja R Harinath

Hi,

"Derek R. Price" <[EMAIL PROTECTED]> writes:
> I added rudimentary support for different implementations of etags (read
> the one Automake expects and Exuberent etags) since they take slightly
> different options.  Exuberent etags is the version distributed with
> RedHat Linux 6.2 & I believe Debian and a few others.
>
> What version of etags was Automake expecting and where can I get it?

I guess it expects to find the version that's distributed as part of
Emacs. 

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

If Exuberent etags is supposed to be a drop-in replacement for Emacs
etags, it should support the same options.  Otherwise, it is a bug in
the distribution if it gives you a "non-standard" etags (you can call
the Emacs etags the "standard").

- Hari
-- 
Raja R Harinath -- [EMAIL PROTECTED]
"When all else fails, read the instructions."  -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash




[PATCH] etags support

2000-12-21 Thread Derek R. Price

I added rudimentary support for different implementations of etags (read
the one Automake expects and Exuberent etags) since they take slightly
different options.  Exuberent etags is the version distributed with
RedHat Linux 6.2 & I believe Debian and a few others.

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

This was enough to get the TAGS target working with CVS, but what it
probably still needs is a test for support for "--lang=none" and a hook
like @AMDEP@ to comment out the TAGS target or support in missing for
when the user doesn't have etags installed or configure can't figure out
how it works.

What version of etags was Automake expecting and where can I get it?

Derek

--
Derek Price  CVS Solutions Architect ( http://CVSHome.org )
mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
--
There are two major products to come out of Berkley: LSD and UNIX . We don't
believe this to be a coincidence.




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  <[EMAIL PROTECTED]>
+
+   * 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-18  Tom Tromey  <[EMAIL PROTECTED]>
 
* automake.in (handle_built_sources): Removed.
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 @@
 SUBDIRSlist='$(SUBDIRS)'; for subdir in $$list; do \
 ## Do nothing if we're trying to look in `.'.
 SUBDIRS   if test "$$subdir" = .; then :; else \
-SUBDIRStest -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+SUBDIRStest -f $$subdir/TAGS && tags="$$tags 
+$(ETAGS_INCLUDE_OPTION)$$here/$$subdir/TAGS"; \
 SUBDIRS   fi; \
 SUBDIRSdone; \
 ## 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)@CONFIG@$$unique$(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  <[EMAIL PROTECTED]>
+
+   * etags.test: New file
+   * Makefile.am (TESTS): added etags.test
+
 2000-12-17  Tom Tromey  <[EMAIL PROTECTED]>
 
* 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
+++ m4/etags.m4 Thu Dec 21 12:03:24 2000
@@ -0,0 +1,60 @@
+#
+# 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
+