2009-10-22 28 views
8

Đây là một followup cho một câu hỏi trước về cross-biên dịch cho iPhone:
Cross-compile Autotools-based Libraries for Official iPhone SDKCross-biên dịch Apache xách tay Runtime cho iPhone

Về cơ bản, tôi đang cố gắng để biên dịch Portable Runtime Apache (APR) phiên bản 1.3.8 (mới nhất) cho iPhone. Tôi hiện đang chạy vào các lỗi sau trong bước cấu hình:

 
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. 

tôi gọi là "cấu hình" kịch bản thông qua "iphone3.1-configure --disable-DSO enable-đề", trong đó "iphone3 .1-configure" là kịch bản sau đây mà tôi đã nấu chín lên để gọi 'cấu hình' kịch bản:

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

các lỗi mà cấu hình là đem lại cho tôi không phải là lần đầu tiên tôi đã nhận được một thông điệp dọc theo dòng "không thể chạy chương trình thử nghiệm trong khi biên dịch chéo". Trên thực tế, các phần tử "ac_cv_file__dev_zero = no" và "ac_cv_func_setpgrp_void = yes" trong tập lệnh "iphone3.1-configure" khiến hai bài kiểm tra thất bại tương tự bị bỏ qua. Vấn đề tôi gặp phải là tôi không biết cách bỏ qua kiểm tra này - có nghĩa là, tôi không biết (các) biến nào được đặt để bỏ qua thử nghiệm này và bất kỳ kiểm tra bổ sung nào cố chạy các tệp thi hành được xây dựng cho mục tiêu nền tảng. Tôi đã có thể bỏ qua hai thử nghiệm tương tự trước đó đơn giản chỉ vì tôi có thể xác định được giải pháp thay thế trên Google ... có ai biết các biến nào cần thiết lập hay cách khác để bỏ qua kiểm tra này không?

Nếu có ai biết cách ngăn chặn tất cả các kiểm tra không thể thực hiện khi biên dịch chéo, hoặc nếu bạn chỉ biết cách loại bỏ kiểm tra cụ thể này, tôi sẽ đánh giá rất cao. Cảm ơn nhiều.

Trả lời

9

Các biến sau đây cần phải được thiết lập:

  • 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"

Sử dụng cập nhật "iphone3.1-configure" kịch bản sau đây để cấu hình các chương trình:

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

Sử dụng "iphone3.1 cấu hình --disable-DSO - -enable-threads & & tạo ", sau đó" sudo make install ".

+0

Xin chào, liên kết tới 'Soạn thảo Runtaime di động Apache cho iphone'. bị phá vỡ. – Seunghoon

+0

Vâng, tôi đã xóa nó. –

+0

Cảm ơn bạn đã thêm câu trả lời này. Nó làm cho cuộc sống của tôi dễ dàng hơn nhiều trong khi xây dựng chéo APR cho nền tảng QNX. Có vẻ như năm năm sau, người ta vẫn cần các thông số cấu hình giống nhau. – MayaPosch

Các vấn đề liên quan