简体   繁体   English

适用于iOS的leptonica 1.69交叉编译(armv7,armv7s和arm64)

[英]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. 但以某种方式c​​pp无法正常工作。 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.

相关问题 如果仅针对armv7和armv7s编译应用程序,则在arm64设备上运行时会使用什么大小的数据类型? - If app is compiled only for armv7 and armv7s, what size data types does it use when running on an arm64 device? 在构建用于多种架构(x86_64,armv7,armv7s,arm64,i386)的C ++共享库时面临的问题 - Facing issues in building a C++ shared library for multiple architectures (x86_64, armv7, armv7s, arm64, i386) 适用于ARMv7 / ARMv7s的Lua - Lua for ARMv7/ARMv7s xcode体系结构宏,用于检测arm64或armv7 - xcode architectures macro for detecting arm64 or armv7 我可以在BlackBerry 10中使用Xcode编译的armv7 / armv7s .so库吗? - Can I use Xcode compiled armv7/armv7s .so library in BlackBerry 10? 架构armv7s的未定义符号:iPhoneExtAudioFileConvertTest - Undefined symbols for architecture armv7s: iPhoneExtAudioFileConvertTest ffmpeg armv7s编译分段错误 - ffmpeg armv7s compile segmentation fault 从iOS示例项目导入cpp文件时找不到架构armv7的符号 - symbol(s) not found for architecture armv7 when importing cpp file from iOS Sample Project ARMv7 NEON:将 32 位掩码解包为 64 位掩码 - ARMv7 NEON: Unpack 32 bit mask to 64 bit mask ld:找不到体系结构armv7的符号-使用库? - ld: symbol(s) not found for architecture armv7 - Using a library?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM