diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2017-02-23 21:58:15 -0800 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2017-02-23 23:18:02 -0800 |
commit | 6ee28136024d70b4497d1ea57d1dcf1c7f1cb52f (patch) | |
tree | 5337cb5f6d608557a8ce1ddf15080d72532ac67e | |
parent | 320078081333da8fc62e2db0bdcddfaebf30cf31 (diff) | |
download | kmod-6ee28136024d70b4497d1ea57d1dcf1c7f1cb52f.tar.gz |
build: update autogen
Bring new options from systemd and other projects.
-rwxr-xr-x | bootstrap | 66 |
1 files changed, 50 insertions, 16 deletions
@@ -1,30 +1,64 @@ #!/bin/sh + set -e +oldpwd=$(pwd) +topdir=$(dirname $0) +cd $topdir + gtkdocize --docdir libkmod/docs || touch libkmod/docs/gtk-doc.make -autoreconf --install --symlink +autoreconf --force --install --symlink libdir() { - (cd "$1/$(gcc -print-multi-os-directory)"; pwd) + echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd) } -args="--prefix=/usr \ +args="\ +--prefix=/usr \ --sysconfdir=/etc \ ---libdir=$(libdir /usr/lib)" - -hackargs="--enable-debug --enable-python --with-xz --with-zlib" - -cat <<EOC +--libdir=$(libdir /usr/lib) \ +" ----------------------------------------------------------------- -Initialized build system. For a common configuration please run: ----------------------------------------------------------------- +if [ -f "$topdir/.config.args" ]; then + args="$args $(cat $topdir/.config.args)" +fi -./configure CFLAGS='-g -O2' $args +if [ ! -L /bin ]; then + args="$args \ + --with-rootprefix= \ + --with-rootlibdir=$(libdir /lib) \ + " +fi -If you are debugging or hacking on kmod, consider configuring -like below: +cd $oldpwd -./configure CFLAGS="-g -O2" $args $hackargs +hackargs="--enable-debug --enable-python --with-xz --with-zlib" -EOC +if [ "x$1" = "xc" ]; then + $topdir/configure CFLAGS='-g -O2' $args + make clean +elif [ "x$1" = "xg" ]; then + $topdir/configure CFLAGS='-g -Og' $args + make clean +elif [ "x$1" = "xl" ]; then + $topdir/configure CC=clang CXX=clang++ $args + make clean +elif [ "x$1" = "xa" ]; then + $topdir/configure CFLAGS='-g -O2 -Wsuggest-attribute=pure -Wsuggest-attribute=const' $args + make clean +elif [ "x$1" = "xs" ]; then + 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 |