9a92e766f658792196035dfb2846d05c59d23339
[yaz-moved-to-github.git] / buildconf.sh
1 #!/bin/sh
2 # $Id: buildconf.sh,v 1.30 2006-05-22 12:11:45 mike Exp $
3
4 automake=automake
5 aclocal=aclocal
6 autoconf=autoconf
7
8 if [ "`uname -s`" = FreeBSD ]; then
9     # FreeBSD intalls the various auto* tools with version numbers
10     echo "Using special configuation for FreeBSD ..."
11     automake=automake19
12     aclocal="aclocal19 -I /usr/local/share/aclocal"
13     autoconf=autoconf259
14 fi
15
16 if $automake --version|head -1 |grep '1\.[4-7]'; then
17     echo "automake 1.4-1.7 is active. You should use automake 1.8 or later"
18     if test -f /etc/debian_version; then
19         echo " sudo apt-get install automake1.9"
20         echo " sudo update-alternatives --config automake"
21     fi
22     exit 1
23 fi
24
25 set -x
26 # I am tired of underquoted warnings for Tcl macros
27 $aclocal -I m4 2>&1 | grep -v "warning: underquoted definition"
28 libtoolize --automake --force 
29 $automake --add-missing 
30 $autoconf
31 set -
32 if [ -f config.cache ]; then
33         rm config.cache
34 fi
35
36 enable_configure=false
37 enable_help=true
38 sh_flags=""
39 conf_flags=""
40 case $1 in
41     -d)
42         sh_flags="-g -Wall -Wdeclaration-after-statement"
43         enable_configure=true
44         enable_help=false
45         shift
46         ;;
47     -c)
48         sh_flags=""
49         enable_configure=true
50         enable_help=false
51         shift
52         ;;
53 esac
54
55 if $enable_configure; then
56     if test -n "$sh_flags"; then
57         CFLAGS="$sh_flags" ./configure $*
58     else
59         ./configure $*
60     fi
61 fi
62 if $enable_help; then
63     cat <<EOF
64
65 Build the Makefiles with the configure command.
66   ./configure [--someoption=somevalue ...]
67
68 For help on options or configuring run
69   ./configure --help
70
71 Build and install binaries with the usual
72   make
73   make check
74   make install
75
76 Build distribution tarball with
77   make dist
78
79 Verify distribution tarball with
80   make distcheck
81
82 Or just build the Debian packages without configuring
83   dpkg-buildpackage -rfakeroot
84
85 When building from a CVS checkout, you need these Debian tools:
86   autoconf, automake, bison, gcc, libtool,
87   docbook-utils, docbook, docbook-xml, docbook-dsssl, jade, jadetex,
88   libxslt1-dev, libssl-dev, libreadline5-dev, libwrap0-dev, any tcl
89 EOF
90 fi