summaryrefslogtreecommitdiff
path: root/buildconf
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-11-15 03:47:13 +0000
committerYang Tse <yangsita@gmail.com>2009-11-15 03:47:13 +0000
commite6c2fe9f7543fcfda318881fc29faf57e3b1f88c (patch)
tree5cdc0aac3b1529b972b2b8f63a46d4ea260519b1 /buildconf
parent3bf689197b434f12ce176aefa9298f29cfecf7f0 (diff)
downloadc-ares-e6c2fe9f7543fcfda318881fc29faf57e3b1f88c.tar.gz
c-ares-e6c2fe9f7543fcfda318881fc29faf57e3b1f88c.tar.bz2
c-ares-e6c2fe9f7543fcfda318881fc29faf57e3b1f88c.zip
Remove files generated on previous buildconf/configure run
Diffstat (limited to 'buildconf')
-rwxr-xr-xbuildconf76
1 files changed, 74 insertions, 2 deletions
diff --git a/buildconf b/buildconf
index f290a41..f2e9ea5 100755
--- a/buildconf
+++ b/buildconf
@@ -1,7 +1,5 @@
#!/bin/sh
-# The logic for finding the right libtoolize is taken from libcurl's buildconf
-
#--------------------------------------------------------------------------
# findtool works as 'which' but we use a different name to make it more
# obvious we aren't using 'which'! ;-)
@@ -22,6 +20,37 @@ findtool(){
IFS=$old_IFS
}
+#--------------------------------------------------------------------------
+# removethis() removes all files and subdirectories with the given name,
+# inside and below the current subdirectory at invocation time.
+#
+removethis(){
+ if test "$#" = "1"; then
+ find . -depth -name $1 -print > buildconf.tmp.$$
+ while read fdname
+ do
+ if test -f "$fdname"; then
+ rm -f "$fdname"
+ elif test -d "$fdname"; then
+ rm -f -r "$fdname"
+ fi
+ done < buildconf.tmp.$$
+ rm -f buildconf.tmp.$$
+ fi
+}
+
+#--------------------------------------------------------------------------
+# Ensure that buildconf runs from the subdirectory where configure.ac lives
+#
+if test ! -f configure.ac ||
+ test ! -f ares_init.c ||
+ test ! -f m4/cares-functions.m4; then
+ echo "Can not run buildconf from outside of c-ares source subdirectory!"
+ echo "Change to the subdirectory where buildconf is found, and try again."
+ exit 1
+fi
+
+#--------------------------------------------------------------------------
# this approach that tries 'glibtool' first is some kind of work-around for
# some BSD-systems I believe that use to provide the GNU libtool named
# glibtool, with 'libtool' being something completely different.
@@ -38,6 +67,49 @@ else
libtoolize=`findtool $LIBTOOLIZE`
fi
+#--------------------------------------------------------------------------
+# Remove files generated on previous buildconf/configure run.
+#
+for fname in .deps \
+ .libs \
+ *.la \
+ *.lo \
+ *.a \
+ *.o \
+ Makefile \
+ Makefile.in \
+ aclocal.m4 \
+ aclocal.m4.bak \
+ ares_build.h \
+ ares_config.h \
+ ares_config.h.in \
+ autom4te.cache \
+ compile \
+ config.guess \
+ config.log \
+ config.lt \
+ config.status \
+ config.sub \
+ configure \
+ depcomp \
+ libcares.pc \
+ libtool \
+ libtool.m4 \
+ ltmain.sh \
+ ltoptions.m4 \
+ ltsugar.m4 \
+ ltversion.m4 \
+ lt~obsolete.m4 \
+ missing \
+ stamp-h1 \
+ stamp-h2 ; do
+ removethis "$fname"
+done
+
+#--------------------------------------------------------------------------
+# run the correct scripts now
+#
+
${libtoolize} --copy --automake --force
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
${AUTOHEADER:-autoheader}