Tweaks to build/package scripts for new waf

* Windows: delete waf installed .dll.a files
* Windows: override waf's conf.env.LIBDIR = conf.env.BINDIR
  with explicit --libdir
* Windows: fix asm (`x86_64-w64-mingw32-as` -D flag is for
  debug messages, -D defines are not available)
* Mac: override waf adding -install_name (and
  -Wl,-compatibility_version -Wl,-current_version)
  by moving -dynamiclib from linkflags to ldflags
* Mac: Allow libs with compat version number suffix
  (not needed anymore, but may help in the future)
This commit is contained in:
Robin Gareus 2020-01-22 00:47:33 +01:00
parent 06b2eb1c27
commit 5a841ef462
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
5 changed files with 27 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
from waflib.extras import autowaf as autowaf from waflib.extras import autowaf as autowaf
from waflib import Options from waflib import Options, Task, Tools
import os import os
import sys import sys
import re import re
@ -373,6 +373,11 @@ def build(bld):
# micro increment <=> no interface changes # micro increment <=> no interface changes
LIBARDOUR_LIB_VERSION = "3.0.0" LIBARDOUR_LIB_VERSION = "3.0.0"
# remove '${DEFINES_ST:DEFINES}' from run_str.
# x86_64-w64-mingw32-as (mingw) -D flag is for debug messages
if bld.env['build_target'] == 'mingw':
class asm(Task.classes['asm']): run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
# operate on copy to avoid adding sources twice # operate on copy to avoid adding sources twice
sources = list(libardour_sources) sources = list(libardour_sources)

View File

@ -472,7 +472,7 @@ while [ true ] ; do
strip -u -r -arch all $file &>/dev/null strip -u -r -arch all $file &>/dev/null
fi fi
deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"` deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | egrep -v "$(basename $file .dylib).*.dylib"`
# echo -n "." # echo -n "."
for dep in $deps ; do for dep in $deps ; do
base=`basename $dep` base=`basename $dep`

View File

@ -81,7 +81,8 @@ DEPSTACK_ROOT="$PREFIX" \
--dist-target=mingw \ --dist-target=mingw \
--also-include=${PREFIX}/include \ --also-include=${PREFIX}/include \
$ARDOURCFG \ $ARDOURCFG \
--prefix=${PREFIX} --prefix=${PREFIX} \
--libdir=${PREFIX}/lib
./waf ${CONCURRENCY} ./waf ${CONCURRENCY}

View File

@ -202,6 +202,7 @@ cp gtk2_ardour/icons/cursor_square/* $DESTDIR/share/${LOWERCASE_DIRNAME}/icons/
# clean build-dir after depoyment # clean build-dir after depoyment
echo " === bundle completed, cleaning up" echo " === bundle completed, cleaning up"
./waf uninstall ./waf uninstall
find $DESTDIR -name "*.dll.a" | xargs rm
echo " === complete" echo " === complete"
du -sh $DESTDIR du -sh $DESTDIR

17
wscript
View File

@ -943,6 +943,12 @@ def configure(conf):
conf.env.append_value ('CXXFLAGS', '-DSILENCE_AFTER') conf.env.append_value ('CXXFLAGS', '-DSILENCE_AFTER')
conf.define ('FREEBIE', 1) conf.define ('FREEBIE', 1)
# set explicit LIBDIR, otherwise mingw/windows builds use
# conf.env.LIBDIR = conf.env.BINDIR and `waf install` fails
# because $BINDIR/ardour6 is the main binary, and $LIBDIR/ardour6/ a directory
if Options.options.libdir:
conf.env.LIBDIR = Options.options.libdir
if Options.options.lv2dir: if Options.options.lv2dir:
conf.env['LV2DIR'] = Options.options.lv2dir conf.env['LV2DIR'] = Options.options.lv2dir
else: else:
@ -1299,6 +1305,17 @@ int main () { return 0; }
# Fix utterly braindead FLAC include path to not smash assert.h # Fix utterly braindead FLAC include path to not smash assert.h
conf.env['INCLUDES_FLAC'] = [] conf.env['INCLUDES_FLAC'] = []
if sys.platform == 'darwin':
# override waf's -install_name added in
# waflib/Tools/ccroot.py when -dynamiclib is used
if conf.env.LINKFLAGS_cshlib:
conf.env.LINKFLAGS_cshlib = [];
conf.env.LDFLAGS_cshlib = ['-dynamiclib']
if conf.env.LINKFLAGS_cxxshlib:
conf.env.LINKFLAGS_cxxshlib = [];
conf.env.LDFLAGS_cxxshlib = ['-dynamiclib']
config_text = open('libs/ardour/config_text.cc', "w") config_text = open('libs/ardour/config_text.cc', "w")
config_text.write('''#include "ardour/ardour.h" config_text.write('''#include "ardour/ardour.h"
namespace ARDOUR { namespace ARDOUR {