]> granicus.if.org Git - php/commitdiff
- missing file
authorPierre Joye <pajoye@php.net>
Mon, 3 Jan 2011 01:22:00 +0000 (01:22 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 3 Jan 2011 01:22:00 +0000 (01:22 +0000)
win32/build/config.w32.phpize.in [new file with mode: 0644]

diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in
new file mode 100644 (file)
index 0000000..b8bf45e
--- /dev/null
@@ -0,0 +1,358 @@
+// vim:ft=javascript\r
+// $Id: config.w32 306241 2010-12-11 22:18:10Z pajoye $\r
+// "Master" config file; think of it as a configure.in\r
+// equivalent.\r
+\r
+var PHP_CYGWIN="notset";\r
+PHP_CL = PATH_PROG('cl', null, 'PHP_CL');\r
+if (!PHP_CL) {\r
+       ERROR("MS C++ compiler is required");\r
+}\r
+/* For the record here: */\r
+// 1200 is VC6\r
+// 1300 is vs.net 2002\r
+// 1310 is vs.net 2003\r
+// 1400 is vs.net 2005\r
+// 1500 is vs.net 2008\r
+// 1600 is vs.net 2010\r
+// Which version of the compiler do we have?\r
+VCVERS = probe_binary(PHP_CL).substr(0, 5).replace('.', '');\r
+STDOUT.WriteLine("  Detected compiler " + VC_VERSIONS[VCVERS]);\r
+\r
+if (VCVERS < 1500) {\r
+       ERROR("Unsupported MS C++ Compiler, VC9 (2008) minimum is required");\r
+}\r
+\r
+AC_DEFINE('COMPILER', VC_VERSIONS[VCVERS], "Detected compiler version");\r
+DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]);\r
+AC_DEFINE('PHP_COMPILER_ID', VC_VERSIONS_SHORT[VCVERS], "Compiler compatibility ID");\r
+\r
+// do we use x64 or 80x86 version of compiler?\r
+X64 = probe_binary(PHP_CL, 64, null, 'PHP_CL');\r
+if (X64) {\r
+       STDOUT.WriteLine("  Detected 64-bit compiler");\r
+} else {\r
+       STDOUT.WriteLine("  Detected 32-bit compiler");\r
+}\r
+AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");\r
+DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86');\r
+\r
+// cygwin now ships with link.exe.  Avoid searching the cygwin path\r
+// for this, as we want the MS linker, not the fileutil\r
+PATH_PROG('link', WshShell.Environment("Process").Item("PATH"));\r
+PATH_PROG('nmake');\r
+\r
+// we don't want to define LIB, as that will override the default library path\r
+// that is set in that env var\r
+PATH_PROG('lib', null, 'MAKE_LIB');\r
+if (!PATH_PROG('bison')) {\r
+       ERROR('bison is required')\r
+}\r
+\r
+// There's a minimum requirement for re2c..\r
+MINRE2C = "0.13.4";\r
+\r
+RE2C = PATH_PROG('re2c');\r
+if (RE2C) {\r
+       var intvers, intmin;\r
+       var pattern = /\./g;\r
+\r
+       RE2CVERS = probe_binary(RE2C, "version");\r
+       STDOUT.WriteLine('  Detected re2c version ' + RE2CVERS);\r
+\r
+       intvers = RE2CVERS.replace(pattern, '') - 0;\r
+       intmin = MINRE2C.replace(pattern, '') - 0;\r
+\r
+       if (intvers < intmin) {\r
+               STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);\r
+               STDOUT.WriteLine('Parsers will not be generated. Upgrade your copy at http://sf.net/projects/re2c');\r
+               DEFINE('RE2C', '');\r
+       } else {\r
+               DEFINE('RE2C_FLAGS', '');\r
+       }\r
+} else {\r
+       STDOUT.WriteLine('Parsers will not be regenerated');\r
+}\r
+PATH_PROG('zip');\r
+PATH_PROG('lemon');\r
+\r
+// avoid picking up midnight commander from cygwin\r
+PATH_PROG('mc', WshShell.Environment("Process").Item("PATH"));\r
+\r
+// Try locating manifest tool\r
+if (VCVERS > 1200) {\r
+       PATH_PROG('mt', WshShell.Environment("Process").Item("PATH"));\r
+}\r
+\r
+// stick objects somewhere outside of the source tree\r
+ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');\r
+if (PHP_OBJECT_OUT_DIR.length) {\r
+       PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR);\r
+       if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) {\r
+               ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist');\r
+       }\r
+       PHP_OBJECT_OUT_DIR += '\\';\r
+} else if (X64) {\r
+       if (!FSO.FolderExists("x64")) {\r
+               FSO.CreateFolder("x64");\r
+       }\r
+       PHP_OBJECT_OUT_DIR = 'x64\\';\r
+}\r
+\r
+ARG_ENABLE('debug', 'Compile with debugging symbols', "no");\r
+ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');\r
+if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {\r
+       ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");\r
+}\r
+\r
+DEFINE('PHP_PREFIX', PHP_PREFIX);\r
+\r
+DEFINE("BASE_INCLUDES", "/I " + PHP_DIR + "/include /I " + PHP_DIR + "/include/main /I " + PHP_DIR + "/include/Zend /I " + PHP_DIR + "/include/TSRM /I " + PHP_DIR + "/include/ext ");\r
+\r
+// CFLAGS for building the PHP dll\r
+DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \\r
+/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x500");\r
+\r
+DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');\r
+\r
+// General CFLAGS for building objects\r
+DEFINE("CFLAGS", "/nologo /FD $(BASE_INCLUDES) /D _WINDOWS \\r
+/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 ");\r
+\r
+if (VCVERS < 1400) {\r
+       // Enable automatic precompiled headers\r
+       ADD_FLAG('CFLAGS', ' /YX ');\r
+\r
+       if (PHP_DEBUG == "yes") {\r
+               // Set some debug/release specific options\r
+               ADD_FLAG('CFLAGS', ' /GZ ');\r
+       }\r
+}\r
+\r
+if (VCVERS >= 1400) {\r
+       // fun stuff: MS deprecated ANSI stdio and similar functions\r
+       // disable annoying warnings.  In addition, time_t defaults\r
+       // to 64-bit.  Ask for 32-bit.\r
+       if (X64) {\r
+               ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 ');\r
+       } else {\r
+               ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');\r
+       }\r
+\r
+       if (PHP_DEBUG == "yes") {\r
+               // Set some debug/release specific options\r
+               ADD_FLAG('CFLAGS', ' /RTC1 ');\r
+       }\r
+}\r
+\r
+ARG_WITH('prefix', 'PHP installation prefix', '');\r
+ARG_WITH('mp', 'Tell VC9+ use up to [n,auto,disable] processes for compilation', 'auto');\r
+if (VCVERS >= 1500 && PHP_MP != 'disable') {\r
+               // no from disable-all \r
+               if(PHP_MP == 'auto' || PHP_MP == 'no') {\r
+                        ADD_FLAG('CFLAGS', ' /MP ');\r
+               } else {\r
+                       if(parseInt(PHP_MP) != 0) {\r
+                               ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' ');\r
+                       } else {\r
+                               STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);\r
+                       }\r
+               }\r
+}\r
+\r
+/* For snapshot builders, where can we find the additional\r
+ * files that make up the snapshot template? */\r
+ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no");\r
+\r
+// General DLL link flags\r
+DEFINE("DLL_LDFLAGS", "/dll ");\r
+\r
+// PHP DLL link flags\r
+DEFINE("PHP_LDFLAGS", "$(DLL_LDFLAGS)");\r
+\r
+// General libs\r
+// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib\r
+DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib");\r
+\r
+// Set some debug/release specific options\r
+if (PHP_DEBUG == "yes") {\r
+       ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +\r
+               (X64?"/Zi":"/ZI"));\r
+       ADD_FLAG("LDFLAGS", "/debug");\r
+       // Avoid problems when linking to release libraries that use the release\r
+       // version of the libc\r
+       ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");\r
+} else {\r
+       // Generate external debug files when --enable-debug-pack is specified\r
+       if (PHP_DEBUG_PACK == "yes") {\r
+               ADD_FLAG("CFLAGS", "/Zi");\r
+               ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");\r
+       }\r
+       // Equivalent to Release_TSInline build -> best optimization\r
+       ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");\r
+\r
+       // if you have VS.Net /GS hardens the binary against buffer overruns\r
+       // ADD_FLAG("CFLAGS", "/GS");\r
+}\r
+\r
+if (PHP_ZTS == "yes") {\r
+       ADD_FLAG("CFLAGS", "/D ZTS=1");\r
+}\r
+\r
+DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");\r
+\r
+\r
+// we want msvcrt in the PHP DLL\r
+ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");\r
+\r
+// set up the build dir and DLL name\r
+if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {\r
+       DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");\r
+       if (!MODE_PHPIZE) {\r
+               DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll");\r
+               DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib");\r
+       }\r
+} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {\r
+       DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug");\r
+       if (!MODE_PHPIZE) {\r
+               DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll");\r
+               DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib");\r
+       }\r
+} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {\r
+       DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS");\r
+       if (!MODE_PHPIZE) {\r
+               DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll");\r
+               DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib");\r
+       }\r
+} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {\r
+       DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release");\r
+       if (!MODE_PHPIZE) {\r
+               DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll");\r
+               DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib");\r
+       }\r
+}\r
+\r
+if (MODE_PHPIZE) {\r
+       DEFINE("PHPDLL", PHP_DLL);\r
+       DEFINE("PHPLIB", PHP_DLL_LIB);\r
+}\r
+\r
+// Find the php_build dir - it contains headers and libraries\r
+// that we need\r
+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');\r
+\r
+if (PHP_PHP_BUILD == 'no') {\r
+       if (FSO.FolderExists("..\\deps")) {\r
+               PHP_PHP_BUILD = "..\\deps";\r
+       } else {\r
+               if (FSO.FolderExists("..\\php_build")) {\r
+                       PHP_PHP_BUILD = "..\\php_build";\r
+               } else {\r
+                       if (X64) {\r
+                               if (FSO.FolderExists("..\\win64build")) {\r
+                                       PHP_PHP_BUILD = "..\\win64build";\r
+                               } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) {\r
+                                       PHP_PHP_BUILD = "..\\php-win64-dev\\php_build";\r
+                               }\r
+                       } else {\r
+                               if (FSO.FolderExists("..\\win32build")) {\r
+                                       PHP_PHP_BUILD = "..\\win32build";\r
+                               } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) {\r
+                                       PHP_PHP_BUILD = "..\\php-win32-dev\\php_build";\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+       PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD);\r
+}\r
+DEFINE("PHP_BUILD", PHP_PHP_BUILD);\r
+\r
+ARG_WITH('extra-includes', 'Extra include path to use when building everything', '');\r
+ARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');\r
+\r
+var php_usual_include_suspects = PHP_PHP_BUILD+"\\include";\r
+var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib";\r
+\r
+ADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" ');\r
+ADD_FLAG("LDFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');\r
+\r
+// Poke around for some headers\r
+function probe_basic_headers()\r
+{\r
+       var p;\r
+\r
+       if (PHP_PHP_BUILD != "no") {\r
+               php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";\r
+               php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";\r
+       }\r
+}\r
+\r
+function add_extra_dirs()\r
+{\r
+       var path, i, f;\r
+\r
+       if (PHP_EXTRA_INCLUDES.length) {\r
+               path = PHP_EXTRA_INCLUDES.split(';');\r
+               for (i = 0; i < path.length; i++) {\r
+                       f = FSO.GetAbsolutePathName(path[i]);\r
+                       if (FSO.FolderExists(f)) {\r
+                               ADD_FLAG("CFLAGS", '/I "' + f + '" ');\r
+                       }\r
+               }\r
+       }\r
+       if (PHP_EXTRA_LIBS.length) {\r
+               path = PHP_EXTRA_LIBS.split(';');\r
+               for (i = 0; i < path.length; i++) {\r
+                       f = FSO.GetAbsolutePathName(path[i]);\r
+                       if (FSO.FolderExists(f)) {\r
+                               if (VCVERS <= 1200 && f.indexOf(" ") >= 0) {\r
+                                       ADD_FLAG("LDFLAGS", '/libpath:"\\"' + f + '\\"" ');\r
+                               } else {\r
+                                       ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" ');\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+}\r
+\r
+probe_basic_headers();\r
+add_extra_dirs();\r
+\r
+//DEFINE("PHP_BUILD", PHP_PHP_BUILD);\r
+\r
+STDOUT.WriteBlankLines(1);\r
+STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));\r
+STDOUT.WriteLine("PHP Core:  " + get_define('PHPDLL') + " and " + get_define('PHPLIB'));\r
+\r
+\r
+if (VCVERS == 1200) {\r
+       AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);\r
+}\r
+\r
+if (VCVERS >= 1400) {\r
+       AC_DEFINE('HAVE_STRNLEN', 1);\r
+}\r
+\r
+STDOUT.WriteBlankLines(1);\r
+\r
+if (PHP_SNAPSHOT_TEMPLATE == "no") {\r
+       /* default is as a sibling of the php_build dir */\r
+       if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) {\r
+               PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template");\r
+       } else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) {\r
+               PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template");\r
+       }\r
+}\r
+\r
+DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);\r
+\r
+if (PHP_DSP != "no") {\r
+       if (FSO.FolderExists("tmp")) {\r
+               FSO.DeleteFolder("tmp");\r
+       }\r
+       FSO.CreateFolder("tmp");\r
+}\r
+\r
+AC_DEFINE("PHP_DIR", PHP_DIR);\r
+DEFINE("PHP_DIR", PHP_DIR);\r