Skip to content

Commit c261706

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 7c29764 commit c261706

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
@@ -62,12 +62,18 @@ ifneq (,$(PGAPPICON))
6262
PGICOSTR = $(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
6363
endif
6464

65+
# We do not install src/port/win32ver.rc, its content being specific to
66+
# PostgreSQL Global Development Group software. Any module can ship a
67+
# win32ver.rc or furnish a rule for generating one. Set $(PGFILEDESC) to
68+
# signal win32ver.rc availability to the dll build rule below.
69+
ifndef PGXS
6570
win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
6671
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*//'`';' $< >$@
72+
endif
6773

6874
win32ver.o: win32ver.rc
6975
$(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)
7076

7177
# Rule for building a shared library from a single .o file
72-
%.dll: %.o $(WIN32RES)
78+
%.dll: %.o $(if $(PGFILEDESC),$(WIN32RES))
7379
$(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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy