chiark / gitweb /
rules: SUSE - move last distro rule to package
[elogind.git] / autogen.sh
index fb96d4a..d35e945 100755 (executable)
@@ -1,39 +1,35 @@
 #!/bin/sh -e
 
+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 \
 -Wformat=2 -Wtype-limits"
-args="--prefix=/usr --exec-prefix= --sysconfdir=/etc --with-selinux"
-libdir=$(basename $(cd /lib/$(gcc -print-multi-os-directory); pwd))
 
-case "$1" in
-       *install|"")
-               args="$args --with-libdir-name=$libdir"
-               export CFLAGS="$CFLAGS -O2"
-               echo "   configure:  $args"
-               echo
-               ./configure $args
-               ;;
-       *devel)
-               args="$args --enable-debug --with-libdir-name=$libdir"
-               export CFLAGS="$CFLAGS -O0"
-               echo "   configure:  $args"
-               echo
-               ./configure $args
-               ;;
-       *clean)
-               ./configure
-               make maintainer-clean
-               git clean -f -X
-               exit 0
+case "$CFLAGS" in
+       *-O[0-9]*)
                ;;
        *)
-               echo "Usage: $0 [--install|--devel|--clean]"
-               exit 1
+               MYCFLAGS="$MYCFLAGS -O2"
                ;;
 esac
+
+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 $@