Move key size fixups from rpmdbAdd & Remove to td2key()
[platform/upstream/rpm.git] / autogen.sh
1 #!/bin/sh
2
3 export CFLAGS
4 export LDFLAGS
5
6 LTV="libtoolize (GNU libtool) 1.5.22"
7 ACV="autoconf (GNU Autoconf) 2.61"
8 AMV="automake (GNU automake) 1.10"
9 USAGE="
10 This script documents the versions of the tools I'm using to build rpm:
11         libtool-1.5.22
12         autoconf-2.61
13         automake-1.10
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 libtoolize --copy --force
40 autopoint --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 ${myopts} "$@"
66 fi