Remove -Wdeclaration-after-statement because it requires newer gcc
[pazpar2-moved-to-github.git] / buildconf.sh
1 #!/bin/sh
2 # $Id: buildconf.sh,v 1.3 2007-01-12 23:34:15 adam Exp $
3
4 automake=automake
5 aclocal=aclocal
6 autoconf=autoconf
7 libtoolize=libtoolize
8 autoheader=autoheader
9
10 if [ "`uname -s`" = FreeBSD ]; then
11     # FreeBSD intalls the various auto* tools with version numbers
12     echo "Using special configuration for FreeBSD ..."
13     automake=automake19
14     aclocal="aclocal19 -I /usr/local/share/aclocal"
15     autoconf=autoconf259
16     libtoolize=libtoolize15
17     autoheader=autoheader259
18 fi
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
30 # I am tired of underquoted warnings for Tcl macros
31 $aclocal -I m4 2>&1 | grep -v aclocal/tcl.m4
32 $autoheader
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"
47     sh_flags="-g -Wall"
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 $*
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 Or just build the Debian packages without configuring
88   dpkg-buildpackage -rfakeroot
89
90 When building from a CVS checkout, you need these Debian tools:
91   libyaz-dev
92
93 EOF
94 fi
95 # Local Variables:
96 # mode:shell-script
97 # sh-indentation: 2
98 # sh-basic-offset: 4
99 # End: