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