diff options
author | 2015-06-25 15:54:44 -0700 | |
---|---|---|
committer | 2015-06-25 15:54:44 -0700 | |
commit | d42ad96c845cd6dec4181717d0aa3b2af4de3fde (patch) | |
tree | 67707e6ca9ad8c056f357afd5a296810a36c599f | |
parent | 88f8e940a0ec77037f5dd5a1e3ffed3220111a17 (diff) | |
parent | 76ed0cc26a69d768513d59d0f1913e669f002f72 (diff) |
Merge pull request #2222 from stanley-cheung/fix_php_extension_osx_configure
php extension: do not link rt in osx
-rw-r--r-- | src/php/README.md | 23 | ||||
-rwxr-xr-x | src/php/ext/grpc/config.m4 | 9 |
2 files changed, 25 insertions, 7 deletions
diff --git a/src/php/README.md b/src/php/README.md index 42ddb2d731..370a8107f4 100644 --- a/src/php/README.md +++ b/src/php/README.md @@ -5,14 +5,27 @@ This directory contains source code for PHP implementation of gRPC layered on sh #Status -Pre-Alpha : This gRPC PHP implementation is work-in-progress and is not expected to work yet. +Alpha : Ready for early adopters ## ENVIRONMENT -Prerequisite: PHP 5.5 or later, PHPUnit, pecl +Prerequisite: PHP 5.5 or later, `phpunit`, `pecl` + +Linux: + +```sh +$ sudo apt-get install php5 php5-dev phpunit php-pear +``` + +OS X: ```sh -sudo apt-get install php5 php5-dev phpunit php-pear +$ curl https://phar.phpunit.de/phpunit.phar -o phpunit.phar +$ chmod +x phpunit.phar +$ sudo mv phpunit.phar /usr/local/bin/phpunit + +$ curl -O http://pear.php.net/go-pear.phar +$ sudo php -d detect_unicode=0 go-pear.phar ``` ## Build from Homebrew @@ -71,8 +84,8 @@ $ make $ sudo make install ``` -In your php.ini file, add the line `extension=grpc.so` to load the extension -at PHP startup. +(Optional) In your php.ini file, add the line `extension=grpc.so` to load +the extension at PHP startup. Install Composer diff --git a/src/php/ext/grpc/config.m4 b/src/php/ext/grpc/config.m4 index b485aabf40..8bacdfbfec 100755 --- a/src/php/ext/grpc/config.m4 +++ b/src/php/ext/grpc/config.m4 @@ -35,8 +35,13 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_LIBRARY(dl,,GRPC_SHARED_LIBADD) PHP_ADD_LIBRARY(dl) - PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD) - PHP_ADD_LIBRARY(rt) + case $host in + *darwin*) ;; + *) + PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD) + PHP_ADD_LIBRARY(rt) + ;; + esac GRPC_LIBDIR=$GRPC_DIR/${GRPC_LIB_SUBDIR-lib} |