2 #***************************************************************************
4 # Project ___| | | | _ \| |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at http://curl.haxx.se/docs/copyright.html.
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
23 ###########################################################################
30 # this works as 'which' but we use a different name to make it more obvious we
31 # aren't using 'which'! ;-)
38 # echo "checks for $file in $path" >&2
39 if test -f "$path/$file"; then
46 #--------------------------------------------------------------------------
47 # autoconf 2.57 or newer
50 ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
51 if test -z "$ac_version"; then
52 echo "buildconf: autoconf not found."
53 echo " You need autoconf version $need_autoconf or newer installed."
56 IFS=.; set $ac_version; IFS=' '
57 if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then
58 echo "buildconf: autoconf version $ac_version found."
59 echo " You need autoconf version $need_autoconf or newer installed."
60 echo " If you have a sufficient autoconf installed, but it"
61 echo " is not named 'autoconf', then try setting the"
62 echo " AUTOCONF environment variable."
66 echo "buildconf: autoconf version $ac_version (ok)"
68 #--------------------------------------------------------------------------
69 # autoheader 2.50 or newer
71 ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
72 if test -z "$ah_version"; then
73 echo "buildconf: autoheader not found."
74 echo " You need autoheader version 2.50 or newer installed."
77 IFS=.; set $ah_version; IFS=' '
78 if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
79 echo "buildconf: autoheader version $ah_version found."
80 echo " You need autoheader version 2.50 or newer installed."
81 echo " If you have a sufficient autoheader installed, but it"
82 echo " is not named 'autoheader', then try setting the"
83 echo " AUTOHEADER environment variable."
87 echo "buildconf: autoheader version $ah_version (ok)"
89 #--------------------------------------------------------------------------
90 # automake 1.7 or newer
93 am_version=`${AUTOMAKE:-automake} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'`
94 if test -z "$am_version"; then
95 echo "buildconf: automake not found."
96 echo " You need automake version $need_automake or newer installed."
99 IFS=.; set $am_version; IFS=' '
100 if test "$1" = "1" -a "$2" -lt "7" || test "$1" -lt "1"; then
101 echo "buildconf: automake version $am_version found."
102 echo " You need automake version $need_automake or newer installed."
103 echo " If you have a sufficient automake installed, but it"
104 echo " is not named 'automake', then try setting the"
105 echo " AUTOMAKE environment variable."
109 echo "buildconf: automake version $am_version (ok)"
111 ac=`findtool ${ACLOCAL:-aclocal}`
112 if test -z "$ac"; then
113 echo "buildconf: aclocal not found. Weird automake installation!"
116 echo "buildconf: aclocal found"
119 #--------------------------------------------------------------------------
122 LIBTOOL_WANTED_MAJOR=1
123 LIBTOOL_WANTED_MINOR=4
124 LIBTOOL_WANTED_PATCH=2
125 LIBTOOL_WANTED_VERSION=1.4.2
127 # this approach that tries 'glibtool' first is some kind of work-around for
128 # some BSD-systems I believe that use to provide the GNU libtool named
129 # glibtool, with 'libtool' being something completely different.
130 libtool=`findtool glibtool 2>/dev/null`
131 if test ! -x "$libtool"; then
132 libtool=`findtool ${LIBTOOL:-libtool}`
135 if test -z "$LIBTOOLIZE"; then
136 # set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found
137 # $libtool is already the full path
138 libtoolize="${libtool}ize"
140 libtoolize=`findtool $LIBTOOLIZE`
143 lt_pversion=`$libtool --version 2>/dev/null|head -n 2|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
144 if test -z "$lt_pversion"; then
145 echo "buildconf: libtool not found."
146 echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
149 lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$//'`
150 IFS=.; set $lt_version; IFS=' '
157 if test "$major" = "$LIBTOOL_WANTED_MAJOR"; then
158 if test "$minor" -lt "$LIBTOOL_WANTED_MINOR"; then
160 elif test -n "$LIBTOOL_WANTED_PATCH"; then
161 if test "$minor" -gt "$LIBTOOL_WANTED_MINOR"; then
163 elif test -n "$patch"; then
164 if test "$patch" -lt "$LIBTOOL_WANTED_PATCH"; then
172 if test $lt_status != "good"; then
173 echo "buildconf: libtool version $lt_pversion found."
174 echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
178 echo "buildconf: libtool version $lt_version (ok)"
180 if test -f "$libtoolize"; then
181 echo "buildconf: libtoolize found"
183 echo "buildconf: libtoolize not found. Weird libtool installation!"
187 #--------------------------------------------------------------------------
190 m4=`${M4:-m4} --version 2>/dev/null|head -n 1`;
191 m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'`
193 if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then
194 echo "buildconf: GNU m4 version $m4_version (ok)"
196 echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!"
200 #--------------------------------------------------------------------------
203 PERL=`findtool ${PERL:-perl}`
205 # ------------------------------------------------------------
207 # run the correct scripts now
209 echo "buildconf: running libtoolize"
210 $libtoolize --copy --automake --force || die "The libtoolize command failed"
211 echo "buildconf: running aclocal"
212 ACLOCAL_FLAGS="-I m4 $ACLOCAL_FLAGS"
213 ${ACLOCAL:-aclocal} $ACLOCAL_FLAGS || die "The aclocal command line failed"
214 if test -n "$PERL"; then
215 echo "buildconf: running aclocal hack to convert all mv to mv -f"
216 $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
218 echo "buildconf: perl not found"
221 echo "buildconf: running autoheader"
222 ${AUTOHEADER:-autoheader} || die "The autoheader command failed"
223 echo "buildconf: cp lib/config.h.in src/config.h.in"
224 cp lib/config.h.in src/config.h.in
225 echo "buildconf: running autoconf"
226 ${AUTOCONF:-autoconf} || die "The autoconf command failed"
228 if test -d ares; then
230 echo "buildconf: running in ares"
235 echo "buildconf: running automake"
236 ${AUTOMAKE:-automake} -a -c || die "The automake command failed"