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

From: Date: Tue, 10 Apr 2007 06:22:28 +0000
Subject: cvs: php-src(PHP_5_2) /win32/build config.w32 config.w32.h.in
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-43795@lists.php.net to get a copy of this message
dmitry Tue Apr 10 06:22:28 2007 UTC Modified files: (Branch: PHP_5_2) /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.40.2.8.2.7&r2=1.40.2.8.2.8&diff_format=u Index: php-src/win32/build/config.w32 diff -u php-src/win32/build/config.w32:1.40.2.8.2.7 php-src/win32/build/config.w32:1.40.2.8.2.8 --- php-src/win32/build/config.w32:1.40.2.8.2.7 Wed Dec 20 10:49:33 2006 +++ php-src/win32/build/config.w32 Tue Apr 10 06:22:28 2007 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.40.2.8.2.7 2006/12/20 10:49:33 dmitry Exp $ +// $Id: config.w32,v 1.40.2.8.2.8 2007/04/10 06:22:28 dmitry Exp $ // "Master" config file; think of it as a configure.in // equivalent. @@ -27,6 +27,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")); @@ -59,6 +77,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"); @@ -102,7 +125,12 @@ // fun stuff: MS deprecated ANSI stdio and similar functions // disable annoying warnings. In addition, time_t defaults // to 64-bit. Ask for 32-bit. - ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 '); + if (X64) { + ADD_FLAG('CFLAGS', ' /wd4996 '); +// ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 '); + } else { + ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 '); + } if (PHP_DEBUG == "yes") { // Set some debug/release specific options @@ -126,7 +154,8 @@ // Set some debug/release specific options if (PHP_DEBUG == "yes") { - ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /ZI /Od /D _DEBUG /D ZEND_DEBUG=1"); + ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " + + (X64?"/Zi":"/ZI")); ADD_FLAG("LDFLAGS", "/debug"); // Avoid problems when linking to release libraries that use the release // version of the libc @@ -177,18 +206,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() @@ -312,7 +351,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.7.2.4.2.1&r2=1.7.2.4.2.2&diff_format=u Index: php-src/win32/build/config.w32.h.in diff -u php-src/win32/build/config.w32.h.in:1.7.2.4.2.1 php-src/win32/build/config.w32.h.in:1.7.2.4.2.2 --- php-src/win32/build/config.w32.h.in:1.7.2.4.2.1 Fri Nov 10 09:56:16 2006 +++ php-src/win32/build/config.w32.h.in Tue Apr 10 06:22:28 2007 @@ -1,6 +1,6 @@ /* Build Configuration Template for Win32. - $Id: config.w32.h.in,v 1.7.2.4.2.1 2006/11/10 09:56:16 dmitry Exp $ + $Id: config.w32.h.in,v 1.7.2.4.2.2 2007/04/10 06:22:28 dmitry Exp $ */ /* Default PHP / PEAR directories */ @@ -151,6 +151,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 (#43795) next »