Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sat, 2018-03-24, 13:00

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed, 2011-01-05, 15:09 

Joined: Fri, 2010-11-19, 23:48
Posts: 12
Hi, i tried to cross compile dcmtk on my Mac by using compile script like this(targert arch is ARM):

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

export SDKVER="4.2"
export DEVROOT="/Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer/"
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-darwin10/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 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/lib/gcc/arm-apple-darwin10/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 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/lib/gcc/arm-apple-darwin10/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="--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/arm-apple-darwin10-gcc-4.2.1"
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

if [ ! \( -d "$SDKROOT" \) ] ; then
   echo "The iPhone SDK could not be found. Folder \"$SDKROOT\" does not exist."
   exit 1

./configure \
    --prefix="$PREFIX" \
    --build="i686-apple-darwin10.5.0" \
    --host="arm-apple-darwin10" \
    --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" $@

i thik i'm close to solve this problem. The output is:

Running configure for module config.
checking build system type... i686-apple-darwin10.5.0
checking host system type... arm-apple-darwin10
checking whether make sets ${MAKE}... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for arm-apple-darwin10-gcc... /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/arm-apple-darwin10-gcc-4.2.1
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/arm-apple-darwin10-gcc-4.2.1 accepts -g... yes
checking how to run the C preprocessor... /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/cpp
checking for c++... /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/g++-4.2
checking for arm-apple-darwin10-g++... (cached) /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/g++-4.2
checking whether we are using the GNU C++ compiler... yes
checking whether /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/g++-4.2 accepts -g... yes
checking how to run the C++ preprocessor... /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/cpp
checking for ranlib... /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/ranlib
checking for ar... /Users/bartek/XCODE_4.2/Platforms/iPhoneOS.platform/Developer//usr/bin/ar
checking for libtool... libtool
checking whether libtool is GNU libtool... no
checking for AIX... no
checking for library containing strerror... none required
checking for long file names... yes
checking for inline... inline
checking for working const... yes
checking whether char is unsigned... no
checking whether right shift is unsigned... configure: error: cannot run test program while cross compiling


But how to disable runtime checks? i think that is solution.
I will be grateful for any help.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group