我使用以下构建脚本
https://gist.github.com/felix-schwarz/c61c0f7d9ab60f53ebb0
为tvOS构建libcrypto和libssl。我安装了Xcode 7.1 beta(7B75)。我更新了这行
DEVELOPER=`xcode-select -print-path`
引用Xcode-beta.app中的Developer文件夹。当我运行脚本时,它无法构建tvOS库。当我检查/tmp/....log文件时,它首先告诉我-mtvos-min-version = 9.0是一个未知选项。当我从构建脚本中删除该选项时,
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} !" "Makefile"
变为
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"
它确实继续创建所有目标文件,但是当它试图创建库时我得到了这个错误:
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f ../Makefile.shared -e \
APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o" \
LIBDEPS="-Wl,-search_paths_first $LIBRARIES " \
link_app.${shlib_target}
( :; LIBDEPS="${LIBDEPS:--Wl,-search_paths_first -L.. -lssl -L.. -lcrypto }"; LDCMD="${LDCMD:-/Applications/Xcode-beta.app/Contents/Developer/usr/bin/gcc -fembed-bitcode -arch arm64}"; LDFLAGS="${LDFLAGS:--isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -fomit-frame-pointer -fno-common}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o ${LIBDEPS} )
clang: error: -fembed-bitcode is not supported on versions of iOS prior to 6.0
make[2]: *** [link_app.] Error 1
make[1]: *** [openssl] Error 2
make: *** [build_apps] Error 1
知道我做错了吗?
答案 0 :(得分:1)
仍然从Xcode 7.0调用make可执行文件,而不是Xcode 7.1 beta。我通过将Xcode-beta.app重命名为Xcode.app来解决它。然后,当我运行脚本时,它工作了!