diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:03:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:03:56 +0000 |
commit | 18da3ffcd7f3c8a0c5f790c801b5813503c2273d (patch) | |
tree | 84caf98dc5cef3d123c56ba12e35fd67026e0693 /autogen.sh | |
parent | Initial commit. (diff) | |
download | kmod-18da3ffcd7f3c8a0c5f790c801b5813503c2273d.tar.xz kmod-18da3ffcd7f3c8a0c5f790c801b5813503c2273d.zip |
Adding upstream version 31+20240202.upstream/31+20240202
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..a7a6022 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +set -e + +oldpwd=$(pwd) +topdir=$(dirname $0) +cd $topdir + +gtkdocize --docdir libkmod/docs || touch libkmod/docs/gtk-doc.make +autoreconf --force --install --symlink + +libdir() { + echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd) +} + +args="\ +--prefix=/usr \ +--sysconfdir=/etc \ +--libdir=$(libdir /usr/lib) \ +" + +if [ -f "$topdir/.config.args" ]; then + args="$args $(cat $topdir/.config.args)" +fi + +if [ ! -L /bin ]; then + args="$args \ + --with-rootlibdir=$(libdir /lib) \ + " +fi + +cd $oldpwd + +hackargs="\ +--enable-debug \ +--with-zstd \ +--with-xz \ +--with-zlib \ +--with-openssl \ +" + +if [ "x$1" = "xc" ]; then + shift + $topdir/configure CFLAGS='-g -O2' $args $hackargs "$@" + make clean +elif [ "x$1" = "xg" ]; then + shift + $topdir/configure CFLAGS='-g -Og' $args "$@" + make clean +elif [ "x$1" = "xl" ]; then + shift + $topdir/configure CC=clang CXX=clang++ $args "$@" + make clean +elif [ "x$1" = "xa" ]; then + shift + $topdir/configure CFLAGS='-g -O2 -Wsuggest-attribute=pure -Wsuggest-attribute=const' $args "$@" + make clean +elif [ "x$1" = "xs" ]; then + shift + scan-build $topdir/configure CFLAGS='-g -O0 -std=gnu11' $args "$@" + scan-build make +else + echo + echo "----------------------------------------------------------------" + echo "Initialized build system. For a common configuration please run:" + echo "----------------------------------------------------------------" + echo + echo "$topdir/configure CFLAGS='-g -O2' $args" + echo + echo If you are debugging or hacking on kmod, consider configuring + echo like below: + echo + echo "$topdir/configure CFLAGS='-g -O2' $args $hackargs" +fi |