Closing in on correct parameters.

This commit is contained in:
David Dawes
2018-06-16 13:38:33 -07:00
parent 238baa0995
commit c2d0ef72e8

View File

@@ -1,15 +1,18 @@
#!/bin/sh #!/bin/sh
KMD_DIR=kmd/mac/verus-cli KMD_DIR=kmd/mac/verus-cli
binaries=("komodo-cli" "komodod") binaries=("komodo-cli" "komodod")
alllibs=() alllibs=()
for binary in "${binaries[@]}"; for binary in "${binaries[@]}";
do do
# find the dylibs to copy for komodod # do the work in the destination directory
DYLIBS=`otool -L src/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` cp src/$binary $KMD_DIR
# find the dylibs to copy for komodod
DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'`
echo "copying $DYLIBS to $KMD_DIR" echo "copying $DYLIBS to $KMD_DIR"
# copy the dylibs to the srcdir # copy the dylibs to the srcdir
for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done
done done
libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib") libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib")
@@ -20,9 +23,9 @@ do
chmod 755 $KMD_DIR/$binary chmod 755 $KMD_DIR/$binary
# find the dylibs to copy for komodod # find the dylibs to copy for komodod
DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'`
echo "copying indirect $DYLIBS to $KMD_DIR" echo "copying $DYLIBS to $KMD_DIR"
# copy the dylibs to the srcdir # copy the dylibs to the srcdir
for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); done
done done
indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib")
@@ -33,20 +36,23 @@ do
chmod 755 src/$binary chmod 755 src/$binary
# find the dylibs to copy for komodod # find the dylibs to copy for komodod
DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'`
echo "copying $DYLIBS to $KMD_DIR" echo "copying indirect $DYLIBS to $KMD_DIR"
# copy the dylibs to the srcdir # copy the dylibs to the dest dir
for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=(i$dylib); done
done done
for binary in "${binaries[@]}"; for binary in "${binaries[@]}";
do do
# modify komodod to point to dylibs # modify komodod to point to dylibs
echo "modifying $binary to use local libraries" echo "modifying $binary to use local libraries"
for dylib in "${allibs[@]}"; i=0
for dylib in "${alllibs[@]}"
do do
echo "Next lib is $dylib " let i=i+1
install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary; echo "Next lib is $dylib "
done;
install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary
done
chmod +x $KMD_DIR/$binary chmod +x $KMD_DIR/$binary
done done