Skip to content

Commit 2fcedad

Browse files
committed
Link $(WIN32RES) into single-file modules only when PGFILEDESC is set.
Commit 0ffc201 included this object unconditionally. Being unprepared for that, most external, single-file modules failed to build. This better aligns the GNU make build system with the heuristic in the MSVC build's Project::AddDirResourceFile(). In-tree, installed modules set PGFILEDESC, so they will see no change. Also, under PGXS, omit the nonfunctioning rule to build win32ver.rc. Back-patch to 9.5, where the aforementioned commit first appeared.
1 parent 94a8b45 commit 2fcedad

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/makefiles/Makefile.win32

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@ ifneq (,$(PGAPPICON))
6868
PGICOSTR = $(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
6969
endif
7070

71+
# We do not install src/port/win32ver.rc, its content being specific to
72+
# PostgreSQL Global Development Group software. Any module can ship a
73+
# win32ver.rc or furnish a rule for generating one. Set $(PGFILEDESC) to
74+
# signal win32ver.rc availability to the dll build rule below.
75+
ifndef PGXS
7176
win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
7277
sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $< >$@
78+
endif
7379

7480
win32ver.o: win32ver.rc
7581
$(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)
7682

7783
# Rule for building a shared library from a single .o file
78-
%.dll: %.o $(WIN32RES)
84+
%.dll: %.o $(if $(PGFILEDESC),$(WIN32RES))
7985
$(CC) $(CFLAGS) -shared -static-libgcc -o $@ $^ -Wl,--export-all-symbols $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)

src/makefiles/pgxs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ endif # MODULE_big
202202

203203
clean:
204204
ifdef MODULES
205-
rm -f $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .o, $(MODULES)) $(WIN32RES)
205+
rm -f $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .o, $(MODULES)) $(if $(PGFILEDESC),$(WIN32RES))
206206
endif
207207
ifdef DATA_built
208208
rm -f $(DATA_built)

0 commit comments

Comments
 (0)