1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
#!/bin/sh
#set -x
# helps bootstrapping am-utils, when checked out from CVS
# requires GNU autoconf and GNU automake
# this is not meant to go into the distributions
# Erez Zadok <ezk@cs.columbia.edu>
# test cwd
test -f ../amd/amd.c && cd ..
if [ ! -f amd/amd.c ]; then
echo "Must run $0 from the top level source directory."
exit 1
fi
# validate macros directory and some macro files
if [ ! -d aux/macros ]; then
echo No aux/macros directory found!
exit 1
fi
if [ ! -f aux/macros/HEADER ]; then
echo No aux/macros/HEADER file found!
exit 1
fi
# generate acinclude.m4 file
echo "AMU: prepare acinclude.m4..."
test -f acinclude.m4 && mv -f acinclude.m4 acinclude.m4.old
(cd aux/macros
for i in HEADER *.m4; do
cat $i
echo
echo
done
cat TRAILER
) > acinclude.m4
# generate aclocal.m4 file
echo "AMU: aclocal..."
test -f aclocal.m4 && mv -f aclocal.m4 aclocal.m4.old
if aclocal ; then
:
else
echo "aclocal command failed. fix errors and rerun $0."
exit 2
fi
# produce new configure.in (temp) script
echo "AMU: autoconf..."
LOG=/tmp/amu-$$.log
rm -f ${LOG}
autoconf configure.in > configure.new 2> ${LOG}
# remove annoying "AC_TRY_RUN" warnings
CUTWARNMSG1="warning: AC_TRY_RUN called without default to allow cross compiling"
CUTWARNMSG2="AC_OUTPUT_COMMANDS|autoupdate"
egrep -v "${CUTWARNMSG1}" ${LOG} > ${LOG}.new
mv ${LOG}.new ${LOG}
if test -s ${LOG}; then
echo "AUTOCONF ERRORS (MUST FIX):"
cat ${LOG}
rm -f ${LOG}
exit 2
fi
# now prepare the real configure script
mv -f configure configure.old
mv -f configure.new configure
chmod a+rx configure
rm -f configure.old
# run autoheader to produce C header .in files
echo "AMU: autoheader..."
autoheader configure.in > config.h.in 2> ${LOG}
egrep -v "${CUTWARNMSG1}" ${LOG} > ${LOG}.new
mv ${LOG}.new ${LOG}
if test -s ${LOG}; then
echo "AUTOHEADER ERRORS (MUST FIX):"
cat ${LOG}
rm -f ${LOG}
exit 2
fi
rm -f ${LOG}
# generate makefiles
#cmd="automake --add-missing --ignore-deps"
cmd="automake --add-missing"
echo "AMU: $cmd..."
if ${cmd} ; then
:
else
echo "automake command failed. fix errors and rerun $0."
exit 2
fi
# save timestamp
echo "AMU: save timestamp..."
echo timestamp > stamp-h.in
exit 0
|