libeio and http_parser build with PIC code
authorAria Stewart <aredridel@nbtsc.org>
Mon, 21 Feb 2011 07:04:55 +0000 (00:04 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Fri, 25 Feb 2011 00:19:43 +0000 (16:19 -0800)
Fix building as a shared library

Closes GH-708.

deps/libeio/wscript
wscript

index 5194ead..280dca6 100644 (file)
@@ -125,5 +125,7 @@ def build(bld):
   libeio.install_path = None
   if bld.env["USE_DEBUG"]:
     libeio.clone("debug");
+  if Options.options.product_type != 'program':
+    libeio.ccflags = "-fPIC"
   bld.install_files('${PREFIX}/include/node/', 'eio.h');
 
diff --git a/wscript b/wscript
index de5ee45..51a46ec 100644 (file)
--- a/wscript
+++ b/wscript
@@ -619,6 +619,8 @@ def build(bld):
   http_parser.install_path = None
   if bld.env["USE_DEBUG"]:
     http_parser.clone("debug")
+  if product_type_is_lib:
+    http_parser.ccflags = '-fPIC'
 
   ### src/native.cc
   def make_macros(loc, content):