cvs: php-src /win32/build config.w32 config.w32.h.in

From: Date: Tue, 10 Apr 2007 06:22:45 +0000
Subject: cvs: php-src /win32/build config.w32 config.w32.h.in
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-43796@lists.php.net to get a copy of this message
dmitry Tue Apr 10 06:22:45 2007 UTC Modified files: /php-src/win32/build config.w32 config.w32.h.in Log: Initial WIN64 support http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.63&r2=1.64&diff_format=u Index: php-src/win32/build/config.w32 diff -u php-src/win32/build/config.w32:1.63 php-src/win32/build/config.w32:1.64 --- php-src/win32/build/config.w32:1.63 Sat Mar 3 21:40:23 2007 +++ php-src/win32/build/config.w32 Tue Apr 10 06:22:45 2007 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.63 2007/03/03 21:40:23 helly Exp $ +// $Id: config.w32,v 1.64 2007/04/10 06:22:45 dmitry Exp $ // "Master" config file; think of it as a configure.in // equivalent. @@ -26,6 +26,24 @@ // 13 is vs.net 2003 // 14 is vs.net 2005 +// do we use x64 or 80x86 version of compiler? +function probe_msvc_compiler_x64(CL) +{ + // tricky escapes to get stderr redirection to work + var banner = execute('cmd /c ""' + CL + '" 2>&1"'); + if (banner.match(/x64/)) { + return 1; + } + return 0; +} + +X64 = probe_msvc_compiler_x64(CL); +if (X64) { + STDOUT.WriteLine("Detected 64-bit compiler"); +} else { + STDOUT.WriteLine("Detected 32-bit compiler"); +} + // cygwin now ships with link.exe. Avoid searching the cygwin path // for this, as we want the MS linker, not the fileutil PATH_PROG('link', WshShell.Environment("Process").Item("PATH")); @@ -58,6 +76,11 @@ ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist'); } PHP_OBJECT_OUT_DIR += '\\'; +} else if (X64) { + if (!FSO.FolderExists("x64")) { + FSO.CreateFolder("x64"); + } + PHP_OBJECT_OUT_DIR = 'x64\\'; } ARG_ENABLE('debug', 'Compile with debugging symbols', "no"); @@ -100,7 +123,12 @@ if (VCVERS >= 14) { // fun stuff: MS deprecated ANSI stdio and similar functions // disable annoying warnings - ADD_FLAG('CFLAGS', ' /wd4996 '); + if (X64) { + ADD_FLAG('CFLAGS', ' /wd4996 '); +// ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 '); + } else { + ADD_FLAG('CFLAGS', ' /wd4996 '); + } if (PHP_DEBUG == "yes") { // Set some debug/release specific options @@ -125,7 +153,11 @@ // Set some debug/release specific options if (PHP_DEBUG == "yes") { - ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /ZI /Od /D _DEBUG /D ZEND_DEBUG=1"); + if (X64) { + ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /Zi /Od /D _DEBUG /D ZEND_DEBUG=1"); + } else { + ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /ZI /Od /D _DEBUG /D ZEND_DEBUG=1"); + } ADD_FLAG("LDFLAGS", "/debug"); // Avoid problems when linking to release libraries that use the release // version of the libc @@ -176,18 +208,28 @@ if (PHP_PHP_BUILD == 'no') { if (FSO.FolderExists("..\\php_build")) { PHP_PHP_BUILD = "..\\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"; + } 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"; + } + } } } ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); -var php_usual_include_suspects = "..\\php_build\\include;..\\win32build\\include;..\\bindlib_w32"; -var php_usual_lib_suspects = "..\\php_build\\lib;..\\win32build\\lib;..\\bindlib_w32"; +var php_usual_include_suspects = PHP_PHP_BUILD+"\\include;..\\bindlib_w32"; +var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib;..\\bindlib_w32"; // Poke around for some headers function probe_basic_headers() @@ -323,7 +365,9 @@ if (PHP_SNAPSHOT_TEMPLATE == "no") { /* default is as a sibling of the php_build dir */ - if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) { + if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) { + PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template"); + } else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) { PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template"); } } http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32.h.in?r1=1.12&r2=1.13&diff_format=u Index: php-src/win32/build/config.w32.h.in diff -u php-src/win32/build/config.w32.h.in:1.12 php-src/win32/build/config.w32.h.in:1.13 --- php-src/win32/build/config.w32.h.in:1.12 Fri Nov 10 09:56:37 2006 +++ php-src/win32/build/config.w32.h.in Tue Apr 10 06:22:45 2007 @@ -1,6 +1,6 @@ /* Build Configuration Template for Win32. - $Id: config.w32.h.in,v 1.12 2006/11/10 09:56:37 dmitry Exp $ + $Id: config.w32.h.in,v 1.13 2007/04/10 06:22:45 dmitry Exp $ */ /* Default PHP / PEAR directories */ @@ -150,6 +150,8 @@ /* vs.net 2005 has a 64-bit time_t. This will likely break * 3rdParty libs that were built with older compilers; switch * back to 32-bit */ -#define _USE_32BIT_TIME_T 1 +#ifndef _WIN64 +# define _USE_32BIT_TIME_T 1 +#endif #define HAVE_STDLIB_H 1

« previous php.cvs (#43796) next »