From 9757d9adbf00d3bfabdd3532408f05e92781989f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 11 Nov 2014 15:28:20 +0100 Subject: [PATCH] generalize --with-php-build option handling --- win32/build/config.w32 | 27 +-------------------------- win32/build/config.w32.phpize.in | 27 +-------------------------- win32/build/confutils.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 52 deletions(-) diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 8e63fc829a..6c6626773e 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -103,32 +103,7 @@ else if (PHP_DEBUG != "yes" && PHP_PGO != "no") { // Find the php_build dir - it contains headers and libraries // that we need ARG_WITH('php-build', 'Path to where you extracted the development libraries (http://wiki.php.net/internals/windows/libs). Assumes that it is a sibling of this source dir (..\\deps) if not specified', 'no'); - -if (PHP_PHP_BUILD == 'no') { - if (FSO.FolderExists("..\\deps")) { - PHP_PHP_BUILD = "..\\deps"; - } else { - if (FSO.FolderExists("..\\php_build")) { - PHP_PHP_BUILD = "..\\php_build"; - } else { - if (X64) { - if (FSO.FolderExists("..\\win64build")) { - PHP_PHP_BUILD = "..\\win64build"; - } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win64-dev\\php_build"; - } - } else { - if (FSO.FolderExists("..\\win32build")) { - PHP_PHP_BUILD = "..\\win32build"; - } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win32-dev\\php_build"; - } - } - } - } - PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD); -} -DEFINE("PHP_BUILD", PHP_PHP_BUILD); +php_build_option_handle(); ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in index a82369a855..91b3552412 100644 --- a/win32/build/config.w32.phpize.in +++ b/win32/build/config.w32.phpize.in @@ -87,32 +87,7 @@ if (MODE_PHPIZE) { // Find the php_build dir - it contains headers and libraries // that we need ARG_WITH('php-build', 'Path to where you extracted the development libraries (http://wiki.php.net/internals/windows/libs). Assumes that it is a sibling of this source dir (..\\deps) if not specified', 'no'); - -if (PHP_PHP_BUILD == 'no') { - if (FSO.FolderExists("..\\deps")) { - PHP_PHP_BUILD = "..\\deps"; - } else { - if (FSO.FolderExists("..\\php_build")) { - PHP_PHP_BUILD = "..\\php_build"; - } else { - if (X64) { - if (FSO.FolderExists("..\\win64build")) { - PHP_PHP_BUILD = "..\\win64build"; - } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win64-dev\\php_build"; - } - } else { - if (FSO.FolderExists("..\\win32build")) { - PHP_PHP_BUILD = "..\\win32build"; - } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win32-dev\\php_build"; - } - } - } - } - PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD); -} -DEFINE("PHP_BUILD", PHP_PHP_BUILD); +php_build_option_handle(); ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index da2ffc6429..1c47ace175 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2679,3 +2679,32 @@ function setup_zts_stuff() } } +function php_build_option_handle() +{ + if (PHP_PHP_BUILD == 'no') { + if (FSO.FolderExists("..\\deps")) { + PHP_PHP_BUILD = "..\\deps"; + } else { + if (FSO.FolderExists("..\\php_build")) { + PHP_PHP_BUILD = "..\\php_build"; + } else { + if (X64) { + if (FSO.FolderExists("..\\win64build")) { + PHP_PHP_BUILD = "..\\win64build"; + } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) { + PHP_PHP_BUILD = "..\\php-win64-dev\\php_build"; + } + } else { + if (FSO.FolderExists("..\\win32build")) { + PHP_PHP_BUILD = "..\\win32build"; + } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) { + PHP_PHP_BUILD = "..\\php-win32-dev\\php_build"; + } + } + } + } + PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD); + } + DEFINE("PHP_BUILD", PHP_PHP_BUILD); +} + -- 2.50.1