]> git.ipfire.org Git - thirdparty/util-linux.git/blame - autogen.sh
build-sys: convert login-utils/ to module
[thirdparty/util-linux.git] / autogen.sh
CommitLineData
8eeb575c
KZ
1#!/bin/sh
2
3#
4# Helps generate autoconf/automake stuff, when code is checked out from SCM.
5#
93e0319d 6# Copyright (C) 2006-2010 - Karel Zak <kzak@redhat.com>
8eeb575c
KZ
7#
8
9srcdir=`dirname $0`
b12991dd 10test -z "$srcdir" && srcdir=.
8eeb575c
KZ
11
12THEDIR=`pwd`
13cd $srcdir
14DIE=0
1e018c15 15HAS_GTKDOC=1
8eeb575c 16
93e0319d
KZ
17test -f mount/mount.c || {
18 echo
19 echo "You must run this script in the top-level util-linux directory"
20 echo
21 DIE=1
22}
23
8eeb575c
KZ
24(autopoint --version) < /dev/null > /dev/null 2>&1 || {
25 echo
93e0319d
KZ
26 echo "You must have autopoint installed to generate util-linux build system."
27 echo "The autopoint command is part of the GNU gettext package."
28 echo
8eeb575c
KZ
29 DIE=1
30}
31(autoconf --version) < /dev/null > /dev/null 2>&1 || {
32 echo
601d12fb 33 echo "You must have autoconf installed to generate util-linux build system."
8eeb575c 34 echo
8eeb575c
KZ
35 DIE=1
36}
93e0319d
KZ
37(autoheader --version) < /dev/null > /dev/null 2>&1 || {
38 echo
39 echo "You must have autoheader installed to generate util-linux build system."
40 echo "The autoheader command is part of the GNU autoconf package."
41 echo
42 DIE=1
43}
4b2ede3e
KZ
44(libtool --version) < /dev/null > /dev/null 2>&1 || {
45 echo
46 echo "You must have libtool-2 installed to generate util-linux build system."
47 echo
48 DIE=1
49}
8eeb575c
KZ
50(automake --version) < /dev/null > /dev/null 2>&1 || {
51 echo
601d12fb 52 echo "You must have automake installed to generate util-linux build system."
8eeb575c 53 echo
8eeb575c
KZ
54 DIE=1
55}
8eeb575c 56
4b2ede3e 57ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
13ba1df8 58ltver=${ltver:-"none"}
aada54e0 59test ${ltver##2.} = "$ltver" && {
4b2ede3e
KZ
60 echo "You must have libtool version >= 2.x.x, but you have $ltver."
61 DIE=1
62}
b12991dd 63
93e0319d
KZ
64if test "$DIE" -eq 1; then
65 exit 1
66fi
67
952a06cf
KZ
68echo
69echo "Generate build-system by:"
70echo " autopoint: $(autopoint --version | head -1)"
71echo " aclocal: $(aclocal --version | head -1)"
72echo " autoconf: $(autoconf --version | head -1)"
73echo " autoheader: $(autoheader --version | head -1)"
74echo " automake: $(automake --version | head -1)"
4b2ede3e 75echo " libtoolize: $(libtoolize --version | head -1)"
952a06cf 76
38c75b59
SK
77rm -rf autom4te.cache
78
f2c166ff 79set -e
7c2ee1d2 80po/update-potfiles
1eca726f 81autopoint --force $AP_OPTS
cc3c3fdd
SK
82if ! grep -q datarootdir po/Makefile.in.in; then
83 echo autopoint does not honor dataroot variable, patching.
84 sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
85datadir = @datadir@/g' po/Makefile.in.in
86fi
4b2ede3e 87libtoolize --force $LT_OPTS
1eca726f
KZ
88aclocal -I m4 $AL_OPTS
89autoconf $AC_OPTS
90autoheader $AH_OPTS
1e018c15 91
1eca726f 92automake --add-missing $AM_OPTS
8eeb575c
KZ
93
94cd $THEDIR
95
952a06cf 96echo
e1bc6da9 97echo "Now type '$srcdir/configure' and 'make' to compile."
952a06cf 98echo
8eeb575c
KZ
99
100