}
#
-# workaround for libtoolize bug - it does not update
-# the file if they dont exist
+# Workarounds for libtoolize randomness - it does not update
+# the files if they exist, except it requires install-sh.
+#
rm -f config.guess config.sub install-sh ltmain.sh libtool
+cp -p ${USUAL_DIR}/mk/install-sh .
if libtoolize --help | grep "[-][-]install" > /dev/null; then
- libtoolize -i -q -f
+ libtoolize -i -f -q
else
libtoolize
fi
# drop ltmain.sh if libtool is not used
-grep -qE 'LT_INIT|LIBTOOL' configure.ac || rm -f ltmain.sh
+grep -E 'LT_INIT|LIBTOOL' configure.ac > /dev/null || rm -f ltmain.sh
# Now generate configure & config.h
aclocal -I ${USUAL_DIR}/m4
-autoheader
-autoconf
-# workaround for old autotools that dont provide install-sh
-test -f install-sh || cp -p ${USUAL_DIR}/mk/install-sh .
+grep AC_CONFIG_HEADER configure.ac > /dev/null && autoheader
+
+autoconf
# clean junk
rm -rf autom4te.* aclocal*