@@ -24,15 +24,22 @@ set -e
2424THIS_DIR=$( DIRNAME=$( dirname " $0 " ) ; cd " $DIRNAME " ; pwd)
2525cd " $THIS_DIR "
2626
27- if [ " $MR_ARCH " = " x86_64" ]; then
28- compiler=" darwin64-x86_64-cc"
29- elif [ " $MR_ARCH " = " arm64" ]; then
30- compiler=" darwin64-arm64-cc"
27+
28+ export CROSS_TOP=" $XCRUN_SDK_PLATFORM_PATH /Developer"
29+ export CROSS_SDK=$( basename " $MR_SYS_ROOT " )
30+
31+ if [[ " $MR_PLAT " == " ios" || " $MR_PLAT " == " tvos" ]]; then
32+ compiler=" iphoneos-cross"
3133else
32- echo " unknown architecture $FF_ARCH " ;
33- exit 1
34+ if [[ " $MR_ARCH " == " x86_64" ]]; then
35+ compiler=" darwin64-x86_64-cc"
36+ else
37+ compiler=" darwin64-arm64-cc"
38+ fi
3439fi
3540
41+ echo " CROSS_TOP:$CROSS_TOP "
42+ echo " CROSS_SDK:$CROSS_SDK "
3643# no-hw no-asm
3744
3845CFG_FLAGS=" no-shared no-engine no-dynamic-engine no-static-engine \
@@ -51,11 +58,11 @@ CFG_FLAGS="$CFG_FLAGS $compiler"
5158C_FLAGS=" $MR_DEFAULT_CFLAGS "
5259
5360# for cross compile
54- if [[ $( uname -m) != " $MR_ARCH " || " $MR_FORCE_CROSS " ]]; then
55- echo " [*] cross compile, on $( uname -m) compile $MR_PLAT $MR_ARCH ."
56- # https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
57- CFLAGS=" $CFLAGS -isysroot $MR_SYS_ROOT "
58- fi
61+ # if [[ $(uname -m) != "$MR_ARCH" || "$MR_FORCE_CROSS" ]];then
62+ # echo "[*] cross compile, on $(uname -m) compile $MR_PLAT $MR_ARCH."
63+ # # https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
64+ # CFLAGS="$CFLAGS -isysroot $MR_SYS_ROOT"
65+ # fi
5966
6067cd $MR_BUILD_SOURCE
6168if [ -f " ./Makefile" ]; then
6976 echo " Openssl CFG: $CFG_FLAGS "
7077 echo " ----------------------"
7178
72- export C_FLAGS=" $C_FLAGS "
73- export CXXFLAG=" $C_FLAGS "
79+ export CFLAGS=" $C_FLAGS "
80+ export CXXFLAGS=" $C_FLAGS "
81+ export LDFLAGS=" $C_FLAGS "
7482 export CC=" $MR_CC "
83+
7584 ./Configure $CFG_FLAGS
7685fi
7786
0 commit comments