Automaked pazpar2. Bug #799. Preprocessor defines are put in cconfig.h and
[pazpar2-moved-to-github.git] / buildconf.sh
1 #!/bin/sh
2 # $Id: buildconf.sh,v 1.1 2007-01-08 12:43:41 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"
47     enable_configure=true
48     enable_help=false
49     shift
50     ;;
51     -c)
52     sh_flags=""
53     enable_configure=true
54     enable_help=false
55     shift
56     ;;
57 esac
58
59 if $enable_configure; then
60     if test -n "$sh_flags"; then
61         CFLAGS="$sh_flags" ./configure $*
62     else
63         ./configure $*
64     fi
65 fi
66 if $enable_help; then
67     cat <<EOF
68     
69 Build the Makefiles with the configure command.
70   ./configure [--someoption=somevalue ...]
71   
72 For help on options or configuring run
73   ./configure --help
74
75 Build and install binaries with the usual
76   make
77   make check
78   make install
79
80 Build distribution tarball with
81   make dist
82
83 Verify distribution tarball with
84   make distcheck
85
86 Or just build the Debian packages without configuring
87   dpkg-buildpackage -rfakeroot
88
89 When building from a CVS checkout, you need these Debian tools:
90   libyaz-dev
91
92 EOF
93 fi
94 # Local Variables:
95 # mode:shell-script
96 # sh-indentation: 2
97 # sh-basic-offset: 4
98 # End: