fixed flex problem in hardcore mode
[lwes.git] / bootstrap
blobf5221449400855b011f14e95ebe3b2c8d7ced67e
1 #!/bin/sh
3 # libtool and autoheader checks are not always necessary, so check to see if
4 # we need to use them
5 references_libtool=`perl -ne 'print if (! m/^dnl/ && ! m/^#/ && m/PROG_LIBTOOL/)' configure.ac`
6 references_autoheader=`perl -ne 'print if (! m/^dnl/ && ! m/^#/ && m/CONFIG_HEADER/)' configure.ac`
8 check_alternatives () \
10 _check_save="$1"
12 if test "x$_check_save" = x
13 then
14 echo "ERROR: bad call to check_alternatives" 1>&2
15 exit 1
18 shift
20 _check_var="$1"
21 _check_rv=""
23 while test "x$_check_var" != x
25 _check_rv=`which "$_check_var" 2> /dev/null`
26 if test "x$_check_rv" != x
27 then
28 break
30 shift
31 _check_var="$1"
32 done
34 if test "x$_check_rv" = x
35 then
36 echo "ERROR: can't find alternative for $_check_save" 1>&2
37 exit 1
40 eval $_check_save='"$_check_rv"'
43 if test "x$references_libtool" != "x" ; then
44 check_alternatives mylibtoolize glibtoolize libtoolize libtoolize15
46 check_alternatives myaclocal aclocal19 aclocal
47 if test "x$references_autoheader" != "x" ; then
48 check_alternatives myautoheader autoheader259 autoheader257 autoheader
50 check_alternatives myautomake automake19 automake
51 check_alternatives myautom4te autom4te259 autom4te257 autom4te
52 check_alternatives myautoconf autoconf259 autoconf257 autoconf
54 if test "x$references_libtool" != "x" ; then
55 echo -n "Running $mylibtoolize ... "
56 "$mylibtoolize" --automake > .libtool.out 2>&1
57 if test "x$?" != "x0" ; then
58 cat .libtool.out
59 exit 1
61 echo "done"
64 if test -d /usr/local/share/aclocal; then
65 aclocal_extra_dirs="$aclocal_extra_dirs -I /usr/local/share/aclocal"
68 echo -n "Running $myaclocal ... "
69 AUTOM4TE="$myautom4te" "$myaclocal" $aclocal_extra_dirs > .aclocal.out 2>&1
70 if test "x$?" != "x0" ; then
71 cat .aclocal.out
72 exit 1
74 echo "done"
76 if test "x$references_autoheader" != "x" ; then
77 echo -n "Running $myautoheader ... "
78 "$myautoheader" > .autoheader.out 2>&1
79 if test "x$?" != "x0" ; then
80 cat .autoheader.out
81 exit 1
83 echo "done"
86 echo -n "Running $myautomake ... "
87 AUTOCONF="$myautoconf" "$myautomake" -a > .automake.out 2>&1
88 if test "x$?" != "x0" ; then
89 cat .automake.out
90 exit 1
92 echo "done"
94 echo -n "Running $myautoconf ... "
95 "$myautoconf" > .autoconf.out 2>&1
96 if test "x$?" != "x0" ; then
97 cat .autoconf.out
98 exit 1
100 echo "done"