warnings: do a line break before enabled/disabled note
[nasm.git] / autogen.sh
blobc681c679eea713bc57545d47086ac366144cacd0
1 #!/bin/sh -x
3 # Run this script to regenerate autoconf files
5 recheck=false
6 if [ x"$1" = x--recheck ]; then
7 recheck=true
8 config=$(sh config.status --config 2>/dev/null)
9 fi
11 # This allows for overriding the default autoconf programs
12 AUTOCONF="${AUTOCONF:-${AUTOTOOLS_PREFIX}autoconf}"
13 AUTOMAKE="${AUTOMAKE:-${AUTOTOOLS_PREFIX}automake}"
14 ACLOCAL="${ACLOCAL:-${AUTOTOOLS_PREFIX}aclocal}"
15 AUTOHEADER="${AUTOHEADER:-${AUTOTOOLS_PREFIX}autoheader}"
17 mkdir -p autoconf autoconf/helpers config
18 autolib="`"$AUTOMAKE" --print-libdir`"
19 if test ! x"$autolib" = x; then
20 for prg in install-sh compile config.guess config.sub; do
21 # Update autoconf helpers if and only if newer ones are available
22 if test -f "$autolib"/"$prg" && \
23 ( test -f "$autolib"/"$prg" && \
24 sed -n -r -e \
25 's/^(scriptver(|sion)|timestamp)=['\''"]?([^'\''"]+).*$/\3/p' \
26 "$autolib"/"$prg" autoconf/helpers/"$prg" | \
27 sort --check=quiet; test $? -ne 0 )
28 then
29 cp -f "$autolib"/"$prg" autoconf/helpers
31 done
33 mv -f autoconf/aclocal.m4 autoconf/aclocal.m4.old
34 mkdir -p autoconf/m4.old autoconf/m4
35 mv -f autoconf/m4/*.m4 autoconf/m4.old/ 2>/dev/null || true
36 ACLOCAL_PATH="${ACLOCAL_PATH}${ACLOCAL_PATH:+:}`pwd`/autoconf/m4.old"
37 export ACLOCAL_PATH
38 "$ACLOCAL" --install --output=autoconf/aclocal.m4 -I autoconf/m4
39 if test ! -f autoconf/aclocal.m4; then
40 # aclocal failed, revert to previous files
41 mv -f autoconf/m4.old/*.m4 autoconf/m4/
42 mv -f autoconf/aclocal.m4.old autoconf/aclocal.m4
44 rm -rf autoconf/*m4.old
45 "$AUTOHEADER" -B autoconf
46 if [ config/config.h.in -nt config/unconfig.h ]; then
47 # Create a file corresponding to a completely empty configure
48 # instance, commenting out the #undef directives from the template
49 # just like configure would do.
50 perl -np < config/config.h.in > config/unconfig.h \
51 -e 's:^(\#\s*undef\s.*)$:/* $1 */:;' \
52 -e 's:config/config.h.in:config/unconfig.h:;' \
53 -e 's:autoheader:autogen.sh:;'
55 "$AUTOCONF" -B autoconf
56 rm -rf autom4te.cache config.log config.status config/config.h Makefile
58 if $recheck; then
59 # This bizarre statement has to do with how config.status quotes its output
60 echo exec sh configure $config | sh -