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