2009-10-22 4 views
8

Dies ist ein Followup auf eine frühere Anfrage auf Cross-Kompilierung für das iPhone Quer kompilieren:
Cross-compile Autotools-based Libraries for Official iPhone SDKApache Portable Runtime auf das iPhone

Grundsätzlich Ich versuche, die Apache Portable Runtime (APR) zu kompilieren Version 1.3.8 (neueste) für das iPhone. Ich bin derzeit in die folgenden Fehler während des Konfigurationsschrittes:

 
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. 

ich die "configure" Skript über "iphone3.1-configure --disable-dso --enable-threads" am Aufruf, wobei „iphone3 0,1-configure“ist das folgende Skript, das ich gekocht-up haben die aufzurufen‚konfigurieren‘Skript:

 
#! /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] 

der Fehler, der mir konfigurieren, geben ist nicht das erste Mal, dass ich eine Nachricht an die erhalten haben, Zeilen von "kann Test-Programm nicht ausführen, während Quercompiling". Tatsächlich führen die Elemente "ac_cv_file__dev_zero = no" und "ac_cv_func_setpgrp_void = yes" im Skript "iphone3.1-configure" dazu, dass zwei ähnlich ausfallende Tests umgangen werden. Das Problem, das ich habe, ist, dass ich nicht weiß, wie man diese Prüfung umgehen kann - das heißt, ich weiß nicht, welche Variablen gesetzt werden sollen, um diesen Test zu umgehen und zusätzliche Tests, die ausführbare Dateien für das Ziel ausführen Plattform. Ich konnte die früheren zwei ähnlichen Tests einfach umgehen, weil ich die Problemumgehung bei Google finden konnte ... weiß jemand, welche Variablen zu setzen oder eine andere Möglichkeit, diese Prüfung zu umgehen?

Wenn jemand eine Möglichkeit kennt, alle Tests zu unterdrücken, die beim Quercompilieren nicht ausgeführt werden können, oder wenn Sie nur wissen, wie Sie diese spezifische Prüfung unterdrücken können, wäre ich sehr dankbar. Vielen Dank.

Antwort

9

Die folgenden Variablen müssen gesetzt werden:

  • 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 = "ja"
  • ac_cv_sizeof_struct_iovec = "8"
  • apr_cv_mutex_recursive = "yes"

Verwenden Sie die folgenden aktualisierten "iphone3.1-configure" Skript, das Programm zu konfigurieren:

 
#! /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] 

Use „iphone3.1 konfigurieren --disable-dso - -enable-threads & & make ", dann" sudo make install ".

+0

Hallo, der Link zu 'Cross-Compiling der Apache Portable Runtaime für das iPhone.' ist kaputt. – Seunghoon

+0

Ja, ich habe das gelöscht. –

+0

Vielen Dank für das Hinzufügen dieser Antwort. Es hat mein Leben viel einfacher gemacht, während ich den APR für eine QNX-Plattform gebündelt habe. Scheint wie fünf Jahre später braucht man immer noch die gleichen Konfigurationsparameter. – MayaPosch