Run both git submodule init + update
[pazpar2-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 $automake --add-missing 
39 $autoconf
40 set -
41 if [ -f config.cache ]; then
42     rm config.cache
43 fi
44
45 enable_configure=false
46 enable_help=true
47 sh_flags=""
48 conf_flags=""
49 case $1 in
50     -d)
51     #sh_flags="-g -Wall -Wdeclaration-after-statement"
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         CFLAGS="$sh_flags" ./configure $*
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   libyaz-dev
97
98 EOF
99 fi
100 # Local Variables:
101 # mode:shell-script
102 # sh-indentation: 2
103 # sh-basic-offset: 4
104 # End: