Ensure CONFIG_FLAGS makes it into the build rules when doing out of tree builds.
[asterisk/asterisk.git] / bootstrap.sh
1 #!/bin/sh
2
3 check_for_app() {
4         $1 --version 2>&1 >/dev/null
5         if [ $? != 0 ]
6         then
7                 echo "Please install $1 and run bootstrap.sh again!"
8                 exit 1
9         fi
10 }
11
12 # On FreeBSD and OpenBSD, multiple autoconf/automake versions have different names.
13 # On Linux, environment variables tell which one to use.
14
15 case `uname -sr` in
16         'FreeBSD 4'*)   # FreeBSD 4.x has a different naming
17                 MY_AC_VER=259
18                 MY_AM_VER=19
19                 ;;
20         *'BSD'*)
21                 MY_AC_VER=-2.62
22                 MY_AM_VER=-1.9
23                 ;;
24         *'SunOS '*)
25                 MY_AC_VER=
26                 MY_AM_VER=-1.9
27                 ;;
28         *)
29                 MY_AC_VER=
30                 MY_AM_VER=
31                 AUTOCONF_VERSION=2.60
32                 AUTOMAKE_VERSION=1.9
33                 export AUTOCONF_VERSION
34                 export AUTOMAKE_VERSION
35                 ;;
36 esac
37
38 check_for_app autoconf${MY_AC_VER}
39 check_for_app autoheader${MY_AC_VER}
40 check_for_app automake${MY_AM_VER}
41 check_for_app aclocal${MY_AM_VER}
42
43 echo "Generating the configure script ..."
44
45 aclocal${MY_AM_VER} -I autoconf
46 autoconf${MY_AC_VER}
47 autoheader${MY_AC_VER}
48 automake${MY_AM_VER} --add-missing --copy 2>/dev/null
49
50 exit 0