Fix old mac (single-arch) build.
authorCarl Hetherington <cth@carlh.net>
Fri, 16 Jul 2021 10:35:43 +0000 (12:35 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 24 Jul 2021 20:35:59 +0000 (22:35 +0200)
platform/osx/make_dmg.sh

index aefa94e2cdbbe50dc2c3f01e45979ca796f971dd..a48b1e6aeb299b143668ff1f3932624a2af8461f 100644 (file)
@@ -84,19 +84,25 @@ function copy_lib_root {
 }
 
 function copy_lib_env {
-       for f in $ENV/$ARCH2/lib/$1*.dylib; do
-               if [ -h $f ]; then
-                       ln -s $(readlink $f) "$2/`basename $f`"
-               else
-                       if [ "$ARCH2" == "" ]; then
+       if [ "$ARCH2" == "" ]; then
+               for f in $ENV/$ARCH1/lib/$1*.dylib; do
+                       if [ -h $f ]; then
+                               ln -s $(readlink $f) "$2/`basename $f`"
+                       else
                                cp $f "$2/`basename $f`"
+                       fi
+               done
+       else
+               for f in $ENV/$ARCH2/lib/$1*.dylib; do
+                       if [ -h $f ]; then
+                               ln -s $(readlink $f) "$2/`basename $f`"
                        else
                                g=`echo $f | sed -e "s@/$ARCH2/@/$ARCH1/@g"`
                                mkdir -p "$2"
                                lipo -create $f $g -output "$2/$(basename $f)"
                        fi
-               fi
-       done
+               done
+       fi
     to_relink="$to_relink|$1"
 }