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