summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-10-05 03:16:18 +0000
committerDavid Robillard <d@drobilla.net>2014-10-05 03:16:18 +0000
commit4e3571f8fd583ea808cb1f56a197ab95aabe9be7 (patch)
tree2fa80e751837f05c5a22b74f110af969ac8254f8 /wscript
parente77bc896494b9fe980e89639b0120f7c37f219da (diff)
downloadlilv-4e3571f8fd583ea808cb1f56a197ab95aabe9be7.tar.gz
lilv-4e3571f8fd583ea808cb1f56a197ab95aabe9be7.tar.bz2
lilv-4e3571f8fd583ea808cb1f56a197ab95aabe9be7.zip
Configure based on compiler target OS for cross-compilation.
Only add -dl to pkg-config file for appropriate platforms. Fix #986. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5472 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r--wscript25
1 files changed, 13 insertions, 12 deletions
diff --git a/wscript b/wscript
index 92ff3fb..99ca96b 100644
--- a/wscript
+++ b/wscript
@@ -87,7 +87,7 @@ def configure(conf):
autowaf.define(conf, 'LILV_NEW_LV2', 1) # New LV2 discovery API
defines = ['_POSIX_C_SOURCE', '_BSD_SOURCE']
- if Options.platform == 'darwin':
+ if conf.env.DEST_OS == 'darwin':
defines += ['_DARWIN_C_SOURCE']
# Check for gcov library (for test coverage)
@@ -122,7 +122,7 @@ def configure(conf):
lilv_path_sep = ':'
lilv_dir_sep = '/'
- if sys.platform == 'win32':
+ if conf.env.DEST_OS == 'win32':
lilv_path_sep = ';'
lilv_dir_sep = '\\\\'
@@ -132,16 +132,16 @@ def configure(conf):
# Set default LV2 path
lv2_path = Options.options.default_lv2_path
if lv2_path == '':
- if Options.platform == 'darwin':
+ if conf.env.DEST_OS == 'darwin':
lv2_path = lilv_path_sep.join(['~/Library/Audio/Plug-Ins/LV2',
'~/.lv2',
'/usr/local/lib/lv2',
'/usr/lib/lv2',
'/Library/Audio/Plug-Ins/LV2'])
- elif Options.platform == 'haiku':
+ elif conf.env.DEST_OS == 'haiku':
lv2_path = lilv_path_sep.join(['~/.lv2',
'/boot/common/add-ons/lv2'])
- elif Options.platform == 'win32':
+ elif conf.env.DEST_OS == 'win32':
lv2_path = lilv_path_sep.join(['%APPDATA%\\\\LV2',
'%COMMONPROGRAMFILES%\\\\LV2'])
else:
@@ -192,11 +192,6 @@ def build(bld):
bld.install_files(includedir, bld.path.ant_glob('lilv/*.h'))
bld.install_files(includedir, bld.path.ant_glob('lilv/*.hpp'))
- # Pkgconfig file
- autowaf.build_pc(bld, 'LILV', LILV_VERSION, LILV_MAJOR_VERSION, [],
- {'LILV_MAJOR_VERSION' : LILV_MAJOR_VERSION,
- 'LILV_PKG_DEPS' : 'lv2 serd-0 sord-0 sratom-0'})
-
lib_source = '''
src/collections.c
src/instance.c
@@ -217,14 +212,20 @@ def build(bld):
lib = ['dl']
libflags = ['-fvisibility=hidden']
defines = []
- if sys.platform == 'win32':
+ if bld.env.DEST_OS == 'win32':
lib = []
if bld.env.MSVC_COMPILER:
libflags = []
defines = ['snprintf=_snprintf']
- elif sys.platform.find('bsd') > 0:
+ elif bld.env.DEST_OS.find('bsd') > 0:
lib = []
+ # Pkgconfig file
+ autowaf.build_pc(bld, 'LILV', LILV_VERSION, LILV_MAJOR_VERSION, [],
+ {'LILV_MAJOR_VERSION' : LILV_MAJOR_VERSION,
+ 'LILV_PKG_DEPS' : 'lv2 serd-0 sord-0 sratom-0',
+ 'LILV_PKG_LIBS' : ' -l'.join([''] + lib)})
+
# Shared Library
if bld.env.BUILD_SHARED:
obj = bld(features = 'c cshlib',