make MakeMaker work on debian and fix some leftovers from the library rip-out transition
[rrdtool.git] / MakeMakefile
1 #!/bin/sh
2 #
3 # Run this script after the first cvs checkout to build
4 # makefiles and friends
5
6 vcheck (){
7   perl <<PERL
8 @t = split /\./, "$1";
9 @v = map { int \$_ } split /\./, (split /\s+/, \`$2\`)[3];
10 print "$2 = ", (join ".",@v), "  (expected $1)\n";
11 \$v = \$t[0]*1000000+\$t[1]*1000+\$t[2] <= \$v[0]*1000000+\$v[1]*1000+\$v[2];
12 exit \$v
13 PERL
14 }
15
16
17 if vcheck 1.5 "libtool --version"
18 then
19   echo "get a copy of GNU libtool >= 1.5"
20   exit 1
21 fi
22
23 #if vcheck 1.8.2  "automake  --version"
24 #then
25 #  if vcheck 1.8.2  "automake-1.8 --version"
26 #  then
27 #    echo "get a copy of GNU automake >= 1.8.2"
28 #    exit 1
29 #  else
30 #    automake=automake-1.8
31 #    aclocal="aclocal-1.8  --acdir=/usr/share/aclocal-1.8 -I /usr/share/aclocal/"
32 #  fi
33 #else
34 #    automake="automake"
35 #    aclocal="aclocal  -I /usr/pack/libtool-1.5-to/share/aclocal"
36 #fi
37
38 if vcheck 1.7.9  "automake  --version"
39 then
40   if vcheck 1.7.9  "automake-1.7 --version"
41   then
42     echo "get a copy of GNU automake >= 1.79"
43     exit 1
44   else
45     automake=automake-1.7
46     aclocal="aclocal-1.7  --acdir=/usr/share/aclocal-1.7 -I /usr/share/aclocal/"
47   fi
48 else
49     automake="automake"
50     aclocal="aclocal -I /usr/pack/libtool-1.5-to/share/aclocal"
51 fi
52
53 if vcheck 2.58 "autoconf --version"
54 then
55   echo "get a copy of GNU autoconf >= 2.54"
56   exit 1
57 fi
58
59 set -x
60 find . -name Makefile | xargs rm -f
61 find . -name "*.la" | xargs rm -f
62 find . -name Makefile.in | xargs rm -f
63 find . -name .libs | xargs rm -r
64 find . -name .debs | xargs rm -r
65
66
67 # wget ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.tar.gz
68 libtoolize --copy --force
69 #cp ltmain.sh config
70
71 # wget ftp://sources.redhat.com/pub/automake/automake-1.7.9.tar.gz
72 # If autoconf generates undefined MACRO errors, it may be unable
73 # to find libtool.m4. Add the -I flag to aclocal to specify the
74 # directory location of this file.
75 $aclocal
76 $automake --foreign --add-missing --force-missing --copy --warnings=all
77 # wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.58.tar.gz
78 autoconf --warnings=all --force
79 rm config.h.in
80 autoheader --warnings=all --force  
81
82