aboutsummaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh95
1 files changed, 63 insertions, 32 deletions
diff --git a/autogen.sh b/autogen.sh
index 9b36158..0b08e8b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# autogen.sh
-# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH
+# Copyright (C) 2003, 2014, 2017, 2018, 2022 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -15,7 +15,7 @@
# configure it for the respective package. It is maintained as part of
# GnuPG and source copied by other packages.
#
-# Version: 2018-07-10
+# Version: 2024-12-03
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,18 +137,17 @@ die_p
configure_opts=
extraoptions=
# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc
+maintainer_mode_option=
w32_toolprefixes=
w32_extraoptions=
-w32ce_toolprefixes=
-w32ce_extraoptions=
w64_toolprefixes=
w64_extraoptions=
amd64_toolprefixes=
+disable_gettext_checks=
# End list of optional variables sourced from ~/.gnupg-autogen.rc
# What follows are variables which are sourced but default to
# environment variables or lacking them hardcoded values.
#w32root=
-#w32ce_root=
#w64root=
#amd64root=
@@ -159,6 +160,11 @@ case "$1" in
SILENT=" --silent"
shift
;;
+ --print-tsdir)
+ myhost="print-tsdir"
+ SILENT=" --silent"
+ shift
+ ;;
--git-build)
myhost="git-build"
shift
@@ -167,11 +173,6 @@ case "$1" in
myhost="w32"
shift
;;
- --build-w32ce)
- myhost="w32"
- myhostsub="ce"
- shift
- ;;
--build-w64)
myhost="w32"
myhostsub="64"
@@ -203,7 +204,7 @@ if [ "$myhost" = "git-build" ]; then
die_p
make || fatal "error running make"
die_p
- make check || fatal "error running male check"
+ make check || fatal "error running make check"
die_p
exit 0
fi
@@ -221,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
@@ -241,10 +248,12 @@ if [ "$myhost" = "find-version" ]; then
if [ -z "$micro" ]; then
matchstr1="$package-$major.[0-9]*"
matchstr2="$package-$major-base"
+ matchstr3=""
vers="$major.$minor"
else
matchstr1="$package-$major.$minor.[0-9]*"
- matchstr2="$package-$major.$minor-base"
+ matchstr2="$package-$major.[0-9]*-base"
+ matchstr3="$package-$major-base"
vers="$major.$minor.$micro"
fi
@@ -252,30 +261,49 @@ if [ "$myhost" = "find-version" ]; then
if [ -e .git ]; then
ingit=yes
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
- tmp=$(echo "$tmp" | sed s/^"$package"//)
if [ -n "$tmp" ]; then
- tmp=$(echo "$tmp" | sed s/^"$package"// \
- | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
+ tmp=$(echo "$tmp" | sed s/^"$package"// \
+ | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
else
- tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \
- | awk -F- '$4!=0{print"-beta"$4}')
+ # (due tof "-base" in the tag we need to take the 4th field)
+ tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null)
+ if [ -n "$tmp" ]; then
+ tmp=$(echo "$tmp" | sed s/^"$package"// \
+ | awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
+ elif [ -n "${matchstr3}" ]; then
+ tmp=$(git describe --match "${matchstr3}" --long 2>/dev/null)
+ if [ -n "$tmp" ]; then
+ tmp=$(echo "$tmp" | sed s/^"$package"// \
+ | awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
+ fi
+ fi
fi
[ -n "$tmp" ] && beta=yes
+ cid=$(git rev-parse --verify HEAD | tr -d '\n\r')
rev=$(git rev-parse --short HEAD | tr -d '\n\r')
rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
else
ingit=no
beta=yes
tmp="-unknown"
+ cid="0000000"
rev="0000000"
rvd="0"
fi
- echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:"
+ echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:$cid:"
exit 0
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"
@@ -294,12 +322,6 @@ fi
# ******************
if [ "$myhost" = "w32" ]; then
case $myhostsub in
- ce)
- w32root="$w32ce_root"
- [ -z "$w32root" ] && w32root="$HOME/w32ce_root"
- toolprefixes="$w32ce_toolprefixes arm-mingw32ce"
- extraoptions="$extraoptions $w32ce_extraoptions"
- ;;
64)
w32root="$w64root"
[ -z "$w32root" ] && w32root="$HOME/w64root"
@@ -313,6 +335,7 @@ if [ "$myhost" = "w32" ]; then
extraoptions="$extraoptions $w32_extraoptions"
;;
esac
+ w32root=$(echo "$w32root" | sed s,^//,/,)
info "Using $w32root as standard install directory"
replace_sysroot
@@ -345,7 +368,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 +413,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} "$@"
@@ -413,17 +436,16 @@ q
}' ${configure_ac}`
automake_vers_num=`echo "$automake_vers" | cvtver`
+gettext_vers="n/a"
if [ -d "${tsdir}/po" ]; then
gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
s/^.*\[\(.*\)])/\1/p
q
}' ${configure_ac}`
gettext_vers_num=`echo "$gettext_vers" | cvtver`
-else
- gettext_vers="n/a"
fi
-if [ -z "$autoconf_vers" -o -z "$automake_vers" -o -z "$gettext_vers" ]
+if [ -z "$autoconf_vers" -o -z "$automake_vers" ]
then
echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2
exit 1
@@ -501,12 +523,21 @@ fi
if [ -n "${ACLOCAL_FLAGS}" ]; then
aclocal_flags="${aclocal_flags} ${ACLOCAL_FLAGS}"
fi
+
+automake_flags="--gnu"
+if [ -n "${extra_automake_flags}" ]; then
+ automake_flags="${automake_flags} ${extra_automake_flags}"
+fi
+if [ -n "${AUTOMAKE_FLAGS}" ]; then
+ automake_flags="${automake_flags} ${AUTOMAKE_FLAGS}"
+fi
+
info "Running $ACLOCAL ${aclocal_flags} ..."
$ACLOCAL ${aclocal_flags}
info "Running autoheader..."
$AUTOHEADER
-info "Running automake --gnu ..."
-$AUTOMAKE --gnu;
+info "Running $AUTOMAKE ${automake_flags} ..."
+$AUTOMAKE ${automake_flags};
info "Running autoconf${FORCE} ..."
$AUTOCONF${FORCE}