LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cross compile httpd (https://www.linuxquestions.org/questions/linux-software-2/cross-compile-httpd-878249/)

daniil 05-02-2011 12:44 AM

cross compile httpd
 
Hello.

I try to cross compile httpd for power pc.

It seems that configure doesn't detect cross compilation.

The first error was that sizeof (void*) is less than (long), so I have commented out that check (I think it is a hard work around).

So I've got another error ./dftables: cannoct execute binary file.
Why it tries to execute binary for ppc on x86 machine?

This is my build script.

Regards,
Daniil

#!/bin/sh

NAME=httpd-2.2.17

PWD=$(pwd)


CS_TOOLCHAIN_PATH=$PWD/sdk/apm-2010.09
SYSROOT=$PWD/sdk/V1.2/44xFP/staging
PATH=$CS_TOOLCHAIN_PATH/bin:$PATH
CROSS_COMPILE=powerpc-apm-linux-gnu-
ARCH=powerpc

export CS_TOOLCHAIN PATH CROSS_COMPILE SYSROOT ARCH

CC=powerpc-apm-linux-gnu-gcc
CPP=powerpc-apm-linux-gnu-cpp
AS=powerpc-apm-linux-gnu-as
ASCPP=powerpc-apm-linux-gnu-as
AR=powerpc-apm-linux-gnu-ar
RANLIB=powerpc-apm-linux-gnu-ranlib
CXXCPP=powerpc-apm-linux-gnu-cpp
CXX=powerpc-apm-linux-gnu-g++
LD=powerpc-apm-linux-gnu-ld
STRIP=powerpc-apm-linux-gun-strip
CFLAGS="-mcpu=440fp -mtune=440fp --sysroot $SYSROOT"
LDFLAGS=-L$SYSROOT/lib

export CC CPP AS ASCPP AR RANLIB CXXCPP CXX LD STRIP CFLAGS LDFLAGS

PREFIX=$PWD/pkg/$NAME/wwwroot
cd src/$NAME

#
# Comment out checking out for sizeof(void*) < sizeof (long) in configure file.
#
./configure --prefix=$PREFIX \
--build=i586-linux \
--host=powerpc-linux \
--with-z=$SYSROOT/lib \
--enable-so \
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"

make install

cd ../../pkg
tar czf $NAME.tar.gz $NAME


All times are GMT -5. The time now is 12:06 AM.