5
5
# Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
6
6
# Portions Copyright (c) 1994, Regents of the University of California
7
7
#
8
- # $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.143 2006/04/11 20:26:40 neilc Exp $
8
+ # $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.144 2006/04/28 02:53:20 tgl Exp $
9
9
#
10
10
# -------------------------------------------------------------------------
11
11
@@ -16,8 +16,8 @@ include $(top_builddir)/src/Makefile.global
16
16
17
17
# shared library parameters
18
18
NAME = pq
19
- SO_MAJOR_VERSION = 4
20
- SO_MINOR_VERSION = 2
19
+ SO_MAJOR_VERSION = 5
20
+ SO_MINOR_VERSION = 0
21
21
DLTYPE = library
22
22
23
23
override CPPFLAGS := -DFRONTEND -I$(srcdir ) $(CPPFLAGS ) -I$(top_builddir ) /src/port
@@ -125,6 +125,31 @@ $(srcdir)/blibpqdll.def: exports.txt
125
125
echo ' ; Aliases for MS compatible names' >> $@
126
126
sed -e ' /^#/d' -e ' s/^\(.* \)\([0-9][0-9]*\)/ \1= _\1/' < $< | sed ' s/ *$$//' >> $@
127
127
128
+ # Where possible, restrict the symbols exported by the library to just the
129
+ # official list, so as to avoid unintentional ABI changes. On recent Darwin
130
+ # this also quiets multiply-defined-symbol warnings in programs that use
131
+ # libpgport along with libpq.
132
+
133
+ ifeq ($(PORTNAME ) , darwin)
134
+ $(shlib ) : exports.list
135
+
136
+ exports.list : exports.txt
137
+ $(AWK ) ' /^[^#]/ {printf "_%s\n",$$1}' $< > $@
138
+
139
+ exported_symbols_list = -exported_symbols_list exports.list
140
+ endif
141
+
142
+ ifeq ($(PORTNAME ) , linux)
143
+ $(shlib ) : exports.list
144
+
145
+ exports.list : exports.txt
146
+ echo ' { global:' > $@
147
+ $(AWK ) ' /^[^#]/ {printf "%s;\n",$$1}' $< >> $@
148
+ echo ' local: *; };' >> $@
149
+
150
+ exported_symbols_list = -Wl,--version-script=exports.list
151
+ endif
152
+
128
153
# depend on Makefile.global to force rebuild on re-run of configure
129
154
$(srcdir ) /libpq.rc : libpq.rc.in $(top_builddir ) /src/Makefile.global
130
155
sed -e ' s/\(VERSION.*\),0 *$$/\1,' ` date ' +%y%j' | sed ' s/^0*//' ` ' /' < $< > $@
@@ -147,7 +172,7 @@ uninstall: uninstall-lib
147
172
rm -f ' $(DESTDIR)$(includedir)/libpq-fe.h' ' $(DESTDIR)$(includedir_internal)/libpq-int.h' ' $(DESTDIR)$(includedir_internal)/pqexpbuffer.h' ' $(DESTDIR)$(datadir)/pg_service.conf.sample'
148
173
149
174
clean distclean : clean-lib
150
- rm -f $(OBJS ) pg_config_paths.h crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c thread.c md5.c ip.c encnames.c wchar.c pthread.h
175
+ rm -f $(OBJS ) pg_config_paths.h crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c thread.c md5.c ip.c encnames.c wchar.c pthread.h exports.list
151
176
rm -f pg_config_paths.h # Might be left over from a Win32 client-only build
152
177
153
178
maintainer-clean : distclean
0 commit comments