From: Yang Tse Date: Wed, 26 Nov 2008 16:51:51 +0000 (+0000) Subject: Brad Spencer provided changes to allow buildconf to work on OS X. X-Git-Tag: upstream/1.10.0~614 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8781fb19f9f0423571bfa0c7ef35e12f58503e7e;p=platform%2Fupstream%2Fc-ares.git Brad Spencer provided changes to allow buildconf to work on OS X. --- diff --git a/CHANGES b/CHANGES index 284ca5e..4c6b7b2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changelog for the c-ares project +* Nov 26 2008 (Yang Tse) +- Brad Spencer provided changes to allow buildconf to work on OS X. + * Nov 25 2008 (Yang Tse) - In preparation for the upcomming IPv6 nameservers patch, the internal ares_addr union is now changed into an internal struct which also holds diff --git a/buildconf b/buildconf index 44706ce..4e49b3e 100755 --- a/buildconf +++ b/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}