浏览代码

- add sanity check to make sure that LD_LIBRARY_PATH doesn't contain CWD

Bernhard Reutner-Fischer 18 年之前
父节点
当前提交
a1a86ef91f
共有 1 个文件被更改,包括 25 次插入0 次删除
  1. 25 0
      toolchain/dependencies/dependencies.sh

+ 25 - 0
toolchain/dependencies/dependencies.sh

@@ -55,6 +55,31 @@ if test -n "$CXXFLAGS" ; then
 fi;
 echo "CXXFLAGS clean:					Ok"
 
+echo "WORKS" | grep "WORKS" >/dev/null 2>&1
+if test $? != 0 ; then
+	echo "grep works:				FALSE"
+	exit 1
+fi
+
+# sanity check for CWD in LD_LIBRARY_PATH
+# try not to rely on egrep..
+if test -n "$LD_LIBRARY_PATH" ; then
+	/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep ':.:' >/dev/null 2>&1 ||
+	/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep 'TRiGGER_start:' >/dev/null 2>&1 ||
+	/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep ':TRiGGER_end' >/dev/null 2>&1 ||
+	/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep '::' >/dev/null 2>&1
+	if test $? = 0; then
+		echo "LD_LIBRARY_PATH sane:				FALSE"
+		echo "You seem to have the current working directory in your"
+		echo "LD_LIBRARY_PATH environment variable. This doesn't work."
+		exit 1;
+	else
+		echo "LD_LIBRARY_PATH sane:				Ok"
+	fi
+fi;
+
+
+
 #############################################################
 #
 # check build system 'sed'