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