* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / autogen.sh
1 #!/bin/sh
2
3 # Test for a autoconf commands.
4
5 # Test for a autoconf.
6
7 HAVE_AUTOCONF=false
8
9 for AUTOCONF in autoconf autoconf259; do
10     if ${AUTOCONF} --version > /dev/null 2>&1; then
11         AUTOCONF_VERSION=`${AUTOCONF} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
12 #        echo ${AUTOCONF_VERSION}
13         case ${AUTOCONF_VERSION} in
14             2.59* | 2.6[0-9]* )
15                 HAVE_AUTOCONF=true
16                 break;
17                 ;;
18         esac
19     fi
20 done
21
22 # Test for a autoheader.
23
24 HAVE_AUTOHEADER=false
25
26 for AUTOHEADER in autoheader autoheader259; do
27     if ${AUTOHEADER} --version > /dev/null 2>&1; then
28         AUTOHEADER_VERSION=`${AUTOHEADER} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
29 #        echo ${AUTOHEADER_VERSION}
30         case ${AUTOHEADER_VERSION} in
31             2.59* | 2.6[0-9]* )
32                 HAVE_AUTOHEADER=true
33                 break;
34                 ;;
35         esac
36     fi
37 done
38
39 # Test for a autoreconf.
40
41 HAVE_AUTORECONF=false
42
43 for AUTORECONF in autoreconf; do
44     if ${AUTORECONF} --version > /dev/null 2>&1; then
45         AUTORECONF_VERSION=`${AUTORECONF} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
46 #        echo ${AUTORECONF_VERSION}
47         case ${AUTORECONF_VERSION} in
48             2.59* | 2.6[0-9]* )
49                 HAVE_AUTORECONF=true
50                 break;
51                 ;;
52         esac
53     fi
54 done
55
56 if test ${HAVE_AUTOCONF} = false; then
57     echo "No proper autoconf was found."
58     echo "You must have autoconf 2.59 or later installed."
59     exit 1
60 fi
61
62 if test ${HAVE_AUTOHEADER} = false; then
63     echo "No proper autoheader was found."
64     echo "You must have autoconf 2.59 or later installed."
65     exit 1
66 fi
67
68 if test ${HAVE_AUTORECONF} = false; then
69     echo "No proper autoreconf was found."
70     echo "You must have autoconf 2.59 or later installed."
71     exit 1
72 fi
73
74
75 # Test for a automake commands.
76
77 # Test for a aclocal.
78
79 HAVE_ACLOCAL=false
80
81 for ACLOCAL in aclocal aclocal-1.10 aclocal-1.9 aclocal19; do
82     if ${ACLOCAL} --version > /dev/null 2>&1; then
83         ACLOCAL_VERSION=`${ACLOCAL} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
84 #        echo ${ACLOCAL_VERSION}
85         case ${ACLOCAL_VERSION} in
86             1.9* | 1.1[0-9]* )
87                 HAVE_ACLOCAL=true
88                 break;
89                 ;;
90         esac
91     fi
92 done
93
94 # Test for a automake.
95
96 HAVE_AUTOMAKE=false
97
98 for AUTOMAKE in automake automake-1.10 automake-1.9 automake19; do
99     if ${AUTOMAKE} --version > /dev/null 2>&1; then
100         AUTOMAKE_VERSION=`${AUTOMAKE} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
101 #        echo ${AUTOMAKE_VERSION}
102         case ${AUTOMAKE_VERSION} in
103             1.9* | 1.1[0-9]* )
104                 HAVE_AUTOMAKE=true
105                 break;
106                 ;;
107         esac
108     fi
109 done
110
111 if test ${HAVE_ACLOCAL} = false; then
112     echo "No proper aclocal was found."
113     echo "You must have automake 1.9 or later installed."
114     exit 1
115 fi
116
117 if test ${HAVE_AUTOMAKE} = false; then
118     echo "No proper automake was found."
119     echo "You must have automake 1.9 or later installed."
120     exit 1
121 fi
122
123
124 # Test for a libtoolize.
125
126 HAVE_LIBTOOLIZE=false
127
128 for LIBTOOLIZE in libtoolize libtoolize15 glibtoolize; do
129     if ${LIBTOOLIZE} --version > /dev/null 2>&1; then
130         LIBTOOLIZE_VERSION=`${LIBTOOLIZE} --version | sed 's/^.*[^0-9.]\([0-9]\{1,\}\.[0-9.]\{1,\}\).*/\1/'`
131 #        echo ${LIBTOOLIZE_VERSION}
132         case ${LIBTOOLIZE_VERSION} in
133             1.5* | 2.* )
134                 HAVE_LIBTOOLIZE=true
135                 break;
136                 ;;
137         esac
138     fi
139 done
140
141 if test ${HAVE_LIBTOOLIZE} = false; then
142     echo "No proper libtoolize was found."
143     echo "You must have libtool 1.5 or later installed."
144     exit 1
145 fi
146
147
148 export ACLOCAL AUTOCONF AUTOHEADER AUTOMAKE LIBTOOLIZE
149
150 ${AUTORECONF} --force --install --no-recursive