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