Add sub modules when not present.
[metaproxy-moved-to-github.git] / buildconf.sh
1 #!/bin/sh
2 # $Id: buildconf.sh,v 1.14 2008-02-27 11:08:48 adam Exp $
3
4 automake=automake
5 aclocal=aclocal
6 autoconf=autoconf
7 libtoolize=libtoolize
8 autoheader=autoheader
9
10 test -d config || mkdir config
11 if test -d m4/.git -a -d doc/common/.git; then
12     :
13 else
14     git submodule init
15     git submodule update
16 fi
17
18 if [ "`uname -s`" = FreeBSD ]; then
19     # FreeBSD intalls the various auto* tools with version numbers
20     echo "Using special configuration for FreeBSD ..."
21     automake=automake19
22     aclocal="aclocal19 -I /usr/local/share/aclocal"
23     autoconf=autoconf259
24     libtoolize=libtoolize15
25     autoheader=autoheader259
26 fi
27 if $automake --version|head -1 |grep '1\.[4-7]'; then
28     echo "automake 1.4-1.7 is active. You should use automake 1.8 or later"
29     if test -f /etc/debian_version; then
30         echo " sudo apt-get install automake1.9"
31         echo " sudo update-alternatives --config automake"
32     fi
33     exit 1
34 fi
35
36 set -x
37
38 # I am tired of underquoted warnings for Tcl macros
39 $aclocal -I m4 2>&1 | grep -v aclocal/tcl.m4
40 $autoheader
41 $libtoolize --automake --force 
42 $automake --add-missing 
43 $autoconf
44 set -
45 if [ -f config.cache ]; then
46     rm config.cache
47 fi
48
49 enable_configure=false
50 enable_help=true
51 sh_flags=""
52 conf_flags=""
53 case $1 in
54     -d)
55     sh_flags="-g -Wall"
56     enable_configure=true
57     enable_help=false
58     shift
59     ;;
60     -c)
61     sh_flags=""
62     enable_configure=true
63     enable_help=false
64     shift
65     ;;
66 esac
67
68 if $enable_configure; then
69     if test -n "$sh_flags"; then
70         CXXFLAGS="$sh_flags" ./configure --disable-shared --enable-static $*
71     else
72         ./configure $*
73     fi
74 fi
75 if $enable_help; then
76     cat <<EOF
77     
78 Build the Makefiles with the configure command.
79   ./configure [--someoption=somevalue ...]
80   
81 For help on options or configuring run
82   ./configure --help
83
84 Build and install binaries with the usual
85   make
86   make check
87   make install
88
89 Build distribution tarball with
90   make dist
91
92 Verify distribution tarball with
93   make distcheck
94
95 Or just build the Debian packages without configuring
96   dpkg-buildpackage -rfakeroot
97
98 When building from a CVS checkout, you need these Debian tools:
99   autoconf, automake, libtool, gcc, g++, make,
100   xsltproc, docbook, docbook-xml, docbook-xsl, trang,
101   libxslt1-dev, libyazpp-dev,
102   libboost-thread-dev, libboost-test-dev
103 and for the image-processing needed to build the documentation:
104   inkscape
105
106 EOF
107 fi
108 # Local Variables:
109 # mode:shell-script
110 # sh-indentation: 2
111 # sh-basic-offset: 4
112 # End: