std-autogen: more random workarounds
authorMarko Kreen <markokr@gmail.com>
Tue, 20 Dec 2011 21:00:59 +0000 (23:00 +0200)
committerMarko Kreen <markokr@gmail.com>
Tue, 20 Dec 2011 21:28:34 +0000 (23:28 +0200)
mk/std-autogen.sh

index 3128a22347b67f9895d415f882e98618065ca242..c80e84ec1092e83af40e7c878ecd14f070535098 100755 (executable)
@@ -15,25 +15,26 @@ test -f "${USUAL_DIR}/m4/usual.m4" || {
 }
 
 # 
-# 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*