Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

build: support building a .so

You can now select to build a shared object at configure time:

  $ ./gyp_uv -Dcomponent=shared_library -Dlibrary=shared_library

And build it with:

  $ make -C out BUILDTYPE=Debug # or BUILDTYPE=Release

Or, if you use ninja:

  $ ninja -C out/Debug
  • Loading branch information...
commit d56434a21d9e972df1303495440f3bc4f0476da2 1 parent e318b06
Ben Noordhuis authored November 06, 2012
7  gyp_uv
@@ -72,13 +72,14 @@ if __name__ == '__main__':
72 72
     args.append('-Dgcc_version=%d' % (10 * major + minor))
73 73
     args.append('-Dclang=%d' % int(is_clang))
74 74
 
75  
-  if not any(a.startswith('-Dtarget_arch') for a in args):
  75
+  if not any(a.startswith('-Dtarget_arch=') for a in args):
76 76
     args.append('-Dtarget_arch=ia32')
77 77
 
78  
-  if not any(a.startswith('-Dlibrary') for a in args):
  78
+  if not any(a.startswith('-Dlibrary=') for a in args):
79 79
     args.append('-Dlibrary=static_library')
80 80
 
81  
-  args.append('-Dcomponent=static_library')
  81
+  if not any(a.startswith('-Dcomponent=') for a in args):
  82
+    args.append('-Dcomponent=static_library')
82 83
 
83 84
   gyp_args = list(args)
84 85
   print gyp_args
8  include/uv.h
@@ -1639,9 +1639,11 @@ struct uv_signal_s {
1639 1639
 };
1640 1640
 
1641 1641
 /* These functions are no-ops on Windows. */
1642  
-int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
1643  
-int uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum);
1644  
-int uv_signal_stop(uv_signal_t* handle);
  1642
+UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
  1643
+UV_EXTERN int uv_signal_start(uv_signal_t* handle,
  1644
+                              uv_signal_cb signal_cb,
  1645
+                              int signum);
  1646
+UV_EXTERN int uv_signal_stop(uv_signal_t* handle);
1645 1647
 
1646 1648
 
1647 1649
 /*
7  uv.gyp
@@ -144,7 +144,12 @@
144 144
             'src/unix/udp.c',
145 145
           ],
146 146
           'include_dirs': [ 'src/unix/ev', ],
147  
-          'libraries': [ '-lm' ]
  147
+          'libraries': [ '-lm' ],
  148
+          'conditions': [
  149
+            ['"<(library)" == "shared_library"', {
  150
+              'cflags': [ '-fPIC' ],
  151
+            }],
  152
+          ],
148 153
         }],
149 154
         [ 'OS=="mac"', {
150 155
           'sources': [ 'src/unix/darwin.c', 'src/unix/fsevents.c' ],

0 notes on commit d56434a

Please sign in to comment.
Something went wrong with that request. Please try again.