Cross Compile Apache

850 views
Skip to first unread message

adam jvok

unread,
Feb 18, 2010, 12:55:22 AM2/18/10
to dealextr...@googlegroups.com
Following my yesterday's MySQL cross-compile (see previous post), becoming an addict I went on to build Apache.
OK, snake has already got an http server, but perhaps you want more.

I still have the SDK/cross-tools in $HOME/cnusers.

1. Build
=======
cd $HOME/cnusers
wget http://mirrors.geoexpat.com/apache/httpd/httpd-2.2.14.tar.bz2
bunzip2 httpd-2.2.14.tar.bz2
tar xvf httpd-2.2.14.tar
cd httpd-2.2.14

The first build is *not* a cross-compile - I do this to get a couple of tools needed below.

./configure
make
cp ./srclib/pcre/dftables ../
cp ./server/gen_test_char ../
cd ..

Don't know if really needed, but cleanup completely:

rm -rf httpd-2.2.14
tar xvf httpd-2.2.14.tar
cd httpd-2.2.14

export PATH=$PATH:$HOME/cnusers/CNS2100-LSDK-6.8.2/CNS2100-LSDK-6.8.2/tools/arm-uclibc-3.4.6/bin

I expected to be able to use --host=arm-linux in the 'configure' below, that fails, complaining about problems building a test program. I couldn't see what the problem was, so I used --host=arm-linux-uclibc. That then causes problems in expat/configure, which are overcome by doing this hack:

sed -i '2631s/\$host_alias/arm-linux/' ./srclib/apr-util/xml/expat/configure
sed -i '2632s/\$host_alias/arm-linux/' ./srclib/apr-util/xml/expat/configure

Setup where the build products will go:

mkdir install_dir

On Snake, I will install to /usb/sda1/apache.
There must be a better way of doing this, but the best I've come up with is:

sudo mkdir -p /usb/sda1/apache
sudo ln -s `pwd`/install_dir /usb/sda1/apache

./configure  --host=arm-linux-uclibc  LIBS=-lpthread apr_cv_process_shared_works=set ap_cv_void_ptr_lt_long=no ac_cv_sizeof_struct_iovec=8 apr_cv_tcp_nodelay_with_cork=yes ac_cv_func_setpgrp_void=no  ac_cv_file__dev_zero=yes --prefix=/usb/sda1/apache

Without those odd looking parameters, configure will not succeed.
 
make

when it fails, complaining about dftables:

cp ../dftables ./srclib/pcre/dftables
make

when it fails, complaining about gen_test_char:

cp ../gen_test_char ./server/gen_test_char
make

make install
Results should now be in install_dir.

2. Install
=======
As per my MySQL post, the '$' commands are on Snake, otherwise on my desktop. $snake=IP of snake.

$ mkdir /usb/sda1/apache
cd install_dir
scp -r * root@$snake:/usb/sda1/apache/

The daemon user/group is used by apache (conf/httpd.conf).
$ adduser -g daemon daemon

Because Snake already runs a http process on port 80, edit conf/httpd.conf
Listen 81

3. Test
=======
From my desktop web browser: http://$snake:81 (replace $snake with your snake IP).

I'm going to try and resist doing any more of this for a while.


adam jvok

unread,
Feb 18, 2010, 12:58:09 AM2/18/10
to dealextr...@googlegroups.com
I missed a critical command in step 2: Install

$ /usb/sda1/apache/bin/apachectl start

Davilinux

unread,
Feb 25, 2010, 7:21:09 PM2/25/10
to DealExtreme NAS

Hi Adam!!

After seeing your post (and those similar ones), I would like to help
to get a scanner server for our NAS, using SANE. But my programming/
compiling skills do not reach an acceptable minimum.
All we have to do is to compile the ARM version of sane-utils and
libsane, including the required dependencies (SnakeOS=Debian based?)
After this, we'll have to edit some few files to get our scanner
device serving:

* /etc/sane.d/saned.conf
* /etc/sane.d/epson.conf <-- My case, I have a DX3800
* /etc/services <-- containing a proper sane line:
sane-port 6566/tcp sane saned # SANE network scanner daemon
* inetd / xinetd
* ...

Keep in touch?

Thanx in advance.

Regards.

David.


On 18 feb, 06:55, adam jvok <ajv...@gmail.com> wrote:
> Following my yesterday's MySQL cross-compile (see previous post), becoming
> an addict I went on to build Apache.
> OK, snake has already got an http server, but perhaps you want more.
>
> I still have the SDK/cross-tools in $HOME/cnusers.
>
> 1. Build
> =======
> cd $HOME/cnusers

> wgethttp://mirrors.geoexpat.com/apache/httpd/httpd-2.2.14.tar.bz2

Reply all
Reply to author
Forward
0 new messages