From adcd16c3c304b6cefdb168adb5c9710dc1895705 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Wed, 8 Dec 2021 15:19:40 +0000
Subject: [PATCH] RF: Also need to drop -L flags that are set in environment,
 in addition to -rpath flags

---
 config/buildSettings.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/config/buildSettings.mk b/config/buildSettings.mk
index 2bff6c1..5257812 100644
--- a/config/buildSettings.mk
+++ b/config/buildSettings.mk
@@ -98,6 +98,13 @@ COMMA    := ,
 _LDFLAGS := $(patsubst -Wl${COMMA}-rpath%,,${LDFLAGS})
 LDFLAGS   = ${_LDFLAGS}
 
+# Also drop -L options from LDFLAGS if set in the
+# environment, as we want to set our own
+# precedence rules as above ($FSLDEVDIR > $FSLDIR)
+# - this is done in vars.mk
+_LDFLAGS := $(patsubst -L%,,${_LDFLAGS})
+LDFLAGS   = ${_LDFLAGS}
+
 ifeq ($(SYSTYPE), Darwin)
 
   # CC, CXX, CFLAGS, CXXFLAGS, and LDFLAGS
-- 
GitLab