diff --git a/src/Makefile.in b/src/Makefile.in index 3d25c7053..f73f9f50b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 diff --git a/src/configure b/src/configure index 97c5ac31a..a62d18d9f 100755 --- a/src/configure +++ b/src/configure @@ -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 diff --git a/src/configure.in b/src/configure.in index 87781b7dd..e75809094 100644 --- a/src/configure.in +++ b/src/configure.in @@ -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)