diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-01-16 15:56:32 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-01-16 15:58:55 -0500 |
| commit | e6afa8918c461c1dd80c5063a950518fa4e950cd (patch) | |
| tree | 00a11500527f8b29966fd441de6dee8449b5bc97 /src/bin/initdb/Makefile | |
| parent | 2eb34ac369741c110b593e2dc2195c57d29ab8e8 (diff) | |
Move wchar.c and encnames.c to src/common/.
Formerly, various frontend directories symlinked these two sources
and then built them locally. That's an ancient, ugly hack, and
we now have a much better way: put them into libpgcommon.
So do that. (The immediate motivation for this is the prospect
of having to introduce still more symlinking if we don't.)
This commit moves these two files absolutely verbatim, for ease of
reviewing the git history. There's some follow-on work to be done
that will modify them a bit.
Robert Haas, Tom Lane
Discussion: https://postgr.es/m/CA+TgmoYO8oq-iy8E02rD8eX25T-9SmyxKWqqks5OMHxKvGXpXQ@mail.gmail.com
Diffstat (limited to 'src/bin/initdb/Makefile')
| -rw-r--r-- | src/bin/initdb/Makefile | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile index f587a8675db..7e237547808 100644 --- a/src/bin/initdb/Makefile +++ b/src/bin/initdb/Makefile @@ -18,7 +18,12 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) -I$(top_srcdir)/src/timezone $(CPPFLAGS) -# note: we need libpq only because fe_utils does +# Note: it's important that we link to encnames.o from libpgcommon, not +# from libpq, else we have risks of version skew if we run with a libpq +# shared library from a different PG version. The libpq_pgport macro +# should ensure that that happens. +# +# We need libpq only because fe_utils does. LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport) # use system timezone data? @@ -28,7 +33,6 @@ endif OBJS = \ $(WIN32RES) \ - encnames.o \ findtimezone.o \ initdb.o \ localtime.o @@ -38,15 +42,7 @@ all: initdb initdb: $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) -# We used to pull in all of libpq to get encnames.c, but that -# exposes us to risks of version skew if we link to a shared library. -# Do it the hard way, instead, so that we're statically linked. - -encnames.c: % : $(top_srcdir)/src/backend/utils/mb/% - rm -f $@ && $(LN_S) $< . - -# Likewise, pull in localtime.c from src/timezones - +# We must pull in localtime.c from src/timezones localtime.c: % : $(top_srcdir)/src/timezone/% rm -f $@ && $(LN_S) $< . @@ -60,7 +56,7 @@ uninstall: rm -f '$(DESTDIR)$(bindir)/initdb$(X)' clean distclean maintainer-clean: - rm -f initdb$(X) $(OBJS) encnames.c localtime.c + rm -f initdb$(X) $(OBJS) localtime.c rm -rf tmp_check # ensure that changes in datadir propagate into object file |
