Don't exit on differing autotools.
[platform/upstream/rpm.git] / autogen.sh
1 #!/bin/sh
2
3 export CFLAGS
4 export LDFLAGS
5
6 LTV="libtoolize (GNU libtool) 1.5.18"
7 ACV="autoconf (GNU Autoconf) 2.59"
8 AMV="automake (GNU automake) 1.9.5"
9 USAGE="
10 This script documents the versions of the tools I'm using to build rpm:
11         libtool-1.5.18
12         autoconf-2.59
13         automake-1.9.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=`which glibtoolize 2>/dev/null`
20 case $libtoolize in
21 /*) ;;
22 *)  libtoolize=`which libtoolize 2>/dev/null`
23     case $libtoolize in
24     /*) ;;
25     *)  libtoolize=libtoolize
26     esac
27 esac
28
29 [ "`$libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
30 [ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
31 [ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" # && exit 1
32
33 myopts=
34 if [ X"$@" = X  -a "X`uname -s`" = "XDarwin" -a -d /opt/local ]; then
35     export myopts="--prefix=/usr --disable-nls"
36     export CPPFLAGS="-I${myprefix}/include"
37 fi
38
39 if [ -d popt ]; then
40     (echo "--- popt"; cd popt; ./autogen.sh --noconfigure "$@")
41 fi
42 if [ -d zlib ]; then
43     (echo "--- zlib"; cd zlib; ./autogen.sh --noconfigure "$@")
44 fi
45 if [ -d beecrypt ]; then
46     (echo "--- beecrypt"; cd beecrypt; ./autogen.sh --noconfigure "$@")
47 fi
48 if [ -d elfutils ]; then
49     (echo "--- elfutils"; cd elfutils; ./autogen.sh --noconfigure "$@")
50 fi
51 if [ -d file ]; then
52     (echo "--- file"; cd file; ./autogen.sh --noconfigure "$@")
53 fi
54 if [ -d neon ]; then
55     (echo "--- neon"; cd neon; ./autogen.sh "$@")
56 fi
57
58 echo "--- rpm"
59 $libtoolize --copy --force
60 aclocal
61 autoheader
62 automake -a -c
63 autoconf
64
65 if [ "$1" = "--noconfigure" ]; then 
66     exit 0;
67 fi
68
69 if [ X"$@" = X  -a "X`uname -s`" = "XLinux" ]; then
70     if [ -d /usr/share/man ]; then
71         mandir=/usr/share/man
72         infodir=/usr/share/info
73     else
74         mandir=/usr/man
75         infodir=/usr/info
76     fi
77     if [ -d /usr/lib/nptl ]; then
78         enable_posixmutexes="--enable-posixmutexes"
79     else
80         enable_posixmutexes=
81     fi
82     ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=${infodir} --mandir=${mandir} ${enable_posixmutexes} "$@"
83 else
84     ./configure ${myopts} "$@"
85 fi