Skip to content

Instantly share code, notes, and snippets.

@vguerra
Created May 3, 2014 01:28
Show Gist options
  • Save vguerra/83e38ed0a9275af08d7c to your computer and use it in GitHub Desktop.
Save vguerra/83e38ed0a9275af08d7c to your computer and use it in GitHub Desktop.
using pkg-config to query information about nanomsg
diff --git a/wscript b/wscript
index fe8cfb7..3b403a1 100755
--- a/wscript
+++ b/wscript
@@ -43,7 +43,7 @@ DEFAULT_CONF = {
def build_nanomsgext(waf):
conf = copy(DEFAULT_CONF)
conf.update({
- 'lib' : ['nanomsg'],
+ 'use' : ['NANOMSG'],
'source': c_files(waf),
'target': 'nanomsgext',
})
@@ -58,7 +58,8 @@ def build_nanomsgext(waf):
def build_nanomsgxx(waf):
conf = copy(DEFAULT_CONF)
conf.update({
- 'lib' : ['nanomsg', 'nanomsgext'],
+ 'lib' : ['nanomsgext'],
+ 'use' : ['NANOMSG'],
'linkflags': ['-L.'],
'source' : cpp_files(waf),
'target' : 'nanomsgxx',
@@ -81,7 +82,8 @@ def build_tests(waf):
conf = copy(DEFAULT_CONF)
conf.update({
'features' : ['cxx', 'cxxprogram', 'test'],
- 'lib' : ['nanomsg', 'nanomsgxx', 'nanomsgext'],
+ 'lib' : ['nanomsgxx', 'nanomsgext'],
+ 'use' : ['NANOMSG'],
'linkflags': ['-L.'],
'install_path': None,
})
@@ -119,9 +121,10 @@ def build(waf):
def configure(waf):
waf.load('compiler_c compiler_cxx waf_unit_test')
- waf.check_cxx(
- lib = 'nanomsg'
- )
+ waf.check_cfg(package='libnanomsg',
+ uselib_store='NANOMSG',
+ args=['--cflags', '--libs'],
+ msg="Checking for nanomsg")
def dist(waf):
waf.algo = 'tar.gz'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment