Lionにphp4.4.9をインストール
会社のmac(10.7.3)にインストール。
諸事情でmacportsは使わない。
- mysqlは本家にあるバイナリを使用。
- postgresqlは、適当にビルド。
- apache, libiconvは、デフォルトを使用。
gettext-0.17
CFLAGS="-arch x86_64" CCFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure --with-libiconv-prefix=/usr --without-emacs
-
- 0.17を使う。0.18 は、_zif_setlocale なんたらかんたらとmake時に怒られる。
- with-libiconv-prefixを設定する
- 以下のパッチをあてる。 参照:湘南ぱいそん
diff --git a/gettext-tools/gnulib-lib/stpncpy.c b/gettext-tools/gnulib-lib/stpncpy.c index ca53ebb..5a97b84 100644 --- a/gettext-tools/gnulib-lib/stpncpy.c +++ b/gettext-tools/gnulib-lib/stpncpy.c @@ -31,7 +31,7 @@ /* Copy no more than N bytes of SRC to DST, returning a pointer past the last non-NUL byte written into DST. */ char * -__stpncpy (char *dest, const char *src, size_t n) +__stncpy (char *dest, const char *src, size_t n) { char c; char *s = dest;
freetype-2.3.12, jpeg-8, libpng-1.4.2, t1lib-5.1.2, libmcrypt-2.5.8, zlib 1.2.6
CFLAGS="-arch x86_64" CCFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure
php-4.4.9
iconv周りの修正
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index dc3b799..62fb3ca 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -84,7 +84,7 @@ ZEND_GET_MODULE(iconv) #endif #ifdef HAVE_LIBICONV -#define iconv libiconv +#define iconv iconv #endif /* {{{ prototypes */
今回のビルドスクリプト
#!/bin/sh PREFIX='/usr/local/' build() { make distclean EXTENSION_DIR=${1}lib/extensions/ export EXTENSION_DIR CFLAGS='-arch x86_64 -g -Os -pipe -no-cpp-precomp' CCFLAGS='-arch x86_64 -g -Os -pipe' CXXFLAGS='-arch x86_64 -g -Os -pipe' LDFLAGS='-arch x86_64 -bind_at_load' export CFLAGS CXXFLAGS LDFLAGS CCFLAGS EXTRA_LIBS='-lresolv' export EXTRA_LIBS ./configure \ --prefix=${1} \ --with-apxs2=/usr/sbin/apxs \ --with-config-file-path=${1}/etc \ --with-pear=${1}/pear \ --enable-cli \ --enable-force-cgi-redirect \ --enable-mbstring \ --enable-mbregex \ --enable-zend-multibyte \ --enable-memory-limit \ --with-iconv-dir=/usr \ --enable-sockets \ --enable-ftp \ --with-curl \ --enable-exif \ --with-mysql=/usr/local/mysql \ --with-pgsql=/usr/local/postgresql \ --enable-zip \ --with-bz2 \ --with-zlib \ --with-zlib-dir=/usr/local \ --with-gettext=/usr/local \ --with-mcrypt=/usr/local \ --with-xmlrpc \ --enable-xml \ --with-xsl \ --with-dom \ --with-gd \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-freetype-dir=/usr/local \ --with-t1lib=/usr/local \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --with-ttf \ && make all } complete() { echo "\ndone" echo "PREFIX => ${PREFIX}" echo 'next: sudo make install' } PWD=`pwd` VER=`basename $PWD` PREFIX=${PREFIX}${VER} build ${PREFIX} && complete
make install で怒られる。
% sudo make install Installing PHP SAPI module: apache2handler /usr/share/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1/build-1/libtool' libs/libphp4.so /usr/libexec/a pache2 /usr/share/apr-1/build-1/libtool --mode=install cp libs/libphp4.so /usr/libexec/apache2/ libtool: install: cp libs/libphp4.so /usr/libexec/apache2/libphp4.so Warning! dlname not found in /usr/libexec/apache2/libphp4.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/libexec/apache2/libphp4.so [activating module `php4' in /private/etc/apache2/httpd.conf] Installing PHP CLI binary: /usr/local/php-4.4.9/bin/ Installing PHP CLI man page: /usr/local/php-4.4.9/man/man1/ Installing PEAR environment: /usr/local/php-4.4.9/pear/ dyld: Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/oppara/src/php/php-4.4.9/sapi/cli/php Reason: image not found make[1]: *** [install-pear-packages] Trace/BPT trap: 5 make: *** [install-pear] Error 2 export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/usr/local/mysql/lib
他のライブラリはフルパスなのに、mysqlのは、なぜかファイル名のみの模様。
なので、他のやばそうなファイルと一緒に修正。
% install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib ./libs/libphp4.bundle % install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib ./libs/libphp4.so % install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib ./sapi/cli/php
で、make install