compiling Apache module for all of httpd's architectures

Hi,

I'm trying to get CoSign ( http://www.umich.edu/~umweb/software/cosign/) up and running on my XServe (PPC) running Leopard (10.5.1). I was able to get a version of CoSign to compile and made the necessary config changes to my sites/sitename.conf files. Apache won't restart though. So, I ran a configtest and got this error:

httpd: Syntax error on line 156 of /private/etc/apache2/httpd.conf:
Cannot load /usr/libexec/apache2/mod_cosign.so into server:
dlopen(/usr/libexec/apache2/mod_cosign.so, 10): no suitable image
found. Did find:\n\t/usr/libexec/apache2/mod_cosign.so: mach-o, but
wrong architecture

It looks like I need to get mod_sign.so to compile on more achitectures; here's the "file" output for my current version:

$ file mod_cosign.so
mod_cosign.so: Mach-O bundle ppc

I have XCode 3.0 installed. Is there a way for me to compile the module using approriate CFLAGS and LDFLAGS? What might those be? How can I get XCode to compile for httpd's 4 architectures?

It looks like similar problems have happened with other modules. Here's a site I've found and am willing to try, but I'm hoping someone here has more info: http://www.fatcatsoftware.com/blog/2007/running-fogbugz-on-leopard

Thanks for your help!
Libby

PowerPC XServe, Mac OS X (10.5.1), Leopard Server

Posted on Nov 30, 2007 11:41 AM

Reply
1 reply

Nov 30, 2007 3:51 PM in response to libbyh

Hi all,

I got some help from UMich. Here's what worked. You may be able to use this to figure out what configure changes to make to modules besides CoSign to get them to compile for Apache 2.2 on 10.5.1.

env CFLAGS="-arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 -g -O2"
./configure --enable-apache2=/usr/sbin/apxs

Don't run "make" yet. First edit the file filters/apache2/Makefile and
replace the following two lines

LDFLAGS= -L/usr/lib ${LIBS}

CFLAGS= ${DEFS} ${INCPATH}

with these two lines:

LDFLAGS= -Wl,"-arch ppc7400" -Wl,"-arch ppc64" -Wl,"-arch i386"
-Wl,"-arch x86_64" -L/usr/lib ${LIBS}

CFLAGS= -Wc,"-arch ppc7400" -Wc,"-arch ppc64" -Wc,"-arch i386"
-Wc,"-arch x86_64" ${DEFS} ${INCPATH}

Now run "make" and then check to see whether or not the resulting module
contains code for all four architectures:

make
file filters/apache2/.libs/mod_cosign.so

Here's the output you should get from the file command:

$ file filters/apache2/.libs/mod_cosign.so
filters/apache2/.libs/mod_cosign.so: Mach-O universal binary with 4
architectures
filters/apache2/.libs/mod_cosign.so (for architecture ppc7400):
Mach-O bundle ppc
filters/apache2/.libs/mod_cosign.so (for architecture ppc64): Mach-O
64-bit bundle ppc64
filters/apache2/.libs/mod_cosign.so (for architecture i386): Mach-O
bundle i386
filters/apache2/.libs/mod_cosign.so (for architecture x86_64): Mach-O
64-bit bundle x86_64

After a "make install" and an Apache restart, CoSign is initialized and running fine.

Libby

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

compiling Apache module for all of httpd's architectures

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.