]> git.ipfire.org Git - thirdparty/kmod.git/blob - autogen.sh
Remove unmaintained experimental tools
[thirdparty/kmod.git] / autogen.sh
1 #!/bin/sh
2
3 set -e
4
5 oldpwd=$(pwd)
6 topdir=$(dirname $0)
7 cd $topdir
8
9 gtkdocize --docdir libkmod/docs || touch libkmod/docs/gtk-doc.make
10 autoreconf --force --install --symlink
11
12 libdir() {
13 echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd)
14 }
15
16 args="\
17 --prefix=/usr \
18 --sysconfdir=/etc \
19 --libdir=$(libdir /usr/lib) \
20 "
21
22 if [ -f "$topdir/.config.args" ]; then
23 args="$args $(cat $topdir/.config.args)"
24 fi
25
26 if [ ! -L /bin ]; then
27 args="$args \
28 --with-rootlibdir=$(libdir /lib) \
29 "
30 fi
31
32 cd $oldpwd
33
34 hackargs="\
35 --enable-debug \
36 --with-zstd \
37 --with-xz \
38 --with-zlib \
39 --with-openssl \
40 "
41
42 if [ "x$1" = "xc" ]; then
43 shift
44 $topdir/configure CFLAGS='-g -O2' $args $hackargs "$@"
45 make clean
46 elif [ "x$1" = "xg" ]; then
47 shift
48 $topdir/configure CFLAGS='-g -Og' $args "$@"
49 make clean
50 elif [ "x$1" = "xl" ]; then
51 shift
52 $topdir/configure CC=clang CXX=clang++ $args "$@"
53 make clean
54 elif [ "x$1" = "xa" ]; then
55 shift
56 $topdir/configure CFLAGS='-g -O2 -Wsuggest-attribute=pure -Wsuggest-attribute=const' $args "$@"
57 make clean
58 elif [ "x$1" = "xs" ]; then
59 shift
60 scan-build $topdir/configure CFLAGS='-g -O0 -std=gnu11' $args "$@"
61 scan-build make
62 else
63 echo
64 echo "----------------------------------------------------------------"
65 echo "Initialized build system. For a common configuration please run:"
66 echo "----------------------------------------------------------------"
67 echo
68 echo "$topdir/configure CFLAGS='-g -O2' $args"
69 echo
70 echo If you are debugging or hacking on kmod, consider configuring
71 echo like below:
72 echo
73 echo "$topdir/configure CFLAGS='-g -O2' $args $hackargs"
74 fi