Always run 'git submodule update' when git is in use
[yazproxy-moved-to-github.git] / buildconf.sh
1 #!/bin/sh
2
3 test -d config || mkdir config
4 if test .git; then
5     if test -d m4/.git -a -d doc/common/.git; then
6         :
7     else
8         git submodule init
9     fi
10     git submodule update
11 fi
12
13 if automake --version|head -1 |grep '1\.[4-7]'; then
14     echo "automake 1.4-1.7 is active. You should use automake 1.8 or later"
15     if test -f /etc/debian_version; then
16         echo " sudo apt-get install automake1.9"
17         echo " sudo update-alternatives --config automake"
18     fi
19     exit 1
20 fi
21
22 set -x
23 # I am tired of underquoted warnings for Tcl macros
24 aclocal -I m4 2>&1 | grep -v aclocal/tcl.m4
25 libtoolize --automake --force 
26 automake --add-missing 
27 autoconf
28 set -
29 if [ -f config.cache ]; then
30         rm config.cache
31 fi
32
33 enable_configure=false
34 enable_help=true
35 sh_flags=""
36 conf_flags=""
37 case $1 in
38     -d)
39         sh_flags="-g -Wall"
40         enable_configure=true
41         enable_help=false
42         shift
43         ;;
44     -c)
45         sh_flags=""
46         enable_configure=true
47         enable_help=false
48         shift
49         ;;
50 esac
51
52 if $enable_configure; then
53     if test -n "$sh_flags"; then
54         CXXFLAGS="$sh_flags" ./configure --disable-shared --enable-static $*
55     else
56         ./configure $*
57     fi
58 fi
59 if $enable_help; then
60     cat <<EOF
61
62 Build the Makefiles with the configure command.
63   ./configure [--someoption=somevalue ...]
64
65 For help on options or configuring run
66   ./configure --help
67
68 Build and install binaries with the usual
69   make
70   make check
71   make install
72
73 Build distribution tarball with
74   make dist
75
76 Verify distribution tarball with
77   make distcheck
78
79 Or just build the Debian packages without configuring
80   dpkg-buildpackage -rfakeroot
81
82 When building from a CVS checkout, you need these Debian tools:
83   autoconf, automake, libtool, gcc, g++, make,
84   xsltproc, docbook, docbook-xml, docbook-xsl,
85   libxslt1-dev, libyazpp1-dev
86 EOF
87 fi