add license to distribution file
[lwes.git] / bootstrap
blob5e761c7460518f3775f786d2639ad356f5b7e8c0
1 #!/bin/sh
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
15 # we need to use them
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 () \
21 _check_save="$1"
23 if test "x$_check_save" = x
24 then
25 echo "ERROR: bad call to check_alternatives" 1>&2
26 exit 1
29 shift
31 _check_var="$1"
32 _check_rv=""
34 while test "x$_check_var" != x
36 _check_rv=`which "$_check_var" 2> /dev/null`
37 if test "x$_check_rv" != x
38 then
39 break
41 shift
42 _check_var="$1"
43 done
45 if test "x$_check_rv" = x
46 then
47 echo "ERROR: can't find alternative for $_check_save" 1>&2
48 exit 1
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
69 cat .libtool.out
70 exit 1
72 echo "done"
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
82 cat .aclocal.out
83 exit 1
85 echo "done"
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
91 cat .autoheader.out
92 exit 1
94 echo "done"
97 echo -n "Running $myautomake ... "
98 AUTOCONF="$myautoconf" "$myautomake" -a > .automake.out 2>&1
99 if test "x$?" != "x0" ; then
100 cat .automake.out
101 exit 1
103 echo "done"
105 echo -n "Running $myautoconf ... "
106 "$myautoconf" > .autoconf.out 2>&1
107 if test "x$?" != "x0" ; then
108 cat .autoconf.out
109 exit 1
111 echo "done"