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