From 0a7c541ef3d87a2b4276551fd56475cbf591015d Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Fri, 6 Feb 2015 17:54:32 +0100
Subject: [PATCH] Fix for travis

for some reason clang stopped working with LD_LIBRARY_PATH was set to
a blank variable. Now the -rpath stuff is only used when LD_LIBRARY_PATH is set
---
 .travis.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 76de37430..47e0a4714 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,12 +39,15 @@ install:
   - test "$LAPACK" == yes  && sudo apt-get install libatlas-base-dev      || true
   - test "$ALMOST" == yes && ./.travis.install.almost                     || true
   - test "$ALMOST" == yes && ENALMOST="--enable-almost"                 || true
+  - test "$ALMOST" == yes && PLUMED_CPPFLAGS="$INCLUDE -I/usr/local/include -I/usr/local/include/almost"  || true
+# moreover, we hardcode path to dynamic library, required for xdrfile to link properly
+# I do it only when LD_LIBRARY_PATH is non blank, since otherwise clang gives problems
+  - test -n "$LD_LIBRARY_PATH" && PLUMED_LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" || true
 script:
 # we set all the optional modules on
   - touch src/crystallization.on src/manyrestraints.on
 # we have to pass the full path since on travis machines sudo does not have compilers in the path
-# moreover, we hardcode path to dynamic library, required for xdrfile to link properly
-  - ./configure CXX=$(which $PLUMED_CXX) CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" CPPFLAGS="$INCLUDE -I/usr/local/include -I/usr/local/include/almost" $ENALMOST
+  - ./configure CXX=$(which $PLUMED_CXX) CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="$PLUMED_LDFLAGS" CPPFLAGS="$PLUMED_CPPFLAGS" $ENALMOST
   - make -j 2
 # we install plumed so that it is in the path
   - sudo make install
-- 
GitLab