summaryrefslogtreecommitdiffstats
path: root/FUNCTIONS
diff options
context:
space:
mode:
authorThomas Orgis2015-04-23 09:51:06 +0200
committerThomas Orgis2015-04-23 09:51:06 +0200
commit3fd574c7a86894b1c963f8589d1d0b9632f3497e (patch)
treebf83521dd7f6dfe2c3c98e524dc808e5b7edf11e /FUNCTIONS
parent144d5c558340b527c970f38b9d34b302f13a8fd1 (diff)
FUNCTIONS: more robust waf_build
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-xFUNCTIONS16
1 files changed, 13 insertions, 3 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index 179b05a2aa..5a9d3c5a92 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -508,12 +508,22 @@ function note_config_files() {
# please use this one instead of maunaly calling waf when possible
# Disabled caching as this has GREAT potential for borkage
# and waf is fast without it as well
+# The waf disables options between versions and bails out if they are given,
+# so check first if they are supported..
function waf_build() {
- ./waf configure --prefix=${INSTALL_ROOT}/usr \
- --mandir=${INSTALL_ROOT}/usr/share/man \
+ local waf_opts="--prefix=$INSTALL_ROOT/usr"
+ # Some waf not know man, waf angry with man.
+ if ./waf --help | grep -q -- --mandir; then
+ waf_opts="$waf_opts --mandir=$INSTALL_ROOT/usr/share/man"
+ fi
+ # Same with some other options.
+ if ./waf --help | grep -q -- --nocache; then
+ waf_opts="$waf_opts --nocache"
+ fi
+ ./waf configure $waf_opts \
-j $MAKE_NJOBS \
- --nocache $OPTS &&
+ $OPTS &&
./waf build
}