Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does anyone have some tips on compiling PHP's intl extension on OS X 10.6.3?

I'm getting compile errors each way I try it and I've been googling for ages and getting nowhere. Any help greatly appreciated.

When make gets to the huge gcc command to compile libphp5.bundle, I get the following error:

Undefined symbols:
  "___gxx_personality_v0", referenced from:
      icu_4_2::MessageFormatAdapter::getArgTypeList(icu_4_2::MessageFormat const&, int&)in msgformat_helpers.o
      _umsg_parse_helper in msgformat_helpers.o
      _umsg_format_arg_count in msgformat_helpers.o
      _umsg_format_helper in msgformat_helpers.o
      CIE in msgformat_helpers.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1

My compile commands are:

MACOSX_DEPLOYMENT_TARGET=10.6
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 MACOSX_DEPLOYMENT_TARGET
./configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-curl=/usr \
--with-gd \
--with-jpeg-dir=/src/jpeg/jpeg-local \
--with-png-dir=/usr/X11R6 \
--with-freetype-dir=/usr/X11R6 \
--with-xpm-dir=/usr/X11R6 \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--enable-mbstring \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/mysql/mysql.sock \
--with-iodbc=/usr \
--enable-shmop \
--with-snmp=/usr \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--with-pcre-regex=/src/pcre/pcre-local/usr/local \
--with-pcre-dir=/src/pcre/pcre-local/usr/local \
--with-icu-dir=/usr/local \
--enable-intl

export EXTRA_CFLAGS="-lresolv"
make
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Simple google search turned up this page. Pay close attention to the very bottom post:

 [2010-02-10 12:05 UTC] surfchen at gmail dot com
It is a linking problem, here is the simple workaround:
edit Makefile and add -lstdc++ into EXTRA_LIBS.
share|improve this answer
    
solefald, I am ashamed of my googling skills. I don't if I failed to find that page or failed to read it carefully. In any case, thank you very much. This fixed the compile and I am collating like a unicoder now. –  fsb Apr 20 '10 at 15:20
    
glad i could help! :) –  solefald Apr 20 '10 at 15:27
add comment

phpbrew has a patch for this

https://github.com/c9s/phpbrew/commit/18ef766d0e013ee87ac7d86e338ebec89fbeb445.

You may run:

sed -i \'/^BUILD_/ s/\$(CC)/\$(CXX)/g\' Makefile
sed -i \'/EXTRA_LIBS = /s|$| -lstdc++|\' Makefile

To fix this issue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.