2 #======================================================================
3 # Copyright (c) 2008, Yahoo! Inc. All rights reserved.
5 # Licensed under the New BSD License (the "License"); you may not use
6 # this file except in compliance with the License. Unless required
7 # by applicable law or agreed to in writing, software distributed
8 # under the License is distributed on an "AS IS" BASIS, WITHOUT
9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License. See accompanying LICENSE file.
12 #======================================================================
14 # libtool and autoheader checks are not always necessary, so check to see if
16 references_libtool
=`perl -ne 'print if (! m/^dnl/ && ! m/^#/ && m/PROG_LIBTOOL/)' configure.ac`
17 references_autoheader
=`perl -ne 'print if (! m/^dnl/ && ! m/^#/ && m/CONFIG_HEADER/)' configure.ac`
19 check_alternatives
() \
23 if test "x$_check_save" = x
25 echo "ERROR: bad call to check_alternatives" 1>&2
34 while test "x$_check_var" != x
36 _check_rv
=`which "$_check_var" 2> /dev/null`
37 if test "x$_check_rv" != x
45 if test "x$_check_rv" = x
47 echo "ERROR: can't find alternative for $_check_save" 1>&2
51 eval $_check_save='"$_check_rv"'
54 if test "x$references_libtool" != "x" ; then
55 check_alternatives mylibtoolize glibtoolize libtoolize libtoolize15
57 check_alternatives myaclocal aclocal19 aclocal
58 if test "x$references_autoheader" != "x" ; then
59 check_alternatives myautoheader autoheader259 autoheader257 autoheader
61 check_alternatives myautomake automake19 automake
62 check_alternatives myautom4te autom4te259 autom4te257 autom4te
63 check_alternatives myautoconf autoconf259 autoconf257 autoconf
65 if test "x$references_libtool" != "x" ; then
66 echo -n "Running $mylibtoolize ... "
67 "$mylibtoolize" --automake > .libtool.out
2>&1
68 if test "x$?" != "x0" ; then
75 if test -d /usr
/local
/share
/aclocal
; then
76 aclocal_extra_dirs
="$aclocal_extra_dirs -I /usr/local/share/aclocal"
79 echo -n "Running $myaclocal ... "
80 AUTOM4TE
="$myautom4te" "$myaclocal" $aclocal_extra_dirs > .aclocal.out
2>&1
81 if test "x$?" != "x0" ; then
87 if test "x$references_autoheader" != "x" ; then
88 echo -n "Running $myautoheader ... "
89 "$myautoheader" > .autoheader.out
2>&1
90 if test "x$?" != "x0" ; then
97 echo -n "Running $myautomake ... "
98 AUTOCONF
="$myautoconf" "$myautomake" -a > .automake.out
2>&1
99 if test "x$?" != "x0" ; then
105 echo -n "Running $myautoconf ... "
106 "$myautoconf" > .autoconf.out
2>&1
107 if test "x$?" != "x0" ; then