From dac2ea5677c50c5222392a4039d4a6c3cb9f4dc8 Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 22 Jun 2026 16:12:22 +0700 Subject: [PATCH] --with-sysconfdir option --- src/SPC/builder/freebsd/BSDBuilder.php | 3 +++ src/SPC/builder/linux/LinuxBuilder.php | 3 +++ src/SPC/builder/macos/MacOSBuilder.php | 3 +++ src/SPC/command/BuildPHPCommand.php | 1 + 4 files changed, 10 insertions(+) diff --git a/src/SPC/builder/freebsd/BSDBuilder.php b/src/SPC/builder/freebsd/BSDBuilder.php index b746dff5..af4723c3 100644 --- a/src/SPC/builder/freebsd/BSDBuilder.php +++ b/src/SPC/builder/freebsd/BSDBuilder.php @@ -65,6 +65,8 @@ class BSDBuilder extends UnixBuilderBase ('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : ''; $config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ? ('--with-config-file-scan-dir=' . $this->getOption('with-config-file-scan-dir') . ' ') : ''; + $sysconfdir = $this->getOption('with-sysconfdir', false) ? + ('--sysconfdir=' . $this->getOption('with-sysconfdir') . ' ') : ''; $enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI; $enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM; @@ -89,6 +91,7 @@ class BSDBuilder extends UnixBuilderBase ($enableMicro ? '--enable-micro ' : '--disable-micro ') . $config_file_path . $config_file_scan_dir . + $sysconfdir . $json_74 . $zts . $this->makeStaticExtensionArgs() diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index 0a04ad38..60513ba7 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -88,6 +88,8 @@ class LinuxBuilder extends UnixBuilderBase ('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : ''; $config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ? ('--with-config-file-scan-dir=' . $this->getOption('with-config-file-scan-dir') . ' ') : ''; + $sysconfdir = $this->getOption('with-sysconfdir', false) ? + ('--sysconfdir=' . $this->getOption('with-sysconfdir') . ' ') : ''; $enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI; $enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM; @@ -125,6 +127,7 @@ class LinuxBuilder extends UnixBuilderBase ($enableCgi ? '--enable-cgi ' : '--disable-cgi ') . $config_file_path . $config_file_scan_dir . + $sysconfdir . $json_74 . $zts . $maxExecutionTimers . diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index 1717a6b9..8ccd217c 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -96,6 +96,8 @@ class MacOSBuilder extends UnixBuilderBase ('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : ''; $config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ? ('--with-config-file-scan-dir=' . $this->getOption('with-config-file-scan-dir') . ' ') : ''; + $sysconfdir = $this->getOption('with-sysconfdir', false) ? + ('--sysconfdir=' . $this->getOption('with-sysconfdir') . ' ') : ''; $enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI; $enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM; @@ -129,6 +131,7 @@ class MacOSBuilder extends UnixBuilderBase ($enableCgi ? '--enable-cgi ' : '--disable-cgi ') . $config_file_path . $config_file_scan_dir . + $sysconfdir . $json_74 . $zts . $this->makeStaticExtensionArgs() . ' ' . diff --git a/src/SPC/command/BuildPHPCommand.php b/src/SPC/command/BuildPHPCommand.php index 58be9087..79e64723 100644 --- a/src/SPC/command/BuildPHPCommand.php +++ b/src/SPC/command/BuildPHPCommand.php @@ -39,6 +39,7 @@ class BuildPHPCommand extends BuildCommand $this->addOption('disable-opcache-jit', null, null, 'disable opcache jit'); $this->addOption('with-config-file-path', null, InputOption::VALUE_REQUIRED, 'Set the path in which to look for php.ini', $isWindows ? null : '/usr/local/etc/php'); $this->addOption('with-config-file-scan-dir', null, InputOption::VALUE_REQUIRED, 'Set the directory to scan for .ini files after reading php.ini', $isWindows ? null : '/usr/local/etc/php/conf.d'); + $this->addOption('with-sysconfdir', null, InputOption::VALUE_REQUIRED, 'Set the sysconfdir (e.g. /etc/php-zts) used by configure (not available on Windows)'); $this->addOption('with-hardcoded-ini', 'I', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Patch PHP source code, inject hardcoded INI'); $this->addOption('with-micro-fake-cli', null, null, 'Let phpmicro\'s PHP_SAPI use "cli" instead of "micro"'); $this->addOption('with-suggested-libs', 'L', null, 'Build with suggested libs for selected exts and libs');