You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Paul Herring <pa...@gmail.com> on 2008/11/28 14:09:57 UTC

[users@httpd] Apache 2.2.10 - apxs - cross-compiling modules failing

Short: I need to cross-compile modules which use apxs, but apxs fails.

Long: I've tried the mod_python list, since that's the list dealing
with my problem module, however after a few rounds of emails, it
became apparent that the problem seems to be with the fact that there
isn't a version of apxs that can be used during cross-compiles.
Either:

1) The host version (if it even exists!) could be used, in which case
the resultant module is likely unsuitable for the target platform or

2) The target version could be used, but that tries to use files that
aren't (yet) in their correct place, since it's being executed from
the host.

Is there some magic I need to be able to cross-compile modules that
require apxs, or a page describing what I need to do that Google
hasn't yet thrown at me? Searches for 'cross-platform apxs' and
'cross-compile apxs' haven't been too illuminating.

TIA.

-- 
PJH

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Henrik Grindal Bakken <hg...@ifi.uio.no>.
Nick Kew <ni...@webthing.com> writes:

> On Fri, 5 Dec 2008 14:11:56 +0000
> "Paul Herring" <pa...@gmail.com> wrote:
>
>> Copy/paste from the mod_python list from my initial stab at finding
>> a solution:
>
> I don't see any evidence of your cross-compiled apache.

I haven't tried too many external apache modules, but cross-compiling
mod_python is certainly difficult.  It tries to run apache to
determine its version, and the same with python.  There's no way to
set an 'ac_cv_foo' variable to override this step.  This part is
easily patched in mod_python's configure (just remove the tests if
you're certain your apache/python are version 2), but it doesn't stop
there.

The cross-apache's apxs doesn't run very well on the build host (stuff
generally isn't installed on host where it'll end up on target, etc),
so when mod_python wants to run apxs to build and link the .so, it
fails.

I got somewhat further along by changing $(APXS) to $(CC) (and fixing
up some flags) in src/Makefile.in, but when it came to the 'dist'
subdirectory, I gave up.  The makefile requires PYTHON_BIN to do a lot
of compiling, and it also builds C files seemingly without looking at
$(CC) (but rather $(APXS)).


-- 
Henrik Grindal Bakken <hg...@ifi.uio.no>
PGP ID: 8D436E52
Fingerprint: 131D 9590 F0CF 47EF 7963  02AF 9236 D25A 8D43 6E52


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Paul Herring <pa...@gmail.com>.
On Fri, Dec 5, 2008 at 3:07 PM, Nick Kew <ni...@webthing.com> wrote:
> On Fri, 5 Dec 2008 14:11:56 +0000
> "Paul Herring" <pa...@gmail.com> wrote:
>
>> Copy/paste from the mod_python list from my initial stab at finding a
>> solution:
>
> I don't see any evidence of your cross-compiled apache.

Because there is (currently) no evidence when trying to compile
modules. Apache cross compiles fine. It's the associated tools
supplied with the apache build to build cross-compiled _modules_ I'm
having problems with.

And as the logs show, the configure doesn't get very far since the
target version of apxs (part of apache) isn't compatible with the
cross-compilation procedure, so it doesn't even get as far as calling
any version of apache, cross-compiled or not (either of which would be
invalid in a cross compilation environment.)

Basically there are three 'sets' of programs used/created when cross compiling
1) Host executables
2) Cross-compiler executables
3) Target executables.

(1) are used to make (2) that are then used to make (3)

The apache build does not appear to produce any in group (2) even
though they are needed when cross compiling (Specifically apxs (so
far) in my example.)

-- 
PJH

http://shabbleland.myminicity.com/tra

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 5 Dec 2008 14:11:56 +0000
"Paul Herring" <pa...@gmail.com> wrote:

> Copy/paste from the mod_python list from my initial stab at finding a
> solution:

I don't see any evidence of your cross-compiled apache.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Paul Herring <pa...@gmail.com>.
On Fri, Dec 5, 2008 at 5:58 PM, Nick Kew <ni...@webthing.com> wrote:
> On Fri, 05 Dec 2008 16:13:35 +0000
> Tom Evans <te...@googlemail.com> wrote:
>
>
>> apxs has its installbuilddir calculated when the apache binaries it
>> accompanies are compiled and installed. Since yours doesn't look in
>> the right place, I'm guessing your cross built apache was not
>> installed/configured correctly.

Appropriate configure options or hints would be nice. Which --options
do I need to set?

>
> Exactly.  You'll need to "make install"

No - I need ./configure options. This happens before 'make install'.
The makefile is generated from configure.

If I'm abjectly wrong here, I apologise, but my problems start before
even attempting 'make build'

> the cross-compiled apache
> to get an apxs that'll pick up the right tools and options.
> You may find you need some dependencies cross-compiled too.

If the copy/paste didn't make it clear enough, there are two versions
of apxs to choose from,

1) the host one. (here)
2) the target one. (there)

Both refer to their own 'local' one.

Cross compilation requires a third one: 'run here, but act as if
you're running there.'

How do I (a) generate this third version (b) refer to it when compiling.

I'll still admit ignorance in this, and ask, 'am I still on the right
list here?'

Am I?

-- 
PJH

http://shabbleland.myminicity.com/tra

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 05 Dec 2008 16:13:35 +0000
Tom Evans <te...@googlemail.com> wrote:


> apxs has its installbuilddir calculated when the apache binaries it
> accompanies are compiled and installed. Since yours doesn't look in
> the right place, I'm guessing your cross built apache was not
> installed/configured correctly.

Exactly.  You'll need to "make install" the cross-compiled apache
to get an apxs that'll pick up the right tools and options.
You may find you need some dependencies cross-compiled too.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Tom Evans <te...@googlemail.com>.
On Fri, 2008-12-05 at 14:11 +0000, Paul Herring wrote:
<snip>
> checking for --with-apxs... /f15_nsb/usr/local/bin/apxs executable, good
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> checking Apache version... cannot open
> /usr/local/conf/build/config_vars.mk: No such file or directory at
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> /f15_nsb/usr/local/bin/apxs line 218.
> cannot open /usr/local/conf/build/config_vars.mk: No such file or
> directory at /f15_nsb/usr/local/bin/apxs line 218.
>  running %/% cannot open /usr/local/conf/build/config_vars.mk: No such
> file or directory at /f15_nsb/usr/local/bin/apxs line 218.
> cannot open /usr/local/conf/build/config_vars.mk: No such file or
> directory at /f15_nsb/usr/local/bin/apxs line 218.
> ./configure: line 2714: /: is a directory
> 
> configure: error: This version of mod_python only works with Apache 2.
> The one you have seems to be .
> ------------->8===========


You told configure that a valid version of apxs was
at /f15/usr/local/bin/apxs.
apxs is just a perl script that explains how to build apache modules. If
you look at it, the first thing it does is to include the file
$installbuilddir/config_vars.mk. As you can see from the output of
running it, it tries to include /usr/local/conf/build/config_vars.mk,
which obviously is not where it is.

apxs has its installbuilddir calculated when the apache binaries it
accompanies are compiled and installed. Since yours doesn't look in the
right place, I'm guessing your cross built apache was not
installed/configured correctly.

Cheers

Tom


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Paul Herring <pa...@gmail.com>.
On Fri, Dec 5, 2008 at 12:53 PM, Nick Kew <ni...@webthing.com> wrote:
> On Fri, 5 Dec 2008 08:17:38 +0000
> "Paul Herring" <pa...@gmail.com> wrote:
>
>> It's been a week since I posted this, and (possibly not surprisingly)
>> I've had no replies.
>>
>> Is it because I've supplied insufficient detail, I'm asking in the
>> wrong place, or because the apache/httpd/apxs build simply isn't
>> designed to be cross-compiled.
>
> Dunno, I've not tried it.
>
> How about telling us what happened when you just tried using
> the apxs from a build cross-compiled for your target platform?

Copy/paste from the mod_python list from my initial stab at finding a solution:

Version of mod_python: 3.3.1
Apache: 2.2.10
Python: 2.4.4 (I realise this is an old version, but this was
requested due to compatibility issues with other software that's
used.)

configure without apxs:
------------->8===========
./configure --build=i586-cross-linux-gnu --host=i686-pc-linux-gnu \
               --prefix=/f15_nsb
checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc
checking for C compiler default output file name... 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 i686-pc-linux-gnu-gcc accepts -g... yes
checking for i686-pc-linux-gnu-gcc option to accept ANSI C... none needed
checking for ar... i686-pc-linux-gnu-ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for main in -lm... yes
checking for an ANSI C-conforming const... yes
checking your blood pressure... a bit high, but we can proceed
configure: checking whether apxs is available...
checking for --with-apxs... no
checking for apxs in /usr/local/apache/sbin... no
checking for apxs in your PATH... checking for apxs... no
checking for apxs2 in your PATH... checking for apxs2... no
configure: WARNING: **** apxs was not found, DSO compilation will not
be available.
configure: WARNING: **** You can use --with-apxs to specify where your apxs is.
configure: error: Neither static nor DSO option available, there is no
point in continuing.
------------->8===========

configure using target version of apxs:

------------->8===========
./configure --build=i586-cross-linux-gnu --host=i686-pc-linux-gnu \
               --prefix=/f15_nsb \
               --with-apxs=/f15_nsb/usr/local/bin/apxs
checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc
checking for C compiler default output file name... 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 i686-pc-linux-gnu-gcc accepts -g... yes
checking for i686-pc-linux-gnu-gcc option to accept ANSI C... none needed
checking for ar... i686-pc-linux-gnu-ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for main in -lm... yes
checking for an ANSI C-conforming const... yes
checking your blood pressure... a bit high, but we can proceed
configure: checking whether apxs is available...
checking for --with-apxs... /f15_nsb/usr/local/bin/apxs executable, good
checking Apache version... cannot open
/usr/local/conf/build/config_vars.mk: No such file or directory at
/f15_nsb/usr/local/bin/apxs line 218.
cannot open /usr/local/conf/build/config_vars.mk: No such file or
directory at /f15_nsb/usr/local/bin/apxs line 218.
 running %/% cannot open /usr/local/conf/build/config_vars.mk: No such
file or directory at /f15_nsb/usr/local/bin/apxs line 218.
cannot open /usr/local/conf/build/config_vars.mk: No such file or
directory at /f15_nsb/usr/local/bin/apxs line 218.
./configure: line 2714: /: is a directory

configure: error: This version of mod_python only works with Apache 2.
The one you have seems to be .
------------->8===========


-- 
PJH

http://shabbleland.myminicity.com/tra

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 5 Dec 2008 08:17:38 +0000
"Paul Herring" <pa...@gmail.com> wrote:

> It's been a week since I posted this, and (possibly not surprisingly)
> I've had no replies.
> 
> Is it because I've supplied insufficient detail, I'm asking in the
> wrong place, or because the apache/httpd/apxs build simply isn't
> designed to be cross-compiled.

Dunno, I've not tried it.

How about telling us what happened when you just tried using
the apxs from a build cross-compiled for your target platform?

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Apache 2.2.10 - apxs - cross-compiling modules failing

Posted by Paul Herring <pa...@gmail.com>.
It's been a week since I posted this, and (possibly not surprisingly)
I've had no replies.

Is it because I've supplied insufficient detail, I'm asking in the
wrong place, or because the apache/httpd/apxs build simply isn't
designed to be cross-compiled.

On Fri, Nov 28, 2008 at 1:09 PM, Paul Herring <pa...@gmail.com> wrote:
> Short: I need to cross-compile modules which use apxs, but apxs fails.
>
> Long: I've tried the mod_python list, since that's the list dealing
> with my problem module, however after a few rounds of emails, it
> became apparent that the problem seems to be with the fact that there
> isn't a version of apxs that can be used during cross-compiles.
> Either:
>
> 1) The host version (if it even exists!) could be used, in which case
> the resultant module is likely unsuitable for the target platform or
>
> 2) The target version could be used, but that tries to use files that
> aren't (yet) in their correct place, since it's being executed from
> the host.
>
> Is there some magic I need to be able to cross-compile modules that
> require apxs, or a page describing what I need to do that Google
> hasn't yet thrown at me? Searches for 'cross-platform apxs' and
> 'cross-compile apxs' haven't been too illuminating.
>
> TIA.
>
> --
> PJH
>

-- 
PJH

http://shabbleland.myminicity.com/tra

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org