- make peace with automake et al in 8.0, ugh.
[platform/upstream/rpm.git] / autogen.sh
1 #!/bin/sh
2
3 export CFLAGS
4 export LDFLAGS
5
6 LTV="libtoolize (GNU libtool) 1.4.2"
7 ACV="autoconf (GNU Autoconf) 2.52"
8 AMV="automake (GNU automake) 1.5"
9 USAGE="
10 This script documents the versions of the tools I'm using to build rpm:
11         libtool-1.4.2
12         autoconf-2.52
13         automake-1.5
14 Simply edit this script to change the libtool/autoconf/automake versions
15 checked if you need to, as rpm should build (and has built) with all
16 recent versions of libtool/autoconf/automake.
17 "
18
19 [ "`libtoolize --version`" != "$LTV" ] && echo "$USAGE" && exit 1
20 [ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" && exit 1
21 [ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" && exit 1
22
23 (cd popt; ./autogen.sh --noconfigure "$@")
24 (cd zlib; ./autogen.sh --noconfigure "$@")
25 (cd beecrypt; ./autogen.sh --noconfigure "$@")
26 libtoolize --copy --force
27 aclocal
28 autoheader
29 automake
30 autoconf
31
32 if [ "$1" = "--noconfigure" ]; then 
33     exit 0;
34 fi
35
36 if [ X"$@" = X  -a "X`uname -s`" = "XLinux" ]; then
37     if [ -d /usr/share/man ]; then
38         mandir=/usr/share/man
39         infodir=/usr/share/info
40     else
41         mandir=/usr/man
42         infodir=/usr/info
43     fi
44     ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=${infodir} --mandir=${mandir} "$@"
45 else
46     ./configure "$@"
47 fi