Index: src/Makefile.shlib =================================================================== RCS file: /projects/cvsroot/pgsql/src/Makefile.shlib,v retrieving revision 1.97 diff -u -r1.97 Makefile.shlib --- src/Makefile.shlib 8 Aug 2005 03:35:13 -0000 1.97 +++ src/Makefile.shlib 18 Oct 2005 17:54:10 -0000 @@ -184,6 +184,12 @@ ifeq ($(PORTNAME), linux) LINK.shared = $(COMPILER) -shared -Wl,-soname,$(soname) + + ifeq ($(wildcard exports.txt),exports.txt) + LINK.shared += -Wl,--version-script,exports.gnuld + EXPORTS_FILE = exports.gnuld + endif + endif ifeq ($(PORTNAME), solaris) @@ -255,6 +261,12 @@ endif # enable_shared +# If you wish to version the symbols, just define SHLIB_VERSION to be +# something like LIBPQ_4.1 in the Makefile for that library. Otherwise the +# symbols will be unversioned (as per default). Produced version script is +# for GNU ld only and is currently created only on Linux. +exports.gnuld: exports.txt + awk 'BEGIN { print "$(SHLIB_VERSION) { global: " } { if( $$1 != "#" ) {print $$1,";"} } END { print "local: *; };" }' < $< > $@ ## @@ -291,7 +303,7 @@ ifneq ($(PORTNAME), aix) # Normal case -$(shlib): $(OBJS) +$(shlib): $(OBJS) $(EXPORTS_FILE) $(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@ # If we're using major and minor versions, then make a symlink to major-version-only. ifneq ($(shlib), $(shlib_major)) @@ -411,7 +423,7 @@ clean-lib: rm -f lib$(NAME).a ifeq ($(enable_shared), yes) - rm -f $(shlib_bare) $(shlib_major) $(shlib) + rm -f $(shlib_bare) $(shlib_major) $(shlib) $(EXPORTS_FILE) ifdef EXPSUFF rm -f lib$(NAME)$(EXPSUFF) endif