print a message before running the autotools
[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 uname -s | grep -q FreeBSD
13 if [ $? = 0 ]
14 then
15         check_for_app aclocal19
16         check_for_app autoconf259
17         check_for_app autoheader259
18         check_for_app automake19
19         echo "Generating the configure script ..."
20         aclocal19 2>/dev/null
21         autoconf259
22         autoheader259
23         automake19 --add-missing --copy 2>/dev/null
24 else
25         export AUTOCONF_VERSION=2.59
26         export AUTOMAKE_VERSION=1.9
27
28         check_for_app aclocal
29         check_for_app autoconf
30         check_for_app autoheader
31         check_for_app automake
32         echo "Generating the configure script ..."
33         aclocal 2>/dev/null
34         autoconf
35         autoheader
36         automake --add-missing --copy 2>/dev/null
37 fi
38
39 exit 0