inplace: Don't add empty component to LD_LIBRARY_PATH when it is empty
authorReid Barton <rwbarton@gmail.com>
Mon, 12 Jan 2015 15:56:58 +0000 (10:56 -0500)
committerReid Barton <rwbarton@gmail.com>
Mon, 12 Jan 2015 15:56:58 +0000 (10:56 -0500)
Summary: Avoids a confusing inconsistency when testing #9386 (about ghci finding .so files in .).

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D593

GHC Trac Issues: #9386

rules/library-path.mk

index 5dd5588..dbfd4be 100644 (file)
@@ -14,8 +14,8 @@
 ifeq "$(TargetOS_CPP)" "mingw32"
 prependLibraryPath = $(error Do not know how to prependLibraryPath on Windows)
 else ifeq "$(TargetOS_CPP)" "darwin"
-prependLibraryPath = export DYLD_LIBRARY_PATH="$1:$$DYLD_LIBRARY_PATH"
+prependLibraryPath = export DYLD_LIBRARY_PATH="$1$${DYLD_LIBRARY_PATH:+:$$DYLD_LIBRARY_PATH}"
 else
-prependLibraryPath = export LD_LIBRARY_PATH="$1:$$LD_LIBRARY_PATH"
+prependLibraryPath = export LD_LIBRARY_PATH="$1$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}"
 endif