Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@bnoordhuis authored
Showing with 15 additions and 7 deletions.
  1. +4 −3 gyp_uv
  2. +5 −3 include/uv.h
  3. +6 −1 uv.gyp
View
7 gyp_uv
@@ -72,13 +72,14 @@ if __name__ == '__main__':
args.append('-Dgcc_version=%d' % (10 * major + minor))
args.append('-Dclang=%d' % int(is_clang))
- if not any(a.startswith('-Dtarget_arch') for a in args):
+ if not any(a.startswith('-Dtarget_arch=') for a in args):
args.append('-Dtarget_arch=ia32')
- if not any(a.startswith('-Dlibrary') for a in args):
+ if not any(a.startswith('-Dlibrary=') for a in args):
args.append('-Dlibrary=static_library')
- args.append('-Dcomponent=static_library')
+ if not any(a.startswith('-Dcomponent=') for a in args):
+ args.append('-Dcomponent=static_library')
gyp_args = list(args)
print gyp_args
View
8 include/uv.h
@@ -1639,9 +1639,11 @@ struct uv_signal_s {
};
/* These functions are no-ops on Windows. */
-int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
-int uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum);
-int uv_signal_stop(uv_signal_t* handle);
+UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
+UV_EXTERN int uv_signal_start(uv_signal_t* handle,
+ uv_signal_cb signal_cb,
+ int signum);
+UV_EXTERN int uv_signal_stop(uv_signal_t* handle);
/*
View
7 uv.gyp
@@ -144,7 +144,12 @@
'src/unix/udp.c',
],
'include_dirs': [ 'src/unix/ev', ],
- 'libraries': [ '-lm' ]
+ 'libraries': [ '-lm' ],
+ 'conditions': [
+ ['"<(library)" == "shared_library"', {
+ 'cflags': [ '-fPIC' ],
+ }],
+ ],
}],
[ 'OS=="mac"', {
'sources': [ 'src/unix/darwin.c', 'src/unix/fsevents.c' ],
Please sign in to comment.
Something went wrong with that request. Please try again.