blob: e07324cdf66e58d18037abb800158a7b169f5889 [file] [log] [blame]
H. Peter Anvin (Intel)dea90382019-08-07 17:43:20 -07001#!/bin/sh -x
H. Peter Anvin2030bd22007-04-12 16:25:58 +00002#
H. Peter Anvinb0121dc2018-12-22 18:17:16 -08003# Run this script to regenerate autoconf files
H. Peter Anvin2030bd22007-04-12 16:25:58 +00004#
H. Peter Anvin54d50782018-12-22 18:51:59 -08005recheck=false
6if [ x"$1" = x--recheck ]; then
7 recheck=true
8 config=$(sh config.status --config 2>/dev/null)
9fi
10
H. Peter Anvin (Intel)dea90382019-08-07 17:43:20 -070011# This allows for overriding the default autoconf programs
12AUTOCONF="${AUTOCONF:-${AUTOTOOLS_PREFIX}autoconf}"
13AUTOMAKE="${AUTOMAKE:-${AUTOTOOLS_PREFIX}automake}"
14ACLOCAL="${ACLOCAL:-${AUTOTOOLS_PREFIX}aclocal}"
15AUTOHEADER="${AUTOHEADER:-${AUTOTOOLS_PREFIX}autoheader}"
16
H. Peter Anvin0bddd0f2019-02-22 01:13:52 -080017mkdir -p autoconf autoconf/helpers config
H. Peter Anvin (Intel)dea90382019-08-07 17:43:20 -070018autolib="`"$AUTOMAKE" --print-libdir`"
19if test ! x"$autolib" = x; then
20 for prg in install-sh compile config.guess config.sub; do
21 if test -f "$autolib"/"$prg"; then
22 cp -f "$autolib"/"$prg" autoconf/helpers
23 fi
24 done
25fi
26mv -f autoconf/aclocal.m4 autoconf/aclocal.m4.old
H. Peter Anvinb0121dc2018-12-22 18:17:16 -080027mkdir -p autoconf/m4.old autoconf/m4
28mv -f autoconf/m4/*.m4 autoconf/m4.old/ 2>/dev/null || true
29ACLOCAL_PATH="${ACLOCAL_PATH}${ACLOCAL_PATH:+:}`pwd`/autoconf/m4.old"
30export ACLOCAL_PATH
H. Peter Anvin (Intel)dea90382019-08-07 17:43:20 -070031"$ACLOCAL" --install --output=autoconf/aclocal.m4 -I autoconf/m4
32if test ! -f autoconf/aclocal.m4; then
33 # aclocal failed, revert to previous files
34 mv -f autoconf/m4.old/*.m4 autoconf/m4/
35 mv -f autoconf/aclocal.m4.old autoconf/aclocal.m4
36fi
37rm -rf autoconf/*m4.old
38"$AUTOHEADER" -B autoconf
39"$AUTOCONF" -B autoconf
H. Peter Anvinb0121dc2018-12-22 18:17:16 -080040rm -rf autom4te.cache config.log config.status config/config.h Makefile
H. Peter Anvin54d50782018-12-22 18:51:59 -080041
42if $recheck; then
43 # This bizarre statement has to do with how config.status quotes its output
44 echo exec sh configure $config | sh -
45fi