Link with Tcl 8.5
[idzebra-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 autom4te.cache && rm -r autom4te.cache
10 test -d config || mkdir config
11 if [ -d .git ]; then
12     git submodule init
13     git submodule update
14 fi
15 if [ "`uname -s`" = FreeBSD ]; then
16     # FreeBSD intalls the various auto* tools with version numbers
17     echo "Using special configuration for FreeBSD ..."
18     automake=automake19
19     aclocal="aclocal19 -I /usr/local/share/aclocal"
20     autoconf=autoconf259
21     libtoolize=libtoolize15
22     autoheader=autoheader259
23 fi
24
25 if [ "`uname -s`" = Darwin ]; then
26     echo "Using special configuration for Darwin/MacOS ..."
27     libtoolize=glibtoolize
28 fi
29
30 if $automake --version|head -1 |grep '1\.[4-7]'; then
31     echo "automake 1.4-1.7 is active. You should use automake 1.8 or later"
32     if [ -f /etc/debian_version ]; then
33         echo " sudo apt-get install automake1.9"
34         echo " sudo update-alternatives --config automake"
35     fi
36     exit 1
37 fi
38
39 set -x
40 $aclocal -I m4
41 if grep AC_CONFIG_HEADERS configure.ac >/dev/null; then
42     $autoheader
43 fi
44 $libtoolize --automake --force 
45 $automake --add-missing 
46 $autoconf
47 set -
48 if [ -f config.cache ]; then
49         rm config.cache
50 fi
51
52 enable_configure=false
53 enable_help=true
54 sh_flags=""
55 conf_flags=""
56 case $1 in
57     -d)
58         sh_cflags="-O0 -g -Wall -Wdeclaration-after-statement -Wstrict-prototypes"
59         sh_cxxflags="-g -Wall"
60         enable_configure=true
61         enable_help=false
62         shift
63         ;;
64     -c)
65         sh_cflags=""
66         sh_cxxflags=""
67         enable_configure=true
68         enable_help=false
69         shift
70         ;;
71 esac
72
73 if $enable_configure; then
74     if [ -n "$sh_cflags" ]; then
75         CFLAGS="$sh_cflags" CXXFLAGS="$sh_cxxflags" ./configure --disable-shared --enable-static $*
76     else
77         ./configure $*
78     fi
79 fi
80 if $enable_help; then
81     cat <<EOF
82
83 Build the Makefiles with the configure command.
84   ./configure [--someoption=somevalue ...]
85
86 For help on options or configuring run
87   ./configure --help
88
89 Build and install binaries with the usual
90   make
91   make check
92   make install
93
94 Build distribution tarball with
95   make dist
96
97 Verify distribution tarball with
98   make distcheck
99
100 EOF
101     if [ -f /etc/debian_version ]; then
102         cat <<EOF
103 Or just build the Debian packages without configuring
104   dpkg-buildpackage -rfakeroot
105
106 When building from Git, you need these Debian packages:
107   autoconf automake libtool gcc tcl8.4
108   xsltproc docbook docbook-xml docbook-xsl inkscape
109   libxslt1-dev libgnutls-dev libreadline5-dev libexpat1-dev
110   pkg-config libexpat1-dev
111
112 And if you want to make a Debian package: dpkg-dev fakeroot debhelper
113 (Then run "dpkg-buildpackage -rfakeroot" in this directory.)
114
115 EOF
116     fi
117     if [ "`uname -s`" = FreeBSD ]; then
118         cat <<EOF
119 When building from a Git, you need these FreeBSD Ports:
120   autoconf259, automake19, libtool15, bison, tcl84,
121   docbook-xsl, libxml2, libxslt, g++-4.0, make
122 EOF
123     fi
124 fi