Wednesday, September 19, 2012

Adding the GCC compiler for Mac OS 10.8.1 and Xcode

I just installed Mountain Lion on my machine and suddenly my apache would not start due to an error with the mod_rewrite.so file.
sudo /usr/local/apache2/bin/httpd --restart httpd: Syntax error on line 56 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/libexec/apache2/mod_rewrite.so into server: dlopen(/usr/libexec/apache2/mod_rewrite.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_rewrite.so: mach-o, but wrong architecture
Doing a file on mod_rewrite.so gives the following:
file /usr/libexec/apache2/mod_rewrite.so /usr/libexec/apache2/mod_rewrite.so: Mach-O 64-bit bundle x86_64
This tells me that the .so file I have has a 64 bit architecture but my apache is 32 bit.
file /usr/local/apache2/bin/httpd /usr/local/apache2/bin/httpd: Mach-O executable i386
Great, so now I need to find a way (quick and easy without having to change too many things) to compile mod_rewrite for a 32 bit architecture. After alot of Googling I finally decided to update my Xcode to 4.4.1 The download was 1.56G.

Now the download is finished and after updating my locate I did a

locate gcc | grep bin

With this I found the gcc from Xcode that I just installed.

Doing a file gave me

file /Developer/usr/bin/gcc
/Developer/usr/bin/gcc: Mach-O universal binary with 3 architectures
/Developer/usr/bin/gcc (for architecture i386): Mach-O executable i386
/Developer/usr/bin/gcc (for architecture ppc7400): Mach-O executable ppc

So what's the flag for using gcc for the 32 bit architecture?? (IN PROGRESS)

No comments:

Post a Comment