chiark / gitweb /
fix $links substitution
[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 CFLAGS="-g -Wall \
45 -Wmissing-declarations -Wmissing-prototypes \
46 -Wnested-externs -Wpointer-arith \
47 -Wpointer-arith -Wsign-compare -Wchar-subscripts \
48 -Wstrict-prototypes -Wshadow"
49
50 if test -z "$1" -o "$1" = "install"; then
51         args="--prefix=/usr --exec-prefix= --sysconfdir=/etc --with-selinux"
52         args="$args --with-libdir-name=$(basename $(gcc -print-multi-os-directory))"
53         CFLAGS="$CFLAGS -O2"
54 elif test "$1" = "devel" ; then
55         args="--prefix=/usr --exec-prefix= --sysconfdir=/etc --with-selinux --enable-debug"
56         args="$args --with-libdir-name=$(basename $(gcc -print-multi-os-directory))"
57         CFLAGS="$CFLAGS -O0"
58 else
59         args=$@
60 fi
61 echo "   configure:  $args"
62 echo
63 export CFLAGS
64 ./configure $args