Build src/common files as a library with -fPIC.
Build a third version of libpgcommon.a, with -fPIC and -DFRONTEND,
as commit ea53100d5
did for src/port. Use that in libpq to avoid
symlinking+rebuilding source files retail.
Also adjust ecpg to use the new src/port and src/common libraries.
Arrange to install these libraries, too, to simplify out-of-tree
builds of shared libraries that need any of these modules.
Discussion: https://postgr.es/m/13022.1538003440@sss.pgh.pa.us
Discussion: https://postgr.es/m/E1g5Y8r-0006vs-QA@gemulon.postgresql.org
This commit is contained in:
parent
f7ab802855
commit
7143b3e821
|
@ -534,21 +534,26 @@ libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
|
||||||
libpq_builddir = $(top_builddir)/src/interfaces/libpq
|
libpq_builddir = $(top_builddir)/src/interfaces/libpq
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# This macro is for use by libraries linking to libpq. (Because libpgport
|
# How to link to libpq. (This macro may be used as-is by backend extensions.
|
||||||
# isn't created with the same link flags as libpq, it can't be used.)
|
# Client-side code should go through libpq_pgport or libpq_pgport_shlib,
|
||||||
|
# instead.)
|
||||||
libpq = -L$(libpq_builddir) -lpq
|
libpq = -L$(libpq_builddir) -lpq
|
||||||
|
|
||||||
# This macro is for use by client executables (not libraries) that use libpq.
|
# libpq_pgport is for use by client executables (not libraries) that use libpq.
|
||||||
# We force clients to pull symbols from the non-shared libraries libpgport
|
# We force clients to pull symbols from the non-shared libraries libpgport
|
||||||
# and libpgcommon rather than pulling some libpgport symbols from libpq just
|
# and libpgcommon rather than pulling some libpgport symbols from libpq just
|
||||||
# because libpq uses those functions too. This makes applications less
|
# because libpq uses those functions too. This makes applications less
|
||||||
# dependent on changes in libpq's usage of pgport. To do this we link to
|
# dependent on changes in libpq's usage of pgport (on platforms where we
|
||||||
|
# don't have symbol export control for libpq). To do this we link to
|
||||||
# pgport before libpq. This does cause duplicate -lpgport's to appear
|
# pgport before libpq. This does cause duplicate -lpgport's to appear
|
||||||
# on client link lines.
|
# on client link lines, since that also appears in $(LIBS).
|
||||||
|
# libpq_pgport_shlib is the same idea, but for use in client shared libraries.
|
||||||
ifdef PGXS
|
ifdef PGXS
|
||||||
libpq_pgport = -L$(libdir) -lpgcommon -lpgport $(libpq)
|
libpq_pgport = -L$(libdir) -lpgcommon -lpgport $(libpq)
|
||||||
|
libpq_pgport_shlib = -L$(libdir) -lpgcommon_shlib -lpgport_shlib $(libpq)
|
||||||
else
|
else
|
||||||
libpq_pgport = -L$(top_builddir)/src/common -lpgcommon -L$(top_builddir)/src/port -lpgport $(libpq)
|
libpq_pgport = -L$(top_builddir)/src/common -lpgcommon -L$(top_builddir)/src/port -lpgport $(libpq)
|
||||||
|
libpq_pgport_shlib = -L$(top_builddir)/src/common -lpgcommon_shlib -L$(top_builddir)/src/port -lpgport_shlib $(libpq)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Cygwin seems to need ldap libraries to be mentioned here, too
|
# Cygwin seems to need ldap libraries to be mentioned here, too
|
||||||
|
|
|
@ -3,17 +3,21 @@
|
||||||
# Makefile
|
# Makefile
|
||||||
# Makefile for src/common
|
# Makefile for src/common
|
||||||
#
|
#
|
||||||
# This makefile generates two outputs:
|
# These files are used by the Postgres backend, and also by frontend
|
||||||
|
# programs. These files provide common functionality that isn't directly
|
||||||
|
# concerned with portability and thus doesn't belong in src/port.
|
||||||
|
#
|
||||||
|
# This makefile generates three outputs:
|
||||||
#
|
#
|
||||||
# libpgcommon.a - contains object files with FRONTEND defined,
|
# libpgcommon.a - contains object files with FRONTEND defined,
|
||||||
# for use by client applications
|
# for use by client applications
|
||||||
#
|
#
|
||||||
# libpgcommon_srv.a - contains object files without FRONTEND defined,
|
# libpgcommon_shlib.a - contains object files with FRONTEND defined,
|
||||||
# for use only by the backend binaries
|
# built suitably for use in shared libraries; for use
|
||||||
|
# by frontend libraries
|
||||||
#
|
#
|
||||||
# You can also symlink/copy individual source files from this directory,
|
# libpgcommon_srv.a - contains object files without FRONTEND defined,
|
||||||
# to compile with different options. (libpq does that, because it needs
|
# for use only by the backend
|
||||||
# to use -fPIC on some platforms.)
|
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# src/common/Makefile
|
# src/common/Makefile
|
||||||
|
@ -52,26 +56,48 @@ else
|
||||||
OBJS_COMMON += sha2.o
|
OBJS_COMMON += sha2.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# A few files are currently only built for frontend, not server
|
||||||
OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o file_utils.o restricted_token.o
|
OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o file_utils.o restricted_token.o
|
||||||
|
|
||||||
|
# foo.o, foo_shlib.o, and foo_srv.o are all built from foo.c
|
||||||
|
OBJS_SHLIB = $(OBJS_FRONTEND:%.o=%_shlib.o)
|
||||||
OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
|
OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
|
||||||
|
|
||||||
all: libpgcommon.a libpgcommon_srv.a
|
all: libpgcommon.a libpgcommon_shlib.a libpgcommon_srv.a
|
||||||
|
|
||||||
# libpgcommon is needed by some contrib
|
# libpgcommon is needed by some contrib
|
||||||
install: all installdirs
|
install: all installdirs
|
||||||
$(INSTALL_STLIB) libpgcommon.a '$(DESTDIR)$(libdir)/libpgcommon.a'
|
$(INSTALL_STLIB) libpgcommon.a '$(DESTDIR)$(libdir)/libpgcommon.a'
|
||||||
|
$(INSTALL_STLIB) libpgcommon_shlib.a '$(DESTDIR)$(libdir)/libpgcommon_shlib.a'
|
||||||
|
|
||||||
installdirs:
|
installdirs:
|
||||||
$(MKDIR_P) '$(DESTDIR)$(libdir)'
|
$(MKDIR_P) '$(DESTDIR)$(libdir)'
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpgcommon.a'
|
rm -f '$(DESTDIR)$(libdir)/libpgcommon.a'
|
||||||
|
rm -f '$(DESTDIR)$(libdir)/libpgcommon_shlib.a'
|
||||||
|
|
||||||
libpgcommon.a: $(OBJS_FRONTEND)
|
libpgcommon.a: $(OBJS_FRONTEND)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
$(AR) $(AROPT) $@ $^
|
$(AR) $(AROPT) $@ $^
|
||||||
|
|
||||||
|
#
|
||||||
|
# Shared library versions of object files
|
||||||
|
#
|
||||||
|
|
||||||
|
libpgcommon_shlib.a: $(OBJS_SHLIB)
|
||||||
|
rm -f $@
|
||||||
|
$(AR) $(AROPT) $@ $^
|
||||||
|
|
||||||
|
# Because this uses its own compilation rule, it doesn't use the
|
||||||
|
# dependency tracking logic from Makefile.global. To make sure that
|
||||||
|
# dependency tracking works anyway for the *_shlib.o files, depend on
|
||||||
|
# their *.o siblings as well, which do have proper dependencies. It's
|
||||||
|
# a hack that might fail someday if there is a *_shlib.o without a
|
||||||
|
# corresponding *.o, but there seems little reason for that.
|
||||||
|
%_shlib.o: %.c %.o
|
||||||
|
$(CC) $(CFLAGS) $(CFLAGS_SL) $(CPPFLAGS) -c $< -o $@
|
||||||
|
|
||||||
#
|
#
|
||||||
# Server versions of object files
|
# Server versions of object files
|
||||||
#
|
#
|
||||||
|
@ -91,12 +117,14 @@ libpgcommon_srv.a: $(OBJS_SRV)
|
||||||
|
|
||||||
# Dependencies of keywords.o need to be managed explicitly to make sure
|
# Dependencies of keywords.o need to be managed explicitly to make sure
|
||||||
# that you don't get broken parsing code, even in a non-enable-depend build.
|
# that you don't get broken parsing code, even in a non-enable-depend build.
|
||||||
# Note that gram.h isn't required for the frontend version of keywords.o.
|
# Note that gram.h isn't required for the frontend versions of keywords.o.
|
||||||
$(top_builddir)/src/include/parser/gram.h: $(top_srcdir)/src/backend/parser/gram.y
|
$(top_builddir)/src/include/parser/gram.h: $(top_srcdir)/src/backend/parser/gram.y
|
||||||
$(MAKE) -C $(top_builddir)/src/backend $(top_builddir)/src/include/parser/gram.h
|
$(MAKE) -C $(top_builddir)/src/backend $(top_builddir)/src/include/parser/gram.h
|
||||||
|
|
||||||
keywords.o: $(top_srcdir)/src/include/parser/kwlist.h
|
keywords.o: $(top_srcdir)/src/include/parser/kwlist.h
|
||||||
|
keywords_shlib.o: $(top_srcdir)/src/include/parser/kwlist.h
|
||||||
keywords_srv.o: $(top_builddir)/src/include/parser/gram.h $(top_srcdir)/src/include/parser/kwlist.h
|
keywords_srv.o: $(top_builddir)/src/include/parser/gram.h $(top_srcdir)/src/include/parser/kwlist.h
|
||||||
|
|
||||||
clean distclean maintainer-clean:
|
clean distclean maintainer-clean:
|
||||||
rm -f libpgcommon.a libpgcommon_srv.a $(OBJS_FRONTEND) $(OBJS_SRV)
|
rm -f libpgcommon.a libpgcommon_shlib.a libpgcommon_srv.a
|
||||||
|
rm -f $(OBJS_FRONTEND) $(OBJS_SHLIB) $(OBJS_SRV)
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
/compatlib.def
|
/compatlib.def
|
||||||
/blibecpg_compatdll.def
|
/blibecpg_compatdll.def
|
||||||
/exports.list
|
/exports.list
|
||||||
/snprintf.c
|
|
||||||
/strerror.c
|
|
||||||
/strlcpy.c
|
|
||||||
/strnlen.c
|
|
||||||
|
|
|
@ -22,17 +22,13 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
|
||||||
-I$(libpq_srcdir) -DFRONTEND $(CPPFLAGS)
|
-I$(libpq_srcdir) -DFRONTEND $(CPPFLAGS)
|
||||||
override CFLAGS += $(PTHREAD_CFLAGS)
|
override CFLAGS += $(PTHREAD_CFLAGS)
|
||||||
|
|
||||||
SHLIB_LINK_INTERNAL = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq)
|
SHLIB_LINK_INTERNAL = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq_pgport_shlib)
|
||||||
SHLIB_LINK = $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
|
SHLIB_LINK = $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
|
||||||
SHLIB_PREREQS = submake-ecpglib submake-pgtypeslib
|
SHLIB_PREREQS = submake-ecpglib submake-pgtypeslib
|
||||||
|
|
||||||
SHLIB_EXPORTS = exports.txt
|
SHLIB_EXPORTS = exports.txt
|
||||||
|
|
||||||
# Need to recompile any libpgport object files
|
OBJS= informix.o $(WIN32RES)
|
||||||
LIBS := $(filter-out -lpgport, $(LIBS))
|
|
||||||
|
|
||||||
OBJS= informix.o snprintf.o strerror.o \
|
|
||||||
$(filter strlcpy.o strnlen.o, $(LIBOBJS)) $(WIN32RES)
|
|
||||||
|
|
||||||
PKG_CONFIG_REQUIRES_PRIVATE = libecpg libpgtypes
|
PKG_CONFIG_REQUIRES_PRIVATE = libecpg libpgtypes
|
||||||
|
|
||||||
|
@ -49,9 +45,6 @@ submake-pgtypeslib:
|
||||||
# Shared library stuff
|
# Shared library stuff
|
||||||
include $(top_srcdir)/src/Makefile.shlib
|
include $(top_srcdir)/src/Makefile.shlib
|
||||||
|
|
||||||
snprintf.c strerror.c strlcpy.c strnlen.c: % : $(top_srcdir)/src/port/%
|
|
||||||
rm -f $@ && $(LN_S) $< .
|
|
||||||
|
|
||||||
install: all installdirs install-lib
|
install: all installdirs install-lib
|
||||||
|
|
||||||
installdirs: installdirs-lib
|
installdirs: installdirs-lib
|
||||||
|
@ -59,6 +52,6 @@ installdirs: installdirs-lib
|
||||||
uninstall: uninstall-lib
|
uninstall: uninstall-lib
|
||||||
|
|
||||||
clean distclean: clean-lib
|
clean distclean: clean-lib
|
||||||
rm -f $(OBJS) snprintf.c strerror.c strlcpy.c strnlen.c
|
rm -f $(OBJS)
|
||||||
|
|
||||||
maintainer-clean: distclean maintainer-clean-lib
|
maintainer-clean: distclean maintainer-clean-lib
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
/ecpglib.def
|
/ecpglib.def
|
||||||
/blibecpgdll.def
|
/blibecpgdll.def
|
||||||
/exports.list
|
/exports.list
|
||||||
/path.c
|
|
||||||
/pgstrcasecmp.c
|
|
||||||
/snprintf.c
|
|
||||||
/strerror.c
|
|
||||||
/strlcpy.c
|
|
||||||
/strnlen.c
|
|
||||||
/thread.c
|
|
||||||
/win32setlocale.c
|
|
||||||
/isinf.c
|
|
||||||
|
|
|
@ -22,20 +22,10 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
|
||||||
-I$(libpq_srcdir) -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS)
|
-I$(libpq_srcdir) -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS)
|
||||||
override CFLAGS += $(PTHREAD_CFLAGS)
|
override CFLAGS += $(PTHREAD_CFLAGS)
|
||||||
|
|
||||||
# Need to recompile any libpgport object files
|
OBJS= execute.o typename.o descriptor.o sqlda.o data.o error.o prepare.o \
|
||||||
LIBS := $(filter-out -lpgport, $(LIBS))
|
memory.o connect.o misc.o $(WIN32RES)
|
||||||
|
|
||||||
OBJS= execute.o typename.o descriptor.o sqlda.o data.o error.o prepare.o memory.o \
|
SHLIB_LINK_INTERNAL = -L../pgtypeslib -lpgtypes $(libpq_pgport_shlib)
|
||||||
connect.o misc.o path.o pgstrcasecmp.o snprintf.o strerror.o \
|
|
||||||
$(filter strlcpy.o strnlen.o win32setlocale.o isinf.o, $(LIBOBJS)) \
|
|
||||||
$(WIN32RES)
|
|
||||||
|
|
||||||
# thread.c is needed only for non-WIN32 implementation of path.c
|
|
||||||
ifneq ($(PORTNAME), win32)
|
|
||||||
OBJS += thread.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
SHLIB_LINK_INTERNAL = -L../pgtypeslib -lpgtypes $(libpq)
|
|
||||||
SHLIB_LINK = $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
|
SHLIB_LINK = $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
|
||||||
SHLIB_PREREQS = submake-libpq submake-pgtypeslib
|
SHLIB_PREREQS = submake-libpq submake-pgtypeslib
|
||||||
|
|
||||||
|
@ -52,16 +42,8 @@ submake-pgtypeslib:
|
||||||
# Shared library stuff
|
# Shared library stuff
|
||||||
include $(top_srcdir)/src/Makefile.shlib
|
include $(top_srcdir)/src/Makefile.shlib
|
||||||
|
|
||||||
# We use some port modules verbatim, but since we need to
|
# Make dependency on pg_config_paths.h visible.
|
||||||
# compile with appropriate options to build a shared lib, we can't
|
|
||||||
# necessarily use the same object files as the backend uses. Instead,
|
|
||||||
# symlink the source files in here and build our own object file.
|
|
||||||
|
|
||||||
path.c pgstrcasecmp.c snprintf.c strerror.c strlcpy.c strnlen.c thread.c win32setlocale.c isinf.c: % : $(top_srcdir)/src/port/%
|
|
||||||
rm -f $@ && $(LN_S) $< .
|
|
||||||
|
|
||||||
misc.o: misc.c $(top_builddir)/src/port/pg_config_paths.h
|
misc.o: misc.c $(top_builddir)/src/port/pg_config_paths.h
|
||||||
path.o: path.c $(top_builddir)/src/port/pg_config_paths.h
|
|
||||||
|
|
||||||
$(top_builddir)/src/port/pg_config_paths.h:
|
$(top_builddir)/src/port/pg_config_paths.h:
|
||||||
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
|
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
|
||||||
|
@ -74,6 +56,5 @@ uninstall: uninstall-lib
|
||||||
|
|
||||||
clean distclean: clean-lib
|
clean distclean: clean-lib
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f path.c pgstrcasecmp.c snprintf.c strerror.c strlcpy.c strnlen.c thread.c win32setlocale.c isinf.c
|
|
||||||
|
|
||||||
maintainer-clean: distclean maintainer-clean-lib
|
maintainer-clean: distclean maintainer-clean-lib
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
/pgtypeslib.def
|
/pgtypeslib.def
|
||||||
/blibpgtypesdll.def
|
/blibpgtypesdll.def
|
||||||
/exports.list
|
/exports.list
|
||||||
/pgstrcasecmp.c
|
|
||||||
/rint.c
|
|
||||||
/snprintf.c
|
|
||||||
/strerror.c
|
|
||||||
/strlcpy.c
|
|
||||||
/string.c
|
|
||||||
/strnlen.c
|
|
||||||
|
|
|
@ -22,17 +22,12 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
|
||||||
-DFRONTEND $(CPPFLAGS)
|
-DFRONTEND $(CPPFLAGS)
|
||||||
override CFLAGS += $(PTHREAD_CFLAGS)
|
override CFLAGS += $(PTHREAD_CFLAGS)
|
||||||
|
|
||||||
# Need to recompile any libpgport object files
|
SHLIB_LINK_INTERNAL = -lpgcommon_shlib -lpgport_shlib
|
||||||
LIBS := $(filter-out -lpgport, $(LIBS))
|
|
||||||
|
|
||||||
SHLIB_LINK += $(filter -lintl -lm, $(LIBS))
|
SHLIB_LINK += $(filter -lintl -lm, $(LIBS))
|
||||||
|
|
||||||
SHLIB_EXPORTS = exports.txt
|
SHLIB_EXPORTS = exports.txt
|
||||||
|
|
||||||
OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \
|
OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \
|
||||||
pgstrcasecmp.o snprintf.o strerror.o \
|
|
||||||
$(filter rint.o strlcpy.o strnlen.o, $(LIBOBJS)) \
|
|
||||||
string.o \
|
|
||||||
$(WIN32RES)
|
$(WIN32RES)
|
||||||
|
|
||||||
all: all-lib
|
all: all-lib
|
||||||
|
@ -40,17 +35,6 @@ all: all-lib
|
||||||
# Shared library stuff
|
# Shared library stuff
|
||||||
include $(top_srcdir)/src/Makefile.shlib
|
include $(top_srcdir)/src/Makefile.shlib
|
||||||
|
|
||||||
# We use some port modules verbatim, but since we need to
|
|
||||||
# compile with appropriate options to build a shared lib, we can't
|
|
||||||
# necessarily use the same object files as the backend uses. Instead,
|
|
||||||
# symlink the source files in here and build our own object file.
|
|
||||||
|
|
||||||
pgstrcasecmp.c rint.c snprintf.c strerror.c strlcpy.c strnlen.c: % : $(top_srcdir)/src/port/%
|
|
||||||
rm -f $@ && $(LN_S) $< .
|
|
||||||
|
|
||||||
string.c: % : $(top_srcdir)/src/common/%
|
|
||||||
rm -f $@ && $(LN_S) $< .
|
|
||||||
|
|
||||||
install: all installdirs install-lib
|
install: all installdirs install-lib
|
||||||
|
|
||||||
installdirs: installdirs-lib
|
installdirs: installdirs-lib
|
||||||
|
@ -58,6 +42,6 @@ installdirs: installdirs-lib
|
||||||
uninstall: uninstall-lib
|
uninstall: uninstall-lib
|
||||||
|
|
||||||
clean distclean: clean-lib
|
clean distclean: clean-lib
|
||||||
rm -f $(OBJS) pgstrcasecmp.c rint.c snprintf.c strerror.c strlcpy.c strnlen.c string.c
|
rm -f $(OBJS)
|
||||||
|
|
||||||
maintainer-clean: distclean maintainer-clean-lib
|
maintainer-clean: distclean maintainer-clean-lib
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
/exports.list
|
/exports.list
|
||||||
/libpq.rc
|
/libpq.rc
|
||||||
# .c files that are symlinked in from elsewhere
|
# .c files that are symlinked in from elsewhere
|
||||||
/ip.c
|
|
||||||
/md5.c
|
|
||||||
/base64.c
|
|
||||||
/link-canary.c
|
|
||||||
/scram-common.c
|
|
||||||
/sha2.c
|
|
||||||
/sha2_openssl.c
|
|
||||||
/saslprep.c
|
|
||||||
/unicode_norm.c
|
|
||||||
/encnames.c
|
/encnames.c
|
||||||
/wchar.c
|
/wchar.c
|
||||||
|
|
|
@ -32,13 +32,9 @@ OBJS= fe-auth.o fe-auth-scram.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-l
|
||||||
|
|
||||||
# src/backend/utils/mb
|
# src/backend/utils/mb
|
||||||
OBJS += encnames.o wchar.o
|
OBJS += encnames.o wchar.o
|
||||||
# src/common
|
|
||||||
OBJS += base64.o ip.o link-canary.o md5.o scram-common.o saslprep.o unicode_norm.o
|
|
||||||
|
|
||||||
ifeq ($(with_openssl),yes)
|
ifeq ($(with_openssl),yes)
|
||||||
OBJS += fe-secure-openssl.o fe-secure-common.o sha2_openssl.o
|
OBJS += fe-secure-openssl.o fe-secure-common.o
|
||||||
else
|
|
||||||
OBJS += sha2.o
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PORTNAME), cygwin)
|
ifeq ($(PORTNAME), cygwin)
|
||||||
|
@ -59,12 +55,14 @@ endif
|
||||||
|
|
||||||
# Add libraries that libpq depends (or might depend) on into the
|
# Add libraries that libpq depends (or might depend) on into the
|
||||||
# shared library link. (The order in which you list them here doesn't
|
# shared library link. (The order in which you list them here doesn't
|
||||||
# matter.) Note that we filter out -lpgport from LIBS and instead
|
# matter.) Note that we filter out -lpgcommon and -lpgport from LIBS and
|
||||||
# insert -lpgport_shlib, to get port files that are built correctly.
|
# instead link with -lpgcommon_shlib and -lpgport_shlib, to get object files
|
||||||
|
# that are built correctly for use in a shlib.
|
||||||
|
SHLIB_LINK_INTERNAL = -lpgcommon_shlib -lpgport_shlib
|
||||||
ifneq ($(PORTNAME), win32)
|
ifneq ($(PORTNAME), win32)
|
||||||
SHLIB_LINK += -lpgport_shlib $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lgssapi_krb5 -lgss -lgssapi -lssl -lsocket -lnsl -lresolv -lintl -lm, $(LIBS)) $(LDAP_LIBS_FE) $(PTHREAD_LIBS)
|
SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lgssapi_krb5 -lgss -lgssapi -lssl -lsocket -lnsl -lresolv -lintl -lm, $(LIBS)) $(LDAP_LIBS_FE) $(PTHREAD_LIBS)
|
||||||
else
|
else
|
||||||
SHLIB_LINK += -lpgport_shlib $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lgssapi32 -lssl -lsocket -lnsl -lresolv -lintl -lm $(PTHREAD_LIBS), $(LIBS)) $(LDAP_LIBS_FE)
|
SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lgssapi32 -lssl -lsocket -lnsl -lresolv -lintl -lm $(PTHREAD_LIBS), $(LIBS)) $(LDAP_LIBS_FE)
|
||||||
endif
|
endif
|
||||||
ifeq ($(PORTNAME), win32)
|
ifeq ($(PORTNAME), win32)
|
||||||
SHLIB_LINK += -lshell32 -lws2_32 -lsecur32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS))
|
SHLIB_LINK += -lshell32 -lws2_32 -lsecur32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS))
|
||||||
|
@ -87,9 +85,6 @@ backend_src = $(top_srcdir)/src/backend
|
||||||
# Instead, symlink the source files in here and build our own object files.
|
# Instead, symlink the source files in here and build our own object files.
|
||||||
# When you add a file here, remember to add it in the "clean" target below.
|
# When you add a file here, remember to add it in the "clean" target below.
|
||||||
|
|
||||||
ip.c md5.c base64.c link-canary.c scram-common.c sha2.c sha2_openssl.c saslprep.c unicode_norm.c: % : $(top_srcdir)/src/common/%
|
|
||||||
rm -f $@ && $(LN_S) $< .
|
|
||||||
|
|
||||||
encnames.c wchar.c: % : $(backend_src)/utils/mb/%
|
encnames.c wchar.c: % : $(backend_src)/utils/mb/%
|
||||||
rm -f $@ && $(LN_S) $< .
|
rm -f $@ && $(LN_S) $< .
|
||||||
|
|
||||||
|
@ -136,8 +131,7 @@ clean distclean: clean-lib
|
||||||
rm -f $(OBJS) pthread.h libpq.rc
|
rm -f $(OBJS) pthread.h libpq.rc
|
||||||
# Might be left over from a Win32 client-only build
|
# Might be left over from a Win32 client-only build
|
||||||
rm -f pg_config_paths.h
|
rm -f pg_config_paths.h
|
||||||
# Remove files we (may have) symlinked in from src/common and other places
|
# Remove files we (may have) symlinked in from other places
|
||||||
rm -f ip.c md5.c base64.c link-canary.c scram-common.c sha2.c sha2_openssl.c saslprep.c unicode_norm.c
|
|
||||||
rm -f encnames.c wchar.c
|
rm -f encnames.c wchar.c
|
||||||
|
|
||||||
maintainer-clean: distclean maintainer-clean-lib
|
maintainer-clean: distclean maintainer-clean-lib
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#
|
#
|
||||||
# libpgport_shlib.a - contains object files with FRONTEND defined,
|
# libpgport_shlib.a - contains object files with FRONTEND defined,
|
||||||
# built suitably for use in shared libraries; for use
|
# built suitably for use in shared libraries; for use
|
||||||
# by libpq and other frontend libraries
|
# by frontend libraries
|
||||||
#
|
#
|
||||||
# libpgport_srv.a - contains object files without FRONTEND defined,
|
# libpgport_srv.a - contains object files without FRONTEND defined,
|
||||||
# for use only by the backend
|
# for use only by the backend
|
||||||
|
@ -53,15 +53,16 @@ OBJS_SRV = $(OBJS:%.o=%_srv.o)
|
||||||
all: libpgport.a libpgport_shlib.a libpgport_srv.a
|
all: libpgport.a libpgport_shlib.a libpgport_srv.a
|
||||||
|
|
||||||
# libpgport is needed by some contrib
|
# libpgport is needed by some contrib
|
||||||
# currently we don't install libpgport_shlib.a, maybe we should?
|
|
||||||
install: all installdirs
|
install: all installdirs
|
||||||
$(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(libdir)/libpgport.a'
|
$(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(libdir)/libpgport.a'
|
||||||
|
$(INSTALL_STLIB) libpgport_shlib.a '$(DESTDIR)$(libdir)/libpgport_shlib.a'
|
||||||
|
|
||||||
installdirs:
|
installdirs:
|
||||||
$(MKDIR_P) '$(DESTDIR)$(libdir)'
|
$(MKDIR_P) '$(DESTDIR)$(libdir)'
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpgport.a'
|
rm -f '$(DESTDIR)$(libdir)/libpgport.a'
|
||||||
|
rm -f '$(DESTDIR)$(libdir)/libpgport_shlib.a'
|
||||||
|
|
||||||
libpgport.a: $(OBJS)
|
libpgport.a: $(OBJS)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
|
|
Loading…
Reference in New Issue