@@ -47,18 +47,14 @@ LOCALOBJS += utils/probes.o
47
47
endif
48
48
endif
49
49
50
- # FIXME: The --enable-shared-postgres-backend parameter build the postgres .so shared between postmaster
50
+ # FIXME: The --enable-shared-postgres-backend parameter build the libpostgres .so shared between postmaster
51
51
# But we only test it locally without CI test. Please use it with caution.
52
- ifeq ($(enable_shared_postgres_backend ) ,yes)
53
- OBJS = $(LOCALOBJS ) $(SUBDIROBJS )
54
- else
55
52
OBJS = \
56
53
$(LOCALOBJS ) \
57
54
$(SUBDIROBJS ) \
58
55
$(top_builddir ) /src/common/libpgcommon_srv.a \
59
56
$(top_builddir ) /src/port/libpgport_srv.a
60
57
61
- endif
62
58
ifeq ($(PORTNAME ) , darwin)
63
59
LDOPTS = -Z
64
60
endif
@@ -86,13 +82,15 @@ ifneq ($(PORTNAME), win32)
86
82
ifneq ($(PORTNAME ) , aix)
87
83
88
84
ifeq ($(enable_shared_postgres_backend ) ,yes)
89
- postgres.so : $(OBJS )
90
- $(CXX ) -shared $(CXXFLAGS ) $(LDFLAGS ) $(LDFLAGS_EX ) $(export_dynamic ) $(filter-out main/main.o, $(call expand_subsys,$^ ) ) -o $@
85
+ libpostgres.so : $(OBJS )
86
+ $(CXX ) -shared $(CXXFLAGS ) $(LDFLAGS ) $(LDFLAGS_SL ) $(export_dynamic ) \
87
+ $(filter-out main/main.o, $(call expand_subsys,$^ ) ) $(LIBS ) -o $@
91
88
92
- postgres : main/main.o postgres .so $(top_builddir ) /src/port/libpgport_srv.a $(top_builddir ) /src/common/libpgcommon_srv.a
89
+ postgres : main/main.o libpostgres .so $(top_builddir ) /src/port/libpgport_srv.a $(top_builddir ) /src/common/libpgcommon_srv.a
93
90
$(CXX ) $(CXXFLAGS ) $(LDFLAGS ) $(LDFLAGS_EX ) $(export_dynamic ) \
94
- main/main.o postgres .so $(top_builddir ) /src/port/libpgport_srv.a \
91
+ main/main.o libpostgres .so $(top_builddir ) /src/port/libpgport_srv.a \
95
92
$(top_builddir ) /src/common/libpgcommon_srv.a $(LIBS ) -o $@
93
+
96
94
else
97
95
postgres : $(OBJS )
98
96
$(CXX ) $(CXXFLAGS ) $(call expand_subsys,$^ ) $(LDFLAGS ) $(LDFLAGS_EX ) $(export_dynamic ) $(LIBS ) -o $@
@@ -152,13 +150,8 @@ $(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
152
150
153
151
# The postgres.o target is needed by the rule in Makefile.global that
154
152
# creates the exports file when MAKE_EXPORTS = true.
155
- ifeq ($(enable_shared_postgres_backend ) ,yes)
156
- postgres.o : $(OBJS ) $(top_builddir ) /src/port/libpgport_srv.a $(top_builddir ) /src/common/libpgcommon_srv.a
157
- $(CXX ) $(LDREL ) $(call expand_subsys,$^ ) $(LDFLAGS ) $(LDFLAGS_EX ) $(LIBS ) -o $@
158
- else
159
153
postgres.o : $(OBJS )
160
154
$(CXX ) $(LDREL ) $(call expand_subsys,$^ ) $(LDFLAGS ) $(LDFLAGS_EX ) $(LIBS ) -o $@
161
- endif
162
155
163
156
# The following targets are specified in make commands that appear in
164
157
# the make files in our subdirectories. Note that it's important we
@@ -272,7 +265,7 @@ endif
272
265
install-bin : postgres $(POSTGRES_IMP ) installdirs
273
266
$(INSTALL_PROGRAM ) postgres$(X ) ' $(DESTDIR)$(bindir)/postgres$(X)'
274
267
ifeq ($(enable_shared_postgres_backend ) ,yes)
275
- $(INSTALL_PROGRAM) postgres .so '$(DESTDIR)$(libdir)/postgres .so'
268
+ $(INSTALL_PROGRAM) libpostgres .so '$(DESTDIR)$(libdir)/libpostgres .so'
276
269
endif
277
270
ifneq ($(PORTNAME ) , win32)
278
271
@rm -f $(DESTDIR)$(bindir)/postmaster$(X)
@@ -311,7 +304,7 @@ endif
311
304
uninstall :
312
305
rm -f $(DESTDIR )$(bindir ) /postgres$(X ) $(DESTDIR )$(bindir ) /postmaster $(DESTDIR )$(bindir ) /cdbsyncmaster
313
306
ifeq ($(enable_shared_postgres_backend ) ,yes)
314
- rm -f $(DESTDIR)$(bindir)/postgres$(X) $(DESTDIR)$(libdir)/postgres .so $(DESTDIR)$(bindir)/postmaster $(DESTDIR)$(bindir)/cdbsyncmaster
307
+ rm -f $(DESTDIR)$(bindir)/postgres$(X) $(DESTDIR)$(libdir)/libpostgres .so $(DESTDIR)$(bindir)/postmaster $(DESTDIR)$(bindir)/cdbsyncmaster
315
308
endif
316
309
ifeq ($(MAKE_EXPORTS ) , true)
317
310
rm -f '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)'
@@ -349,7 +342,7 @@ endif
349
342
clean :
350
343
rm -f $(LOCALOBJS ) postgres$(X ) $(POSTGRES_IMP )
351
344
ifeq ($(enable_shared_postgres_backend ) ,yes)
352
- rm -f $(LOCALOBJS) postgres .so $(POSTGRES_IMP)
345
+ rm -f $(LOCALOBJS) libpostgres .so $(POSTGRES_IMP)
353
346
endif
354
347
ifeq ($(PORTNAME ) , cygwin)
355
348
rm -f postgres.dll libpostgres.a
0 commit comments