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