In general, the variable LN_S is 'ln -s', however, LN_S changes to 'cp
-pR' if configure finds the file system does not support symbolic
links.

I was playing with 'ln' for some other reason where I symbolic linked
it to '/bin/false'. That revealed the failure for
src/backend/Makefile. Greping for 'ln -s' revealed three places it's
used. Attaching the patch to fix the same.
From 60b3374de1e4d0fd143c2a7b3bf78893e32579af Mon Sep 17 00:00:00 2001
From: Ashwin Agrawal <aagra...@pivotal.io>
Date: Fri, 14 Feb 2020 16:16:37 -0800
Subject: [PATCH v1] Use LN_S instead of "ln -s" in Makefile

---
 src/backend/Makefile              | 2 +-
 src/interfaces/ecpg/test/Makefile | 2 +-
 src/makefiles/pgxs.mk             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/Makefile b/src/backend/Makefile
index 9706a95848..f21a454286 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -224,7 +224,7 @@ install-bin: postgres $(POSTGRES_IMP) installdirs
 	$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
 ifneq ($(PORTNAME), win32)
 	@rm -f '$(DESTDIR)$(bindir)/postmaster$(X)'
-	ln -s postgres$(X) '$(DESTDIR)$(bindir)/postmaster$(X)'
+	$(LN_S) postgres$(X) '$(DESTDIR)$(bindir)/postmaster$(X)'
 else
 	$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postmaster$(X)'
 endif
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index be53b7b94d..11d55bde3e 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -73,7 +73,7 @@ remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_
 
 all: $(remaining_files_build)
 $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
-	ln -s $< $@
+	$(LN_S) $< $@
 endif
 
 # Common options for tests. Also pick up anything passed in EXTRA_REGRESS_OPTS
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 271e7eaba8..8c7d126593 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -397,7 +397,7 @@ test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)
 all: $(test_files_build)
 $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
 	$(MKDIR_P) $(dir $@)
-	ln -s $< $@
+	$(LN_S) $< $@
 endif # VPATH
 endif # REGRESS
 
-- 
2.25.0

Reply via email to