From 1688ea8d60aac47f0137cfa8c2160e91b3b8edbe Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 28 May 2020 12:10:53 -0700 Subject: [PATCH] PHP: use php-config instead of explicitly setting include paths. (#7572) --- php/tests/compatibility_test.sh | 5 ----- php/tests/compile_extension.sh | 4 +--- php/tests/gdb_test.sh | 2 -- php/tests/multirequest.sh | 2 -- php/tests/test.sh | 2 -- tests.sh | 6 ------ 6 files changed, 1 insertion(+), 20 deletions(-) diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh index 2b5c6ab5b7..b228e5589b 100755 --- a/php/tests/compatibility_test.sh +++ b/php/tests/compatibility_test.sh @@ -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() { diff --git a/php/tests/compile_extension.sh b/php/tests/compile_extension.sh index 2ffc51f14b..93916b17b6 100755 --- a/php/tests/compile_extension.sh +++ b/php/tests/compile_extension.sh @@ -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 diff --git a/php/tests/gdb_test.sh b/php/tests/gdb_test.sh index da5f3f3ac1..80950c338c 100755 --- a/php/tests/gdb_test.sh +++ b/php/tests/gdb_test.sh @@ -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" diff --git a/php/tests/multirequest.sh b/php/tests/multirequest.sh index 97535ea0ed..f3f68d0d7b 100755 --- a/php/tests/multirequest.sh +++ b/php/tests/multirequest.sh @@ -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 & diff --git a/php/tests/test.sh b/php/tests/test.sh index 3c5e30d738..45a68f87e5 100755 --- a/php/tests/test.sh +++ b/php/tests/test.sh @@ -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 diff --git a/tests.sh b/tests.sh index 59c4162f3f..4def89dc01 100755 --- a/tests.sh +++ b/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 }