diff --git a/config-unix.mk b/config-unix.mk index 2ab534f4..90798760 100644 --- a/config-unix.mk +++ b/config-unix.mk @@ -151,6 +151,11 @@ CPPFLAGS += -Isrc/unix CFLAGS += -DHAVE_DTRACE endif +ifneq (darwin,$(PLATFORM)) +# Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR in src/version.c +LDFLAGS += -Wl,-soname,libuv.so.0.10 +endif + libuv.a: $(OBJS) $(AR) rcs $@ $^ diff --git a/src/version.c b/src/version.c index 6ee0cc93..5dbc3625 100644 --- a/src/version.c +++ b/src/version.c @@ -24,7 +24,9 @@ /* * Versions with an even minor version (e.g. 0.6.1 or 1.0.4) are API and ABI * stable. When the minor version is odd, the API can change between patch - * releases. + * releases. Make sure you update the -soname directives in config-unix.mk + * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but + * not UV_VERSION_PATCH.) */ #undef UV_VERSION_MAJOR /* TODO(bnoordhuis) Remove in v0.11. */ diff --git a/uv.gyp b/uv.gyp index 0effb921..54c771ee 100644 --- a/uv.gyp +++ b/uv.gyp @@ -164,9 +164,16 @@ ], }, 'conditions': [ - ['"<(library)" == "shared_library"', { + ['library=="shared_library"', { 'cflags': [ '-fPIC' ], }], + ['library=="shared_library" and OS!="mac"', { + 'link_settings': { + # Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR + # in src/version.c + 'libraries': [ '-Wl,-soname,libuv.so.0.10' ], + }, + }], ], }], [ 'OS=="linux" or OS=="mac"', {