From 431e72cbe8feb990feb2ae4d8e05d6793bab1190 Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Fri, 11 Jun 2010 21:25:05 +1000 Subject: [PATCH] Make addon building work for Cygwin. --- tools/wafadmin/Tools/node_addon.py | 3 +++ wscript | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/tools/wafadmin/Tools/node_addon.py b/tools/wafadmin/Tools/node_addon.py index 9462b603ac..72748c910b 100644 --- a/tools/wafadmin/Tools/node_addon.py +++ b/tools/wafadmin/Tools/node_addon.py @@ -41,6 +41,9 @@ def detect(conf): found = os.path.exists(join(prefix, "bin/node")) conf.check_message('node prefix', '', found, prefix) + ## On Cygwin we need to link to the generated symbol definitions + if Options.platform.startswith('cygwin'): conf.env['LIB_NODE'] = 'node' + ## On Mac OSX we need to use mac bundles if Options.platform == 'darwin': conf.check_tool('osx') diff --git a/wscript b/wscript index a939657b40..9efca2fdfa 100644 --- a/wscript +++ b/wscript @@ -486,6 +486,12 @@ def build(bld): node.add_objects += ' cares ' node.includes += ' deps/c-ares deps/c-ares/' + bld.env['DEST_OS'] + '-' + bld.env['DEST_CPU'] + if sys.platform.startswith('cygwin'): + bld.env.append_value('LINKFLAGS', '-Wl,--export-all-symbols') + bld.env.append_value('LINKFLAGS', '-Wl,--out-implib,default/libnode.dll.a') + bld.env.append_value('LINKFLAGS', '-Wl,--output-def,default/libnode.def') + bld.install_files('${PREFIX}/lib', "build/default/libnode.*") + def subflags(program): if os.path.exists(join(cwd, ".git")): actual_version=cmd_output("git describe").strip()