Hi all,

I recently started using a new Macbook Pro with an Intel Core 2 Duo, a
64-bit processor, and I was having a problem loading up the
mod_webkit.so that I copied over from my old Macbook Pro (Core Duo):

The error I got was this:

$ apachectl configtest
httpd: Syntax error on line 484 of /private/etc/apache2/httpd.conf:
Syntax error on line 61 of /private/etc/apache2/other/local.conf:
Syntax error on line 1 of /etc/apache2/other/tablet.conf: Cannot load
/usr/libexec/apache2/mod_webkit.so into server:
dlopen(/usr/libexec/apache2/mod_webkit.so, 10): no suitable image
found.  Did find:\n\t/usr/libexec/apache2/mod_webkit.so: mach-o, but
wrong architecture

Turns out it was only compiled for i386:

$ file /usr/libexec/apache2/mod_webkit.so
/usr/libexec/apache2/mod_webkit.so: Mach-O bundle i386

I'm not entirely clear on the details but my universal binary apache
couldn't load up this module.  All the other modules were universal
binaries so after a bit of research I found the necessary flags to
compile mod_webkit as a universal binary (compiling as just x86_64
should also work).  Below find the patch to
WebKit/Adapters/mod_webkit2/Makefile.

You should should see the following if it compiled properly.

$ file .libs/mod_webkit.so
.libs/mod_webkit.so: Mach-O universal binary with 3 architectures
.libs/mod_webkit.so (for architecture x86_64):  Mach-O 64-bit bundle x86_64
.libs/mod_webkit.so (for architecture ppc7400): Mach-O bundle ppc
.libs/mod_webkit.so (for architecture i386):    Mach-O bundle i386

HTH,
Alex

Patch follows (patched against Webware 0.9.4):

--- Makefile.orig       2008-03-13 14:59:35.000000000 -0700
+++ Makefile    2008-03-13 13:57:57.000000000 -0700
@@ -21,6 +21,9 @@
 # INC=-I`$(APXS) -q INCLUDEDIR`
 # LD_SHLIB=`$(APXS) -q LDFLAGS_SHLIB`

+CFLAGS=-Wc,"-arch x86_64" -Wc,"-arch ppc" -Wc,"-arch i386"
+LDFLAGS=-arch x86_64 -arch ppc -arch i386
+
 #   You can pass authorization information (passwords)
 #   from Apache to WebKit, even if Apache has not been
 #   compiled with this feature, by defining the following:
@@ -33,7 +36,7 @@

 #   compile the DSO file
 mod_webkit.la: $(SRC)
-       $(APXS) -c -o mod_webkit.la $(DEF) $(SRC)
+       $(APXS) -c $(CFLAGS) -o mod_webkit.la $(DEF) $(SRC) $(LDFLAGS)

 #   install the DSO file into the Apache installation
 #   and activate it in the Apache configuration

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to