Added wrbuf_put - same as wrbuf_puts but void return value.
[yaz-moved-to-github.git] / buildconf.sh
1 #!/bin/sh
2
3 automake=automake
4 aclocal=aclocal
5 autoconf=autoconf
6 libtoolize=libtoolize
7
8 test -d config || mkdir config
9 if test -d m4/.git -a -d doc/common/.git; then
10     :
11 else
12     git submodule init
13     git submodule update
14 fi
15
16 if [ "`uname -s`" = FreeBSD ]; then
17     # FreeBSD intalls the various auto* tools with version numbers
18     echo "Using special configuration for FreeBSD ..."
19     automake=automake19
20     aclocal="aclocal19 -I /usr/local/share/aclocal"
21     autoconf=autoconf259
22     libtoolize=libtoolize15
23 fi
24
25 if $automake --version|head -1 |grep '1\.[4-7]'; then
26     echo "automake 1.4-1.7 is active. You should use automake 1.8 or later"
27     if test -f /etc/debian_version; then
28         echo " sudo apt-get install automake1.9"
29         echo " sudo update-alternatives --config automake"
30     fi
31     exit 1
32 fi
33
34 set -x
35 # I am tired of underquoted warnings for Tcl macros
36 $aclocal -I m4
37 $libtoolize --automake --force 
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 -Werror -Wstrict-prototypes"
52         sh_flags="-g -Wall -Wdeclaration-after-statement -Wstrict-prototypes"
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 --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 EOF
93     if [ -f /etc/debian_version ]; then
94         cat <<EOF
95 Or just build the Debian packages without configuring
96   dpkg-buildpackage -rfakeroot
97
98 When building from a CVS checkout, you need these Debian packages:
99   autoconf, automake, libtool, gcc, bison, any tcl,
100   xsltproc, docbook, docbook-xml, docbook-xsl,
101   libxslt1-dev, libssl-dev, libreadline5-dev, libwrap0-dev,
102   libpcap0.8-dev
103 EOF
104     fi
105     if [ "`uname -s`" = FreeBSD ]; then
106         cat <<EOF
107 When building from a CVS checkout, you need these FreeBSD Ports:
108   autoconf259, automake19, libtool15, bison, tcl84,
109   docbook-xsl, libxml2, libxslt, g++-4.0, make
110 EOF
111     fi
112 fi