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