From 909b30a17e71253772d2cb174d0dae6d0b8c9401 Mon Sep 17 00:00:00 2001 From: Eric Gallager Date: Mon, 29 Nov 2021 13:24:12 -0500 Subject: Make etags path used by build system configurable This commit allows users to specify a path to their "etags" executable for use when doing "make tags". I based this patch off of this one from upstream automake: https://git.savannah.gnu.org/cgit/automake.git/commit/m4?id=d2ccbd7eb38d6a4277d6f42b994eb5a29b1edf29 This means that I just supplied variables that the user can override for the tags programs, rather than having the configure scripts actually check for them. I handle etags and ctags separately because the intl subdirectory has separate targets for them. This commit only affects the subdirectories that use handwritten Makefiles; the ones that use automake will have to wait until we update the version of automake used to be 1.16.4 or newer before they'll be fixed. Addresses #103021 gcc/ChangeLog: PR other/103021 * Makefile.in: Substitute CTAGS, ETAGS, and CSCOPE variables. Use ETAGS variable in TAGS target. * configure: Regenerate. * configure.ac: Allow CTAGS, ETAGS, and CSCOPE variables to be overridden. gcc/ada/ChangeLog: PR other/103021 * gcc-interface/Make-lang.in: Use ETAGS variable in TAGS target. gcc/c/ChangeLog: PR other/103021 * Make-lang.in: Use ETAGS variable in TAGS target. gcc/cp/ChangeLog: PR other/103021 * Make-lang.in: Use ETAGS variable in TAGS target. gcc/d/ChangeLog: PR other/103021 * Make-lang.in: Use ETAGS variable in TAGS target. gcc/fortran/ChangeLog: PR other/103021 * Make-lang.in: Use ETAGS variable in TAGS target. gcc/go/ChangeLog: PR other/103021 * Make-lang.in: Use ETAGS variable in TAGS target. gcc/objc/ChangeLog: PR other/103021 * Make-lang.in: Use ETAGS variable in TAGS target. gcc/objcp/ChangeLog: PR other/103021 * Make-lang.in: Use ETAGS variable in TAGS target. intl/ChangeLog: PR other/103021 * Makefile.in: Use ETAGS variable in TAGS target, CTAGS variable in CTAGS target, and MKID variable in ID target. * configure: Regenerate. * configure.ac: Allow CTAGS, ETAGS, and MKID variables to be overridden. libcpp/ChangeLog: PR other/103021 * Makefile.in: Use ETAGS variable in TAGS target. * configure: Regenerate. * configure.ac: Allow ETAGS variable to be overridden. libiberty/ChangeLog: PR other/103021 * Makefile.in: Use ETAGS variable in TAGS target. * configure: Regenerate. * configure.ac: Allow ETAGS variable to be overridden. --- intl/Makefile.in | 10 +++++++--- intl/configure | 16 ++++++++++++++++ intl/configure.ac | 14 ++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) (limited to 'intl') diff --git a/intl/Makefile.in b/intl/Makefile.in index ec8c648b7a9..409d693c48e 100644 --- a/intl/Makefile.in +++ b/intl/Makefile.in @@ -50,6 +50,10 @@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ DEFS = -DHAVE_CONFIG_H +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ +MKID = @MKID@ + COMPILE = $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(DEFS-$@) $(INCLUDES) HEADERS = \ @@ -176,17 +180,17 @@ localealias.o localcharset.o relocatable.o: relocatable.h tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && \ - etags -o $$here/TAGS $(HEADERS) $(SOURCES) + $(ETAGS) -o $$here/TAGS $(HEADERS) $(SOURCES) ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && \ - ctags -o $$here/CTAGS $(HEADERS) $(SOURCES) + $(CTAGS) -o $$here/CTAGS $(HEADERS) $(SOURCES) id: ID ID: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && \ - mkid -f$$here/ID $(HEADERS) $(SOURCES) + $(MKID) -f$$here/ID $(HEADERS) $(SOURCES) mostlyclean: rm -f *.a *.la *.o *.obj *.lo core core.* libintl.h diff --git a/intl/configure b/intl/configure index 9d4f5000f9e..03f40487a92 100755 --- a/intl/configure +++ b/intl/configure @@ -627,6 +627,9 @@ BISON3_NO BISON3_YES INCINTL LIBINTL_DEP +MKID +ETAGS +CTAGS MAINT AUTOHEADER AUTOCONF @@ -6799,6 +6802,19 @@ else fi +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$MKID"; then + MKID=mkid +fi + + # Additional info for config.intl. diff --git a/intl/configure.ac b/intl/configure.ac index 72b145958cf..16a740aa230 100644 --- a/intl/configure.ac +++ b/intl/configure.ac @@ -32,6 +32,20 @@ else fi AC_SUBST(MAINT) +dnl Variables for tags utilities; based on automake 1.16.4+'s init.m4 +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$MKID"; then + MKID=mkid +fi +AC_SUBST([MKID]) + # Additional info for config.intl. AC_SUBST(LIBINTL_DEP) AC_SUBST(INCINTL) -- cgit v1.2.3