Find out the etags program and use it in Makefile (M. Mondor)

This commit is contained in:
Juan Jose Garcia Ripoll 2011-01-16 14:04:04 +01:00
parent 91a555f393
commit 79daa899f2
3 changed files with 48 additions and 2 deletions

View file

@ -18,6 +18,7 @@ LDFLAGS = @LDFLAGS@
RM = @RM@
LN_S = @LN_S@
EXE = @EXEEXT@
ETAGS = @ETAGS@
# ==================== Where To Install Things ====================
@ -246,9 +247,10 @@ selfbuild:
# This rule is allowed to fail when etags does not exist.
TAGS:
echo > $@;
test $ETAGS && \
-srcfiles=`find $(srcdir)/c/ $(srcdir)/h/ -name '*.[chd]'`; \
etags --language=c -o $@ $$srcfiles && \
etags --language=none -o $@ --append \
$ETAGS --language=c -o $@ $$srcfiles && \
$ETAGS --language=none -o $@ --append \
--regex='/@\([-:*a-zA-z]+\)/\1/' \
--regex='/@(defun \([-:*a-zA-z]+\)/\1/' \
$$srcfiles

43
src/configure vendored
View file

@ -649,6 +649,7 @@ RM
CP
true_builddir
true_srcdir
ETAGS
AR
SET_MAKE
LN_S
@ -4610,6 +4611,48 @@ else
AR="$ac_cv_prog_AR"
fi
# set variable AR to appropriate `ar' program
for ac_prog in etags emacs-etags
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ETAGS+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ETAGS"; then
ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ETAGS="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ETAGS=$ac_cv_prog_ETAGS
if test -n "$ETAGS"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ETAGS" >&5
$as_echo "$ETAGS" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ETAGS" && break
done
# set variable ETAGS to etags program if found

View file

@ -326,6 +326,7 @@ AC_PROG_LN_S # sets variable LN_S
AC_PROG_MAKE_SET # set $(MAKE) if needed
AC_PROG_RANLIB # set variable RANLIB
AC_CHECK_TOOL([AR],[ar]) # set variable AR to appropriate `ar' program
AC_CHECK_PROGS([ETAGS],[etags emacs-etags]) # set variable ETAGS to etags program if found
dnl -----------------------------------------------------------------------
dnl Checks which do not come with autoconf (must be after AC_PROG_CC)