diff --git a/src/SPC/builder/extension/grpc.php b/src/SPC/builder/extension/grpc.php index ba15518f..732f7cbe 100644 --- a/src/SPC/builder/extension/grpc.php +++ b/src/SPC/builder/extension/grpc.php @@ -28,6 +28,15 @@ class grpc extends Extension 'zend_ce_exception,', ); + // Fix include path conflict with pdo_sqlsrv: grpc's PHP ext dir is added to the global include path via + $grpc_php_dir = "{$this->source_dir}/src/php/ext/grpc"; + if (file_exists("{$grpc_php_dir}/version.h")) { + copy("{$grpc_php_dir}/version.h", "{$grpc_php_dir}/php_grpc_version.h"); + unlink("{$grpc_php_dir}/version.h"); + FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.h", '#include "version.h"', '#include "php_grpc_version.h"'); + FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.c", '#include "version.h"', '#include "php_grpc_version.h"'); + } + $config_m4 = <<<'M4' PHP_ARG_ENABLE(grpc, [whether to enable grpc support], [AS_HELP_STRING([--enable-grpc], [Enable grpc support])]) diff --git a/src/SPC/builder/unix/library/libjpeg.php b/src/SPC/builder/unix/library/libjpeg.php index 98881b76..969fa060 100644 --- a/src/SPC/builder/unix/library/libjpeg.php +++ b/src/SPC/builder/unix/library/libjpeg.php @@ -14,7 +14,10 @@ trait libjpeg ->addConfigureArgs( '-DENABLE_STATIC=ON', '-DENABLE_SHARED=OFF', - '-DWITH_SYSTEM_ZLIB=ON' + '-DWITH_SYSTEM_ZLIB=ON', + '-DWITH_TOOLS=OFF', + '-DWITH_TESTS=OFF', + '-DWITH_SIMD=OFF', ) ->build(); // patch pkgconfig diff --git a/src/SPC/util/executor/UnixCMakeExecutor.php b/src/SPC/util/executor/UnixCMakeExecutor.php index eceab901..d0241f56 100644 --- a/src/SPC/util/executor/UnixCMakeExecutor.php +++ b/src/SPC/util/executor/UnixCMakeExecutor.php @@ -183,6 +183,7 @@ class UnixCMakeExecutor extends Executor $cflags = getenv('SPC_DEFAULT_C_FLAGS'); $cc = getenv('CC'); $cxx = getenv('CCX'); + $include = BUILD_INCLUDE_PATH; logger()->debug("making cmake tool chain file for {$os} {$target_arch} with CFLAGS='{$cflags}'"); $root = BUILD_ROOT_PATH; $pkgConfigExecutable = PkgConfigUtil::findPkgConfig(); @@ -210,6 +211,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "{$include}") +set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "{$include}") set(CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread -lm -lutil") CMAKE; // Whoops, linux may need CMAKE_AR sometimes