Fix boost not found on debian-testing MP-628
[m4-moved-to-github.git] / id-config.sh
1 # To be included by ../buildconf.sh .
2 automake=automake
3 aclocal=aclocal
4 autoconf=autoconf
5 libtoolize=libtoolize
6 autoheader=autoheader
7
8 test -d autom4te.cache && rm -r autom4te.cache
9 test -d config || mkdir config
10 if [ "`uname -s`" = FreeBSD ]; then
11     # FreeBSD intalls the various auto* tools with version numbers
12     echo "Using special configuration for FreeBSD ..."
13     automake=automake
14     aclocal="aclocal -I /usr/local/share/aclocal"
15     autoconf=autoconf
16     libtoolize=libtoolize
17     autoheader=autoheader
18 fi
19
20 if [ "`uname -s`" = Darwin ]; then
21     echo "Using special configuration for Darwin/MacOS ..."
22     libtoolize=glibtoolize
23 fi
24
25 if $automake --version|head -1 |grep ' 1\.[4-7]'; then
26     echo "automake 1.4-1.7 is active. You should use automake 1.8 or later"
27     if [ -f /etc/debian_version ]; then
28         echo " sudo apt-get install automake1.9"
29         echo " sudo update-alternatives --config automake"
30     fi
31     exit 1
32 fi
33
34 set -x
35 $aclocal -I m4
36 if grep AC_CONFIG_HEADERS configure.ac >/dev/null; then
37     $autoheader
38 fi
39 if grep AM_PROG_LIBTOOL configure.ac >/dev/null; then
40     has_libtool=true
41     $libtoolize --automake --force 
42 else
43     has_libtool=false
44 fi
45
46 $automake --add-missing 
47 $autoconf
48 set -
49 if [ -f config.cache ]; then
50         rm config.cache
51 fi
52
53 enable_configure=false
54 enable_help=true
55 sh_flags=""
56 conf_flags=""
57 case $1 in
58     -d)
59         sh_cflags="-g -Wall -Wdeclaration-after-statement -Wstrict-prototypes"
60         sh_cxxflags="-g -Wall"
61         enable_configure=true
62         enable_help=false
63         shift
64         ;;
65     -c)
66         sh_cflags=""
67         sh_cxxflags=""
68         enable_configure=true
69         enable_help=false
70         shift
71         ;;
72 esac
73
74 if $enable_configure; then
75     if [ -n "$sh_cflags" ]; then
76         if $has_libtool; then
77             CFLAGS="$sh_cflags" CXXFLAGS="$sh_cxxflags" ./configure \
78                 --disable-shared --enable-static --with-pic $*
79         else
80             CFLAGS="$sh_cflags" CXXFLAGS="$sh_cxxflags" ./configure $*
81         fi
82     else
83         ./configure $*
84     fi
85 fi