added build instruction for libdbi docu
[rrdtool.git] / MakeMakefile
1 #!/bin/sh
2 #
3 # Run this script after the first cvs checkout to build
4 # makefiles and friends
5
6 #PATH="/usr/sepp/bin:$PATH"
7 #export PATH
8
9 vcheck (){
10   perl <<PERL
11 @t = split /\./, "$1";
12 @v = map { int \$_ } split /\./, (split /\s+/, \`$2\`)[3];
13 print "$2 = ", (join ".",@v), "  (expecting $1 or later)\n";
14 \$v = \$t[0]*1000000+\$t[1]*1000+\$t[2] <= \$v[0]*1000000+\$v[1]*1000+\$v[2];
15 exit \$v
16 PERL
17 }
18
19 ERROR=0
20 LIBTOOL_VER="1.5.6"
21 AUTOMAKE_VER="1.9.2"
22 AUTOCONF_VER="2.59"
23 INTLTOOL_VER="0.35.0"
24
25 if vcheck $LIBTOOL_VER "libtool --version"
26 then
27   echo "get a copy of GNU libtool >= $LIBTOOL_VER"
28   ERROR=1
29 fi
30
31 if vcheck $AUTOMAKE_VER  "automake  --version"
32 then
33   if vcheck $AUTOMAKE_VER  "automake-1.9 --version"
34   then
35     echo "get a copy of GNU automake >= $AUTOMAKE_VER"
36     ERROR=1
37   else
38     automake=automake-1.9
39     aclocal="aclocal-1.9"
40     for d in /usr/pack/automake-1.9.5-to/share/aclocal-1.9 /usr/share/aclocal-1.9 /usr/share/aclocal /usr/pack/rrdtool-1.3svn-to/share/aclocal /usr/pack/intltool-0.37.0-to/share/aclocal ; do
41       [ -d $d ] && aclocal="$aclocal -I $d"
42     done
43   fi
44 else
45     automake="automake"
46     aclocal="aclocal"
47 #    aclocal="aclocal -I /usr/pack/libtool-1.5.14-to/share/aclocal"
48 fi
49
50 if vcheck $AUTOCONF_VER "autoconf --version"
51 then
52   echo "get a copy of GNU autoconf >= $autoconf_ver"
53   ERROR=1
54 fi
55
56 if vcheck $INTLTOOL_VER "intltoolize --version"
57 then
58   echo "get a copy of GNU intltoolize >= $INTLTOOL_VER"
59   ERROR=1
60 fi
61         
62 if [ $ERROR -ne 0 ]
63 then
64   exit 1
65 fi
66
67 # remove the bits we are going to recreate
68
69 echo Removing old Makefiles
70 touch Makefile
71 find . -name "Makefile" -or -name "Makefile.in" -print0 | xargs -0 rm 
72 echo Cleaning out other leftovers
73 for x in configure install-sh intltool-merge.in rrd_config.h.in \
74          missing intltool-update po/Makefile.in.in config.sub \
75          intltool-extract intltool-extract.in config.guess \
76          depcomp intltool-update.in autom4te.cache \
77          intltool-merge compile; do
78   [ ! -L $x -a -d $x ] && rm -r "$x"
79   [ ! -L $x -a -f $x ] && rm "$x"
80 done
81 set -x
82 intltoolize --automake -c -f
83 $aclocal
84 libtoolize --copy --force
85 autoheader --force  
86 $aclocal
87 $automake --foreign --add-missing --force-missing --copy 
88 autoconf --force
89
90 # vim: set syntax=sh :