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