2019-08-08 00:43:20 +00:00
|
|
|
#!/bin/sh -x
|
2007-04-12 16:25:58 +00:00
|
|
|
#
|
2018-12-23 02:17:16 +00:00
|
|
|
# Run this script to regenerate autoconf files
|
2007-04-12 16:25:58 +00:00
|
|
|
#
|
2018-12-23 02:51:59 +00:00
|
|
|
recheck=false
|
|
|
|
if [ x"$1" = x--recheck ]; then
|
|
|
|
recheck=true
|
|
|
|
config=$(sh config.status --config 2>/dev/null)
|
|
|
|
fi
|
|
|
|
|
2019-08-08 00:43:20 +00:00
|
|
|
# This allows for overriding the default autoconf programs
|
|
|
|
AUTOCONF="${AUTOCONF:-${AUTOTOOLS_PREFIX}autoconf}"
|
|
|
|
AUTOMAKE="${AUTOMAKE:-${AUTOTOOLS_PREFIX}automake}"
|
|
|
|
ACLOCAL="${ACLOCAL:-${AUTOTOOLS_PREFIX}aclocal}"
|
|
|
|
AUTOHEADER="${AUTOHEADER:-${AUTOTOOLS_PREFIX}autoheader}"
|
|
|
|
|
2019-02-22 09:13:52 +00:00
|
|
|
mkdir -p autoconf autoconf/helpers config
|
2019-08-08 00:43:20 +00:00
|
|
|
autolib="`"$AUTOMAKE" --print-libdir`"
|
|
|
|
if test ! x"$autolib" = x; then
|
|
|
|
for prg in install-sh compile config.guess config.sub; do
|
2019-09-24 18:13:43 +00:00
|
|
|
# Update autoconf helpers if and only if newer ones are available
|
|
|
|
if test -f "$autolib"/"$prg" && \
|
|
|
|
( test -f "$autolib"/"$prg" && \
|
|
|
|
sed -n -r -e \
|
|
|
|
's/^(scriptver(|sion)|timestamp)=['\''"]?([^'\''"]+).*$/\3/p' \
|
|
|
|
"$autolib"/"$prg" autoconf/helpers/"$prg" | \
|
|
|
|
sort --check=quiet; test $? -ne 0 )
|
|
|
|
then
|
2019-08-08 00:43:20 +00:00
|
|
|
cp -f "$autolib"/"$prg" autoconf/helpers
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
mv -f autoconf/aclocal.m4 autoconf/aclocal.m4.old
|
2018-12-23 02:17:16 +00:00
|
|
|
mkdir -p autoconf/m4.old autoconf/m4
|
|
|
|
mv -f autoconf/m4/*.m4 autoconf/m4.old/ 2>/dev/null || true
|
|
|
|
ACLOCAL_PATH="${ACLOCAL_PATH}${ACLOCAL_PATH:+:}`pwd`/autoconf/m4.old"
|
|
|
|
export ACLOCAL_PATH
|
2019-08-08 00:43:20 +00:00
|
|
|
"$ACLOCAL" --install --output=autoconf/aclocal.m4 -I autoconf/m4
|
|
|
|
if test ! -f autoconf/aclocal.m4; then
|
|
|
|
# aclocal failed, revert to previous files
|
|
|
|
mv -f autoconf/m4.old/*.m4 autoconf/m4/
|
|
|
|
mv -f autoconf/aclocal.m4.old autoconf/aclocal.m4
|
|
|
|
fi
|
|
|
|
rm -rf autoconf/*m4.old
|
|
|
|
"$AUTOHEADER" -B autoconf
|
2019-10-04 04:32:08 +00:00
|
|
|
if [ config/config.h.in -nt config/unconfig.h ]; then
|
|
|
|
# Create a file corresponding to a completely empty configure
|
|
|
|
# instance, commenting out the #undef directives from the template
|
|
|
|
# just like configure would do.
|
|
|
|
perl -np < config/config.h.in > config/unconfig.h \
|
|
|
|
-e 's:^(\#\s*undef\s.*)$:/* $1 */:;' \
|
|
|
|
-e 's:config/config.h.in:config/unconfig.h:;' \
|
|
|
|
-e 's:autoheader:autogen.sh:;'
|
|
|
|
fi
|
2019-08-08 00:43:20 +00:00
|
|
|
"$AUTOCONF" -B autoconf
|
2018-12-23 02:17:16 +00:00
|
|
|
rm -rf autom4te.cache config.log config.status config/config.h Makefile
|
2018-12-23 02:51:59 +00:00
|
|
|
|
|
|
|
if $recheck; then
|
|
|
|
# This bizarre statement has to do with how config.status quotes its output
|
|
|
|
echo exec sh configure $config | sh -
|
|
|
|
fi
|