PHP: use php-config instead of explicitly setting include paths. (#7572)

This commit is contained in:
Joshua Haberman 2020-05-28 12:10:53 -07:00 committed by GitHub
parent 2d654e8198
commit 1688ea8d60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1 additions and 20 deletions

View File

@ -4,12 +4,7 @@ function use_php() {
VERSION=$1
OLD_PATH=$PATH
OLD_CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH
OLD_C_INCLUDE_PATH=$C_INCLUDE_PATH
export PATH=/usr/local/php-${VERSION}/bin:$OLD_PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_CPLUS_INCLUDE_PATH
export C_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_C_INCLUDE_PATH
}
function generate_proto() {

View File

@ -3,12 +3,10 @@
VERSION=$2
export PATH=/usr/local/php-$VERSION/bin:$PATH
export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
pushd ../ext/google/protobuf
make clean || true
set -e
# Add following in configure for debug: --enable-debug CFLAGS='-g -O0'
phpize && ./configure CFLAGS='-g -O0 -Wall' && make
phpize && ./configure --with-php-config=`which php-config` CFLAGS='-g -O0 -Wall' && make
popd

View File

@ -3,8 +3,6 @@
VERSION=$1
export PATH=/usr/local/php-$VERSION/bin:$PATH
export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
php -i | grep "Configuration"

View File

@ -6,8 +6,6 @@ VERSION=7.4
PORT=12345
export PATH=/usr/local/php-$VERSION/bin:$PATH
export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
/bin/bash ./compile_extension.sh $VERSION
nohup php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so -S localhost:$PORT multirequest.php 2>&1 &

View File

@ -3,8 +3,6 @@
VERSION=$1
export PATH=/usr/local/php-$VERSION/bin:$PATH
export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
# Compile c extension
/bin/bash ./compile_extension.sh $VERSION

View File

@ -492,24 +492,18 @@ generate_php_test_proto() {
use_php() {
VERSION=$1
export PATH=/usr/local/php-${VERSION}/bin:$PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$CPLUS_INCLUDE_PATH
export C_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$C_INCLUDE_PATH
generate_php_test_proto
}
use_php_zts() {
VERSION=$1
export PATH=/usr/local/php-${VERSION}-zts/bin:$PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}-zts/include/php/main:/usr/local/php-${VERSION}-zts/include/php/:$CPLUS_INCLUDE_PATH
export C_INCLUDE_PATH=/usr/local/php-${VERSION}-zts/include/php/main:/usr/local/php-${VERSION}-zts/include/php/:$C_INCLUDE_PATH
generate_php_test_proto
}
use_php_bc() {
VERSION=$1
export PATH=/usr/local/php-${VERSION}-bc/bin:$PATH
export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}-bc/include/php/main:/usr/local/php-${VERSION}-bc/include/php/:$CPLUS_INCLUDE_PATH
export C_INCLUDE_PATH=/usr/local/php-${VERSION}-bc/include/php/main:/usr/local/php-${VERSION}-bc/include/php/:$C_INCLUDE_PATH
generate_php_test_proto
}