From 4ed502ba02270adee7c46bb738374cab867baee1 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 22 Feb 2022 17:09:16 -0500 Subject: [PATCH] libgloss: enable maintainer mode support Use AM_MAINTAINER_MODE so devs have to opt-in to automatic rebuilds of autotools. This matches what newlib (and most every other GNU toolchain package) does with automake. --- libgloss/Makefile.in | 9 +++++---- libgloss/aclocal.m4 | 36 ++++++++++++++++++++++++++++++++++++ libgloss/configure | 34 ++++++++++++++++++++++++++++++++++ libgloss/configure.ac | 1 + 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in index 7f1d96f7f..ad7371111 100644 --- a/libgloss/Makefile.in +++ b/libgloss/Makefile.in @@ -456,6 +456,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ M68K_TARGET = @M68K_TARGET@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCORE_BSP_PREFIX = @MCORE_BSP_PREFIX@ MIPS_BSP_LIST = @MIPS_BSP_LIST@ @@ -649,7 +650,7 @@ all: config.h .SUFFIXES: .S .c .dvi .o .obj .ps am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/../multilib.am $(srcdir)/doc/Makefile.inc $(srcdir)/bfin/Makefile.inc $(srcdir)/iq2000/Makefile.inc $(srcdir)/libnosys/Makefile.inc $(srcdir)/wince/Makefile.inc $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/../multilib.am $(srcdir)/doc/Makefile.inc $(srcdir)/bfin/Makefile.inc $(srcdir)/iq2000/Makefile.inc $(srcdir)/libnosys/Makefile.inc $(srcdir)/wince/Makefile.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -676,9 +677,9 @@ $(top_srcdir)/../multilib.am $(srcdir)/doc/Makefile.inc $(srcdir)/bfin/Makefile. $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -689,7 +690,7 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ diff --git a/libgloss/aclocal.m4 b/libgloss/aclocal.m4 index a74c735bd..b6bc2c0f3 100644 --- a/libgloss/aclocal.m4 +++ b/libgloss/aclocal.m4 @@ -646,6 +646,42 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. diff --git a/libgloss/configure b/libgloss/configure index 8662be404..dab6ac807 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -642,6 +642,9 @@ HAVE_MULTISUBDIR_FALSE HAVE_MULTISUBDIR_TRUE HAVE_DOC_FALSE HAVE_DOC_TRUE +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -724,6 +727,7 @@ target_makefile_frag' ac_user_opts=' enable_option_checking enable_silent_rules +enable_maintainer_mode enable_dependency_tracking enable_multilib ' @@ -1361,6 +1365,9 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking @@ -2608,6 +2615,29 @@ END fi fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; @@ -5361,6 +5391,10 @@ else am__EXEEXT_FALSE= fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_DOC_TRUE}" && test -z "${HAVE_DOC_FALSE}"; then as_fn_error $? "conditional \"HAVE_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libgloss/configure.ac b/libgloss/configure.ac index b5a0fce08..ec2a49e03 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -12,6 +12,7 @@ AC_PROG_INSTALL AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE([foreign no-dist no-define subdir-objects 1.15.1]) +AM_MAINTAINER_MODE AM_SILENT_RULES(yes) if test -z "${with_multisubdir}"; then