Leopard native apache with custom (64bit) PHP
With massive! help from Marc Ammann I was able to build a PHP Binary that loads with the Leopard shipped Apache.
First I got iconv source from apple and took the libiconv/include/iconv.h.build.in file. It seems that apple uses different headers in the build process than installed. So the build headers use precompiler flags that gcc doesn't know (it's most likely some sort of XCode stuff which I don't know anything about). After removing that stuff the file looks like this.
With this file as a replacement for /usr/include/iconv.h PHP will build with CFLAGS='-arch x86_64' and load with the native apache afterwards. It's even possible to build the pecl memcache extension like that (but don't forget the right arch).
For completion that were my configure flags:
First I got iconv source from apple and took the libiconv/include/iconv.h.build.in file. It seems that apple uses different headers in the build process than installed. So the build headers use precompiler flags that gcc doesn't know (it's most likely some sort of XCode stuff which I don't know anything about). After removing that stuff the file looks like this.
With this file as a replacement for /usr/include/iconv.h PHP will build with CFLAGS='-arch x86_64' and load with the native apache afterwards. It's even possible to build the pecl memcache extension like that (but don't forget the right arch).
For completion that were my configure flags:
CFLAGS='-arch x86_64' ./configure \
'--with-zlib' \
'--with-apxs2=/usr/sbin/apxs' \
'--prefix=/usr/local/php5' \
'--with-iconv' \
'--with-xsl' \
'--disable-xmlreader' \
'--with-jpeg-dir' \
'--with-png-dir=' \
'--enable-bcmath' \
'--with-curl' \
'--with-ldap' \
'--enable-mbstring' \
'--enable-soap'