8 # this works as 'which' but we use a different name to make it more obvious we
9 # aren't using 'which'! ;-)
16 if test -f "$path/$file"; then
23 #--------------------------------------------------------------------------
24 # autoconf 2.57 or newer
27 ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
28 if test -z "$ac_version"; then
29 echo "buildconf: autoconf not found."
30 echo " You need autoconf version $need_autoconf or newer installed."
33 IFS=.; set $ac_version; IFS=' '
34 if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then
35 echo "buildconf: autoconf version $ac_version found."
36 echo " You need autoconf version $need_autoconf or newer installed."
37 echo " If you have a sufficient autoconf installed, but it"
38 echo " is not named 'autoconf', then try setting the"
39 echo " AUTOCONF environment variable."
43 echo "buildconf: autoconf version $ac_version (ok)"
45 #--------------------------------------------------------------------------
46 # autoheader 2.50 or newer
48 ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
49 if test -z "$ah_version"; then
50 echo "buildconf: autoheader not found."
51 echo " You need autoheader version 2.50 or newer installed."
54 IFS=.; set $ah_version; IFS=' '
55 if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
56 echo "buildconf: autoheader version $ah_version found."
57 echo " You need autoheader version 2.50 or newer installed."
58 echo " If you have a sufficient autoheader installed, but it"
59 echo " is not named 'autoheader', then try setting the"
60 echo " AUTOHEADER environment variable."
64 echo "buildconf: autoheader version $ah_version (ok)"
66 #--------------------------------------------------------------------------
67 # automake 1.7 or newer
70 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/'`
71 if test -z "$am_version"; then
72 echo "buildconf: automake not found."
73 echo " You need automake version $need_automake or newer installed."
76 IFS=.; set $am_version; IFS=' '
77 if test "$1" = "1" -a "$2" -lt "7" || test "$1" -lt "1"; then
78 echo "buildconf: automake version $am_version found."
79 echo " You need automake version $need_automake or newer installed."
80 echo " If you have a sufficient automake installed, but it"
81 echo " is not named 'automake', then try setting the"
82 echo " AUTOMAKE environment variable."
86 echo "buildconf: automake version $am_version (ok)"
90 if test -z "$ac"; then
91 echo "buildconf: aclocal not found. Weird automake installation!"
94 echo "buildconf: aclocal found"
97 #--------------------------------------------------------------------------
100 LIBTOOL_WANTED_MAJOR=1
101 LIBTOOL_WANTED_MINOR=4
102 LIBTOOL_WANTED_PATCH=2
103 LIBTOOL_WANTED_VERSION=1.4.2
105 # this approach that tries 'glibtool' first is some kind of work-around for
106 # some BSD-systems I believe that use to provide the GNU libtool named
107 # glibtool, with 'libtool' being something completely different.
108 libtool=`findtool glibtool 2>/dev/null`
109 if test ! -x "$libtool"; then
110 libtool=`findtool libtool`
113 # set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found
114 LIBTOOLIZE="${libtool}ize"
116 lt_pversion=`$libtool --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
117 if test -z "$lt_pversion"; then
118 echo "buildconf: libtool not found."
119 echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
122 lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$//'`
123 IFS=.; set $lt_version; IFS=' '
130 if test "$major" = "$LIBTOOL_WANTED_MAJOR"; then
131 if test "$minor" -lt "$LIBTOOL_WANTED_MINOR"; then
133 elif test -n "$LIBTOOL_WANTED_PATCH"; then
134 if test "$minor" -gt "$LIBTOOL_WANTED_MINOR"; then
136 elif test -n "$patch"; then
137 if test "$patch" -lt "$LIBTOOL_WANTED_PATCH"; then
145 if test $lt_status != "good"; then
146 echo "buildconf: libtool version $lt_pversion found."
147 echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
151 echo "buildconf: libtool version $lt_version (ok)"
153 if test -f "$LIBTOOLIZE"; then
154 echo "buildconf: libtoolize found"
156 echo "buildconf: libtoolize not found. Weird libtool installation!"
160 #--------------------------------------------------------------------------
163 m4=`${M4:-m4} --version 2>/dev/null|head -n 1`;
164 m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'`
166 if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then
167 echo "buildconf: GNU m4 version $m4_version (ok)"
169 echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!"
173 #--------------------------------------------------------------------------
178 # ------------------------------------------------------------
180 # run the correct scripts now
182 echo "buildconf: running libtoolize"
183 ${LIBTOOLIZE:-libtoolize} --copy --automake --force || die "The libtool command failed"
184 echo "buildconf: running aclocal"
185 ${ACLOCAL:-aclocal} $ACLOCAL_FLAGS || die "The aclocal command line failed"
186 if test -n "$PERL"; then
187 echo "buildconf: running aclocal hack to convert all mv to mv -f"
188 $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
190 echo "buildconf: perl not found"
193 echo "buildconf: running autoheader"
194 ${AUTOHEADER:-autoheader} || die "The autoheader command failed"
195 echo "buildconf: cp lib/config.h.in src/config.h.in"
196 cp lib/config.h.in src/config.h.in
197 echo "buildconf: running autoconf"
198 ${AUTOCONF:-autoconf} || die "The autoconf command failed"
200 if test -d ares; then
202 echo "buildconf: running ares/libtoolize"
203 ${LIBTOOLIZE:-libtoolize} --copy --automake --force || die "The libtool command failed"
204 echo "buildconf: running ares/aclocal"
205 ${ACLOCAL:-aclocal} $ACLOCAL_FLAGS || die "The ares aclocal command failed"
206 echo "buildconf: running ares/autoconf"
207 ${AUTOCONF:-autoconf} || die "The ares autoconf command failed"
211 echo "buildconf: running automake"
212 ${AUTOMAKE:-automake} -a || die "The automake command failed"