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()