Permalink
Browse files

Update library search code to use only tokens that start with "-L"

  • Loading branch information...
1 parent fc14052 commit b65f585f55365f9deef8affa59a3d9aff1556d40 @staticfloat staticfloat committed with StefanKarpinski Jul 16, 2012
View
9 contrib/filterArgs.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Loop over all command line arguments
+for i in "$@"; do
+ # If an argument starts with -L, echo it out sans -L!
+ if [[ $i == -L* ]]; then
+ echo "\"${i:2:${#i}}\""
+ fi
+done
View
2 contrib/repackage_system_suitesparse3.make
@@ -10,7 +10,7 @@ default:
mkdir -p $(JULIAHOME)/deps/SuiteSparse-SYSTEM/lib
cd $(JULIAHOME)/deps/SuiteSparse-SYSTEM/lib && \
rm -f *.a && \
- cp -f `find /lib /usr/lib /usr/local/lib $(subst -L,,$(LDFLAGS)) -name libamd.a -o -name libcolamd.a -o -name libcholmod.a -o -name libumfpack.a 2>/dev/null` . && \
+ cp -f $(shell find /lib /usr/lib /usr/local/lib $(shell eval $(JULIAHOME)/contrib/filterArgs.sh $(LDFLAGS)) -name libamd.a -o -name libcolamd.a -o -name libcholmod.a -o -name libumfpack.a 2>/dev/null) . && \
$(CC) -shared $(WHOLE_ARCHIVE) libamd.a $(NO_WHOLE_ARCHIVE) -o $(USRLIB)/libamd.$(SHLIB_EXT) && \
$(INSTALL_NAME_CMD)libamd.$(SHLIB_EXT) $(USRLIB)/libamd.$(SHLIB_EXT) && \
$(CC) -shared $(WHOLE_ARCHIVE) libcolamd.a $(NO_WHOLE_ARCHIVE) -o $(USRLIB)/libcolamd.$(SHLIB_EXT) && \
View
2 contrib/repackage_system_suitesparse4.make
@@ -10,7 +10,7 @@ default:
mkdir -p $(JULIAHOME)/deps/SuiteSparse-SYSTEM/lib
cd $(JULIAHOME)/deps/SuiteSparse-SYSTEM/lib && \
rm -f *.a && \
- cp -f `find /lib /usr/lib /usr/local/lib $(subst -L,,$(LDFLAGS)) -name libamd.a -o -name libcolamd.a -o -name libcholmod.a -o -name libumfpack.a -o -name libsuitesparseconfig.a 2>/dev/null` . && \
+ cp -f $(shell find /lib /usr/lib /usr/local/lib $(shell eval $(JULIAHOME)/contrib/filterArgs.sh $(LDFLAGS)) -name libamd.a -o -name libcolamd.a -o -name libcholmod.a -o -name libumfpack.a -o -name libsuitesparseconfig.a 2>/dev/null) . && \
$(CC) -shared $(WHOLE_ARCHIVE) libamd.a $(NO_WHOLE_ARCHIVE) -o $(USRLIB)/libamd.$(SHLIB_EXT) && \
$(INSTALL_NAME_CMD)libamd.$(SHLIB_EXT) $(USRLIB)/libamd.$(SHLIB_EXT) && \
$(CC) -shared $(WHOLE_ARCHIVE) libcolamd.a $(NO_WHOLE_ARCHIVE) -o $(USRLIB)/libcolamd.$(SHLIB_EXT) && \

0 comments on commit b65f585

Please sign in to comment.