chiark / gitweb /
udevadm: move init from commands to udevadm
[elogind.git] / autogen.sh
1 #!/bin/sh -e
2
3 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
4         echo
5         echo "You must have autoconf installed to generate the build system."
6         echo
7         exit 1
8 }
9 (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
10         echo
11         echo "You must have libtool installed to generate the build system."
12         echo
13         exit 1
14 }
15 (autoheader --version) < /dev/null > /dev/null 2>&1 || {
16         echo
17         echo "You must have autoheader installed to generate the build system."
18         echo
19         exit 1
20 }
21 (automake --version) < /dev/null > /dev/null 2>&1 || {
22         echo
23         echo "You must have automake installed to generate the build system."
24         echo
25         exit 1
26 }
27
28 test -f udev/udevd.c || {
29         echo "You must run this script in the top-level source directory"
30         exit 1
31 }
32
33 echo "   aclocal:    $(aclocal --version | head -1)"
34 aclocal
35 echo "   autoconf:   $(autoconf --version | head -1)"
36 autoconf
37 echo "   libtool:   $(automake --version | head -1)"
38 libtoolize --force
39 echo "   autoheader: $(autoheader --version | head -1)"
40 autoheader
41 echo "   automake:   $(automake --version | head -1)"
42 automake --add-missing
43
44 if test -z "$@"; then
45         args="--prefix=/usr --exec-prefix= --sysconfdir=/etc --with-selinux"
46         args="$args --with-libdir-name=$(basename $(gcc -print-multi-os-directory))"
47         export CFLAGS="-g -Wall \
48 -Wmissing-declarations -Wmissing-prototypes \
49 -Wnested-externs -Wpointer-arith \
50 -Wpointer-arith -Wsign-compare -Wchar-subscripts \
51 -Wstrict-prototypes -Wshadow"
52 else
53         args=$@
54 fi
55 echo "   configure:  $args"
56 echo
57 ./configure $args