sfox Tue Mar 18 03:12:42 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/win32/build Makefile config.w32 Log: re2c checking. If it's not installed, the least scary of messages goes out. If it's installed but older than the required version, the download link is given. http://cvs.php.net/viewvc.cgi/php-src/win32/build/Makefile?r1=1.35.2.1.2.6.2.2&r2=1.35.2.1.2.6.2.3&diff_format=u Index: php-src/win32/build/Makefile diff -u php-src/win32/build/Makefile:1.35.2.1.2.6.2.2 php-src/win32/build/Makefile:1.35.2.1.2.6.2.3 --- php-src/win32/build/Makefile:1.35.2.1.2.6.2.2 Mon Mar 17 17:06:51 2008 +++ php-src/win32/build/Makefile Tue Mar 18 03:12:42 2008 @@ -14,14 +14,14 @@ # | Author: Wez Furlong <[EMAIL PROTECTED]> | # +----------------------------------------------------------------------+ # -# $Id: Makefile,v 1.35.2.1.2.6.2.2 2008/03/17 17:06:51 scottmac Exp $ +# $Id: Makefile,v 1.35.2.1.2.6.2.3 2008/03/18 03:12:42 sfox Exp $ # This is the makefile template for the win32 build CC="$(CL)" LD="$(LINK)" MC="$(MC)" MT="$(MT)" - +RE2C="$(RE2C)" MCFILE=$(BUILD_DIR)\wsyslog.rc @@ -29,10 +29,16 @@ build_dirs: $(BUILD_DIR) $(BUILD_DIRS_SUB) +!if $(RE2C) == "" +generated_files: build_dirs Zend\zend_ini_parser.c \ + Zend\zend_language_parser.c \ + $(PHPDEF) $(MCFILE) +!else generated_files: build_dirs Zend\zend_ini_parser.c \ Zend\zend_language_parser.c Zend\zend_ini_scanner.c \ Zend\zend_language_scanner.c \ $(PHPDEF) $(MCFILE) +!endif $(BUILD_DIR)\$(PHPDLL).def: $(PHP_DLL_DEF_SOURCES) type $(PHP_DLL_DEF_SOURCES) > $(BUILD_DIR)\$(PHPDLL).def @@ -43,11 +49,13 @@ Zend\zend_language_parser.c Zend\zend_language_parser.h: Zend\zend_language_parser.y $(BISON) --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_language_parser.y +!if $(RE2C) != "" Zend\zend_ini_scanner.c: Zend\zend_ini_scanner.l $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l Zend\zend_language_scanner.c: Zend\zend_language_scanner.l $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l +!endif PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.40.2.8.2.10.2.9&r2=1.40.2.8.2.10.2.10&diff_format=u Index: php-src/win32/build/config.w32 diff -u php-src/win32/build/config.w32:1.40.2.8.2.10.2.9 php-src/win32/build/config.w32:1.40.2.8.2.10.2.10 --- php-src/win32/build/config.w32:1.40.2.8.2.10.2.9 Mon Mar 17 17:29:13 2008 +++ php-src/win32/build/config.w32 Tue Mar 18 03:12:42 2008 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.40.2.8.2.10.2.9 2008/03/17 17:29:13 stas Exp $ +// $Id: config.w32,v 1.40.2.8.2.10.2.10 2008/03/18 03:12:42 sfox Exp $ // "Master" config file; think of it as a configure.in // equivalent. @@ -57,10 +57,40 @@ if (!PATH_PROG('bison')) { ERROR('bison is required') } -if (!PATH_PROG('re2c')) { - ERROR('re2c is required') + +// There's a minimum requirement for re2c.. +MINRE2C = "0.13.3"; + +function probe_re2c_version(RE2C) +{ + var command = "cmd /c " + RE2C + " -v"; + var version = execute(command + '" 2>&1"'); + + if (version.match(/((\d+)\.(\d+)\.(\d+))/)) { + return RegExp.$1; + } + return 0; +} + +RE2C = PATH_PROG('re2c'); +if (RE2C) { + var intvers, intmin; + var pattern = /\./g; + + RE2CVERS = probe_re2c_version(RE2C); + intvers = RE2CVERS.replace(pattern, '') - 0; + intmin = MINRE2C.replace(pattern, '') - 0; + + if (intvers < intmin) { + STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C + ', ' + RE2CVERS + ' detected'); + STDOUT.WriteLine('Parsers will not be generated. Upgrade your copy at http://sf.net/projects/re2c'); + DEFINE('RE2C', ''); + } else { + DEFINE('RE2C_FLAGS', ''); + } +} else { + STDOUT.WriteLine('Parsers will not be regenerated'); } -DEFINE('RE2C_FLAGS', ''); PATH_PROG('zip'); PATH_PROG('lemon');
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php