diff options
author | Tony Theodore <tonyt@logyst.com> | 2017-07-23 13:22:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-23 13:22:14 (GMT) |
commit | 2d788ef0149da2cb2ba5f5e463a803f58d59d8ad (patch) | |
tree | 7041e5ae53656553684cf0b16d884369b71a1296 | |
parent | 2175d9a8f7920dcb2252362e4ec6bf34de2c3d01 (diff) | |
parent | be2e33c9d4bfec190eea3b996579e551c1bf906f (diff) | |
download | mxe-2d788ef0149da2cb2ba5f5e463a803f58d59d8ad.zip mxe-2d788ef0149da2cb2ba5f5e463a803f58d59d8ad.tar.gz mxe-2d788ef0149da2cb2ba5f5e463a803f58d59d8ad.tar.bz2 |
Merge pull request #1836 from Lord-Kamina/master
Fixes for copydlldeps.sh under macOS.
-rwxr-xr-x | tools/copydlldeps.sh | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/tools/copydlldeps.sh b/tools/copydlldeps.sh index e97435d..8ead4a3 100755 --- a/tools/copydlldeps.sh +++ b/tools/copydlldeps.sh @@ -221,20 +221,26 @@ if [ ! -z "$excludepattern" ]; then excludePattern+=" ! -path *$( echo "$curString" | tr -d ' ' )* " done fi -if [ "$loglevel" -gt 1]; then +if [ "$loglevel" -gt 1 ]; then echo "\$excluePattern: $excludePattern" fi str_inputFileList="" if [ "$indir" ]; then for curPath in $( echo "${indir}" | tr -s ' ' | tr ' ' '\n' ); do - curList=$( find $curPath -iregex '.*\(dll\|exe\)' | tr '\n' ' ' ) + if [ `uname -s` == "Darwin" ]; then + curList=$( find $curPath -iname *.exe -or -iname *.dll | tr '\n' ' ' ) + else curList=$( find $curPath -iregex '.*\(dll\|exe\)' | tr '\n' ' ' ) + fi str_inputFileList+=" $curList" done fi if [ "$infile" ]; then for curFile in $( echo "${infile}" | tr -s ' ' | tr ' ' '\n' ); do - curString=$( find $curFile -iregex '.*\(dll\|exe\)' | tr '\n' ' ' ) + if [ `uname -s` == "Darwin" ]; then + curString=$( find $curPath -iname *.exe -or -iname *.dll | tr '\n' ' ' ) + else curString=$( find $curPath -iregex '.*\(dll\|exe\)' | tr '\n' ' ' ) + fi str_inputFileList+=" $curString" done fi @@ -352,14 +358,20 @@ process_enforced_deps(){ # if we would do this file recursively, we should loop to find those and append them all to the list str_srcDirList+=" $enforcedDirectory" # now we search for the dll and exe files to be included - string=$( find $enforcedDirectory -maxdepth 1 -iregex '.*\(dll\|exe\)' | tr '\n' ' ' ) + if [ `uname -s` == "Darwin" ]; then + string=$( find $enforcedDirectory -maxdepth 1 -iname *.exe -or -iname *.dll | tr '\n' ' ' ) + else string=$( find $enforcedDirectory -maxdepth 1 -iregex '.*\(dll\|exe\)' | tr '\n' ' ' ) + fi if [ "$loglevel" -gt 1 ]; then echo "enforcedDirectory=$enforcedDirectory" echo "we found dlls and exes:$string" sleep 4 fi # we hard copy it to DEST - cp -dpRxv "${enforcedDirectory}" "$destdir" + if [ `uname -s` == "Darwin" ]; then + cp -av "${enforcedDirectory}" "$destdir" + else cp -dpRxv "${enforcedDirectory}" "$destdir" + fi } # beginning of the main function @@ -414,7 +426,11 @@ for dll in $( echo $alldeps | tr '\n' ' ' ); do if [ -e "${curFolder}/${curDll}" ]; then counter=$( expr $counter + 1 ) if [ $opmode == "copy" ]; then - cp -dpRxv "${curFolder}/${curDll}" "$destdir" + if [ `uname -s` == "Darwin" ]; then + cp -av "${curFolder}/${curDll}" "$destdir" + else cp -dpRxv "${curFolder}/${curDll}" "$destdir" + fi + elif [ $opmode == "print" ]; then echo "found $dll in: ${curFolder}/${curDll}" else |