[英]leptonica 1.69 crosscompile for iOS (armv7, armv7s and arm64)
I try to cross compile leptonica 1.69 for armv7, armv7s and arm64. 我尝试为armv7,armv7s和arm64交叉编译leptonica 1.69。
For simulator (i386, x86_64) I use these settings and it works fine: 对于模拟器(i386,x86_64),我使用以下设置,并且可以正常运行:
export IOS_BASE_SDK="7.1"
export IOS_DEPLOY_TGT="6.1"
export TOOLCHAIN=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
export DEVROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator$IOS_BASE_SDK.sdk
export CFLAGS="-arch x86_64 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=$IOS_DEPLOY_TGT -I$SDKROOT/usr/include/"
export CPP=$TOOLCHAIN/usr/bin/cpp
export CXX=$TOOLCHAIN/usr/bin/c++
export CXXCPP=$TOOLCHAIN/usr/bin/cpp
export CC=$TOOLCHAIN/usr/bin/cc
export LD=$TOOLCHAIN/usr/bin/ld
export AR=$TOOLCHAIN/usr/bin/ar
export AS=$TOOLCHAIN/usr/bin/as
export NM=$TOOLCHAIN/usr/bin/nm
export RANLIB=$TOOLCHAIN/usr/bin/ranlib
export LDFLAGS="-L$SDKROOT/usr/lib/"
export CPPFLAGS="-no-cpp-precomp -I$SDKROOT/usr/include/"
export CXXFLAGS=$CFLAGS
And then call configure 然后调用configure
./configure --enable-shared=no --disable-programs --without-zlib --without-libpng --without-jpeg --without-giflib --without-libtiff --libdir=$PWD/lib/nodebug
Now to build it for arm I tried to use these settings: (adding -arch to CFLAGS and CPPFLAGS, setting the SDK root and adding --host=x86_64) 现在,为手臂构建它,我尝试使用以下设置:(将-arch添加到CFLAGS和CPPFLAGS,设置SDK根目录并添加--host = x86_64)
export DEVROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS$IOS_BASE_SDK.sdk
export CFLAGS="-arch armv7 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=$IOS_DEPLOY_TGT -I$SDKROOT/usr/include/"
export CPPFLAGS="-arch armv7 -no-cpp-precomp -I$SDKROOT/usr/include/"
./configure --host=x86_64 --enable-shared=no --disable-programs --without-zlib --without-libpng --without-jpeg --without-giflib --without-libtiff --libdir=$PWD/lib/nodebug
but somehow the cpp does not work. 但以某种方式cpp无法正常工作。 The config logs says the following:
配置日志显示以下内容:
configure:5841: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cpp -arch armv7 -no-cpp-precomp -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include/ conftest.c
clang: error: no input files
Anyone any ideas what's wrong? 任何人有什么想法吗? Or any idea how to debug this further?
或有任何想法如何进一步调试吗?
It seems that something with my paths to the compiler, preprocessors etc was wrong. 看来我的编译器,预处理器等路径出错了。 Using just the default ones in the path works.
仅在路径中使用默认值即可。 So removing the following part solved my issue:
因此,删除以下部分解决了我的问题:
export CPP=$TOOLCHAIN/usr/bin/cpp
export CXX=$TOOLCHAIN/usr/bin/c++
export CXXCPP=$TOOLCHAIN/usr/bin/cpp
export CC=$TOOLCHAIN/usr/bin/cc
export LD=$TOOLCHAIN/usr/bin/ld
export AR=$TOOLCHAIN/usr/bin/ar
export AS=$TOOLCHAIN/usr/bin/as
export NM=$TOOLCHAIN/usr/bin/nm
export RANLIB=$TOOLCHAIN/usr/bin/ranlib
export LDFLAGS="-L$SDKROOT/usr/lib/"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.