Build with autogen same as rpm.spec.
[platform/upstream/rpm.git] / autogen.sh
1 #!/bin/sh
2
3 export CFLAGS
4 export LDFLAGS
5
6 LTV="libtoolize (GNU libtool) 1.3.4"
7 ACV="Autoconf version 2.13"
8 AMV="automake (GNU automake) 1.4"
9 USAGE="
10 You need to install:
11         libtool-1.3.4
12         autoconf-2.13
13         automake-1.4
14 "
15
16 [ "`libtoolize --version`" != "$LTV" ] && echo "$USAGE" && exit 1
17 [ "`autoconf --version`" != "$ACV" ] && echo "$USAGE" && exit 1
18 [ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" && exit 1
19
20 (cd popt; ./autogen.sh --noconfigure "$@")
21 libtoolize --copy --force
22 aclocal
23 autoheader
24 automake
25 autoconf
26
27 if [ "$1" = "--noconfigure" ]; then 
28     exit 0;
29 fi
30
31 if [ X"$@" = X  -a "X`uname -s`" = "XLinux" ]; then
32     if [ -d /usr/share/man ]; then
33         mandir=/usr/share/man
34         infodir=/usr/share/info
35     else
36         mandir=/usr/man
37         infodir=/usr/info
38     fi
39     ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=${infodir} --mandir=${mandir} "$@"
40 else
41     ./configure "$@"
42 fi