- iphone/
- 将Apache Portable Runtime交叉编译到iPhone
将Apache Portable Runtime交叉编译到iPhone
将Apache Portable Runtime交叉编译到iPhone,iphone,gcc,iphone-sdk-3.0,autotools,cross-compiling,Iphone,Gcc,Iphone Sdk 3.0,Autotools,Cross Compiling,这是之前关于iPhone交叉编译问题的后续问题:
基本上,我正在尝试为iPhone编译ApachePortableRuntime(APR)版本1.3.8(最新版本)。我当前在配置步骤中遇到以下错误:
checking for working PROCESS_SHARED locks... configure: error: in `/Users/michaelsafyan/Downloads/apr-1.3.8':
configure: error: cannot run test progr
这是之前关于iPhone交叉编译问题的后续问题:
基本上,我正在尝试为iPhone编译ApachePortableRuntime(APR)版本1.3.8(最新版本)。我当前在配置步骤中遇到以下错误:
checking for working PROCESS_SHARED locks... configure: error: in `/Users/michaelsafyan/Downloads/apr-1.3.8':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.
正在检查工作进程\u共享锁。。。配置:错误:在“/Users/michaelsafyan/Downloads/apr-1.3.8”中:
配置:错误:交叉编译时无法运行测试程序
有关详细信息,请参阅“config.log”。
我通过“iphone3.1-configure--disable dso--enable threads”调用“configure”脚本,其中“iphone3.1-configure”是我为调用“configure”脚本而编写的以下脚本:
#! /bin/bash
#
#程序:iphone3.1-configure
#作者:Michael Aaron Safyan(michaelsafyan@gmail.com)
#简介:
#此程序运行由生成的“配置”脚本
#GNU自动工具,以便交叉编译第三方库
#对于iPhone3.1SDK。在目录中运行此脚本
#包含自动工具“配置”脚本。一旦你运行这个,
#您可以使用“make”和“sudomakeinstall”来构建库。
#使用的安装前缀为“/opt/iphone-3.1/”。
#
取消注册会计师资格
取消设置C_INCLUDE_路径
取消设置CPLUS\u INCLUDE\u路径
取消设置OBJC_包含_路径
未设置LIBS
未设置动态备份库路径
未设置动态备份框架路径
导出BUILD\u DARWIN\u VER=`uname-r`
导出SDKVER=“3.1”
export DEVROOT=“/Developer/Platforms/iPhoneOS.platform/Developer”
export-SDKROOT=“$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk”
导出PKG_CONFIG_PATH=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$SDKVER.sdk/usr/lib/pkgconfig:/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/pkgconfig:/opt/iphone-$SDKVER/lib/pkgconfig:/usr/local/iphone-$SDKVER/lib/pkgconfig
export PREFIX=“/opt/iphone-$SDKVER”
导出为=“$DEVROOT/usr/bin/AS”
导出ASCPP=“$DEVROOT/usr/bin/as”
export AR=“$DEVROOT/usr/bin/AR”
export RANLIB=“$DEVROOT/usr/bin/RANLIB”
export CPPFLAGS=“-pipe-no-cpp-precomp-I$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/-I$SDKROOT/usr/include-I$DEVROOT/usr/include-I/opt/iphone-$SDKVER/include-I/usr/local/iphone-$SDKVER/include”
export CFLAGS=“-std=c99-arch armv6-pipe-no cpp precomp-sysroot='$SDKROOT'-isystem$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/-isystem$SDKROOT/usr/include-isystem$DEVROOT/usr/include-isystem/opt/iphone-$SDKVER/include-isystem/usr/local/iphone-$SDKVER/include”
export-cxflags=“-std=c99-arch-armv6-pipe-no-cpp-precomp-sysroot='$SDKROOT'-isystem$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/-isystem$SDKROOT/usr/include-isystem$DEVROOT/usr/include-isystem/opt/iphone-$SDKVER/include-isystem/usr/local/iphone/iphone-$SDKVER/include”
export-LDFLAGS=“-arch-armv6--sysroot=”$SDKROOT'-L$SDKROOT/usr/lib-L$DEVROOT/usr/lib-L/opt/iphone-$SDKVER/lib-L/usr/local/iphone-$SDKVER/lib”
导出CPP=“$DEVROOT/usr/bin/CPP”
导出CXXCPP=“$DEVROOT/usr/bin/cpp”
导出CC=“$DEVROOT/usr/bin/gcc-4.2”
export CXX=“$DEVROOT/usr/bin/g++-4.2”
export LD=“$DEVROOT/usr/bin/LD”
export STRIP=“$DEVROOT/usr/bin/STRIP”
如果[!\(-d“$DEVROOT”\)];然后
echo“找不到iPhone SDK。文件夹\$DEVROOT\”不存在。”
出口1
fi
如果[!\(-d“$SDKROOT”\)];然后
echo“找不到iPhone SDK。文件夹\“$SDKROOT\”不存在。”
出口1
fi
./configure--prefix=“$prefix”--build=“i386苹果达尔文$build\u达尔文版本”--host=“arm-apple-darwin9”--启用静态--禁用共享ac\u cv\u文件\uu开发\u零=否ac\u cv\u函数\u设置PGRP\u无效=是$@
configure给我的错误不是我第一次收到类似“交叉编译时无法运行测试程序”的消息。事实上,“iphone3.1-configure”脚本中的“ac_cv_file_dev_zero=no”和“ac_cv_func_setpgrp_void=yes”元素会导致绕过两个类似的失败测试。我遇到的问题是,我不知道如何绕过此检查——也就是说,我不知道要设置什么变量来绕过此测试以及尝试运行为目标平台构建的可执行文件的任何其他测试。我之所以能够绕过前两个类似的测试,仅仅是因为我能够在谷歌上找到解决方案。。。有人知道要设置哪些变量或以其他方式绕过此检查吗
如果有人知道如何抑制交叉编译时无法执行的所有测试,或者您知道如何抑制这种特定检查,我将不胜感激。非常感谢。需要设置以下变量:
- ac_cv_file_udev_zero=“是”
- ac_cv_func_setpgrp_void=“是”
- apr\u cv\u过程\u共享\u工作=“是”
- apr\u cv\u mutex\u robust\u shared=“否”
- apr_cv_tcp_nodelay_,带有科克=“是”
- ac_cv_sizeof_struct_iovec=“8”
- apr\u cv\u mutex\u recursive=“是”
使用以下更新的“iphone3.1-configure”脚本配置程序:
#! /bin/bash
#
# Program : iphone3.1-configure
# Authors : Michael Aaron Safyan (michaelsafyan@gmail.com)
# Synopsis :
# This program runs the "configure" script generated by the
# GNU Autotools in order to cross-compile thirdparty libraries
# for the iPhone 3.1 SDK. Run this script while in a directory
# containing an autotools "configure" script. Once you run this,
# you can use "make" and "sudo make install" to build the library.
# An install prefix of "/opt/iphone-3.1/" is used.
#
unset CPATH
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset OBJC_INCLUDE_PATH
unset LIBS
unset DYLD_FALLBACK_LIBRARY_PATH
unset DYLD_FALLBACK_FRAMEWORK_PATH
export BUILD_DARWIN_VER=`uname -r`
export SDKVER="3.1"
export DEVROOT="/Developer/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk"
export PKG_CONFIG_PATH=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$SDKVER.sdk/usr/lib/pkgconfig:/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/pkgconfig:/opt/iphone-$SDKVER/lib/pkgconfig:/usr/local/iphone-$SDKVER/lib/pkgconfig
export PREFIX="/opt/iphone-$SDKVER"
export AS="$DEVROOT/usr/bin/as"
export ASCPP="$DEVROOT/usr/bin/as"
export AR="$DEVROOT/usr/bin/ar"
export RANLIB="$DEVROOT/usr/bin/ranlib"
export CPPFLAGS="-pipe -no-cpp-precomp -I$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/ -I$SDKROOT/usr/include -I$DEVROOT/usr/include -I/opt/iphone-$SDKVER/include -I/usr/local/iphone-$SDKVER/include"
export CFLAGS="-std=c99 -arch armv6 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/ -isystem $SDKROOT/usr/include -isystem $DEVROOT/usr/include -isystem /opt/iphone-$SDKVER/include -isystem /usr/local/iphone-$SDKVER/include"
export CXXFLAGS="-std=c99 -arch armv6 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/ -isystem $SDKROOT/usr/include -isystem $DEVROOT/usr/include -isystem /opt/iphone-$SDKVER/include -isystem /usr/local/iphone-$SDKVER/include"
export LDFLAGS="-arch armv6 --sysroot='$SDKROOT' -L$SDKROOT/usr/lib -L$DEVROOT/usr/lib -L/opt/iphone-$SDKVER/lib -L/usr/local/iphone-$SDKVER/lib"
export CPP="$DEVROOT/usr/bin/cpp"
export CXXCPP="$DEVROOT/usr/bin/cpp"
export CC="$DEVROOT/usr/bin/gcc-4.2"
export CXX="$DEVROOT/usr/bin/g++-4.2"
export LD="$DEVROOT/usr/bin/ld"
export STRIP="$DEVROOT/usr/bin/strip"
if [ ! \( -d "$DEVROOT" \) ] ; then
echo "The iPhone SDK could not be found. Folder \"$DEVROOT\" does not exist."
exit 1
fi
if [ ! \( -d "$SDKROOT" \) ] ; then
echo "The iPhone SDK could not be found. Folder \"$SDKROOT\" does not exist."
exit 1
fi
./configure \
--prefix="$PREFIX" \
--build="i386-apple-darwin$BUILD_DARWIN_VER" \
--host="arm-apple-darwin9" \
--enable-static \
--disable-shared \
ac_cv_file__dev_zero="yes" \
ac_cv_func_setpgrp_void="yes" \
apr_cv_process_shared_works="yes" \
apr_cv_mutex_robust_shared="no" \
apr_cv_tcp_nodelay_with_cork="yes" \
ac_cv_sizeof_struct_iovec="8" \
apr_cv_mutex_recursive="yes" $@
#! /bin/bash
#
#程序:iphone3.1-configure
#作者:Michael Aaron Safyan(michaelsafyan@gmail.com)
#简介:
#此程序运行由生成的“配置”脚本
#GNU自动工具,以便交叉编译第三方库
#对于iPhone3.1SDK。在目录中运行此脚本
#包含自动工具“配置”脚本。一旦你运行这个,
#您可以使用“make”和“sudomakeinstall”来构建库。
#使用的安装前缀为“/opt/iphone-3.1/”。
#
取消注册会计师资格
取消设置C_INCLUDE_路径
取消设置CPLUS\u INCLUDE\u路径
取消设置OBJC_包含_路径
未设置LIBS
未设置动态备份库路径
未设置动态备份框架路径
导出BUILD\u DARWIN\u VER=`uname-r`
导出SDKVER=“3.1”
export DEVROOT=“/Developer/Platforms/iPhoneOS.platform/Developer”
export-SDKROOT=“$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk”
导出PKG_CONFIG_PATH=/Developer/Platforms/iPhoneOS.platform/Developer
#! /bin/bash
#
# Program : iphone3.1-configure
# Authors : Michael Aaron Safyan (michaelsafyan@gmail.com)
# Synopsis :
# This program runs the "configure" script generated by the
# GNU Autotools in order to cross-compile thirdparty libraries
# for the iPhone 3.1 SDK. Run this script while in a directory
# containing an autotools "configure" script. Once you run this,
# you can use "make" and "sudo make install" to build the library.
# An install prefix of "/opt/iphone-3.1/" is used.
#
unset CPATH
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset OBJC_INCLUDE_PATH
unset LIBS
unset DYLD_FALLBACK_LIBRARY_PATH
unset DYLD_FALLBACK_FRAMEWORK_PATH
export BUILD_DARWIN_VER=`uname -r`
export SDKVER="3.1"
export DEVROOT="/Developer/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk"
export PKG_CONFIG_PATH=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$SDKVER.sdk/usr/lib/pkgconfig:/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/pkgconfig:/opt/iphone-$SDKVER/lib/pkgconfig:/usr/local/iphone-$SDKVER/lib/pkgconfig
export PREFIX="/opt/iphone-$SDKVER"
export AS="$DEVROOT/usr/bin/as"
export ASCPP="$DEVROOT/usr/bin/as"
export AR="$DEVROOT/usr/bin/ar"
export RANLIB="$DEVROOT/usr/bin/ranlib"
export CPPFLAGS="-pipe -no-cpp-precomp -I$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/ -I$SDKROOT/usr/include -I$DEVROOT/usr/include -I/opt/iphone-$SDKVER/include -I/usr/local/iphone-$SDKVER/include"
export CFLAGS="-std=c99 -arch armv6 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/ -isystem $SDKROOT/usr/include -isystem $DEVROOT/usr/include -isystem /opt/iphone-$SDKVER/include -isystem /usr/local/iphone-$SDKVER/include"
export CXXFLAGS="-std=c99 -arch armv6 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.2.1/include/ -isystem $SDKROOT/usr/include -isystem $DEVROOT/usr/include -isystem /opt/iphone-$SDKVER/include -isystem /usr/local/iphone-$SDKVER/include"
export LDFLAGS="-arch armv6 --sysroot='$SDKROOT' -L$SDKROOT/usr/lib -L$DEVROOT/usr/lib -L/opt/iphone-$SDKVER/lib -L/usr/local/iphone-$SDKVER/lib"
export CPP="$DEVROOT/usr/bin/cpp"
export CXXCPP="$DEVROOT/usr/bin/cpp"
export CC="$DEVROOT/usr/bin/gcc-4.2"
export CXX="$DEVROOT/usr/bin/g++-4.2"
export LD="$DEVROOT/usr/bin/ld"
export STRIP="$DEVROOT/usr/bin/strip"
if [ ! \( -d "$DEVROOT" \) ] ; then
echo "The iPhone SDK could not be found. Folder \"$DEVROOT\" does not exist."
exit 1
fi
if [ ! \( -d "$SDKROOT" \) ] ; then
echo "The iPhone SDK could not be found. Folder \"$SDKROOT\" does not exist."
exit 1
fi
./configure \
--prefix="$PREFIX" \
--build="i386-apple-darwin$BUILD_DARWIN_VER" \
--host="arm-apple-darwin9" \
--enable-static \
--disable-shared \
ac_cv_file__dev_zero="yes" \
ac_cv_func_setpgrp_void="yes" \
apr_cv_process_shared_works="yes" \
apr_cv_mutex_robust_shared="no" \
apr_cv_tcp_nodelay_with_cork="yes" \
ac_cv_sizeof_struct_iovec="8" \
apr_cv_mutex_recursive="yes" $@