2009-10-22 5 views
8

これは、iPhone用のクロスコンパイルの前の質問へのフォローアップであるiPhoneにはApacheポータブルランタイムをクロスコンパイルします、私は、Apacheポータブルランタイムをコンパイルしようとしています。基本的
Cross-compile Autotools-based Libraries for Official iPhone SDK

(APR) iPhone用のバージョン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. 

ところ「iphone3私は、「iphone3.1-のconfigure --disable-DSO --enable-スレッド」を介して「設定」スクリプトを実行しています0.1-のconfigureのconfigure 『スクリプト」私が調理アップしました起動するには、次のスクリプトです』:

 
#! /bin/bash 

# 
# Program : iphone3.1-configure 
# Authors : Michael Aaron Safyan ([email protected]) 
# 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=no ac_cv_func_setpgrp_void=yes [email protected] 

私を与えている設定するエラーは、私が一緒にメッセージを受け取ったのは初めてではありません"クロスコンパイル中にテストプログラムを実行できません"という行があります。実際には、 "iphone3.1-configure"スクリプトの "ac_cv_file__dev_zero = no"と "ac_cv_func_setpgrp_void = yes"要素によって、同様に失敗する2つのテストがバイパスされます。私が抱えている問題は、この検査をバイパスする方法がわからないことです。つまり、このテストをバイパスするために設定する変数と、ターゲット用にビルドされた実行可能ファイルを実行しようとする追加のテストは分かりませんプラットフォーム。 Googleで回避策を見つけることができたため、以前の2つの同様のテストをバイパスすることができました...誰が設定する変数やこのチェックをバイパスする別の方法を知っていますか?

クロスコンパイル時に実行できないすべてのテストを抑制する方法を知っている人、またはこの特定のチェックを抑制する方法を知っている人は、私は非常に感謝しています。どうもありがとうございました。

答えて

9

次の変数を設定する必要があります。

  • ac_cv_file__dev_zero = "yes" を
  • ac_cv_func_setpgrp_void = "yes" を
  • apr_cv_process_shared_works = "yes" を
  • apr_cv_mutex_robust_shared = "いいえ"
  • apr_cv_tcp_nodelay_with_cork = "yes"
  • ac_cv_sizeof_struct_iovec = "8"
  • apr_cv_mutex_recursive = "yes" を

プログラム設定するには、次の更新 "iphone3.1-のconfigure" スクリプトを使用します。

 
#! /bin/bash 

# 
# Program : iphone3.1-configure 
# Authors : Michael Aaron Safyan ([email protected]) 
# 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" [email protected] 

使用「iphone3.1-設定--disable-DSOを - -enable-threads & & make "、" sudo make install "を実行します。

+0

こんにちは、iphone用Apache Portable Runtaimeをクロスコンパイルするためのリンクです。は壊れてます。 – Seunghoon

+0

ええ、私はそれを削除しました。 –

+0

この回答をお寄せいただきありがとうございます。 QNXプラットフォームのAPRをクロス・ビルディングしている間、私の人生はずっと楽になりました。 5年後のように、同じ設定パラメータが必要です。 – MayaPosch