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