From e15a7c411dcadb229f4ff1ae0259c51dde9fd535 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 21 Nov 2024 14:34:57 +0100 Subject: autogen.sh: New command --print-tsdir. * autogen.sh: New command --print-tsdir. (maintainer_mode_option): Allow setting via autogen.rc -- The maintainer mode config option is required for docker builds to avoid surprising rebuilds in a read-only mounted volume. The print-tsdir is a help er for baking the source dir into the configure. --- autogen.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'autogen.sh') diff --git a/autogen.sh b/autogen.sh index 9f91297..271aa0a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -15,7 +15,7 @@ # configure it for the respective package. It is maintained as part of # GnuPG and source copied by other packages. # -# Version: 2024-07-04 +# Version: 2024-11-21 configure_ac="configure.ac" @@ -72,6 +72,7 @@ FORCE= SILENT= PRINT_HOST=no PRINT_BUILD=no +PRINT_TSDIR=no tmp=$(dirname "$0") tsdir=$(cd "${tmp}"; pwd) @@ -84,9 +85,10 @@ if test x"$1" = x"--help"; then echo " --silent Silent operation" echo " --force Pass --force to autoconf" echo " --find-version Helper for configure.ac" - echo " --git-build Run all commands to build from a Git" + echo " --git-build Run all commands to build from a Git" echo " --print-host Print only the host triplet" echo " --print-build Print only the build platform triplet" + echo " --print-tsdir Print only the dir of this script" echo " --build-TYPE Configure to cross build for TYPE" echo "" echo " ARGS are passed to configure in --build-TYPE mode." @@ -135,6 +137,7 @@ die_p configure_opts= extraoptions= # List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc +maintainer_mode_option= w32_toolprefixes= w32_extraoptions= w64_toolprefixes= @@ -157,6 +160,11 @@ case "$1" in SILENT=" --silent" shift ;; + --print-tsdir) + myhost="print-tsdir" + SILENT=" --silent" + shift + ;; --git-build) myhost="git-build" shift @@ -214,6 +222,12 @@ if [ -f "$HOME/.gnupg-autogen.rc" ]; then . "$HOME/.gnupg-autogen.rc" fi +# Disable the --enable-maintainer_mode option. +if [ "${maintainer_mode_option}" = off ]; then + maintainer_mode_option= +elif [ -z "${maintainer_mode_option}" ]; then + maintainer_mode_option=--enable-maintainer-mode +fi # **** FIND VERSION **** # This is a helper for the configure.ac M4 magic @@ -282,6 +296,14 @@ if [ "$myhost" = "find-version" ]; then fi # **** end FIND VERSION **** +# **** PRINT TSDIR VERSION **** +# This is a helper used by some configure.ac M4 magic +if [ "$myhost" = "print-tsdir" ]; then + echo "$tsdir" + exit 0 +fi +# **** end PRINT TSDIR **** + if [ ! -f "$tsdir/build-aux/config.guess" ]; then fatal "$tsdir/build-aux/config.guess not found" @@ -345,7 +367,7 @@ if [ "$myhost" = "w32" ]; then fi fi - $tsdir/configure --enable-maintainer-mode ${SILENT} \ + $tsdir/configure "${maintainer_mode_option}" ${SILENT} \ --prefix=${w32root} \ --host=${host} --build=${build} SYSROOT=${w32root} \ PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \ @@ -390,7 +412,7 @@ if [ "$myhost" = "amd64" ]; then fi fi - $tsdir/configure --enable-maintainer-mode ${SILENT} \ + $tsdir/configure "${maintainer_mode_option}" ${SILENT} \ --prefix=${amd64root} \ --host=${host} --build=${build} \ ${configure_opts} ${extraoptions} "$@" -- cgit v1.2.3