aboutsummaryrefslogtreecommitdiff
path: root/ares/buildconf
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-11-26 16:51:51 +0000
committerYang Tse <yangsita@gmail.com>2008-11-26 16:51:51 +0000
commita30a6f2f200d7fe9f69b182503e734f4618b4339 (patch)
tree61b55526b59e2b75f4fb6c55e750e9bc2a7a4447 /ares/buildconf
parentbaeebb2b573aeefca955cfe8efd7d8eac4c3444c (diff)
Brad Spencer provided changes to allow buildconf to work on OS X.
Diffstat (limited to 'ares/buildconf')
-rwxr-xr-xares/buildconf40
1 files changed, 39 insertions, 1 deletions
diff --git a/ares/buildconf b/ares/buildconf
index 44706ce4f..4e49b3ee1 100755
--- a/ares/buildconf
+++ b/ares/buildconf
@@ -1,6 +1,44 @@
#!/bin/sh
-${LIBTOOLIZE:-libtoolize} --copy --automake --force
+# 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'! ;-)
+#
+findtool(){
+ file="$1"
+
+ old_IFS=$IFS; IFS=':'
+ for path in $PATH
+ do
+ IFS=$old_IFS
+ # echo "checks for $file in $path" >&2
+ if test -f "$path/$file"; then
+ echo "$path/$file"
+ return
+ fi
+ done
+ IFS=$old_IFS
+}
+
+# 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.
+libtool=`findtool glibtool 2>/dev/null`
+if test ! -x "$libtool"; then
+ libtool=`findtool ${LIBTOOL:-libtool}`
+fi
+
+if test -z "$LIBTOOLIZE"; then
+ # set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found
+ # $libtool is already the full path
+ libtoolize="${libtool}ize"
+else
+ libtoolize=`findtool $LIBTOOLIZE`
+fi
+
+${libtoolize} --copy --automake --force
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
${AUTOHEADER:-autoheader}
${AUTOCONF:-autoconf}