automake
[Top][All Lists]
Advanced

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

Re: [PATCH] etags support


From: Akim Demaille
Subject: Re: [PATCH] etags support
Date: 22 Dec 2000 10:56:10 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

 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 <<EOF
  +int globalvar;
  +EOF
  +if AC_TRY_COMMAND(${ETAGS-etags} -f - conftest.c) |egrep "^int globalvar;" 
>/dev/null 2>&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



reply via email to

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