diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-12-17 09:52:05 -0800 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-12-17 09:52:05 -0800 |
commit | 028d4df365484206cf8baadad905870bbc079c5e (patch) | |
tree | 0023211334252efb420673f256f2da08d6e229e1 /autogen.sh | |
parent | edc9d81754f320ff3de25584c5d3281e5b87f0a5 (diff) | |
download | kmod-028d4df365484206cf8baadad905870bbc079c5e.tar.gz |
Remove bootstrap* scripts
Let's just use autogen.sh, no need for wrapper scripts. Now
`autogen.sh c` uses the same recommended options for developing kmod and
also accepts extra arguments.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x[l---------] | autogen.sh | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/autogen.sh b/autogen.sh index ac7bcbb..e003f78 120000..100755 --- a/autogen.sh +++ b/autogen.sh @@ -1 +1,69 @@ -bootstrap
\ No newline at end of file +#!/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-rootprefix= \ + --with-rootlibdir=$(libdir /lib) \ + " +fi + +cd $oldpwd + +hackargs="--enable-debug --enable-python --with-xz --with-zlib" + +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 |