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