Skip to content

Commit 5844565

Browse files
committed
Fix make build on MinGW
Revert a couple of the simplifications done in commit 721856f because platforms without ln -s, where LN_S='cp -pR', such as MinGW, required the specific previous incantations. Reported-by: Noah Misch <noah@leadboat.com> Discussion: https://www.postgresql.org/message-id/20240616193448.28@rfd.leadboat.com
1 parent 02bbc3c commit 5844565

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/backend/Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,24 @@ submake-utils-headers:
133133
# Make symlinks for these headers in the include directory. That way
134134
# we can cut down on the -I options. Also, a symlink is automatically
135135
# up to date when we update the base file.
136+
#
137+
# The point of the prereqdir incantation in some of the rules below is to
138+
# force the symlink to use an absolute path rather than a relative path.
139+
# This is needed to support platforms without ln -s.
136140

137141
.PHONY: generated-headers
138142

139143
generated-headers: $(top_builddir)/src/include/storage/lwlocknames.h $(top_builddir)/src/include/utils/wait_event_types.h submake-catalog-headers submake-nodes-headers submake-utils-headers parser/gram.h
140144

141145
$(top_builddir)/src/include/storage/lwlocknames.h: storage/lmgr/lwlocknames.h
142-
rm -f '$@'
143-
$(LN_S) ../../backend/$< '$@'
146+
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
147+
cd '$(dir $@)' && rm -f $(notdir $@) && \
148+
$(LN_S) "$$prereqdir/$(notdir $<)" .
144149

145150
$(top_builddir)/src/include/utils/wait_event_types.h: utils/activity/wait_event_types.h
146-
rm -f '$@'
147-
$(LN_S) ../../backend/$< '$@'
151+
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
152+
cd '$(dir $@)' && rm -f $(notdir $@) && \
153+
$(LN_S) "$$prereqdir/$(notdir $<)" .
148154

149155
utils/probes.o: utils/probes.d $(SUBDIROBJS)
150156
$(DTRACE) $(DTRACEFLAGS) -C -G -s $(call expand_subsys,$^) -o $@

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