PHP: use php-config instead of explicitly setting include paths. (#7572)
This commit is contained in:
parent
2d654e8198
commit
1688ea8d60
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 &
|
||||
|
@ -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
|
||||
|
6
tests.sh
6
tests.sh
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user