Make peace with automake-1.7.3.
[platform/upstream/rpm.git] / autogen.sh
1 #!/bin/sh
2
3 export CFLAGS
4 export LDFLAGS
5
6 LTV="libtoolize (GNU libtool) 1.4.3"
7 ACV="autoconf (GNU Autoconf) 2.57"
8 AMV="automake (GNU automake) 1.7.3"
9 USAGE="
10 This script documents the versions of the tools I'm using to build rpm:
11         libtool-1.4.3
12         autoconf-2.57
13         automake-1.7.3
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 if [ -d popt ]; then
24     (echo "--- popt"; cd popt; ./autogen.sh --noconfigure "$@")
25 fi
26 if [ -d zlib ]; then
27     (echo "--- zlib"; cd zlib; ./autogen.sh --noconfigure "$@")
28 fi
29 if [ -d beecrypt ]; then
30     (echo "--- beecrypt"; cd beecrypt; ./autogen.sh --noconfigure "$@")
31 fi
32 if [ -d elfutils ]; then
33     (echo "--- elfutils"; cd elfutils; ./autogen.sh --noconfigure "$@")
34 fi
35 if [ -d file ]; then
36     (echo "--- file"; cd file; ./autogen.sh --noconfigure "$@")
37 fi
38
39 echo "--- rpm"
40 libtoolize --copy --force
41 aclocal
42 autoheader
43 automake -a -c
44 autoconf
45
46 if [ "$1" = "--noconfigure" ]; then 
47     exit 0;
48 fi
49
50 if [ X"$@" = X  -a "X`uname -s`" = "XLinux" ]; then
51     if [ -d /usr/share/man ]; then
52         mandir=/usr/share/man
53         infodir=/usr/share/info
54     else
55         mandir=/usr/man
56         infodir=/usr/info
57     fi
58     if [ -d /usr/lib/nptl ]; then
59         enable_posixmutexes="--enable-posixmutexes"
60     else
61         enable_posixmutexes=
62     fi
63     ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=${infodir} --mandir=${mandir} ${enable_posixmutexes} "$@"
64 else
65     ./configure "$@"
66 fi