chiark / gitweb /
libudev: list - properly sort linked list not only the index
[elogind.git] / autogen.sh
index 83af29c..f659fca 100755 (executable)
@@ -3,17 +3,33 @@
 gtkdocize
 autoreconf --install --symlink
 
 gtkdocize
 autoreconf --install --symlink
 
-CFLAGS="-g -Wall \
+MYCFLAGS="-g -Wall \
 -Wmissing-declarations -Wmissing-prototypes \
 -Wnested-externs -Wpointer-arith \
 -Wpointer-arith -Wsign-compare -Wchar-subscripts \
 -Wstrict-prototypes -Wshadow \
 -Wmissing-declarations -Wmissing-prototypes \
 -Wnested-externs -Wpointer-arith \
 -Wpointer-arith -Wsign-compare -Wchar-subscripts \
 -Wstrict-prototypes -Wshadow \
--Wformat=2 -Wtype-limits"
+-Wformat-security -Wtype-limits"
 
 
-libdirname=$(basename $(cd /lib/$(gcc -print-multi-os-directory); pwd))
-args="--prefix=/usr --exec-prefix= --sysconfdir=/etc \
---libdir=/usr/$libdirname --with-libdir-name=$libdirname \
---with-selinux --enable-gtk-doc
+case "$CFLAGS" in
+       *-O[0-9]*)
+               ;;
+       *)
+               MYCFLAGS="$MYCFLAGS -O2"
+               ;;
+esac
 
 
-export CFLAGS="$CFLAGS -O2"
+libdir() {
+       echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
+}
+
+args="--prefix=/usr \
+--sysconfdir=/etc \
+--sbindir=/sbin \
+--libdir=$(libdir /usr/lib) \
+--with-rootlibdir=$(libdir /lib) \
+--libexecdir=/lib/udev \
+--with-selinux \
+--enable-gtk-doc"
+
+export CFLAGS="$CFLAGS $MYCFLAGS"
 ./configure $args $@
 ./configure $args $@