From cc114987bb4479f23d16207160be427d91109358 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 25 Sep 2020 21:36:30 +0100 Subject: Generate and install Windows libraries def files Signed-off-by: falkTX --- common/wscript | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'common') diff --git a/common/wscript b/common/wscript index 907693b7..a9dde271 100644 --- a/common/wscript +++ b/common/wscript @@ -132,6 +132,7 @@ def build(bld): ] includes = ['../windows' ] + includes libsuffix = "64" if (bld.env['DEST_CPU'] == "x86_64" and not bld.variant) else "" + buildbindir = os.path.join('..', bld.path.get_bld().srcpath().rstrip(bld.path.srcpath())) staticbuild = bool('BUILD_STATIC' in bld.env and bld.env['BUILD_STATIC']) uselib.append('REGEX') uselib.append('WS2_32') @@ -148,15 +149,20 @@ def build(bld): clientlib.includes = includes clientlib.name = 'clientlib' clientlib.target = 'jack'+libsuffix + clientlib.install_path = '${LIBDIR}' clientlib.use = uselib if bld.env['IS_WINDOWS']: - clientlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' - clientlib.env['cxxstlib_PATTERN'] = 'lib%s.a' - clientlib.env['implib_PATTERN'] = 'lib%s.dll.a' - clientlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % clientlib.target]) + clientlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' + clientlib.env['cxxstlib_PATTERN'] = 'lib%s.a' + clientlib.env['implib_PATTERN'] = 'lib%s.dll.a' + if staticbuild: + clientlib.env['SHLIB_MARKER'] = '' + clientlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) + clientlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % clientlib.target]) + bld.install_files(clientlib.install_path, [os.path.join(buildbindir, 'lib%s.def' % clientlib.target)]) + if bld.env['AUTOSTART_METHOD'] == 'dbus': clientlib.use.append('DBUS-1') - clientlib.install_path = '${LIBDIR}' clientlib.source = [] + common_libsources clientlib.source += [ 'JackLibClient.cpp', @@ -203,15 +209,6 @@ def build(bld): if bld.env['IS_SUN']: clientlib.env.append_value('LINKFLAGS', '-lnsl -lsocket') - if bld.env['IS_WINDOWS']: - # remove switch to shared binaries if possible, as we most likely want static builds on Windows - if staticbuild: - clientlib.env['SHLIB_MARKER'] = '' - # statically link libjack to libstdc++, some client apps like ardour come - # with a different version of libstdc++.dll that takes precedence and results - # in missing symbols during runtime - clientlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) - if bld.variant: # if there is variant defined, we expect it to be the 32bit client lib one # we don't want to build other stuff in this variant @@ -224,16 +221,17 @@ def build(bld): serverlib.includes = includes serverlib.name = 'serverlib' serverlib.target = 'jackserver'+libsuffix + serverlib.install_path = '${LIBDIR}' serverlib.use = uselib if bld.env['IS_WINDOWS']: serverlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' serverlib.env['cxxstlib_PATTERN'] = 'lib%s.a' serverlib.env['implib_PATTERN'] = 'lib%s.dll.a' - serverlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % serverlib.target]) if staticbuild: serverlib.env['SHLIB_MARKER'] = '' serverlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) - serverlib.install_path = '${LIBDIR}' + serverlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % serverlib.target]) + bld.install_files(serverlib.install_path, [os.path.join(buildbindir, 'lib%s.def' % serverlib.target)]) serverlib.source = [] + common_libsources serverlib.source += [ 'JackAudioDriver.cpp', @@ -327,18 +325,20 @@ def build(bld): netlib.includes = includes netlib.name = 'netlib' netlib.target = 'jacknet'+libsuffix + netlib.install_path = '${LIBDIR}' netlib.use = ['SAMPLERATE', 'CELT', 'OPUS', 'PTHREAD'] if bld.env['IS_WINDOWS']: - netlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' - netlib.env['cxxstlib_PATTERN'] = 'lib%s.a' - netlib.env['implib_PATTERN'] = 'lib%s.dll.a' - netlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % netlib.target]) - if staticbuild: - netlib.env['SHLIB_MARKER'] = '' - netlib.use += ['WS2_32', 'WINMM'] + netlib.use += ['WS2_32', 'WINMM'] + netlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' + netlib.env['cxxstlib_PATTERN'] = 'lib%s.a' + netlib.env['implib_PATTERN'] = 'lib%s.dll.a' + if staticbuild: + netlib.env['SHLIB_MARKER'] = '' + netlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) + netlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % netlib.target]) + bld.install_files(netlib.install_path, [os.path.join(buildbindir, 'lib%s.def' % netlib.target)]) elif not bld.env['IS_MACOSX']: - netlib.use += ['RT'] - netlib.install_path = '${LIBDIR}' + netlib.use += ['RT'] netlib.source = [ 'JackNetAPI.cpp', 'JackNetInterface.cpp', -- cgit v1.2.1