From f39418e9b36987ce1dac0c55da1452e43ec46e15 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 17 Oct 2013 21:52:54 -0400 Subject: [PATCH] Switch dependency order of libpgcommon and libpgport Continuing 63f32f3416a8b4f8e057dc184e8e8eae734ccc8a, libpgcommon should depend on libpgport, but not vice versa. But wait_result_to_str() in wait_error.c depends on pstrdup() in libpgcommon. So move exec.c and wait_error.c from libpgport to libpgcommon. Also switch the link order in the place that's actually used by the failing ecpg builds. The function declarations have been left in port.h for now. That should perhaps be separated sometime. --- src/Makefile.global.in | 2 +- src/bin/initdb/nls.mk | 2 +- src/bin/pg_config/nls.mk | 2 +- src/bin/pg_ctl/nls.mk | 2 +- src/bin/pg_dump/nls.mk | 2 +- src/bin/psql/nls.mk | 2 +- src/common/Makefile | 2 +- src/{port => common}/exec.c | 2 +- src/{port => common}/wait_error.c | 2 +- src/port/Makefile | 5 ++--- src/tools/msvc/Mkvcbuild.pm | 6 +++--- 11 files changed, 14 insertions(+), 15 deletions(-) rename src/{port => common}/exec.c (99%) rename src/{port => common}/wait_error.c (98%) diff --git a/src/Makefile.global.in b/src/Makefile.global.in index b04d382674..4c8454cad7 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -510,7 +510,7 @@ endif LIBOBJS = @LIBOBJS@ -LIBS := -lpgport -lpgcommon $(LIBS) +LIBS := -lpgcommon -lpgport $(LIBS) # to make ws2_32.lib the last library, and always link with shfolder, # so SHGetFolderName isn't picked up from shell32.dll diff --git a/src/bin/initdb/nls.mk b/src/bin/initdb/nls.mk index c0e85fcda8..f10b6177f2 100644 --- a/src/bin/initdb/nls.mk +++ b/src/bin/initdb/nls.mk @@ -1,5 +1,5 @@ # src/bin/initdb/nls.mk CATALOG_NAME = initdb AVAIL_LANGUAGES = cs de es fr it ja pl pt_BR ru zh_CN -GETTEXT_FILES = findtimezone.c initdb.c ../../common/fe_memutils.c ../../port/dirmod.c ../../port/exec.c ../../port/wait_error.c +GETTEXT_FILES = findtimezone.c initdb.c ../../common/exec.c ../../common/fe_memutils.c ../../common/wait_error.c ../../port/dirmod.c GETTEXT_TRIGGERS = simple_prompt diff --git a/src/bin/pg_config/nls.mk b/src/bin/pg_config/nls.mk index 2888c46204..387bbf2c28 100644 --- a/src/bin/pg_config/nls.mk +++ b/src/bin/pg_config/nls.mk @@ -1,4 +1,4 @@ # src/bin/pg_config/nls.mk CATALOG_NAME = pg_config AVAIL_LANGUAGES = cs de es fr it ja ko nb pl pt_BR ro ru sv ta tr zh_CN zh_TW -GETTEXT_FILES = pg_config.c ../../port/exec.c +GETTEXT_FILES = pg_config.c ../../common/exec.c diff --git a/src/bin/pg_ctl/nls.mk b/src/bin/pg_ctl/nls.mk index 51a21a6c47..187df40883 100644 --- a/src/bin/pg_ctl/nls.mk +++ b/src/bin/pg_ctl/nls.mk @@ -1,4 +1,4 @@ # src/bin/pg_ctl/nls.mk CATALOG_NAME = pg_ctl AVAIL_LANGUAGES = cs de es fr it ja pl pt_BR ru sv zh_CN zh_TW -GETTEXT_FILES = pg_ctl.c ../../common/fe_memutils.c ../../port/exec.c ../../port/wait_error.c +GETTEXT_FILES = pg_ctl.c ../../common/exec.c ../../common/fe_memutils.c ../../common/wait_error.c diff --git a/src/bin/pg_dump/nls.mk b/src/bin/pg_dump/nls.mk index 278a0fb5e6..bf40e28eaf 100644 --- a/src/bin/pg_dump/nls.mk +++ b/src/bin/pg_dump/nls.mk @@ -7,7 +7,7 @@ GETTEXT_FILES = pg_backup_archiver.c pg_backup_db.c pg_backup_custom.c \ pg_dump.c common.c pg_dump_sort.c \ pg_restore.c pg_dumpall.c \ parallel.c parallel.h pg_backup_utils.c pg_backup_utils.h \ - ../../common/fe_memutils.c ../../port/exec.c + ../../common/exec.c ../../common/fe_memutils.c GETTEXT_TRIGGERS = write_msg:2 exit_horribly:2 simple_prompt \ ExecuteSqlCommand:3 ahlog:3 warn_or_exit_horribly:3 GETTEXT_FLAGS = \ diff --git a/src/bin/psql/nls.mk b/src/bin/psql/nls.mk index b7c739fb9c..e2505f1774 100644 --- a/src/bin/psql/nls.mk +++ b/src/bin/psql/nls.mk @@ -4,6 +4,6 @@ AVAIL_LANGUAGES = cs de es fr it ja pl pt_BR ru zh_CN zh_TW GETTEXT_FILES = command.c common.c copy.c help.c input.c large_obj.c \ mainloop.c print.c psqlscan.c startup.c describe.c sql_help.h sql_help.c \ tab-complete.c variables.c \ - ../../common/fe_memutils.c ../../port/exec.c ../../port/wait_error.c + ../../common/exec.c ../../common/fe_memutils.c ../../common/wait_error.c GETTEXT_TRIGGERS = N_ psql_error simple_prompt GETTEXT_FLAGS = psql_error:1:c-format diff --git a/src/common/Makefile b/src/common/Makefile index cd97980ce6..c5b98ab27b 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -23,7 +23,7 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -DFRONTEND $(CPPFLAGS) LIBS += $(PTHREAD_LIBS) -OBJS_COMMON = relpath.o +OBJS_COMMON = exec.o relpath.o wait_error.o OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o diff --git a/src/port/exec.c b/src/common/exec.c similarity index 99% rename from src/port/exec.c rename to src/common/exec.c index 01203c056c..527b3af8da 100644 --- a/src/port/exec.c +++ b/src/common/exec.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * src/port/exec.c + * src/common/exec.c * *------------------------------------------------------------------------- */ diff --git a/src/port/wait_error.c b/src/common/wait_error.c similarity index 98% rename from src/port/wait_error.c rename to src/common/wait_error.c index b75710f86a..db0ebdaf18 100644 --- a/src/port/wait_error.c +++ b/src/common/wait_error.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * src/port/wait_error.c + * src/common/wait_error.c * *------------------------------------------------------------------------- */ diff --git a/src/port/Makefile b/src/port/Makefile index a032acca1c..1be4ff57a2 100644 --- a/src/port/Makefile +++ b/src/port/Makefile @@ -30,11 +30,10 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS) LIBS += $(PTHREAD_LIBS) -OBJS = $(LIBOBJS) chklocale.o dirmod.o erand48.o exec.o fls.o inet_net_ntop.o \ +OBJS = $(LIBOBJS) chklocale.o dirmod.o erand48.o fls.o inet_net_ntop.o \ noblock.o path.o pgcheckdir.o pg_crc.o pgmkdirp.o pgsleep.o \ pgstrcasecmp.o pqsignal.o \ - qsort.o qsort_arg.o quotes.o sprompt.o tar.o thread.o \ - wait_error.o + qsort.o qsort_arg.o quotes.o sprompt.o tar.o thread.o # foo_srv.o and foo.o are both built from foo.c, but only foo.o has -DFRONTEND OBJS_SRV = $(OBJS:%.o=%_srv.o) diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 264c5307fb..54314a281f 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -67,14 +67,14 @@ sub mkvcbuild our @pgportfiles = qw( asprintf.c chklocale.c crypt.c fls.c fseeko.c getrusage.c inet_aton.c random.c srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c - erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c exec.c noblock.c path.c + erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c noblock.c path.c pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c pqsignal.c qsort.c qsort_arg.c quotes.c - sprompt.c tar.c thread.c wait_error.c getopt.c getopt_long.c dirent.c rint.c win32env.c + sprompt.c tar.c thread.c getopt.c getopt_long.c dirent.c rint.c win32env.c win32error.c win32setlocale.c); our @pgcommonallfiles = qw( - relpath.c); + exec.c relpath.c wait_error.c); our @pgcommonfrontendfiles = (@pgcommonallfiles, qw(fe_memutils.c)); -- 2.40.0