Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc6978ec

Browse files
committed
Restructure how libpq includes external C files, for clarity.
1 parentcc1ed40 commitc6978ec

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

‎src/interfaces/libpq/Makefile

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,33 @@ override CFLAGS += $(PTHREAD_CFLAGS)
2525
endif
2626

2727
# Need to recompile any libpgport object files because we need these
28-
# object files to use the same compile flags as libpq. If we used
29-
# the object files from libpgport, this would not be true on all
30-
# platforms. We filter some object files so we only use object
31-
# files configure says we need.
28+
# object files to use the same compile flags as libpq; some
29+
# platforms require special flags for all libpq object files.
3230
LIBS :=$(LIBS:-lpgport=)
3331

32+
# external object files that are always used by libpq
33+
BACKEND_LIBPQ = md5 ip
34+
UTILS_MB = encnames wchar
35+
PERM_PGPORT = inet_net_ntop noblock pgstrcasecmp thread
36+
ifeq ($(PORTNAME), win32)
37+
PERM_PGPORT += pgsleep
38+
endif
39+
40+
41+
# pgport object files are used by libpq if identified by configure
42+
OPT_PGPORT =$(filter$(addsuffix .o, crypt getaddrinfo inet_aton open snprintf strerror strlcpy win32error),$(LIBOBJS))
43+
3444
OBJS=fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o\
3545
fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o\
3646
libpq-events.o\
37-
md5.o ip.o wchar.o encnames.o inet_net_ntop.o noblock.o pgstrcasecmp.o thread.o\
38-
$(filter crypt.o getaddrinfo.o inet_aton.o open.o snprintf.o strerror.o strlcpy.o win32error.o,$(LIBOBJS))
47+
$(addsuffix .o,$(PERM_PGPORT)$(OPT_PGPORT)$(BACKEND_LIBPQ)$(UTILS_MB))
3948

4049
ifeq ($(PORTNAME), cygwin)
4150
overrideshlib = cyg$(NAME)$(DLSUFFIX)
4251
endif
4352

4453
ifeq ($(PORTNAME), win32)
45-
OBJS += win32.opgsleep.olibpqrc.o
54+
OBJS += win32.o libpqrc.o
4655

4756
libpqrc.o: libpq.rc
4857
$(WINDRES) -i$< -o$@
@@ -77,17 +86,15 @@ backend_src = $(top_srcdir)/src/backend
7786
# We use several backend modules verbatim, but since we need to
7887
# compile with appropriate options to build a shared lib, we can't
7988
# necessarily use the same object files as the backend uses. Instead,
80-
# symlink the source files in here and build our own object file.
81-
# For port modules, this only happens if configure decides the module
82-
# is needed (see filter hack in OBJS, above).
89+
# we symlink the source files in here and build our own object files.
8390

84-
crypt.cgetaddrinfo.cinet_aton.cinet_net_ntop.cnoblock.copen.cpgstrcasecmp.csnprintf.cstrerror.cstrlcpy.cthread.cwin32error.cpgsleep.c:% :$(top_srcdir)/src/port/%
91+
$(addsuffix .c,$(PERM_PGPORT)$(OPT_PGPORT)):% :$(top_srcdir)/src/port/%
8592
rm -f$@&&$(LN_S)$<.
8693

87-
md5.cip.c:% :$(backend_src)/libpq/%
94+
$(addsuffix .c,$(BACKEND_LIBPQ)):% :$(backend_src)/libpq/%
8895
rm -f$@&&$(LN_S)$<.
8996

90-
encnames.cwchar.c:% :$(backend_src)/utils/mb/%
97+
$(addsuffix .c,$(UTILS_MB)):% :$(backend_src)/utils/mb/%
9198
rm -f$@&&$(LN_S)$<.
9299

93100

@@ -124,7 +131,7 @@ uninstall: uninstall-lib
124131
rm -f'$(DESTDIR)$(datadir)/pg_service.conf.sample'
125132

126133
cleandistclean: clean-lib
127-
rm -f$(OBJS) pg_config_paths.hcrypt.c getaddrinfo.c inet_aton.c noblock.c open.c pgstrcasecmp.c snprintf.c strerror.c strlcpy.c thread.c md5.c ip.c encnames.c wchar.c win32error.c pgsleep.c pthread.h libpq.rc
134+
rm -f$(OBJS) pg_config_paths.hpthread.h libpq.rc$(addsuffix .c,$(BACKEND_LIBPQ)$(UTILS_MB)$(PERM_PGPORT)$(OPT_PGPORT))
128135
# Might be left over from a Win32 client-only build
129136
rm -f pg_config_paths.h
130137

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp