* autogen.sh, src/boehm-gc/autogen.sh: Prefix all shell variables with
[cacao.git] / autogen.sh
1 #!/bin/sh
2
3 # test for a libtoolize
4
5 CACAO_HAVE_LIBTOOLIZE=false
6
7 for CACAO_LIBTOOLIZE in libtoolize libtoolize15 glibtoolize; do
8     if ${CACAO_LIBTOOLIZE} --version > /dev/null 2>&1; then
9         CACAO_LIBTOOLIZE_VERSION=`${CACAO_LIBTOOLIZE} --version | sed 's/^.*[^0-9.]\([0-9]\{1,\}\.[0-9.]\{1,\}\).*/\1/'`
10 #        echo ${CACAO_LIBTOOLIZE_VERSION}
11         case ${CACAO_LIBTOOLIZE_VERSION} in
12             1.5* )
13                 CACAO_HAVE_LIBTOOLIZE=true
14                 break;
15                 ;;
16         esac
17     fi
18 done
19
20 if test ${CACAO_HAVE_LIBTOOLIZE} = false; then
21     echo "No proper libtoolize was found."
22     echo "You must have libtool 1.5 installed."
23     exit 1
24 fi
25
26
27 # test for a aclocal
28
29 CACAO_HAVE_ACLOCAL=false
30
31 for CACAO_ACLOCAL in aclocal aclocal-1.9 aclocal19; do
32     if ${CACAO_ACLOCAL} --version > /dev/null 2>&1; then
33         CACAO_ACLOCAL_VERSION=`${CACAO_ACLOCAL} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
34 #        echo ${CACAO_ACLOCAL_VERSION}
35         case ${CACAO_ACLOCAL_VERSION} in
36             1.9* )
37                 CACAO_HAVE_ACLOCAL=true
38                 break;
39                 ;;
40         esac
41     fi
42 done
43
44 if test ${CACAO_HAVE_ACLOCAL} = false; then
45     echo "No proper aclocal was found."
46     echo "You must have automake 1.9 installed."
47     exit 1
48 fi
49
50
51 # test for a autoheader
52
53 CACAO_HAVE_AUTOHEADER=false
54
55 for CACAO_AUTOHEADER in autoheader autoheader259; do
56     if ${CACAO_AUTOHEADER} --version > /dev/null 2>&1; then
57         CACAO_AUTOHEADER_VERSION=`${CACAO_AUTOHEADER} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
58 #        echo ${CACAO_AUTOHEADER_VERSION}
59         case ${CACAO_AUTOHEADER_VERSION} in
60             2.59* )
61                 CACAO_HAVE_AUTOHEADER=true
62                 break;
63                 ;;
64         esac
65     fi
66 done
67
68 if test ${CACAO_HAVE_AUTOHEADER} = false; then
69     echo "No proper autoheader was found."
70     echo "You must have autoconf 2.59 installed."
71     exit 1
72 fi
73
74
75 # test for a automake
76
77 CACAO_HAVE_AUTOMAKE=false
78
79 for CACAO_AUTOMAKE in automake automake-1.9 automake19; do
80     if ${CACAO_AUTOMAKE} --version > /dev/null 2>&1; then
81         CACAO_AUTOMAKE_VERSION=`${CACAO_AUTOMAKE} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
82 #        echo ${CACAO_AUTOMAKE_VERSION}
83         case ${CACAO_AUTOMAKE_VERSION} in
84             1.9* )
85                 CACAO_HAVE_AUTOMAKE=true
86                 break;
87                 ;;
88         esac
89     fi
90 done
91
92 if test ${CACAO_HAVE_AUTOMAKE} = false; then
93     echo "No proper automake was found."
94     echo "You must have automake 1.9 installed."
95     exit 1
96 fi
97
98
99 # test for a autoconf
100
101 CACAO_HAVE_AUTOCONF=false
102
103 for CACAO_AUTOCONF in autoconf autoconf259; do
104     if ${CACAO_AUTOCONF} --version > /dev/null 2>&1; then
105         CACAO_AUTOCONF_VERSION=`${CACAO_AUTOCONF} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
106 #        echo ${CACAO_AUTOCONF_VERSION}
107         case ${CACAO_AUTOCONF_VERSION} in
108             2.59* )
109                 CACAO_HAVE_AUTOCONF=true
110                 break;
111                 ;;
112         esac
113     fi
114 done
115
116 if test ${CACAO_HAVE_AUTOCONF} = false; then
117     echo "No proper autoconf was found."
118     echo "You must have autoconf 2.59 installed."
119     exit 1
120 fi
121
122
123 ${CACAO_LIBTOOLIZE} --automake
124 if test `uname` = 'FreeBSD'; then
125     ${CACAO_ACLOCAL} -I m4 -I /usr/local/share/aclocal -I /usr/local/share/aclocal19
126 else
127     ${CACAO_ACLOCAL} -I m4
128 fi
129 ${CACAO_AUTOHEADER}
130 ${CACAO_AUTOMAKE} --add-missing
131 ${CACAO_AUTOCONF}
132
133 export CACAO_LIBTOOLIZE
134 export CACAO_ACLOCAL
135 export CACAO_AUTOHEADER
136 export CACAO_AUTOMAKE
137 export CACAO_AUTOCONF
138
139 cd src/boehm-gc && ./autogen.sh && cd ../..