diff mbox series

[OpenWrt-Devel,3/6] tools: Fix unintended lib link in $(STAGING_DIR_HOST)/lib

Message ID 20190614183534.14768-3-jeffery.to@gmail.com
State Superseded
Delegated to: Petr Štetiar
Headers show
Series [OpenWrt-Devel,1/6] build: Add auto file tracking / uninstall for Host/Install | expand

Commit Message

Jeffery To June 14, 2019, 6:35 p.m. UTC
Currently, if the $(STAGING_DIR_HOST)/lib64 link already exists, ln (in
tools/prepare) will interpret $(STAGING_DIR_HOST)/lib64 as a directory
rather than a link name.

The result is a symbolic link named "lib" inside
$(STAGING_DIR_HOST)/lib, pointing to itself.

This adds the -n option to ln so that $(STAGING_DIR_HOST)/lib64 is
treated as a link name.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/tools/Makefile b/tools/Makefile
index d7207ba89d..f3d8debe23 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -138,7 +138,7 @@  $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
 	mkdir -p $(BUILD_DIR_HOST)/stamp $(STAGING_DIR_HOST)/include/sys
 	$(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/
 	$(INSTALL_DATA) $(TOPDIR)/tools/include/sys/*.h $(STAGING_DIR_HOST)/include/sys/
-	ln -sf lib $(STAGING_DIR_HOST)/lib64
+	ln -snf lib $(STAGING_DIR_HOST)/lib64
 	touch $@