build: filter out relative directory entries from $PATH
authorFelix Fietkau <nbd@openwrt.org>
Sun, 3 Jan 2016 23:13:03 +0000 (23:13 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 3 Jan 2016 23:13:03 +0000 (23:13 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 48107

include/toplevel.mk

index c8f342b48fc4e0476312d993060172fa7e52de57..0b5ac2686fd76e9a3298a4619079905e46f7cb09 100644 (file)
@@ -39,6 +39,13 @@ unexport LPATH
 # make sure that a predefined CFLAGS variable does not disturb packages
 export CFLAGS=
 
+empty:=
+space:= $(empty) $(empty)
+path:=$(subst :,$(space),$(PATH))
+path:=$(filter-out .%,$(path))
+path:=$(subst $(space),:,$(path))
+export PATH:=$(path)
+
 unexport TAR_OPTIONS
 
 ifneq ($(shell $(HOSTCC) 2>&1 | grep clang),)