Guest User

Untitled

a guest
Jul 25th, 2013
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* This file automatically generated from win32/build/confutils.js */
  2. MODE_PHPIZE=false;
  3. // Utils for configure script
  4. /*
  5.   +----------------------------------------------------------------------+
  6.   | PHP Version 5                                                        |
  7.   +----------------------------------------------------------------------+
  8.   | Copyright (c) 1997-2008 The PHP Group                                |
  9.   +----------------------------------------------------------------------+
  10.   | This source file is subject to version 3.01 of the PHP license,      |
  11.   | that is bundled with this package in the file LICENSE, and is        |
  12.   | available through the world-wide-web at the following url:           |
  13.   | http://www.php.net/license/3_01.txt                                  |
  14.   | If you did not receive a copy of the PHP license and are unable to   |
  15.   | obtain it through the world-wide-web, please send a note to          |
  16.   | license@php.net so we can mail you a copy immediately.               |
  17.   +----------------------------------------------------------------------+
  18.   | Author: Wez Furlong <wez@thebrainroom.com>                           |
  19.   +----------------------------------------------------------------------+
  20. */
  21.  
  22. // $Id: confutils.js,v 1.60.2.1.2.8.2.33 2009-05-29 07:43:07 kalle Exp $
  23.  
  24. var STDOUT = WScript.StdOut;
  25. var STDERR = WScript.StdErr;
  26. var WshShell = WScript.CreateObject("WScript.Shell");
  27. var FSO = WScript.CreateObject("Scripting.FileSystemObject");
  28. var MFO = null;
  29. var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive");
  30. var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles");
  31. var DSP_FLAGS = new Array();
  32. var PHP_SRC_DIR=FSO.GetParentFolderName(WScript.ScriptFullName);
  33.  
  34. /* Store the enabled extensions (summary + QA check) */
  35. var extensions_enabled = new Array();
  36.  
  37. /* Store the SAPI enabled (summary + QA check) */
  38. var sapi_enabled = new Array();
  39.  
  40. /* Store the headers to install */
  41. var headers_install = new Array();
  42.  
  43. /* Mapping CL version > human readable name */
  44. var VC_VERSIONS = new Array();
  45. VC_VERSIONS[1200] = 'MSVC6 (Visual C++ 6.0)';
  46. VC_VERSIONS[1300] = 'MSVC7 (Visual C++ 2002)';
  47. VC_VERSIONS[1310] = 'MSVC7.1 (Visual C++ 2003)';
  48. VC_VERSIONS[1400] = 'MSVC8 (Visual C++ 2005)';
  49. VC_VERSIONS[1500] = 'MSVC9 (Visual C++ 2008)';
  50. VC_VERSIONS[1600] = 'MSVC10 (Visual C++ 2010)';
  51.  
  52. var VC_VERSIONS_SHORT = new Array();
  53. VC_VERSIONS_SHORT[1200] = 'VC6';
  54. VC_VERSIONS_SHORT[1300] = 'VC7';
  55. VC_VERSIONS_SHORT[1310] = 'VC7.1';
  56. VC_VERSIONS_SHORT[1400] = 'VC8';
  57. VC_VERSIONS_SHORT[1500] = 'VC9';
  58. VC_VERSIONS_SHORT[1600] = 'VC10';
  59.  
  60. if (PROGRAM_FILES == null) {
  61.     PROGRAM_FILES = "C:\\Program Files";
  62. }
  63.  
  64. if (MODE_PHPIZE) {
  65.     if (!FSO.FileExists("config.w32")) {
  66.         STDERR.WriteLine("Must be run from the root of the extension source");
  67.         WScript.Quit(10);
  68.     }
  69. } else {
  70.     if (!FSO.FileExists("README.GIT-RULES")) {
  71.         STDERR.WriteLine("Must be run from the root of the php source");
  72.         WScript.Quit(10);
  73.     }
  74. }
  75.  
  76. var CWD = WshShell.CurrentDirectory;
  77.  
  78. if (typeof(CWD) == "undefined") {
  79.     CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.GIT-RULES"));
  80. }
  81.  
  82. /* defaults; we pick up the precise versions from configure.in */
  83. var PHP_VERSION = 5;
  84. var PHP_MINOR_VERSION = 0;
  85. var PHP_RELEASE_VERSION = 0;
  86. var PHP_EXTRA_VERSION = "";
  87. var PHP_VERSION_STRING = "5.0.0";
  88.  
  89. function get_version_numbers()
  90. {
  91.     var cin = file_get_contents("configure.in");
  92.    
  93.     if (cin.match(new RegExp("PHP_MAJOR_VERSION=(\\d+)"))) {
  94.         PHP_VERSION = RegExp.$1;
  95.     }
  96.     if (cin.match(new RegExp("PHP_MINOR_VERSION=(\\d+)"))) {
  97.         PHP_MINOR_VERSION = RegExp.$1;
  98.     }
  99.     if (cin.match(new RegExp("PHP_RELEASE_VERSION=(\\d+)"))) {
  100.         PHP_RELEASE_VERSION = RegExp.$1;
  101.     }
  102.     PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION;
  103.  
  104.     if (cin.match(new RegExp("PHP_EXTRA_VERSION=\"([^\"]+)\""))) {
  105.         PHP_EXTRA_VERSION = RegExp.$1;
  106.         if (PHP_EXTRA_VERSION.length) {
  107.             PHP_VERSION_STRING += PHP_EXTRA_VERSION;
  108.         }
  109.     }
  110.     DEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING);
  111. }
  112.  
  113. configure_args = new Array();
  114. configure_subst = WScript.CreateObject("Scripting.Dictionary");
  115.  
  116. configure_hdr = WScript.CreateObject("Scripting.Dictionary");
  117. build_dirs = new Array();
  118.  
  119. extension_include_code = "";
  120. extension_module_ptrs = "";
  121.  
  122. if (!MODE_PHPIZE) {
  123.     get_version_numbers();
  124. }
  125.  
  126. /* execute a command and return the output as a string */
  127. function execute(command_line)
  128. {
  129.     var e = WshShell.Exec(command_line);
  130.     var ret = "";
  131.  
  132.     ret = e.StdOut.ReadAll();
  133.  
  134. //STDOUT.WriteLine("command " + command_line);
  135. //STDOUT.WriteLine(ret);
  136.  
  137.     return ret;
  138. }
  139.  
  140. function probe_binary(EXE, what)
  141. {
  142.     // tricky escapes to get stderr redirection to work
  143.     var command = 'cmd /c ""' + EXE;
  144.     if (what == "version") {
  145.         command = command + '" -v"';
  146.     }
  147.     var version = execute(command + '" 2>&1"');
  148.  
  149.     if (what == "64") {
  150.         if (version.match(/x64/)) {
  151.             return 1;
  152.         }
  153.     } else {
  154.         if (version.match(/(\d+\.\d+(\.\d+)?(\.\d+)?)/)) {
  155.             return RegExp.$1;
  156.         }
  157.     }
  158.     return 0;
  159. }
  160.  
  161. function condense_path(path)
  162. {
  163.     path = FSO.GetAbsolutePathName(path);
  164.  
  165.     if (path.substr(0, CWD.length).toLowerCase()
  166.             == CWD.toLowerCase() &&
  167.             (path.charCodeAt(CWD.length) == 92 || path.charCodeAt(CWD.length) == 47)) {
  168.         return path.substr(CWD.length + 1);
  169.     }
  170.  
  171.     var a = CWD.split("\\");
  172.     var b = path.split("\\");
  173.     var i, j;
  174.  
  175.     for (i = 0; i < b.length; i++) {
  176.         if (a[i].toLowerCase() == b[i].toLowerCase())
  177.             continue;
  178.         if (i > 0) {
  179.             /* first difference found */
  180.             path = "";
  181.             for (j = 0; j < a.length - i; j++) {
  182.                 path += "..\\";
  183.             }
  184.             for (j = i; j < b.length; j++) {
  185.                 path += b[j];
  186.                 if (j < b.length - 1)
  187.                     path += "\\";
  188.             }
  189.             return path;
  190.         }
  191.         /* on a different drive */
  192.         break;
  193.     }
  194.    
  195.     return path;
  196. }
  197.  
  198. function ConfigureArg(type, optname, helptext, defval)
  199. {
  200.     var opptype = type == "enable" ? "disable" : "without";
  201.  
  202.     if (defval == "yes" || defval == "yes,shared") {
  203.         this.arg = "--" + opptype + "-" + optname;
  204.         this.imparg = "--" + type + "-" + optname;
  205.     } else {
  206.         this.arg = "--" + type + "-" + optname;
  207.         this.imparg = "--" + opptype + "-" + optname;
  208.     }
  209.    
  210.     this.optname = optname;
  211.     this.helptext = helptext;
  212.     this.defval = defval;
  213.     this.symval = optname.toUpperCase().replace(new RegExp("-", "g"), "_");
  214.     this.seen = false;
  215.     this.argval = defval;
  216. }
  217.  
  218. function ARG_WITH(optname, helptext, defval)
  219. {
  220.     configure_args[configure_args.length] = new ConfigureArg("with", optname, helptext, defval);
  221. }
  222.  
  223. function ARG_ENABLE(optname, helptext, defval)
  224. {
  225.     configure_args[configure_args.length] = new ConfigureArg("enable", optname, helptext, defval);
  226. }
  227.  
  228. function analyze_arg(argval)
  229. {
  230.     var ret = new Array();
  231.     var shared = false;
  232.  
  233.     if (argval == "shared") {
  234.         shared = true;
  235.         argval = "yes";
  236.     } else if (argval == null) {
  237.         /* nothing */
  238.     } else if (arg_match = argval.match(new RegExp("^shared,(.*)"))) {
  239.         shared = true;
  240.         argval = arg_match[1];
  241.     } else if (arg_match = argval.match(new RegExp("^(.*),shared$"))) {
  242.         shared = true;
  243.         argval = arg_match[1];
  244.     }
  245.  
  246.     ret[0] = shared;
  247.     ret[1] = argval;
  248.     return ret;
  249. }
  250.  
  251. function word_wrap_and_indent(indent, text, line_suffix, indent_char)
  252. {
  253.     if (text == null) {
  254.         return "";
  255.     }
  256.    
  257.     var words = text.split(new RegExp("\\s+", "g"));
  258.     var i = 0;
  259.     var ret_text = "";
  260.     var this_line = "";
  261.     var t;
  262.     var space = "";
  263.     var lines = 0;
  264.  
  265.     if (line_suffix == null) {
  266.         line_suffix = "";
  267.     }
  268.  
  269.     if (indent_char == null) {
  270.         indent_char = " ";
  271.     }
  272.  
  273.     for (i = 0; i < indent; i++) {
  274.         space += indent_char;
  275.     }
  276.    
  277.     for (i = 0; i < words.length; i++) {
  278.         if (this_line.length) {
  279.             t = this_line + " " + words[i];
  280.         } else {
  281.             t = words[i];
  282.         }
  283.  
  284.         if (t.length + indent > 78) {
  285.             if (lines++) {
  286.                 ret_text += space;
  287.             }
  288.             ret_text += this_line + line_suffix + "\r\n";
  289.             this_line = "";
  290.         }
  291.  
  292.         if (this_line.length) {
  293.             this_line += " " + words[i];
  294.         } else {
  295.             this_line = words[i];
  296.         }
  297.     }
  298.  
  299.     if (this_line.length) {
  300.         if (lines)
  301.             ret_text += space;
  302.         ret_text += this_line;
  303.     }
  304.  
  305.     return ret_text;
  306. }
  307.  
  308. function conf_process_args()
  309. {
  310.     var i, j;
  311.     var configure_help_mode = false;
  312.     var analyzed = false;
  313.     var nice = "cscript /nologo configure.js ";
  314.     var disable_all = false;
  315.    
  316.     args = WScript.Arguments;
  317.     for (i = 0; i < args.length; i++) {
  318.         arg = args(i);
  319.         nice += ' "' + arg + '"';
  320.         if (arg == "--help") {
  321.             configure_help_mode = true;
  322.             break;
  323.         }
  324.         if (arg == "--disable-all") {
  325.             disable_all = true;
  326.             continue;
  327.         }
  328.  
  329.         // If it is --foo=bar, split on the equals sign
  330.         arg = arg.split("=", 2);
  331.         argname = arg[0];
  332.         if (arg.length > 1) {
  333.             argval = arg[1];
  334.         } else {
  335.             argval = null;
  336.         }
  337.  
  338.         // Find the arg
  339.         found = false;
  340.         for (j = 0; j < configure_args.length; j++) {
  341.             if (argname == configure_args[j].imparg || argname == configure_args[j].arg) {
  342.                 found = true;
  343.  
  344.                 arg = configure_args[j];
  345.                 arg.seen = true;
  346.  
  347.                 analyzed = analyze_arg(argval);
  348.  
  349.                 /* Force shared when called after phpize */
  350.                 if (MODE_PHPIZE) {
  351.                     shared = "shared";
  352.                 } else {
  353.                     shared = analyzed[0];
  354.                 }
  355.                 argval = analyzed[1];
  356.  
  357.                 if (argname == arg.imparg) {
  358.                     /* we matched the implicit, or default arg */
  359.                     if (argval == null) {
  360.                         argval = arg.defval;
  361.                     }
  362.                 } else {
  363.                     /* we matched the non-default arg */
  364.                     if (argval == null) {
  365.                         argval = arg.defval == "no" ? "yes" : "no";
  366.                     }
  367.                 }
  368.                
  369.                 arg.argval = argval;
  370.                 eval("PHP_" + arg.symval + " = argval;");
  371.                 eval("PHP_" + arg.symval + "_SHARED = shared;");
  372.                 break;
  373.             }
  374.         }
  375.         if (!found) {
  376.             STDERR.WriteLine("Unknown option " + argname + "; please try configure.js --help for a list of valid options");
  377.             WScript.Quit(2);
  378.         }
  379.     }
  380.  
  381.     if (configure_help_mode) {
  382.         STDOUT.WriteLine(word_wrap_and_indent(0,
  383. "Options that enable extensions and SAPI will accept \
  384. 'yes' or 'no' as a parameter.  They also accept 'shared' \
  385. as a synonym for 'yes' and request a shared build of that \
  386. module.  Not all modules can be built as shared modules; \
  387. configure will display [shared] after the module name if \
  388. can be built that way. \
  389. "
  390.             ));
  391.         STDOUT.WriteBlankLines(1);
  392.  
  393.         // Measure width to pretty-print the output
  394.         max_width = 0;
  395.         for (i = 0; i < configure_args.length; i++) {
  396.             arg = configure_args[i];
  397.             if (arg.arg.length > max_width)
  398.                 max_width = arg.arg.length;
  399.         }
  400.  
  401.         for (i = 0; i < configure_args.length; i++) {
  402.             arg = configure_args[i];
  403.  
  404.             n = max_width - arg.arg.length;
  405.             pad = "   ";
  406.             for (j = 0; j < n; j++) {
  407.                 pad += " ";
  408.             }
  409.             STDOUT.WriteLine("  " + arg.arg + pad + word_wrap_and_indent(max_width + 5, arg.helptext));
  410.         }
  411.         WScript.Quit(1);
  412.     }
  413.  
  414.     var snapshot_build_exclusions = new Array(
  415.         'debug', 'crt-debug', 'lzf-better-compression',
  416.          'php-build', 'snapshot-template', 'ereg',
  417.          'pcre-regex', 'fastcgi', 'force-cgi-redirect',
  418.          'path-info-check', 'zts', 'ipv6', 'memory-limit',
  419.          'zend-multibyte', 'fd-setsize', 'memory-manager',
  420.          't1lib', 'pgi', 'pgo'
  421.         );
  422.     var force;
  423.  
  424.     // Now set any defaults we might have missed out earlier
  425.     for (i = 0; i < configure_args.length; i++) {
  426.         arg = configure_args[i];
  427.         if (arg.seen)
  428.             continue;
  429.         analyzed = analyze_arg(arg.defval);
  430.         shared = analyzed[0];
  431.         argval = analyzed[1];
  432.        
  433.         // Don't trust a default "yes" answer for a non-core module
  434.         // in a snapshot build
  435.         if (PHP_SNAPSHOT_BUILD != "no" && argval == "yes" && !shared) {
  436.  
  437.             force = true;
  438.             for (j = 0; j < snapshot_build_exclusions.length; j++) {
  439.                 if (snapshot_build_exclusions[j] == arg.optname) {
  440.                     force = false;
  441.                     break;
  442.                 }
  443.             }
  444.  
  445.             if (force) {
  446.                 /* now check if it is a core module */
  447.                 force = false;
  448.                 for (j = 0; j < core_module_list.length; j++) {
  449.                     if (core_module_list[j] == arg.optname) {
  450.                         force = true;
  451.                         break;
  452.                     }
  453.                 }
  454.  
  455.                 if (!force) {
  456.                     STDOUT.WriteLine("snapshot: forcing " + arg.arg + " shared");
  457.                     shared = true;
  458.                 }
  459.             }
  460.         }
  461.        
  462.         if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") {
  463.             force = true;
  464.             for (j = 0; j < snapshot_build_exclusions.length; j++) {
  465.                 if (snapshot_build_exclusions[j] == arg.optname) {
  466.                     force = false;
  467.                     break;
  468.                 }
  469.             }
  470.             if (force) {
  471.                 STDOUT.WriteLine("snapshot: forcing " + arg.optname + " on");
  472.                 argval = "yes";
  473.                 shared = true;
  474.             }
  475.         }
  476.  
  477.         if (disable_all) {
  478.             force = true;
  479.             for (j = 0; j < snapshot_build_exclusions.length; j++) {
  480.                 if (snapshot_build_exclusions[j] == arg.optname) {
  481.                     force = false;
  482.                     break;
  483.                 }
  484.             }
  485.             if (force) {
  486.                 if (arg.defval == '') {
  487.                     argval = '';
  488.                 } else {
  489.                     argval = "no";
  490.                 }
  491.                 shared = false;
  492.             }
  493.         }
  494.  
  495.         eval("PHP_" + arg.symval + " = argval;");
  496.         eval("PHP_" + arg.symval + "_SHARED = shared;");
  497.     }
  498.  
  499.     MFO = FSO.CreateTextFile("Makefile.objects", true);
  500.  
  501.     STDOUT.WriteLine("Saving configure options to config.nice.bat");
  502.     var nicefile = FSO.CreateTextFile("config.nice.bat", true);
  503.     nicefile.WriteLine(nice +  " %*");
  504.     nicefile.Close();
  505.  
  506.     AC_DEFINE('CONFIGURE_COMMAND', nice, "Configure line");
  507. }
  508.  
  509. function DEFINE(name, value)
  510. {
  511.     if (configure_subst.Exists(name)) {
  512.         configure_subst.Remove(name);
  513.     }
  514.     configure_subst.Add(name, value);
  515. }
  516.  
  517. // Searches a set of paths for a file;
  518. // returns the dir in which the file was found,
  519. // true if it was found in the default env path,
  520. // or false if it was not found at all.
  521. // env_name is the optional name of an env var
  522. // specifying the default path to search
  523. function search_paths(thing_to_find, explicit_path, env_name)
  524. {
  525.     var i, found = false, place = false, file, env;
  526.  
  527.     STDOUT.Write("Checking for " + thing_to_find + " ... ");
  528.  
  529.     thing_to_find = thing_to_find.replace(new RegExp("/", "g"), "\\");
  530.  
  531.     if (explicit_path != null) {
  532.         if (typeof(explicit_path) == "string") {
  533.             explicit_path = explicit_path.split(";");
  534.         }
  535.  
  536.         for (i = 0; i < explicit_path.length; i++) {
  537.             file = glob(explicit_path[i] + "\\" + thing_to_find);
  538.             if (file) {
  539.                 found = true;
  540.                 place = file[0];
  541.                 place = place.substr(0, place.length - thing_to_find.length - 1);
  542.                 break;
  543.             }
  544.         }
  545.     }
  546.  
  547.     if (!found && env_name != null) {
  548.         env = WshShell.Environment("Process").Item(env_name);
  549.         env = env.split(";");
  550.         for (i = 0; i < env.length; i++) {
  551.             file = glob(env[i] + "\\" + thing_to_find);
  552.             if (file) {
  553.                 found = true;
  554.                 place = true;
  555.                 break;
  556.             }
  557.         }
  558.     }
  559.  
  560.     if (found && place == true) {
  561.         STDOUT.WriteLine(" <in default path>");
  562.     } else if (found) {
  563.         STDOUT.WriteLine(" " + place);
  564.     } else {
  565.         STDOUT.WriteLine(" <not found>");
  566.     }
  567.     return place;
  568. }
  569.  
  570. function PATH_PROG(progname, additional_paths, symbol)
  571. {
  572.     var exe;
  573.     var place;
  574.     var cyg_path = PHP_CYGWIN + "\\bin;" + PHP_CYGWIN + "\\usr\\local\\bin";
  575.     var php_build_bin_path = PHP_PHP_BUILD + "\\bin"
  576.  
  577.     exe = progname + ".exe";
  578.  
  579.     if (additional_paths == null) {
  580.         additional_paths = cyg_path;
  581.     } else {
  582.         additional_paths += ";" + cyg_path;
  583.     }
  584.  
  585.     additional_paths = additional_paths + ";" + php_build_bin_path;
  586.  
  587.     place = search_paths(exe, additional_paths, "PATH");
  588.  
  589.     if (place == true) {
  590.         place = exe;
  591.     } else if (place != false) {
  592.         place = place + "\\" + exe;
  593.     }
  594.  
  595.     if (place) {
  596.         if (symbol == null) {
  597.             symbol = progname.toUpperCase();
  598.         }
  599.         DEFINE(symbol, place);
  600.     }
  601.     return place;
  602. }
  603.  
  604. function find_pattern_in_path(pattern, path)
  605. {
  606.     if (path == null) {
  607.         return false;
  608.     }
  609.  
  610.     var dirs = path.split(';');
  611.     var i;
  612.     var items;
  613.  
  614.     for (i = 0; i < dirs.length; i++) {
  615.         items = glob(dirs[i] + "\\" + pattern);
  616.         if (items) {
  617.             return condense_path(items[0]);
  618.         }
  619.     }
  620.     return false;
  621. }
  622.  
  623. function CHECK_LIB(libnames, target, path_to_check, common_name)
  624. {
  625.     STDOUT.Write("Checking for library " + libnames + " ... ");
  626.  
  627.     if (common_name == null && target != null) {
  628.         common_name = target;
  629.     }
  630.  
  631.     if (path_to_check == null) {
  632.         path_to_check = "";
  633.     }
  634.  
  635.     // if they specified a common name for the package that contains
  636.     // the library, tag some useful defaults on to the end of the
  637.     // path to be searched
  638.     if (common_name != null) {
  639.         path_to_check += ";" + PHP_PHP_BUILD + "\\" + common_name + "*";
  640.         path_to_check += ";" + PHP_PHP_BUILD + "\\lib\\" + common_name + "*";
  641.         path_to_check += ";..\\" + common_name + "*";
  642.     }
  643.  
  644.     // Determine target for build flags
  645.     if (target == null) {
  646.         target = "";
  647.     } else {
  648.         target = "_" + target.toUpperCase();
  649.     }
  650.  
  651.     // Expand path to include general dirs
  652.     path_to_check += ";" + php_usual_lib_suspects;
  653.  
  654.     // It is common practice to put libs under one of these dir names
  655.     var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : (PHP_DEBUG_PACK == "yes"?"Release_Dbg":"Release"), "lib", "libs", "libexec");
  656.  
  657.     // libnames can be ; separated list of accepted library names
  658.     libnames = libnames.split(';');
  659.  
  660.     // for debug builds, lib may have _debug appended, we want that first
  661.     if (PHP_DEBUG == "yes") {
  662.         var length = libnames.length;
  663.         for (var i = 0; i < length; i++) {
  664.             var name = new String(libnames[i]);
  665.             rExp = /.lib$/i;
  666.             name = name.replace(rExp,"_debug.lib");
  667.             libnames.unshift(name);
  668.         }
  669.     }
  670.  
  671.     var i, j, k, libname;
  672.     var location = false;
  673.     var path = path_to_check.split(';');
  674.    
  675.     for (i = 0; i < libnames.length; i++) {
  676.         libname = libnames[i];
  677.  
  678.         for (k = 0; k < path.length; k++) {
  679.             location = glob(path[k] + "\\" + libname);
  680.             if (location) {
  681.                 location = location[0];
  682.                 break;
  683.             }
  684.             for (j = 0; j < subdirs.length; j++) {
  685.                 location = glob(path[k] + "\\" + subdirs[j] + "\\" + libname);
  686.                 if (location) {
  687.                     location = location[0];
  688.                     break;
  689.                 }
  690.             }
  691.             if (location)
  692.                 break;
  693.         }
  694.  
  695.         if (location) {
  696.             location = condense_path(location);
  697.             var libdir = FSO.GetParentFolderName(location);
  698.             libname = FSO.GetFileName(location);
  699.             ADD_FLAG("LDFLAGS" + target, '/libpath:"' + libdir + '" ');
  700.             ADD_FLAG("LIBS" + target, libname);
  701.  
  702.             STDOUT.WriteLine(location);
  703.  
  704.             return location;
  705.         }
  706.  
  707.         // Check in their standard lib path
  708.         location = find_pattern_in_path(libname, WshShell.Environment("Process").Item("LIB"));
  709.  
  710.         if (location) {
  711.             location = condense_path(location);
  712.             libname = FSO.GetFileName(location);
  713.             ADD_FLAG("LIBS" + target, libname);
  714.  
  715.             STDOUT.WriteLine("<in LIB path> " + libname);
  716.             return location;
  717.         }
  718.  
  719.         // Check in their general extra libs path
  720.         location = find_pattern_in_path(libname, PHP_EXTRA_LIBS);
  721.         if (location) {
  722.             location = condense_path(location);
  723.             libname = FSO.GetFileName(location);
  724.             ADD_FLAG("LIBS" + target, libname);
  725.             STDOUT.WriteLine("<in extra libs path>");
  726.             return location;
  727.         }
  728.     }
  729.  
  730.     STDOUT.WriteLine("<not found>");
  731.  
  732.     return false;
  733. }
  734.  
  735. function OLD_CHECK_LIB(libnames, target, path_to_check)
  736. {
  737.     if (target == null) {
  738.         target = "";
  739.     } else {
  740.         target = "_" + target.toUpperCase();
  741.     }
  742.    
  743.     if (path_to_check == null) {
  744.         path_to_check = php_usual_lib_suspects;
  745.     } else {
  746.         path_to_check += ";" + php_usual_lib_suspects;
  747.     }
  748.     var have = 0;
  749.     var p;
  750.     var i;
  751.     var libname;
  752.  
  753.     var subdir = PHP_DEBUG == "yes" ? "Debug" : (PHP_DEBUG_PACK == "yes"?"Release_Dbg":"Release");
  754.  
  755.     libnames = libnames.split(';');
  756.     for (i = 0; i < libnames.length; i++) {
  757.         libname = libnames[i];
  758.         p = search_paths(libname, path_to_check, "LIB");
  759.  
  760.         if (!p) {
  761.             p = search_paths(subdir + "\\" + libname, path_to_check, "LIB");
  762.             if (p) {
  763.                 p += "\\" + subdir;
  764.             }
  765.         }
  766.  
  767.         if (typeof(p) == "string") {
  768.             ADD_FLAG("LDFLAGS" + target, '/libpath:"' + p + '" ');
  769.             ADD_FLAG("LIBS" + target, libname);
  770.             have = 1;
  771.         } else if (p == true) {
  772.             ADD_FLAG("LIBS" + target, libname);
  773.             have = 1;
  774.         } else {
  775.             /* not found in the defaults or the explicit paths,
  776.              * so check the general extra libs; if we find
  777.              * it here, no need to add another /libpath: for it as we
  778.              * already have it covered, but we need to add the lib
  779.              * to LIBS_XXX */
  780.             if (false != search_paths(libname, PHP_EXTRA_LIBS, null)) {
  781.                 ADD_FLAG("LIBS" + target, libname);
  782.                 have = 1;
  783.             }
  784.         }
  785.  
  786.         if (have) {
  787.             break;
  788.         }
  789.     }
  790.  
  791. //  AC_DEFINE("HAVE_" + header_name.toUpperCase().replace(new RegExp("/\\\\-\.", "g"), "_"), have);
  792.  
  793.     return have;
  794.  
  795. }
  796.  
  797. function CHECK_FUNC_IN_HEADER(header_name, func_name, path_to_check, add_to_flag)
  798. {
  799.     var c = false;
  800.     var sym;
  801.  
  802.     STDOUT.Write("Checking for " + func_name + " in " + header_name + " ... ");
  803.  
  804.     c = GREP_HEADER(header_name, func_name, path_to_check);
  805.  
  806.     sym = func_name.toUpperCase();
  807.     sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_");
  808.  
  809.     if (typeof(add_to_flag) == "undefined") {
  810.         AC_DEFINE("HAVE_" + sym, c ? 1 : 0);
  811.     } else {
  812.         ADD_FLAG(add_to_flag, "/DHAVE_" + sym + "=" + (c ? "1" : "0"));
  813.     }
  814.  
  815.     if (c) {
  816.         STDOUT.WriteLine("OK");
  817.         return c;
  818.     }
  819.     STDOUT.WriteLine("No");
  820.     return false;  
  821. }
  822.  
  823. function GREP_HEADER(header_name, regex, path_to_check)
  824. {
  825.     var c = false;
  826.  
  827.     if (FSO.FileExists(path_to_check + "\\" + header_name)) {
  828.         c = file_get_contents(path_to_check + "\\" + header_name);
  829.     }
  830.  
  831.     if (!c) {
  832.         /* look in the include path */
  833.  
  834.         var p = search_paths(header_name, path_to_check, "INCLUDE");
  835.         if (typeof(p) == "string") {
  836.             c = file_get_contents(p);
  837.         } else if (p == false) {
  838.             p = search_paths(header_name, PHP_EXTRA_INCLUDES, null);
  839.             if (typeof(p) == "string") {
  840.                 c = file_get_contents(p);
  841.             }
  842.         }
  843.         if (!c) {
  844.             return false;
  845.         }
  846.     }
  847.  
  848.     if (typeof(regex) == "string") {
  849.         regex = new RegExp(regex);
  850.     }
  851.  
  852.     if (c.match(regex)) {
  853.         /* caller can now use RegExp.$1 etc. to get at patterns */
  854.         return true;
  855.     }
  856.     return false;
  857. }
  858.  
  859. function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env, add_dir_part, add_to_flag_only)
  860. {
  861.     var dir_part_to_add = "";
  862.    
  863.     if (use_env == null) {
  864.         use_env = true;
  865.     }
  866.  
  867.     // if true, add the dir part of the header_name to the include path
  868.     if (add_dir_part == null) {
  869.         add_dir_part = false;
  870.     } else if (add_dir_part) {
  871.         var basename = FSO.GetFileName(header_name);
  872.         dir_part_to_add = "\\" + header_name.substr(0, header_name.length - basename.length - 1);
  873.     }
  874.  
  875.     if (path_to_check == null) {
  876.         path_to_check = php_usual_include_suspects;
  877.     } else {
  878.         path_to_check += ";" + php_usual_include_suspects;
  879.     }
  880.    
  881.     var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null);
  882.     var have = 0;
  883.     var sym;
  884.  
  885.     if (typeof(p) == "string") {
  886.         ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" ');
  887.     } else if (p == false) {
  888.         /* not found in the defaults or the explicit paths,
  889.          * so check the general extra includes; if we find
  890.          * it here, no need to add another /I for it as we
  891.          * already have it covered, unless we are adding
  892.          * the dir part.... */
  893.         p = search_paths(header_name, PHP_EXTRA_INCLUDES, null);
  894.         if (typeof(p) == "string" && add_dir_part) {
  895.             ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" ');
  896.         }
  897.     }
  898.     have = p ? 1 : 0
  899.  
  900.     sym = header_name.toUpperCase();
  901.     sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_");
  902.  
  903.     if (typeof(add_to_flag_only) == "undefined" &&
  904.             flag_name.match(new RegExp("^CFLAGS_(.*)$"))) {
  905.         add_to_flag_only = true;
  906.     }
  907.  
  908.     if (typeof(add_to_flag_only) != "undefined") {
  909.         ADD_FLAG(flag_name, "/DHAVE_" + sym + "=" + have);
  910.     } else {
  911.         AC_DEFINE("HAVE_" + sym, have, "have the " + header_name + " header file");
  912.     }
  913.  
  914.     return p;
  915. }
  916.  
  917. /* emits rule to generate version info for a SAPI
  918.  * or extension.  Returns the name of the .res file
  919.  * that will be generated */
  920. function generate_version_info_resource(makefiletarget, basename, creditspath, sapi)
  921. {
  922.     var resname = makefiletarget + ".res";
  923.     var res_desc = makefiletarget;
  924.     var res_prod_name = "PHP " + makefiletarget;
  925.     var credits;
  926.     var thanks = "";
  927.     var logo = "";
  928.     var debug = "";
  929.     var project_url = "http://www.php.net";
  930.     var project_header = creditspath + "/php_" + basename + ".h";
  931.     var versioning = "";
  932.  
  933.     if (sapi) {
  934.         var internal_name = basename.toUpperCase() + " SAPI";
  935.     } else {
  936.         var internal_name = basename.toUpperCase() + " extension";
  937.     }
  938.  
  939.     if (FSO.FileExists(creditspath + '/CREDITS')) {
  940.         credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1);
  941.         res_desc = credits.ReadLine();
  942.         try {
  943.             thanks = credits.ReadLine();
  944.         } catch (e) {
  945.             thanks = null;
  946.         }
  947.         if (thanks == null) {
  948.             thanks = "";
  949.         } else {
  950.             thanks = "Thanks to " + thanks;
  951.         }
  952.         credits.Close();
  953.     }
  954.  
  955.     if (creditspath.match(new RegExp("pecl"))) {
  956.         /* PECL project url - this will eventually work correctly for all */
  957.         project_url = "http://pecl.php.net/" + basename;
  958.  
  959.         /* keep independent versioning PECL-specific for now */
  960.         if (FSO.FileExists(project_header)) {
  961.             if (header = FSO.OpenTextFile(project_header, 1)) {
  962.                 contents = header.ReadAll();
  963.                 /* allowed: x.x.x[a|b|-alpha|-beta][RCx][-dev] */
  964.                 if (contents.match(new RegExp('PHP_' + basename.toUpperCase() + '_VERSION(\\s+)"((\\d+\.\\d+(\.\\d+)?)((a|b)(\\d)?|\-[a-z]{3,5})?(RC\\d+)?(\-dev)?)'))) {
  965.                     project_version = RegExp.$2;
  966.                     file_version = RegExp.$3.split('.');
  967.                     if (!file_version[2]) {
  968.                         file_version[2] = 0;
  969.                     }
  970.                     versioning = '\\"" /d EXT_FILE_VERSION=' + file_version[0] + ',' + file_version[1] + ',' + file_version[2] + ' /d EXT_VERSION="\\"' + project_version;
  971.                 }
  972.                 header.Close();
  973.             }
  974.         }
  975.     }
  976.  
  977.     if (makefiletarget.match(new RegExp("\\.exe$"))) {
  978.         logo = " /d WANT_LOGO ";
  979.     }
  980.  
  981.     if (PHP_DEBUG != "no") {
  982.         debug = " /d _DEBUG";
  983.     }
  984.  
  985.     /**
  986.      * Use user supplied template.rc if it exists
  987.      */
  988.     if (FSO.FileExists(creditspath + '\\template.rc')) {
  989.         MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": " + creditspath + "\\template.rc");
  990.         MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo + debug +
  991.             ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' +
  992.             makefiletarget + '\\"" /d PRODUCT_NAME="\\"' + res_prod_name +
  993.             versioning + '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" ' +
  994.             creditspath + '\\template.rc');
  995.         return resname;
  996.     }
  997.     if (MODE_PHPIZE) {
  998.         MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": $(PHP_DIR)\\build\\template.rc");
  999.         MFO.WriteLine("\t$(RC)  /I $(PHP_DIR)/include /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
  1000.             ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'
  1001.             + makefiletarget + '\\"" /d URL="\\"' + project_url +
  1002.             '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
  1003.             '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" $(PHP_DIR)\\build\\template.rc');
  1004.     } else {
  1005.         MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");
  1006.         MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
  1007.             ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'
  1008.             + makefiletarget + '\\"" /d URL="\\"' + project_url +
  1009.             '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
  1010.             '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" win32\\build\\template.rc');
  1011.     }
  1012.     MFO.WriteBlankLines(1);
  1013.     return resname;
  1014. }
  1015.  
  1016. function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
  1017. {
  1018.     var SAPI = sapiname.toUpperCase();
  1019.     var ldflags;
  1020.     var resname;
  1021.     var ld;
  1022.     var manifest;
  1023.  
  1024.     if (typeof(obj_dir) == "undefined") {
  1025.         sapiname_for_printing = configure_module_dirname;
  1026.     } else {
  1027.         sapiname_for_printing = configure_module_dirname + " (via " + obj_dir + ")";
  1028.     }
  1029.  
  1030.     STDOUT.WriteLine("Enabling SAPI " + sapiname_for_printing);
  1031.  
  1032.     MFO.WriteBlankLines(1);
  1033.     MFO.WriteLine("# objects for SAPI " + sapiname);
  1034.     MFO.WriteBlankLines(1);
  1035.  
  1036.     if (cflags) {
  1037.         ADD_FLAG('CFLAGS_' + SAPI, cflags);
  1038.     }
  1039.  
  1040.     ADD_SOURCES(configure_module_dirname, file_list, sapiname, obj_dir);
  1041.     MFO.WriteBlankLines(1);
  1042.     MFO.WriteLine("# SAPI " + sapiname);
  1043.     MFO.WriteBlankLines(1);
  1044.  
  1045.     /* generate a .res file containing version information */
  1046.     resname = generate_version_info_resource(makefiletarget, sapiname, configure_module_dirname, true);
  1047.    
  1048.     MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
  1049.     MFO.WriteLine("\t@echo SAPI " + sapiname_for_printing + " build complete");
  1050.     if (MODE_PHPIZE) {
  1051.         MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
  1052.     } else {
  1053.         MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
  1054.     }
  1055.  
  1056.     if (makefiletarget.match(new RegExp("\\.dll$"))) {
  1057.         ldflags = "/dll $(LDFLAGS)";
  1058.         manifest = "-@$(_VC_MANIFEST_EMBED_DLL)";
  1059.     } else if (makefiletarget.match(new RegExp("\\.lib$"))) {
  1060.         ldflags = "$(LDFLAGS)";
  1061.         ld = "$(MAKE_LIB)";
  1062.     } else {
  1063.         ldflags = "$(LDFLAGS)";
  1064.         manifest = "-@$(_VC_MANIFEST_EMBED_EXE)";
  1065.     }
  1066.    
  1067.     if(PHP_PGI == "yes" || PHP_PGO != "no") {
  1068.         ldflags += " /PGD:$(PGOPGD_DIR)\\" + makefiletarget.substring(0, makefiletarget.indexOf(".")) + ".pgd";
  1069.     }
  1070.  
  1071.     if (MODE_PHPIZE) {
  1072.         if (ld) {
  1073.             MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
  1074.         } else {
  1075.             ld = "@$(CC)";
  1076.             MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
  1077.         }
  1078.     } else {
  1079.         if (ld) {
  1080.             MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
  1081.         } else {
  1082.             ld = "@$(CC)";
  1083.             MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
  1084.         }
  1085.     }
  1086.  
  1087.     if (manifest) {
  1088.         MFO.WriteLine("\t" + manifest);
  1089.     }
  1090.        
  1091.     DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')');
  1092.  
  1093.     if (configure_module_dirname.match("pecl")) {
  1094.         ADD_FLAG("PECL_TARGETS", makefiletarget);
  1095.     } else {
  1096.         ADD_FLAG("SAPI_TARGETS", makefiletarget);
  1097.     }
  1098.  
  1099.     if (PHP_DSP != "no") {
  1100.         generate_dsp_file(sapiname, configure_module_dirname, file_list, false);
  1101.     }
  1102.  
  1103.     MFO.WriteBlankLines(1);
  1104.     sapi_enabled[sapi_enabled.length] = [sapiname];
  1105. }
  1106.  
  1107. function ADD_DIST_FILE(filename)
  1108. {
  1109.     if (configure_module_dirname.match("pecl")) {
  1110.         ADD_FLAG("PECL_EXTRA_DIST_FILES", filename);
  1111.     } else {
  1112.         ADD_FLAG("PHP_EXTRA_DIST_FILES", filename);
  1113.     }
  1114. }  
  1115.  
  1116. function file_get_contents(filename)
  1117. {
  1118.     var f, c;
  1119.     try {
  1120.         f = FSO.OpenTextFile(filename, 1);
  1121.         c = f.ReadAll();
  1122.         f.Close();
  1123.         return c;
  1124.     } catch (e) {
  1125.         STDOUT.WriteLine("Problem reading " + filename);
  1126.         return false;
  1127.     }
  1128. }
  1129.  
  1130. // Add a dependency on another extension, so that
  1131. // the dependencies are built before extname
  1132. function ADD_EXTENSION_DEP(extname, dependson, optional)
  1133. {
  1134.     var EXT = extname.toUpperCase();
  1135.     var DEP = dependson.toUpperCase();
  1136.     var dep_present = false;
  1137.     var dep_shared = false;
  1138.  
  1139.     if (MODE_PHPIZE) {
  1140.         ext_deps_js = file_get_contents(PHP_DIR + "\\script\\ext_deps.js");
  1141.         eval(ext_deps_js);
  1142.     }
  1143.  
  1144.     try {
  1145.         dep_present = eval("PHP_" + DEP);
  1146.  
  1147.         if (dep_present != "no") {
  1148.             try {
  1149.                 dep_shared = eval("PHP_" + DEP + "_SHARED");
  1150.             } catch (e) {
  1151.                 dep_shared = false;
  1152.             }
  1153.         }
  1154.  
  1155.     } catch (e) {
  1156.         dep_present = "no";
  1157.     }
  1158.  
  1159.     if (optional) {
  1160.         if (dep_present == "no") {
  1161.             MESSAGE("\t" + dependson + " not found: " + dependson + " support in " + extname + " disabled");
  1162.             return false;
  1163.         }
  1164.     }
  1165.  
  1166.     var ext_shared = eval("PHP_" + EXT + "_SHARED");
  1167.  
  1168.     if (dep_shared) {
  1169.         if (!ext_shared) {
  1170.             if (optional) {
  1171.                 MESSAGE("\tstatic " + extname + " cannot depend on shared " + dependson + ": " + dependson + "support disabled");
  1172.                 return false;
  1173.             }
  1174.             ERROR("static " + extname + " cannot depend on shared " + dependson);
  1175.         }
  1176.  
  1177.         ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)");
  1178.         ADD_FLAG("LIBS_" + EXT, "php_" + dependson + ".lib");
  1179.         ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\php_" + dependson + ".lib");
  1180.  
  1181.     } else {
  1182.  
  1183.         if (dep_present == "no") {
  1184.             if (ext_shared) {
  1185.                 WARNING(extname + " cannot be built: missing dependency, " + dependson + " not found");
  1186.  
  1187.                 var dllname = ' php_' + extname + '.dll';
  1188.  
  1189.                 if (!REMOVE_TARGET(dllname, 'EXT_TARGETS')) {
  1190.                     REMOVE_TARGET(dllname, 'PECL_TARGETS');
  1191.                 }
  1192.  
  1193.                 return false;
  1194.  
  1195.             }
  1196.  
  1197.             ERROR("Cannot build " + extname + "; " + dependson + " not enabled");
  1198.             return false;
  1199.         }
  1200.     } // dependency is statically built-in to PHP
  1201.     return true;
  1202. }
  1203.  
  1204. function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
  1205. {
  1206.     var objs = null;
  1207.     var EXT = extname.toUpperCase();
  1208.     var extname_for_printing;
  1209.     var ldflags;
  1210.  
  1211.     if (shared == null) {
  1212.         eval("shared = PHP_" + EXT + "_SHARED;");
  1213.     } else {
  1214.         eval("PHP_" + EXT + "_SHARED = shared;");
  1215.     }
  1216.  
  1217.     if (cflags == null) {
  1218.         cflags = "";
  1219.     }
  1220.  
  1221.     if (typeof(obj_dir) == "undefined") {
  1222.         extname_for_printing = configure_module_dirname;
  1223.     } else {
  1224.         extname_for_printing = configure_module_dirname + " (via " + obj_dir + ")";
  1225.     }
  1226.  
  1227.     if (shared) {
  1228.         STDOUT.WriteLine("Enabling extension " + extname_for_printing + " [shared]");
  1229.         cflags = "/D COMPILE_DL_" + EXT + " /D " + EXT + "_EXPORTS=1 " + cflags;
  1230.         ADD_FLAG("CFLAGS_PHP", "/D COMPILE_DL_" + EXT);
  1231.     } else {
  1232.         STDOUT.WriteLine("Enabling extension " + extname_for_printing);
  1233.     }
  1234.  
  1235.     MFO.WriteBlankLines(1);
  1236.     MFO.WriteLine("# objects for EXT " + extname);
  1237.     MFO.WriteBlankLines(1);
  1238.  
  1239.     ADD_SOURCES(configure_module_dirname, file_list, extname, obj_dir);
  1240.    
  1241.     MFO.WriteBlankLines(1);
  1242.  
  1243.     if (shared) {
  1244.         if (dllname == null) {
  1245.             dllname = "php_" + extname + ".dll";
  1246.         }
  1247.         var libname = dllname.substring(0, dllname.length-4) + ".lib";
  1248.  
  1249.         var resname = generate_version_info_resource(dllname, extname, configure_module_dirname, false);
  1250.         var ld = "@$(CC)";
  1251.  
  1252.         ldflags = "";
  1253.         if (PHP_PGI == "yes" || PHP_PGO != "no") {
  1254.             ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd";
  1255.         }
  1256.  
  1257.         MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);
  1258.         MFO.WriteBlankLines(1);
  1259.         if (MODE_PHPIZE) {
  1260.             MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
  1261.             MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
  1262.         } else {
  1263.             MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
  1264.             MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
  1265.         }
  1266.         MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)");
  1267.         MFO.WriteBlankLines(1);
  1268.  
  1269.         if (configure_module_dirname.match("pecl")) {
  1270.             ADD_FLAG("PECL_TARGETS", dllname);
  1271.         } else {
  1272.             ADD_FLAG("EXT_TARGETS", dllname);
  1273.         }
  1274.         MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname);
  1275.         MFO.WriteLine("\t@echo EXT " + extname + " build complete");
  1276.         MFO.WriteBlankLines(1);
  1277.        
  1278.         DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')');
  1279.     } else {
  1280.         ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)");
  1281.         ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")");
  1282.         ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")");
  1283.         ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")");
  1284.  
  1285.         /* find the header that declares the module pointer,
  1286.          * so we can include it in internal_functions.c */
  1287.         var ext_dir = FSO.GetFolder(configure_module_dirname);
  1288.         var fc = new Enumerator(ext_dir.Files);
  1289.         var re = /\.h$/;
  1290.         var s, c;
  1291.         for (; !fc.atEnd(); fc.moveNext()) {
  1292.             s = fc.item() + "";
  1293.             if (s.match(re)) {
  1294.                 c = file_get_contents(s);
  1295.                 if (c.match("phpext_")) {
  1296.                     extension_include_code += '#include "' + configure_module_dirname + '/' + FSO.GetFileName(s) + '"\r\n';
  1297.                 }
  1298.             }
  1299.         }
  1300.    
  1301.         extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n';
  1302.    
  1303.         DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')');
  1304.     }
  1305.     ADD_FLAG("CFLAGS_" + EXT, cflags);
  1306.  
  1307.     if (PHP_DSP != "no") {
  1308.         generate_dsp_file(extname, configure_module_dirname, file_list, shared);
  1309.     }
  1310.  
  1311.     extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static'];
  1312. }
  1313.  
  1314. function ADD_SOURCES(dir, file_list, target, obj_dir)
  1315. {
  1316.     var i;
  1317.     var tv;
  1318.     var src, obj, sym, flags;
  1319.  
  1320.     if (target == null) {
  1321.         target = "php";
  1322.     }
  1323.  
  1324.     sym = target.toUpperCase() + "_GLOBAL_OBJS";
  1325.     flags = "CFLAGS_" + target.toUpperCase() + '_OBJ';
  1326.  
  1327.     if (configure_subst.Exists(sym)) {
  1328.         tv = configure_subst.Item(sym);
  1329.     } else {
  1330.         tv = "";
  1331.     }
  1332.  
  1333.     file_list = file_list.split(new RegExp("\\s+"));
  1334.     file_list.sort();
  1335.  
  1336.     var re = new RegExp("\.[a-z0-9A-Z]+$");
  1337.  
  1338.     dir = dir.replace(new RegExp("/", "g"), "\\");
  1339.     var objs_line = "";
  1340.     var srcs_line = "";
  1341.  
  1342.     var sub_build = "$(BUILD_DIR)\\";
  1343.  
  1344.     /* if module dir is not a child of the main source dir,
  1345.      * we need to tweak it; we should have detected such a
  1346.      * case in condense_path and rewritten the path to
  1347.      * be relative.
  1348.      * This probably breaks for non-sibling dirs, but that
  1349.      * is not a problem as buildconf only checks for pecl
  1350.      * as either a child or a sibling */
  1351.     if (obj_dir == null) {
  1352.         var build_dir = dir.replace(new RegExp("^..\\\\"), "");
  1353.         var mangle_dir = build_dir.replace(new RegExp("[\\\\/.-]", "g"), "_");
  1354.         var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase();
  1355.     }
  1356.     else {
  1357.         var build_dir = obj_dir.replace(new RegExp("^..\\\\"), "");
  1358.         var mangle_dir = build_dir.replace(new RegExp("[\\\\/.-]", "g"), "_");
  1359.         var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase();
  1360.     }
  1361.    
  1362.     var dirs = build_dir.split("\\");
  1363.     var i, d = "";
  1364.     for (i = 0; i < dirs.length; i++) {
  1365.         d += dirs[i];
  1366.         build_dirs[build_dirs.length] = d;
  1367.         d += "\\";
  1368.     }
  1369.     sub_build += d;
  1370.  
  1371.  
  1372.     DEFINE(bd_flags_name, " /Fd" + sub_build + " /Fp" + sub_build + " /FR" + sub_build + " ");
  1373.  
  1374.     for (i in file_list) {
  1375.         src = file_list[i];
  1376.         obj = src.replace(re, ".obj");
  1377.         tv += " " + sub_build + obj;
  1378.  
  1379.         if (!MODE_PHPIZE && PHP_ONE_SHOT == "yes") {
  1380.             if (i > 0) {
  1381.                 objs_line += " " + sub_build + obj;
  1382.                 srcs_line += " " + dir + "\\" + src;
  1383.             } else {
  1384.                 objs_line = sub_build + obj;   
  1385.                 srcs_line = dir + "\\" + src;
  1386.             }
  1387.         } else {
  1388.             MFO.WriteLine(sub_build + obj + ": " + dir + "\\" + src);
  1389.             MFO.WriteLine("\t@$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + obj);
  1390.         }
  1391.     }
  1392.  
  1393.     if (!MODE_PHPIZE && PHP_ONE_SHOT == "yes") {
  1394.         MFO.WriteLine(objs_line + ": " + srcs_line);
  1395.         MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) /Fo" + sub_build + " $(" + bd_flags_name + ") /c " + srcs_line);
  1396.     }
  1397.  
  1398.     DEFINE(sym, tv);
  1399. }
  1400.  
  1401. function REMOVE_TARGET(dllname, flag)
  1402. {
  1403.     var dllname = dllname.replace(/\s/g, "");
  1404.     var EXT = dllname.replace(/php_(\S+)\.dll/, "$1").toUpperCase();
  1405.     var php_flags = configure_subst.Item("CFLAGS_PHP");
  1406.  
  1407.     if (configure_subst.Exists(flag)) {
  1408.         var targets = configure_subst.Item(flag);
  1409.  
  1410.         if (targets.match(dllname)) {
  1411.             configure_subst.Remove(flag);
  1412.             targets = targets.replace(dllname, "");
  1413.             targets = targets.replace(/\s+/, " ");
  1414.             targets = targets.replace(/\s$/, "");
  1415.             configure_subst.Add(flag, targets);
  1416.             configure_hdr.Add("HAVE_" + EXT, new Array(0, ""));
  1417.             configure_subst.Item("CFLAGS_PHP") = php_flags.replace(" /D COMPILE_DL_" + EXT, "");
  1418.             extensions_enabled.pop();
  1419.             return true;
  1420.         }
  1421.     }
  1422.     return false;
  1423. }
  1424.  
  1425. function generate_internal_functions()
  1426. {
  1427.     var infile, outfile;
  1428.     var indata;
  1429.  
  1430.     STDOUT.WriteLine("Generating main/internal_functions.c");
  1431.    
  1432.     infile = FSO.OpenTextFile("main/internal_functions.c.in", 1);
  1433.     indata = infile.ReadAll();
  1434.     infile.Close();
  1435.    
  1436.     indata = indata.replace("@EXT_INCLUDE_CODE@", extension_include_code);
  1437.     indata = indata.replace("@EXT_MODULE_PTRS@", extension_module_ptrs);
  1438.  
  1439.     if (FSO.FileExists("main/internal_functions.c")) {
  1440.         var origdata = file_get_contents("main/internal_functions.c");
  1441.  
  1442.         if (origdata == indata) {
  1443.             STDOUT.WriteLine("\t[content unchanged; skipping]");
  1444.             return;
  1445.         }
  1446.     }
  1447.  
  1448.     outfile = FSO.CreateTextFile("main/internal_functions.c", true);
  1449.     outfile.Write(indata);
  1450.     outfile.Close();
  1451. }
  1452.  
  1453. function output_as_table(header, ar_out)
  1454. {
  1455.     var l = header.length;
  1456.     var cols = 80;
  1457.     var fixedlenght = "";
  1458.     var t = 0;
  1459.     var i,j,k,m;
  1460.     var out = "| ";
  1461.     var min = new Array(l);
  1462.     var max = new Array(l);
  1463.  
  1464.     if (l != ar_out[0].length) {
  1465.         STDOUT.WriteLine("Invalid header argument, can't output the table " + l + " " + ar_out[0].length  );
  1466.         return;
  1467.     }
  1468.  
  1469.     for (j=0; j < l; j++) {
  1470.         var tmax, tmin;
  1471.  
  1472.         /*Figure out the max length per column */
  1473.         tmin = 0;
  1474.         tmax = 0;
  1475.         for (k = 0; k < ar_out.length; k++) {
  1476.             var t = ar_out[k][j].length;
  1477.             if (t > tmax) tmax = t;
  1478.             else if (t < tmin) tmin = t;
  1479.         }
  1480.         if (tmax > header[j].length) {
  1481.             max[j] = tmax;
  1482.         } else {
  1483.             max[j] = header[j].length;
  1484.         }
  1485.         if (tmin < header[j].length) {
  1486.             min[j] = header[j].length;
  1487.         }
  1488.     }
  1489.  
  1490.     sep = "";
  1491.     k = 0;
  1492.     for (i = 0; i < l; i++) {
  1493.         k += max[i] + 3;
  1494.     }
  1495.     k++;
  1496.  
  1497.     for (j=0; j < k; j++) {
  1498.         sep += "-";
  1499.     }
  1500.  
  1501.     STDOUT.WriteLine(sep);
  1502.     out = "|";
  1503.     for (j=0; j < l; j++) {
  1504.         out += " " + header[j];
  1505.         for (var i = 0; i < (max[j] - header[j].length); i++){
  1506.             out += " ";
  1507.         }
  1508.         out += " |";
  1509.     }
  1510.     STDOUT.WriteLine(out);
  1511.  
  1512.     STDOUT.WriteLine(sep);
  1513.  
  1514.     out = "|";
  1515.     for (i=0; i < ar_out.length; i++) {
  1516.         line = ar_out[i];
  1517.         for (j=0; j < l; j++) {
  1518.             out += " " + line[j];
  1519.             for (var k = 0; k < (max[j] - line[j].length); k++){
  1520.                 out += " ";
  1521.             }
  1522.             out += " |";
  1523.         }
  1524.         STDOUT.WriteLine(out);
  1525.         out = "|";
  1526.     }
  1527.  
  1528.     STDOUT.WriteLine(sep);
  1529. }
  1530.  
  1531. function write_summary()
  1532. {
  1533.     var ar = new Array();
  1534.  
  1535.     STDOUT.WriteBlankLines(2);
  1536.  
  1537.     STDOUT.WriteLine("Enabled extensions:");
  1538.     output_as_table(["Extension", "Mode"], extensions_enabled.sort());
  1539.     STDOUT.WriteBlankLines(2);
  1540.     if (!MODE_PHPIZE) {
  1541.         STDOUT.WriteLine("Enabled SAPI:");
  1542.         output_as_table(["Sapi Name"], sapi_enabled);
  1543.         STDOUT.WriteBlankLines(2);
  1544.     }
  1545.     ar[0] = ['Build type', PHP_DEBUG == "yes" ? "Debug" : "Release"];
  1546.     ar[1] = ['Thread Safety', PHP_ZTS == "yes" ? "Yes" : "No"];
  1547.     ar[2] = ['Compiler', VC_VERSIONS[VCVERS]];
  1548.     ar[3] = ['Architecture', X64 ? 'x64' : 'x86'];
  1549.  
  1550.     output_as_table(["",""], ar);
  1551.     STDOUT.WriteBlankLines(2);
  1552. }
  1553.  
  1554. function generate_files()
  1555. {
  1556.     var i, dir, bd, last;
  1557.  
  1558.     STDOUT.WriteBlankLines(1);
  1559.     STDOUT.WriteLine("Creating build dirs...");
  1560.     dir = get_define("BUILD_DIR");
  1561.     build_dirs.sort();
  1562.     last = null;
  1563.  
  1564.     if (!FSO.FolderExists(dir)) {
  1565.         FSO.CreateFolder(dir);
  1566.     }
  1567.  
  1568.     for (i = 0; i < build_dirs.length; i++) {
  1569.         bd = FSO.BuildPath(dir, build_dirs[i]);
  1570.         if (bd == last) {
  1571.             continue;
  1572.         }
  1573.         last = bd;
  1574.  
  1575.         build_dir = get_define('BUILD_DIR');
  1576.         build_dir = build_dir.replace(new RegExp("\\\\", "g"), "\\\\");
  1577.         if (build_dir.substr(build_dir.Length - 2, 2) != '\\\\') {
  1578.             build_dir += '\\\\';
  1579.         }
  1580.         ADD_FLAG("BUILD_DIRS_SUB", bd.replace(new RegExp(build_dir), ''));
  1581.  
  1582.         if (!FSO.FolderExists(bd)) {
  1583.             FSO.CreateFolder(bd);
  1584.         }
  1585.     }
  1586.  
  1587.     if (PHP_DSP != "no") {
  1588.         generate_dsp_file("TSRM", "TSRM", null, false);
  1589.         generate_dsp_file("Zend", "Zend", null, false);
  1590.         generate_dsp_file("win32", "win32", null, false);
  1591.         generate_dsp_file("main", "main", null, false);
  1592.         generate_dsp_file("streams", "main\\streams", null, false);
  1593.         copy_dsp_files();
  1594.     }
  1595.  
  1596.     STDOUT.WriteLine("Generating files...");
  1597.     generate_makefile();
  1598.     if (!MODE_PHPIZE) {
  1599.         generate_internal_functions();
  1600.         generate_config_h();
  1601.         generate_phpize();
  1602.     }
  1603.     STDOUT.WriteLine("Done.");
  1604.     STDOUT.WriteBlankLines(1);
  1605.     write_summary();
  1606.  
  1607.     if (PHP_SNAPSHOT_BUILD != "no") {
  1608.         STDOUT.WriteLine("Type 'nmake snap' to build a PHP snapshot");
  1609.     } else {
  1610.         STDOUT.WriteLine("Type 'nmake' to build PHP");
  1611.     }
  1612. }
  1613.  
  1614. function generate_config_h()
  1615. {
  1616.     var infile, outfile;
  1617.     var indata;
  1618.     var prefix;
  1619.  
  1620.     prefix = PHP_PREFIX.replace(new RegExp("\\\\", "g"), "\\\\");
  1621.  
  1622.     STDOUT.WriteLine("Generating main/config.w32.h");
  1623.    
  1624.     infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1);
  1625.     indata = infile.ReadAll();
  1626.     infile.Close();
  1627.    
  1628.     outfile = FSO.CreateTextFile("main/config.w32.h", true);
  1629.  
  1630.     indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix);
  1631.     outfile.Write(indata);
  1632.  
  1633.     var keys = (new VBArray(configure_hdr.Keys())).toArray();
  1634.     var i, j;
  1635.     var item;
  1636.     var pieces, stuff_to_crack, chunk;
  1637.  
  1638.     outfile.WriteBlankLines(1);
  1639.     outfile.WriteLine("/* values determined by configure.js */");
  1640.  
  1641.     for (i in keys) {
  1642.         item = configure_hdr.Item(keys[i]);
  1643.         outfile.WriteBlankLines(1);
  1644.         pieces = item[0];
  1645.  
  1646.         if (item[1] != undefined) {
  1647.             outfile.WriteLine("/* " + item[1] + " */");
  1648.         }
  1649.  
  1650.         if (typeof(pieces) == "string" && pieces.charCodeAt(0) == 34) {
  1651.             /* quoted string have a maximal length of 2k under vc.
  1652.              * solution is to crack them and let the compiler concat
  1653.              * them implicitly */
  1654.             stuff_to_crack = pieces;
  1655.             pieces = "";
  1656.  
  1657.             while (stuff_to_crack.length) {
  1658.                 j = 65;
  1659.                 while (stuff_to_crack.charCodeAt(j) != 32 && j < stuff_to_crack.length)
  1660.                     j++;
  1661.  
  1662.                 chunk = stuff_to_crack.substr(0, j);
  1663.                 pieces += chunk;
  1664.                 stuff_to_crack = stuff_to_crack.substr(chunk.length);
  1665.                 if (stuff_to_crack.length)
  1666.                     pieces += '" "';
  1667.             }
  1668.         }
  1669.        
  1670.         outfile.WriteLine("#define " + keys[i] + " " + pieces);
  1671.     }
  1672.    
  1673.     outfile.Close();
  1674. }
  1675.  
  1676. function generate_phpize()
  1677. {
  1678.     STDOUT.WriteLine("Generating phpize");
  1679.     dest = get_define("BUILD_DIR") + '/devel';
  1680.  
  1681.     if (!FSO.FolderExists(dest)) {
  1682.         FSO.CreateFolder(dest);
  1683.     }
  1684.  
  1685.     var MF = FSO.CreateTextFile(dest + "/phpize.js", true);
  1686.     var DEPS = FSO.CreateTextFile(dest + "/ext_deps.js", true);
  1687.     prefix = get_define("PHP_PREFIX");
  1688.     prefix = prefix.replace(new RegExp("/", "g"), "\\");
  1689.     prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\");
  1690.     MF.WriteLine("var PHP_PREFIX=" + '"' + prefix + '"');
  1691.     MF.WriteLine("var PHP_ZTS=" + '"' + (PHP_ZTS.toLowerCase() == "yes" ? "Yes" : "No") + '"');
  1692.     MF.WriteLine("var VC_VERSION=" + VCVERS);
  1693.     MF.WriteLine("var PHP_VERSION=" + PHP_VERSION);
  1694.     MF.WriteLine("var PHP_MINOR_VERSION=" + PHP_MINOR_VERSION);
  1695.     MF.WriteLine("var PHP_RELEASE_VERSION=" + PHP_RELEASE_VERSION);
  1696.     MF.WriteBlankLines(1);
  1697.     MF.WriteLine("/* Genereted extensions list with mode (static/shared) */");
  1698.  
  1699.     var count = extensions_enabled.length;
  1700.     for (i in extensions_enabled) {
  1701.         out = "PHP_" + extensions_enabled[i][0].toUpperCase() + "_SHARED=" + (extensions_enabled[i][1] == 'shared' ? 'true' : 'false') + ";";
  1702.         DEPS.WriteLine("PHP_" + extensions_enabled[i][0].toUpperCase() + "=true;");
  1703.         DEPS.WriteLine(out);
  1704.         MF.WriteLine(out);
  1705.     }
  1706.  
  1707.     MF.WriteBlankLines(2);
  1708.     MF.WriteLine("/* Genereted win32/build/phpize.js.in */");
  1709.     MF.WriteBlankLines(1);
  1710.     MF.Write(file_get_contents("win32/build/phpize.js.in"));
  1711.     MF.Close();
  1712.     DEPS.Close();
  1713.  
  1714.     /* Generate flags file */
  1715.     /* spit out variable definitions */
  1716.     CJ = FSO.CreateTextFile(dest + "/config.phpize.js");
  1717.  
  1718.     CJ.WriteLine("var PHP_ZTS =" + '"' + PHP_ZTS + '"');
  1719.     CJ.WriteLine("var PHP_DLL_LIB =" + '"' + get_define('PHPLIB') + '"');
  1720.     CJ.WriteLine("var PHP_DLL =" + '"' + get_define('PHPDLL') + '"');
  1721.     CJ.WriteBlankLines(1);
  1722.     CJ.Close();
  1723. }
  1724.  
  1725. function generate_makefile()
  1726. {
  1727.     STDOUT.WriteLine("Generating Makefile");
  1728.     var MF = FSO.CreateTextFile("Makefile", true);
  1729.  
  1730.     MF.WriteLine("# Generated by configure.js");
  1731.     /* spit out variable definitions */
  1732.     var keys = (new VBArray(configure_subst.Keys())).toArray();
  1733.     var i;
  1734.     MF.WriteLine("PHP_SRC_DIR =" + PHP_SRC_DIR);
  1735.     for (i in keys) {
  1736.         // The trailing space is needed to prevent the trailing backslash
  1737.         // that is part of the build dir flags (CFLAGS_BD_XXX) from being
  1738.         // seen as a line continuation character
  1739.         MF.WriteLine(keys[i] + "=" +
  1740.             //word_wrap_and_indent(1, configure_subst.Item(keys[i]), ' \\', '\t') + " "
  1741.             configure_subst.Item(keys[i]) + " "
  1742.             );
  1743.         MF.WriteBlankLines(1);
  1744.     }
  1745.  
  1746.     MF.WriteBlankLines(1);
  1747.     if (MODE_PHPIZE) {
  1748.         var TF = FSO.OpenTextFile(PHP_DIR + "/script/Makefile.phpize", 1);
  1749.     } else {
  1750.         var TF = FSO.OpenTextFile("win32/build/Makefile", 1);
  1751.     }
  1752.  
  1753.     MF.Write(TF.ReadAll());
  1754.  
  1755.     MF.WriteLine("build-headers:");
  1756.     MF.WriteLine("  @if not exist $(BUILD_DIR_DEV)\\include mkdir $(BUILD_DIR_DEV)\\include >nul");
  1757.     MF.WriteLine("  @for %D in ($(INSTALL_HEADERS_DIR)) do @if not exist $(BUILD_DIR_DEV)\\include\\%D mkdir $(BUILD_DIR_DEV)\\include\\%D >nul");
  1758.     for (i in headers_install) {
  1759.         if (headers_install[i][2] != "") {
  1760.                 MF.WriteLine("  @if not exist $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " mkdir $(BUILD_DIR_DEV)\\include\\" +
  1761.                                                 headers_install[i][2] + ">nul");
  1762.                 MF.WriteLine("  @copy " + headers_install[i][0] + " " + "$(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " /y >nul");
  1763.         }
  1764.     }
  1765.     MF.WriteLine("  @for %D in ($(INSTALL_HEADERS_DIR)) do @copy %D*.h $(BUILD_DIR_DEV)\\include\\%D /y >nul");
  1766.     TF.Close();
  1767.  
  1768.     MF.WriteBlankLines(2);
  1769.  
  1770.     MFO.Close();
  1771.     TF = FSO.OpenTextFile("Makefile.objects", 1);
  1772.     MF.Write(TF.ReadAll());
  1773.     TF.Close();
  1774.  
  1775.     MF.Close();
  1776. }
  1777.  
  1778. function ADD_FLAG(name, flags, target)
  1779. {
  1780.     if (target != null) {
  1781.         name = target.toUpperCase() + "_" + name;
  1782.     }
  1783.     if (configure_subst.Exists(name)) {
  1784.         var curr_flags = configure_subst.Item(name);
  1785.  
  1786.         if (curr_flags.indexOf(flags) >= 0) {
  1787.             return;
  1788.         }
  1789.        
  1790.         flags = curr_flags + " " + flags;
  1791.         configure_subst.Remove(name);
  1792.     }
  1793.     configure_subst.Add(name, flags);
  1794.  
  1795.     if (PHP_DSP != "no") {
  1796.         if (flags && (name.substr(name.length-3) != "PHP") && (name.substr(0, 7) == "CFLAGS_")) {
  1797.             DSP_FLAGS[DSP_FLAGS.length] = new Array(name, flags);
  1798.         }
  1799.     }
  1800. }
  1801.  
  1802. function get_define(name)
  1803. {
  1804.     if (configure_subst.Exists(name)) {
  1805.         return configure_subst.Item(name);
  1806.     }
  1807.     return "";
  1808. }
  1809.  
  1810. // Add a .def to the core to export symbols
  1811. function ADD_DEF_FILE(name)
  1812. {
  1813.     if (!configure_subst.Exists("PHPDEF")) {
  1814.         DEFINE("PHPDEF", "$(BUILD_DIR)\\$(PHPDLL).def");
  1815.         ADD_FLAG("PHP_LDFLAGS", "/def:$(PHPDEF)");
  1816.     }
  1817.     ADD_FLAG("PHP_DLL_DEF_SOURCES", name);
  1818. }
  1819.  
  1820. function AC_DEFINE(name, value, comment, quote)
  1821. {
  1822.     if (quote == null) {
  1823.         quote = true;
  1824.     }
  1825.     if (quote && typeof(value) == "string") {
  1826.         value = '"' + value.replace(new RegExp('(["\\\\])', "g"), '\\$1') + '"';
  1827.     } else if (value.length == 0) {
  1828.         value = '""';
  1829.     }
  1830.     var item = new Array(value, comment);
  1831.     if (configure_hdr.Exists(name)) {
  1832.         var orig_item = configure_hdr.Item(name);
  1833.         STDOUT.WriteLine("AC_DEFINE[" + name + "]=" + value + ": is already defined to " + orig_item[0]);
  1834.     } else {
  1835.         configure_hdr.Add(name, item);
  1836.     }
  1837. }
  1838.  
  1839. function MESSAGE(msg)
  1840. {
  1841.     STDOUT.WriteLine("" + msg);
  1842. }
  1843.  
  1844. function ERROR(msg)
  1845. {
  1846.     STDERR.WriteLine("ERROR: " + msg);
  1847.     WScript.Quit(3);
  1848. }
  1849.  
  1850. function WARNING(msg)
  1851. {
  1852.     STDERR.WriteLine("WARNING: " + msg);
  1853.     STDERR.WriteBlankLines(1);
  1854. }
  1855.  
  1856. function copy_and_subst(srcname, destname, subst_array)
  1857. {
  1858.     if (!FSO.FileExists(srcname)) {
  1859.         srcname = configure_module_dirname + "\\" + srcname;
  1860.         destname = configure_module_dirname + "\\" + destname;
  1861.     }
  1862.  
  1863.     var content = file_get_contents(srcname);
  1864.     var i;
  1865.  
  1866.     for (i = 0; i < subst_array.length; i+=2) {
  1867.         var re = subst_array[i];
  1868.         var rep = subst_array[i+1];
  1869.  
  1870.         content = content.replace(re, rep);
  1871.     }
  1872.    
  1873.     var f = FSO.CreateTextFile(destname, true);
  1874.     f.Write(content);
  1875.     f.Close();
  1876. }
  1877.  
  1878. // glob using simple filename wildcards
  1879. // returns an array of matches that are found
  1880. // in the filesystem
  1881. function glob(path_pattern)
  1882. {
  1883.     var path_parts = path_pattern.replace(new RegExp("/", "g"), "\\").split("\\");
  1884.     var p;
  1885.     var base = "";
  1886.     var is_pat_re = /\*/;
  1887.  
  1888. //STDOUT.WriteLine("glob: " + path_pattern);
  1889.  
  1890.     if (FSO.FileExists(path_pattern)) {
  1891.         return new Array(path_pattern);
  1892.     }
  1893.    
  1894.     // first, build as much as possible that doesn't have a pattern
  1895.     for (p = 0; p < path_parts.length; p++) {
  1896.         if (path_parts[p].match(is_pat_re))
  1897.             break;
  1898.         if (p)
  1899.             base += "\\";
  1900.         base += path_parts[p]; 
  1901.     }
  1902.  
  1903.     return _inner_glob(base, p, path_parts);
  1904. }
  1905.  
  1906. function _inner_glob(base, p, parts)
  1907. {
  1908.     var pat = parts[p];
  1909.     var full_name = base + "\\" + pat;
  1910.     var re = null;
  1911.     var items = null;
  1912.  
  1913.     if (p == parts.length) {
  1914.         return false;
  1915.     }
  1916.  
  1917. //STDOUT.WriteLine("inner: base=" + base + " p=" + p + " pat=" + pat);
  1918.  
  1919.     if (FSO.FileExists(full_name)) {
  1920.         if (p < parts.length - 1) {
  1921.             // we didn't reach the full extent of the pattern
  1922.             return false;
  1923.         }
  1924.         return new Array(full_name);
  1925.     }
  1926.  
  1927.     if (FSO.FolderExists(full_name) && p == parts.length - 1) {
  1928.         // we have reached the end of the pattern; no need to recurse
  1929.         return new Array(full_name);
  1930.     }
  1931.  
  1932.     // Convert the pattern into a regexp
  1933.     re = new RegExp("^" + pat.replace(/\./g, '\\.').replace(/\*/g, '.*').replace(/\?/g, '.') + "$", "i");
  1934.  
  1935.     items = new Array();
  1936.  
  1937.     if (!FSO.FolderExists(base)) {
  1938.         return false;
  1939.     }
  1940.  
  1941.     var folder = FSO.GetFolder(base);
  1942.     var fc = null;
  1943.     var subitems = null;
  1944.     var item_name = null;
  1945.     var j;
  1946.  
  1947.     fc = new Enumerator(folder.SubFolders);
  1948.     for (; !fc.atEnd(); fc.moveNext()) {
  1949.         item_name = FSO.GetFileName(fc.item());
  1950.  
  1951.         if (item_name.match(re)) {
  1952.             // got a match; if we are at the end of the pattern, just add these
  1953.             // things to the items array
  1954.             if (p == parts.length - 1) {
  1955.                 items[items.length] = fc.item();
  1956.             } else {
  1957.                 // we should recurse and do more matches
  1958.                 subitems = _inner_glob(base + "\\" + item_name, p + 1, parts);
  1959.                 if (subitems) {
  1960.                     for (j = 0; j < subitems.length; j++) {
  1961.                         items[items.length] = subitems[j];
  1962.                     }
  1963.                 }
  1964.             }
  1965.         }
  1966.     }
  1967.  
  1968.     // if we are at the end of the pattern, we should match
  1969.     // files too
  1970.     if (p == parts.length - 1) {
  1971.         fc = new Enumerator(folder.Files);
  1972.         for (; !fc.atEnd(); fc.moveNext()) {
  1973.             item_name = FSO.GetFileName(fc.item());
  1974.             if (item_name.match(re)) {
  1975.                 items[items.length] = fc.item();
  1976.             }
  1977.         }
  1978.     }
  1979.  
  1980.     if (items.length == 0)
  1981.         return false;
  1982.  
  1983.     return items;
  1984. }
  1985.  
  1986. function PHP_INSTALL_HEADERS(dir, headers_list)
  1987. {
  1988.     headers_list = headers_list.split(new RegExp("\\s+"));
  1989.     headers_list.sort();
  1990.     if (dir.length > 0 && dir.substr(dir.length - 1) != '/' && dir.substr(dir.length - 1) != '\\') {
  1991.         dir += '/';
  1992.     }
  1993.     dir = dir.replace(new RegExp("/", "g"), "\\");
  1994.  
  1995.     for (i in headers_list) {
  1996.         found = false;
  1997.         src = headers_list[i];
  1998.         src = src.replace(new RegExp("/", "g"), "\\");
  1999.         isdir = FSO.FolderExists(dir + src);
  2000.         isfile = FSO.FileExists(dir + src);
  2001.         if (isdir) {
  2002.             if (src.length > 0 && src.substr(src.length - 1) != '/' && src.substr(src.length - 1) != '\\') {
  2003.                 src += '\\';
  2004.             }
  2005.             headers_install[headers_install.length] = [dir + src, 'dir',''];
  2006.             ADD_FLAG("INSTALL_HEADERS_DIR", dir + src);
  2007.             found = true;
  2008.         } else if (isfile) {
  2009.             dirname = FSO.GetParentFolderName(dir + src);
  2010.             headers_install[headers_install.length] = [dir + src, 'file', dirname];
  2011.             ADD_FLAG("INSTALL_HEADERS", dir + src);
  2012.             found = true;
  2013.         } else {
  2014.             path =  configure_module_dirname + "\\"+ src;
  2015.             isdir = FSO.FolderExists(path);
  2016.             isfile = FSO.FileExists(path);
  2017.             if (isdir) {
  2018.                 if (src.length > 0 && src.substr(src.length - 1) != '/' && src.substr(src.length - 1) != '\\') {
  2019.                     src += '\\';
  2020.                 }
  2021.                 headers_install[headers_install.length] = [path, 'dir',''];
  2022.                 ADD_FLAG("INSTALL_HEADERS_DIR", path);
  2023.             } else if (isfile) {
  2024.                 dirname = FSO.GetParentFolderName(path);
  2025.                 headers_install[headers_install.length] = [path, 'file', dir];
  2026.                 ADD_FLAG("INSTALL_HEADERS", dir + src);
  2027.                 found = true;
  2028.             }
  2029.         }
  2030.  
  2031.         if (found == false) {
  2032.             STDOUT.WriteLine(headers_list);
  2033.             ERROR("Cannot find header " + dir + src);
  2034.         }
  2035.     }
  2036. }
  2037.  
  2038. // for snapshot builders, this option will attempt to enable everything
  2039. // and you can then build everything, ignoring fatal errors within a module
  2040. // by running "nmake snap"
  2041. PHP_SNAPSHOT_BUILD = "no";
  2042. if (!MODE_PHPIZE) {
  2043.     ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no');
  2044.  
  2045.     // one-shot build optimizes build by asking compiler to build
  2046.     // several objects at once, reducing overhead of starting new
  2047.     // compiler processes.
  2048.     ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no');
  2049. }
  2050.  
  2051. PHP_DSP="no"
  2052.  
  2053. core_module_list = new Array(
  2054. "TSRM",
  2055. "aolserver",
  2056. "apache",
  2057. "apache2filter",
  2058. "apache2handler",
  2059. "apache-hooks",
  2060. "cgi",
  2061. "cli",
  2062. "embed",
  2063. "isapi",
  2064. "nsapi",
  2065. "pi3web",
  2066. "bcmath",
  2067. "bz2",
  2068. "calendar",
  2069. "com-dotnet",
  2070. "ctype",
  2071. "curl",
  2072. "date",
  2073. "dba",
  2074. "dom",
  2075. "enchant",
  2076. "ereg",
  2077. "exif",
  2078. "fileinfo",
  2079. "filter",
  2080. "ftp",
  2081. "gd",
  2082. "gettext",
  2083. "gmp",
  2084. "hash",
  2085. "iconv",
  2086. "imap",
  2087. "interbase",
  2088. "intl",
  2089. "json",
  2090. "ldap",
  2091. "libxml",
  2092. "mbstring",
  2093. "mcrypt",
  2094. "mssql",
  2095. "mysql",
  2096. "mysqli",
  2097. "mysqlnd",
  2098. "oci8",
  2099. "odbc",
  2100. "openssl",
  2101. "pcre",
  2102. "pdo",
  2103. "pdo-dblib",
  2104. "pdo-firebird",
  2105. "pdo-mysql",
  2106. "pdo-oci",
  2107. "pdo-odbc",
  2108. "pdo-pgsql",
  2109. "pdo-sqlite",
  2110. "pgsql",
  2111. "phar",
  2112. "pspell",
  2113. "reflection",
  2114. "session",
  2115. "shmop",
  2116. "simplexml",
  2117. "snmp",
  2118. "soap",
  2119. "sockets",
  2120. "spl",
  2121. "sqlite3",
  2122. "standard",
  2123. "sybase-ct",
  2124. "tidy",
  2125. "tokenizer",
  2126. "wddx",
  2127. "xml",
  2128. "xmlreader",
  2129. "xmlrpc",
  2130. "xmlwriter",
  2131. "xsl",
  2132. "zip",
  2133. "zlib",
  2134. false // dummy
  2135. );
  2136. try {
  2137. ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin');
  2138. } catch (e) {
  2139.     STDOUT.WriteLine("problem: " + e);
  2140. }
  2141. try {
  2142. ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');
  2143. } catch (e) {
  2144.     STDOUT.WriteLine("problem: " + e);
  2145. }
  2146. try {
  2147. ARG_ENABLE('debug', 'Compile with debugging symbols', "no");
  2148. } catch (e) {
  2149.     STDOUT.WriteLine("problem: " + e);
  2150. }
  2151. try {
  2152. ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');
  2153. } catch (e) {
  2154.     STDOUT.WriteLine("problem: " + e);
  2155. }
  2156. try {
  2157. ARG_ENABLE('pgi', 'Generate PGO instrumented binaries', 'no');
  2158. } catch (e) {
  2159.     STDOUT.WriteLine("problem: " + e);
  2160. }
  2161. try {
  2162. ARG_WITH('pgo', 'Compile optimized binaries using training data from folder', 'no');
  2163. } catch (e) {
  2164.     STDOUT.WriteLine("problem: " + e);
  2165. }
  2166. try {
  2167. ARG_ENABLE('zts', 'Thread safety', 'yes');
  2168. } catch (e) {
  2169.     STDOUT.WriteLine("problem: " + e);
  2170. }
  2171. try {
  2172. ARG_WITH('prefix', 'where PHP will be installed', '');
  2173. } catch (e) {
  2174.     STDOUT.WriteLine("problem: " + e);
  2175. }
  2176. try {
  2177. ARG_WITH('mp', 'Tell VC9+ use up to [n,auto,disable] processes for compilation', 'auto');
  2178. } catch (e) {
  2179.     STDOUT.WriteLine("problem: " + e);
  2180. }
  2181. try {
  2182. 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');
  2183. } catch (e) {
  2184.     STDOUT.WriteLine("problem: " + e);
  2185. }
  2186. try {
  2187. ARG_WITH('extra-includes', 'Extra include path to use when building everything', '');
  2188. } catch (e) {
  2189.     STDOUT.WriteLine("problem: " + e);
  2190. }
  2191. try {
  2192. ARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');
  2193. } catch (e) {
  2194.     STDOUT.WriteLine("problem: " + e);
  2195. }
  2196. try {
  2197. ARG_ENABLE("ipv6", "Disable IPv6 support (default is turn it on if available)", "yes");
  2198. } catch (e) {
  2199.     STDOUT.WriteLine("problem: " + e);
  2200. }
  2201. try {
  2202. ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", "256");
  2203. } catch (e) {
  2204.     STDOUT.WriteLine("problem: " + e);
  2205. }
  2206. try {
  2207. ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no");
  2208. } catch (e) {
  2209.     STDOUT.WriteLine("problem: " + e);
  2210. }
  2211. try {
  2212. ARG_ENABLE("security-flags", "Disable the compiler security flags", "yes");
  2213. } catch (e) {
  2214.     STDOUT.WriteLine("problem: " + e);
  2215. }
  2216. try {
  2217. ARG_ENABLE("static-analyze", "Enable the VC compiler static analyze", "no");
  2218. } catch (e) {
  2219.     STDOUT.WriteLine("problem: " + e);
  2220. }
  2221. try {
  2222. ARG_WITH('aolserver', 'Build AOLserver support', 'no');
  2223. } catch (e) {
  2224.     STDOUT.WriteLine("problem: " + e);
  2225. }
  2226. try {
  2227. ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'no');
  2228. } catch (e) {
  2229.     STDOUT.WriteLine("problem: " + e);
  2230. }
  2231. try {
  2232. ARG_WITH('apache-includes', 'Where to find Apache 1.3 headers', null);
  2233. } catch (e) {
  2234.     STDOUT.WriteLine("problem: " + e);
  2235. }
  2236. try {
  2237. ARG_WITH('apache-libs', 'Where to find Apache 1.3 libraries', null);
  2238. } catch (e) {
  2239.     STDOUT.WriteLine("problem: " + e);
  2240. }
  2241. try {
  2242. ARG_ENABLE('apache2filter', 'Build Apache 2.x filter', 'no');
  2243. } catch (e) {
  2244.     STDOUT.WriteLine("problem: " + e);
  2245. }
  2246. try {
  2247. ARG_ENABLE('apache2-2filter', 'Build Apache 2.2.x filter', 'no');
  2248. } catch (e) {
  2249.     STDOUT.WriteLine("problem: " + e);
  2250. }
  2251. try {
  2252. ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no');
  2253. } catch (e) {
  2254.     STDOUT.WriteLine("problem: " + e);
  2255. }
  2256. try {
  2257. ARG_ENABLE('apache2-2handler', 'Build Apache 2.2.x handler', 'no');
  2258. } catch (e) {
  2259.     STDOUT.WriteLine("problem: " + e);
  2260. }
  2261. try {
  2262. ARG_ENABLE('apache2-4handler', 'Build Apache 2.4.x handler', 'no');
  2263. } catch (e) {
  2264.     STDOUT.WriteLine("problem: " + e);
  2265. }
  2266. try {
  2267. ARG_WITH('apache-hooks', 'Build Apache 1.3.x (hooks) version of PHP', 'no');
  2268. } catch (e) {
  2269.     STDOUT.WriteLine("problem: " + e);
  2270. }
  2271. try {
  2272. ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes');
  2273. } catch (e) {
  2274.     STDOUT.WriteLine("problem: " + e);
  2275. }
  2276. try {
  2277. ARG_ENABLE('cli', 'Build CLI version of PHP', 'yes');
  2278. } catch (e) {
  2279.     STDOUT.WriteLine("problem: " + e);
  2280. }
  2281. try {
  2282. ARG_ENABLE('crt-debug', 'Enable CRT memory dumps for debugging sent to STDERR', 'no');
  2283. } catch (e) {
  2284.     STDOUT.WriteLine("problem: " + e);
  2285. }
  2286. try {
  2287. ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no');
  2288. } catch (e) {
  2289.     STDOUT.WriteLine("problem: " + e);
  2290. }
  2291. try {
  2292. ARG_ENABLE('embed', 'Embedded SAPI library', 'no');
  2293. } catch (e) {
  2294.     STDOUT.WriteLine("problem: " + e);
  2295. }
  2296. try {
  2297. ARG_ENABLE('isapi', 'Build ISAPI version of PHP', 'no');
  2298. } catch (e) {
  2299.     STDOUT.WriteLine("problem: " + e);
  2300. }
  2301. try {
  2302. ARG_ENABLE('nsapi', 'Build NSAPI for Netscape/iPlanet/SunONE webservers', 'no');
  2303. } catch (e) {
  2304.     STDOUT.WriteLine("problem: " + e);
  2305. }
  2306. try {
  2307. ARG_WITH('nsapi-includes', 'Where to find NSAPI headers', null);
  2308. } catch (e) {
  2309.     STDOUT.WriteLine("problem: " + e);
  2310. }
  2311. try {
  2312. ARG_WITH('nsapi-libs', 'Where to find NSAPI libraries', null);
  2313. } catch (e) {
  2314.     STDOUT.WriteLine("problem: " + e);
  2315. }
  2316. try {
  2317. ARG_WITH('pi3web', 'Pi3Web', 'no');
  2318. } catch (e) {
  2319.     STDOUT.WriteLine("problem: " + e);
  2320. }
  2321. try {
  2322. ARG_ENABLE("bcmath", "bc style precision math functions", "yes");
  2323. } catch (e) {
  2324.     STDOUT.WriteLine("problem: " + e);
  2325. }
  2326. try {
  2327. ARG_WITH("bz2", "BZip2", "no");
  2328. } catch (e) {
  2329.     STDOUT.WriteLine("problem: " + e);
  2330. }
  2331. try {
  2332. ARG_ENABLE("calendar", "calendar conversion support", "yes");
  2333. } catch (e) {
  2334.     STDOUT.WriteLine("problem: " + e);
  2335. }
  2336. try {
  2337. ARG_ENABLE("com-dotnet", "COM and .Net support", "yes");
  2338. } catch (e) {
  2339.     STDOUT.WriteLine("problem: " + e);
  2340. }
  2341. try {
  2342. ARG_ENABLE("ctype", "ctype", "yes");
  2343. } catch (e) {
  2344.     STDOUT.WriteLine("problem: " + e);
  2345. }
  2346. try {
  2347. ARG_WITH("curl", "cURL support", "no");
  2348. } catch (e) {
  2349.     STDOUT.WriteLine("problem: " + e);
  2350. }
  2351. try {
  2352. ARG_WITH("dba", "DBA support", "no");
  2353. } catch (e) {
  2354.     STDOUT.WriteLine("problem: " + e);
  2355. }
  2356. try {
  2357. ARG_WITH("enchant", "Enchant Support", "no");
  2358. } catch (e) {
  2359.     STDOUT.WriteLine("problem: " + e);
  2360. }
  2361. try {
  2362. ARG_WITH("ereg", "POSIX extended regular expressions", "yes");
  2363. } catch (e) {
  2364.     STDOUT.WriteLine("problem: " + e);
  2365. }
  2366. try {
  2367. ARG_ENABLE("fileinfo", "fileinfo support", "no");
  2368. } catch (e) {
  2369.     STDOUT.WriteLine("problem: " + e);
  2370. }
  2371. try {
  2372. ARG_ENABLE("filter", "Filter Support", "yes");
  2373. } catch (e) {
  2374.     STDOUT.WriteLine("problem: " + e);
  2375. }
  2376. try {
  2377. ARG_ENABLE("ftp", "ftp support", "yes");
  2378. } catch (e) {
  2379.     STDOUT.WriteLine("problem: " + e);
  2380. }
  2381. try {
  2382. ARG_WITH("gd", "Bundled GD support", "yes,shared");
  2383. } catch (e) {
  2384.     STDOUT.WriteLine("problem: " + e);
  2385. }
  2386. try {
  2387. ARG_WITH("t1lib", "t1lib support", "yes");
  2388. } catch (e) {
  2389.     STDOUT.WriteLine("problem: " + e);
  2390. }
  2391. try {
  2392. ARG_WITH("gettext", "gettext support", "no");
  2393. } catch (e) {
  2394.     STDOUT.WriteLine("problem: " + e);
  2395. }
  2396. try {
  2397. ARG_WITH("gmp", "Include GNU MP support.", "no");
  2398. } catch (e) {
  2399.     STDOUT.WriteLine("problem: " + e);
  2400. }
  2401. try {
  2402. ARG_ENABLE("hash", "enable hash support", "yes");
  2403. } catch (e) {
  2404.     STDOUT.WriteLine("problem: " + e);
  2405. }
  2406. try {
  2407. ARG_WITH("mhash", "mhash support", "no");
  2408. } catch (e) {
  2409.     STDOUT.WriteLine("problem: " + e);
  2410. }
  2411. try {
  2412. ARG_WITH("iconv", "iconv support", "yes");
  2413. } catch (e) {
  2414.     STDOUT.WriteLine("problem: " + e);
  2415. }
  2416. try {
  2417. ARG_WITH("imap", "IMAP Support", "no");
  2418. } catch (e) {
  2419.     STDOUT.WriteLine("problem: " + e);
  2420. }
  2421. try {
  2422. ARG_WITH("interbase", "InterBase support", "no");
  2423. } catch (e) {
  2424.     STDOUT.WriteLine("problem: " + e);
  2425. }
  2426. try {
  2427. ARG_ENABLE("intl", "Enable internationalization support", "no");
  2428. } catch (e) {
  2429.     STDOUT.WriteLine("problem: " + e);
  2430. }
  2431. try {
  2432. ARG_ENABLE("json", "JavaScript Object Serialization support", "yes");
  2433. } catch (e) {
  2434.     STDOUT.WriteLine("problem: " + e);
  2435. }
  2436. try {
  2437. ARG_WITH("ldap", "LDAP support", "no");
  2438. } catch (e) {
  2439.     STDOUT.WriteLine("problem: " + e);
  2440. }
  2441. try {
  2442. ARG_ENABLE("mbstring", "multibyte string functions", "no");
  2443. } catch (e) {
  2444.     STDOUT.WriteLine("problem: " + e);
  2445. }
  2446. try {
  2447. ARG_ENABLE("mbregex", "multibyte regex support", "no");
  2448. } catch (e) {
  2449.     STDOUT.WriteLine("problem: " + e);
  2450. }
  2451. try {
  2452. ARG_ENABLE("mbregex-backtrack", "check multibyte regex backtrack", "yes");
  2453. } catch (e) {
  2454.     STDOUT.WriteLine("problem: " + e);
  2455. }
  2456. try {
  2457. ARG_WITH("mcrypt", "mcrypt support", "no");
  2458. } catch (e) {
  2459.     STDOUT.WriteLine("problem: " + e);
  2460. }
  2461. try {
  2462. ARG_WITH("mssql", "mssql support", "no");
  2463. } catch (e) {
  2464.     STDOUT.WriteLine("problem: " + e);
  2465. }
  2466. try {
  2467. ARG_WITH("dblib", "mssql support with freetds", "no");
  2468. } catch (e) {
  2469.     STDOUT.WriteLine("problem: " + e);
  2470. }
  2471. try {
  2472. ARG_WITH("mysqlnd", "Mysql Native Client Driver", "yes");
  2473. } catch (e) {
  2474.     STDOUT.WriteLine("problem: " + e);
  2475. }
  2476. try {
  2477. ARG_WITH("oci8", "OCI8 support", "no");
  2478. } catch (e) {
  2479.     STDOUT.WriteLine("problem: " + e);
  2480. }
  2481. try {
  2482. ARG_WITH("oci8-11g", "OCI8 support using Oracle 11g Instant Client", "no");
  2483. } catch (e) {
  2484.     STDOUT.WriteLine("problem: " + e);
  2485. }
  2486. try {
  2487. ARG_ENABLE("odbc", "ODBC support", "yes");
  2488. } catch (e) {
  2489.     STDOUT.WriteLine("problem: " + e);
  2490. }
  2491. try {
  2492. ARG_WITH("openssl", "OpenSSL support", "no");
  2493. } catch (e) {
  2494.     STDOUT.WriteLine("problem: " + e);
  2495. }
  2496. try {
  2497. ARG_WITH("pgsql", "PostgreSQL support", "no");
  2498. } catch (e) {
  2499.     STDOUT.WriteLine("problem: " + e);
  2500. }
  2501. try {
  2502. ARG_WITH("pspell", "pspell/aspell (whatever it's called this month) support", "no");
  2503. } catch (e) {
  2504.     STDOUT.WriteLine("problem: " + e);
  2505. }
  2506. try {
  2507. ARG_ENABLE("session", "session support", "yes");
  2508. } catch (e) {
  2509.     STDOUT.WriteLine("problem: " + e);
  2510. }
  2511. try {
  2512. ARG_ENABLE("shmop", "shmop support", "no");
  2513. } catch (e) {
  2514.     STDOUT.WriteLine("problem: " + e);
  2515. }
  2516. try {
  2517. ARG_WITH("snmp", "SNMP support", "no");
  2518. } catch (e) {
  2519.     STDOUT.WriteLine("problem: " + e);
  2520. }
  2521. try {
  2522. ARG_ENABLE("sockets", "SOCKETS support", "no");
  2523. } catch (e) {
  2524.     STDOUT.WriteLine("problem: " + e);
  2525. }
  2526. try {
  2527. ARG_WITH("sqlite3", "SQLite 3 support", "no");
  2528. } catch (e) {
  2529.     STDOUT.WriteLine("problem: " + e);
  2530. }
  2531. try {
  2532. ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", "");
  2533. } catch (e) {
  2534.     STDOUT.WriteLine("problem: " + e);
  2535. }
  2536. try {
  2537. ARG_WITH("sybase-ct", "SYBASE_CT support", "no");
  2538. } catch (e) {
  2539.     STDOUT.WriteLine("problem: " + e);
  2540. }
  2541. try {
  2542. ARG_WITH("tidy", "TIDY support", "no");
  2543. } catch (e) {
  2544.     STDOUT.WriteLine("problem: " + e);
  2545. }
  2546. try {
  2547. ARG_ENABLE("tokenizer", "tokenizer support", "yes");
  2548. } catch (e) {
  2549.     STDOUT.WriteLine("problem: " + e);
  2550. }
  2551. try {
  2552. ARG_ENABLE("zip", "ZIP support", "yes");
  2553. } catch (e) {
  2554.     STDOUT.WriteLine("problem: " + e);
  2555. }
  2556. try {
  2557. ARG_ENABLE("zlib", "ZLIB support", "yes");
  2558. } catch (e) {
  2559.     STDOUT.WriteLine("problem: " + e);
  2560. }
  2561. try {
  2562. ARG_WITH("libxml", "LibXML support", "yes");
  2563. } catch (e) {
  2564.     STDOUT.WriteLine("problem: " + e);
  2565. }
  2566. try {
  2567. ARG_WITH("dom", "DOM support", "yes");
  2568. } catch (e) {
  2569.     STDOUT.WriteLine("problem: " + e);
  2570. }
  2571. try {
  2572. ARG_ENABLE("exif", "exif", "no");
  2573. } catch (e) {
  2574.     STDOUT.WriteLine("problem: " + e);
  2575. }
  2576. try {
  2577. ARG_WITH("mysql", "MySQL support", "no");
  2578. } catch (e) {
  2579.     STDOUT.WriteLine("problem: " + e);
  2580. }
  2581. try {
  2582. ARG_WITH("mysqli", "MySQLi support", "no");
  2583. } catch (e) {
  2584.     STDOUT.WriteLine("problem: " + e);
  2585. }
  2586. try {
  2587. ARG_ENABLE("pdo", "Enable PHP Data Objects support", "no");
  2588. } catch (e) {
  2589.     STDOUT.WriteLine("problem: " + e);
  2590. }
  2591. try {
  2592. ARG_WITH("pdo-dblib", "freetds dblib (Sybase, MS-SQL) support for PDO", "no");
  2593. } catch (e) {
  2594.     STDOUT.WriteLine("problem: " + e);
  2595. }
  2596. try {
  2597. ARG_WITH("pdo-mssql", "Native MS-SQL support for PDO", "no");
  2598. } catch (e) {
  2599.     STDOUT.WriteLine("problem: " + e);
  2600. }
  2601. try {
  2602. ARG_WITH("pdo-firebird", "Firebird support for PDO", "no");
  2603. } catch (e) {
  2604.     STDOUT.WriteLine("problem: " + e);
  2605. }
  2606. try {
  2607. ARG_WITH("pdo-mysql", "MySQL support for PDO", "no");
  2608. } catch (e) {
  2609.     STDOUT.WriteLine("problem: " + e);
  2610. }
  2611. try {
  2612. ARG_WITH("pdo-oci", "Oracle OCI support for PDO", "no");
  2613. } catch (e) {
  2614.     STDOUT.WriteLine("problem: " + e);
  2615. }
  2616. try {
  2617. ARG_WITH("pdo-odbc", "ODBC support for PDO", "no");
  2618. } catch (e) {
  2619.     STDOUT.WriteLine("problem: " + e);
  2620. }
  2621. try {
  2622. ARG_WITH("pdo-pgsql", "PostgreSQL support for PDO", "no");
  2623. } catch (e) {
  2624.     STDOUT.WriteLine("problem: " + e);
  2625. }
  2626. try {
  2627. ARG_WITH("pdo-sqlite", "for pdo_sqlite support", "no");
  2628. } catch (e) {
  2629.     STDOUT.WriteLine("problem: " + e);
  2630. }
  2631. try {
  2632. ARG_WITH("pdo-sqlite-external", "for pdo_sqlite support from an external dll", "no");
  2633. } catch (e) {
  2634.     STDOUT.WriteLine("problem: " + e);
  2635. }
  2636. try {
  2637. ARG_ENABLE("phar", "disable phar support", "yes");
  2638. } catch (e) {
  2639.     STDOUT.WriteLine("problem: " + e);
  2640. }
  2641. try {
  2642. ARG_ENABLE("phar-native-ssl", "enable phar with native OpenSSL support", "no");
  2643. } catch (e) {
  2644.     STDOUT.WriteLine("problem: " + e);
  2645. }
  2646. try {
  2647. ARG_WITH("simplexml", "Simple XML support", "yes");
  2648. } catch (e) {
  2649.     STDOUT.WriteLine("problem: " + e);
  2650. }
  2651. try {
  2652. ARG_ENABLE("soap", "SOAP support", "no");
  2653. } catch (e) {
  2654.     STDOUT.WriteLine("problem: " + e);
  2655. }
  2656. try {
  2657. ARG_WITH("wddx", "WDDX support", "yes");
  2658. } catch (e) {
  2659.     STDOUT.WriteLine("problem: " + e);
  2660. }
  2661. try {
  2662. ARG_WITH("xml", "XML support", "yes");
  2663. } catch (e) {
  2664.     STDOUT.WriteLine("problem: " + e);
  2665. }
  2666. try {
  2667. ARG_ENABLE("xmlreader", "XMLReader support", "yes");
  2668. } catch (e) {
  2669.     STDOUT.WriteLine("problem: " + e);
  2670. }
  2671. try {
  2672. ARG_WITH("xmlrpc", "XMLRPC-EPI support", "no");
  2673. } catch (e) {
  2674.     STDOUT.WriteLine("problem: " + e);
  2675. }
  2676. try {
  2677. ARG_ENABLE("xmlwriter", "XMLWriter support", "yes");
  2678. } catch (e) {
  2679.     STDOUT.WriteLine("problem: " + e);
  2680. }
  2681. try {
  2682. ARG_WITH("xsl", "xsl support", "no");
  2683. } catch (e) {
  2684.     STDOUT.WriteLine("problem: " + e);
  2685. }
  2686.  
  2687. conf_process_args();
  2688.  
  2689. // vim:ft=javascript
  2690. // $Id$
  2691. // "Master" config file; think of it as a configure.in
  2692. // equivalent.
  2693.  
  2694. /* ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin'); */
  2695. PHP_CL = PATH_PROG('cl', null, 'PHP_CL');
  2696. if (!PHP_CL) {
  2697.     ERROR("MS C++ compiler is required");
  2698. }
  2699.  
  2700. /* For the record here: */
  2701. // 1200 is VC6
  2702. // 1300 is vs.net 2002
  2703. // 1310 is vs.net 2003
  2704. // 1400 is vs.net 2005
  2705. // 1500 is vs.net 2008
  2706. // 1600 is vs.net 2010
  2707. // Which version of the compiler do we have?
  2708. VCVERS = probe_binary(PHP_CL).substr(0, 5).replace('.', '');
  2709. STDOUT.WriteLine("  Detected compiler " + VC_VERSIONS[VCVERS]);
  2710.  
  2711. if (VCVERS < 1500) {
  2712.     ERROR("Unsupported MS C++ Compiler, VC9 (2008) minimum is required");
  2713. }
  2714.  
  2715. AC_DEFINE('COMPILER', VC_VERSIONS[VCVERS], "Detected compiler version");
  2716. DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]);
  2717. AC_DEFINE('PHP_COMPILER_ID', VC_VERSIONS_SHORT[VCVERS], "Compiler compatibility ID");
  2718.  
  2719. // do we use x64 or 80x86 version of compiler?
  2720. X64 = probe_binary(PHP_CL, 64, null, 'PHP_CL');
  2721. if (X64) {
  2722.     STDOUT.WriteLine("  Detected 64-bit compiler");
  2723. } else {
  2724.     STDOUT.WriteLine("  Detected 32-bit compiler");
  2725. }
  2726. AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");
  2727. DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86');
  2728.  
  2729. // cygwin now ships with link.exe.  Avoid searching the cygwin path
  2730. // for this, as we want the MS linker, not the fileutil
  2731. PATH_PROG('link', WshShell.Environment("Process").Item("PATH"));
  2732. PATH_PROG('nmake');
  2733.  
  2734. // we don't want to define LIB, as that will override the default library path
  2735. // that is set in that env var
  2736. PATH_PROG('lib', null, 'MAKE_LIB');
  2737. if (!PATH_PROG('bison')) {
  2738.     ERROR('bison is required')
  2739. }
  2740.  
  2741. // There's a minimum requirement for re2c..
  2742. MINRE2C = "0.13.4";
  2743.  
  2744. RE2C = PATH_PROG('re2c');
  2745. if (RE2C) {
  2746.     var intvers, intmin;
  2747.     var pattern = /\./g;
  2748.  
  2749.     RE2CVERS = probe_binary(RE2C, "version");
  2750.     STDOUT.WriteLine('  Detected re2c version ' + RE2CVERS);
  2751.  
  2752.     intvers = RE2CVERS.replace(pattern, '') - 0;
  2753.     intmin = MINRE2C.replace(pattern, '') - 0;
  2754.  
  2755.     if (intvers < intmin) {
  2756.         STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);
  2757.         STDOUT.WriteLine('Parsers will not be generated. Upgrade your copy at http://sf.net/projects/re2c');
  2758.         DEFINE('RE2C', '');
  2759.     } else {
  2760.         DEFINE('RE2C_FLAGS', '');
  2761.     }
  2762. } else {
  2763.     STDOUT.WriteLine('Parsers will not be regenerated');
  2764. }
  2765. PATH_PROG('zip');
  2766. PATH_PROG('lemon');
  2767.  
  2768. // avoid picking up midnight commander from cygwin
  2769. PATH_PROG('mc', WshShell.Environment("Process").Item("PATH"));
  2770.  
  2771. // Try locating manifest tool
  2772. if (VCVERS > 1200) {
  2773.     PATH_PROG('mt', WshShell.Environment("Process").Item("PATH"));
  2774. }
  2775.  
  2776. // stick objects somewhere outside of the source tree
  2777. /* ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', ''); */
  2778. if (PHP_OBJECT_OUT_DIR.length) {
  2779.     PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR);
  2780.     if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) {
  2781.         ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist');
  2782.     }
  2783.     PHP_OBJECT_OUT_DIR += '\\';
  2784. } else if (X64) {
  2785.     if (!FSO.FolderExists("x64")) {
  2786.         FSO.CreateFolder("x64");
  2787.     }
  2788.     PHP_OBJECT_OUT_DIR = 'x64\\';
  2789. }
  2790.  
  2791. /* ARG_ENABLE('debug', 'Compile with debugging symbols', "no"); */
  2792. /* ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no'); */
  2793. if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {
  2794.     ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");
  2795. }
  2796.  
  2797. /* ARG_ENABLE('pgi', 'Generate PGO instrumented binaries', 'no'); */
  2798. /* ARG_WITH('pgo', 'Compile optimized binaries using training data from folder', 'no'); */
  2799. if (PHP_PGI == "yes" || PHP_PGO != "no") {
  2800.     PGOMGR = PATH_PROG('pgomgr', WshShell.Environment("Process").Item("PATH"));
  2801.     if (!PGOMGR) {
  2802.         ERROR("--enable-pgi and --with-pgo options can only be used if PGO capable compiler is present.");
  2803.     }
  2804.     if (PHP_PGI == "yes" && PHP_PGO != "no") {
  2805.         ERROR("Use of both --enable-pgi and --with-pgo not allowed.");
  2806.     }
  2807. }
  2808.  
  2809. /* ARG_ENABLE('zts', 'Thread safety', 'yes'); */
  2810. // Configures the hard-coded installation dir
  2811. /* ARG_WITH('prefix', 'where PHP will be installed', ''); */
  2812. if (PHP_PREFIX == '') {
  2813.     PHP_PREFIX = "C:\\php";
  2814.     if (PHP_DEBUG == "yes")
  2815.         PHP_PREFIX += "\\debug";
  2816. }
  2817. DEFINE('PHP_PREFIX', PHP_PREFIX);
  2818.  
  2819. DEFINE("BASE_INCLUDES", "/I . /I main /I Zend /I TSRM /I ext ");
  2820.  
  2821. // CFLAGS for building the PHP dll
  2822. DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \
  2823. /D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x500");
  2824.  
  2825. DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
  2826.  
  2827. // General CFLAGS for building objects
  2828. DEFINE("CFLAGS", "/nologo /FD $(BASE_INCLUDES) /D _WINDOWS \
  2829. /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 ");
  2830.  
  2831. if (VCVERS < 1400) {
  2832.     // Enable automatic precompiled headers
  2833.     ADD_FLAG('CFLAGS', ' /YX ');
  2834.  
  2835.     if (PHP_DEBUG == "yes") {
  2836.         // Set some debug/release specific options
  2837.         ADD_FLAG('CFLAGS', ' /GZ ');
  2838.     }
  2839. }
  2840.  
  2841. if (VCVERS >= 1400) {
  2842.     // fun stuff: MS deprecated ANSI stdio and similar functions
  2843.     // disable annoying warnings.  In addition, time_t defaults
  2844.     // to 64-bit.  Ask for 32-bit.
  2845.     if (X64) {
  2846.         ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 ');
  2847.     } else {
  2848.         ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');
  2849.     }
  2850.  
  2851.     if (PHP_DEBUG == "yes") {
  2852.         // Set some debug/release specific options
  2853.         ADD_FLAG('CFLAGS', ' /RTC1 ');
  2854.     }
  2855. }
  2856.  
  2857. /* ARG_WITH('mp', 'Tell VC9+ use up to [n,auto,disable] processes for compilation', 'auto'); */
  2858. if (VCVERS >= 1500 && PHP_MP != 'disable') {
  2859.         // no from disable-all
  2860.         if(PHP_MP == 'auto' || PHP_MP == 'no') {
  2861.              ADD_FLAG('CFLAGS', ' /MP ');
  2862.         } else {
  2863.             if(parseInt(PHP_MP) != 0) {
  2864.                 ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' ');
  2865.             } else {
  2866.                 STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);
  2867.             }
  2868.         }
  2869. }
  2870.  
  2871. // General link flags
  2872. DEFINE("LDFLAGS", "/nologo /version:" +
  2873.     PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION);
  2874.  
  2875. // General DLL link flags
  2876. DEFINE("DLL_LDFLAGS", "/dll ");
  2877.  
  2878. // PHP DLL link flags
  2879. DEFINE("PHP_LDFLAGS", "$(DLL_LDFLAGS)");
  2880.  
  2881. // General libs
  2882. // urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib
  2883. DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib");
  2884.  
  2885. // Set some debug/release specific options
  2886. if (PHP_DEBUG == "yes") {
  2887.     ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +
  2888.         (X64?"/Zi":"/ZI"));
  2889.     ADD_FLAG("LDFLAGS", "/debug");
  2890.     // Avoid problems when linking to release libraries that use the release
  2891.     // version of the libc
  2892.     ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
  2893. } else {
  2894.     // Generate external debug files when --enable-debug-pack is specified
  2895.     if (PHP_DEBUG_PACK == "yes") {
  2896.         ADD_FLAG("CFLAGS", "/Zi");
  2897.         ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
  2898.     }
  2899.     // Equivalent to Release_TSInline build -> best optimization
  2900.     ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");
  2901.  
  2902.     // if you have VS.Net /GS hardens the binary against buffer overruns
  2903.     // ADD_FLAG("CFLAGS", "/GS");
  2904. }
  2905.  
  2906. if (PHP_ZTS == "yes") {
  2907.     ADD_FLAG("CFLAGS", "/D ZTS=1");
  2908.     ADD_FLAG("ZTS", "1");
  2909. } else {
  2910.     ADD_FLAG("ZTS", "0");
  2911. }
  2912.  
  2913. DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");
  2914.  
  2915.  
  2916. // we want msvcrt in the PHP DLL
  2917. ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
  2918.  
  2919. // set up the build dir and DLL name
  2920. if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
  2921.     DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");
  2922.     DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll");
  2923.     DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib");
  2924. } else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {
  2925.     DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug");
  2926.     DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll");
  2927.     DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib");
  2928. } else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {
  2929.     DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS");
  2930.     DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll");
  2931.     DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib");
  2932. } else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {
  2933.     DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release");
  2934.     DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll");
  2935.     DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib");
  2936. }
  2937.  
  2938. // CFLAGS, LDFLAGS and BUILD_DIR are defined
  2939. // Add compiler and link flags if PGO options are selected
  2940. if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
  2941.     ADD_FLAG('CFLAGS', "/GL /O2");
  2942.     ADD_FLAG('LDFLAGS', "/LTCG:PGINSTRUMENT");
  2943.     DEFINE("PGOPGD_DIR", "$(BUILD_DIR)");
  2944. }
  2945. else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
  2946.     ADD_FLAG('CFLAGS', "/GL /O2");
  2947.     ADD_FLAG('LDFLAGS', "/LTCG:PGUPDATE");
  2948.     DEFINE("PGOPGD_DIR", ((PHP_PGO.length == 0 || PHP_PGO == "yes") ? "$(BUILD_DIR)" : PHP_PGO));
  2949. }
  2950.  
  2951. // Find the php_build dir - it contains headers and libraries
  2952. // that we need
  2953. /* 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'); */
  2954.  
  2955. if (PHP_PHP_BUILD == 'no') {
  2956.     if (FSO.FolderExists("..\\deps")) {
  2957.         PHP_PHP_BUILD = "..\\deps";
  2958.     } else {
  2959.         if (FSO.FolderExists("..\\php_build")) {
  2960.             PHP_PHP_BUILD = "..\\php_build";
  2961.         } else {
  2962.             if (X64) {
  2963.                 if (FSO.FolderExists("..\\win64build")) {
  2964.                     PHP_PHP_BUILD = "..\\win64build";
  2965.                 } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) {
  2966.                     PHP_PHP_BUILD = "..\\php-win64-dev\\php_build";
  2967.                 }
  2968.             } else {
  2969.                 if (FSO.FolderExists("..\\win32build")) {
  2970.                     PHP_PHP_BUILD = "..\\win32build";
  2971.                 } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) {
  2972.                     PHP_PHP_BUILD = "..\\php-win32-dev\\php_build";
  2973.                 }
  2974.             }
  2975.         }
  2976.     }
  2977.     PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD);
  2978. }
  2979. DEFINE("PHP_BUILD", PHP_PHP_BUILD);
  2980.  
  2981. /* ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); */
  2982. /* ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); */
  2983.  
  2984. var php_usual_include_suspects = PHP_PHP_BUILD+"\\include";
  2985. var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib";
  2986.  
  2987. ADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" ');
  2988. ADD_FLAG("LDFLAGS", '/libpath:"' + php_usual_lib_suspects + '" ');
  2989.  
  2990. // Poke around for some headers
  2991. function probe_basic_headers()
  2992. {
  2993.     var p;
  2994.  
  2995.     if (PHP_PHP_BUILD != "no") {
  2996.         php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";
  2997.         php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";
  2998.     }
  2999. }
  3000.  
  3001. function add_extra_dirs()
  3002. {
  3003.     var path, i, f;
  3004.  
  3005.     if (PHP_EXTRA_INCLUDES.length) {
  3006.         path = PHP_EXTRA_INCLUDES.split(';');
  3007.         for (i = 0; i < path.length; i++) {
  3008.             f = FSO.GetAbsolutePathName(path[i]);
  3009.             if (FSO.FolderExists(f)) {
  3010.                 ADD_FLAG("CFLAGS", '/I "' + f + '" ');
  3011.             }
  3012.         }
  3013.     }
  3014.     if (PHP_EXTRA_LIBS.length) {
  3015.         path = PHP_EXTRA_LIBS.split(';');
  3016.         for (i = 0; i < path.length; i++) {
  3017.             f = FSO.GetAbsolutePathName(path[i]);
  3018.             if (FSO.FolderExists(f)) {
  3019.                 if (VCVERS <= 1200 && f.indexOf(" ") >= 0) {
  3020.                     ADD_FLAG("LDFLAGS", '/libpath:"\\"' + f + '\\"" ');
  3021.                 } else {
  3022.                     ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" ');
  3023.                 }
  3024.             }
  3025.         }
  3026.     }
  3027.  
  3028. }
  3029.  
  3030. probe_basic_headers();
  3031. add_extra_dirs();
  3032.  
  3033. //DEFINE("PHP_BUILD", PHP_PHP_BUILD);
  3034.  
  3035. STDOUT.WriteBlankLines(1);
  3036. STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));
  3037. STDOUT.WriteLine("PHP Core:  " + get_define('PHPDLL') + " and " + get_define('PHPLIB'));
  3038.  
  3039. ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \
  3040.     zend_ini_parser.c zend_ini_scanner.c zend_alloc.c zend_compile.c \
  3041.     zend_constants.c zend_dynamic_array.c zend_exceptions.c \
  3042.     zend_execute_API.c zend_highlight.c \
  3043.     zend_llist.c zend_opcode.c zend_operators.c zend_ptr_stack.c \
  3044.     zend_stack.c zend_variables.c zend.c zend_API.c zend_extensions.c \
  3045.     zend_hash.c zend_list.c zend_indent.c zend_builtin_functions.c \
  3046.     zend_sprintf.c zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c \
  3047.     zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \
  3048.     zend_object_handlers.c zend_objects_API.c \
  3049.     zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \
  3050.     zend_float.c zend_string.c");
  3051.  
  3052. if (VCVERS == 1200) {
  3053.     AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
  3054. }
  3055.  
  3056. ADD_SOURCES("main", "main.c snprintf.c spprintf.c getopt.c fopen_wrappers.c \
  3057.     php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
  3058.     strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
  3059.     php_open_temporary_file.c php_logos.c output.c internal_functions.c php_sprintf.c");
  3060. ADD_SOURCES("win32", "inet.c fnmatch.c sockets.c");
  3061.  
  3062. // Newer versions have it
  3063. if (VCVERS <= 1300) {
  3064.     ADD_SOURCES("win32", "strtoi64.c");
  3065. }
  3066. if (VCVERS >= 1400) {
  3067.     AC_DEFINE('HAVE_STRNLEN', 1);
  3068. }
  3069.  
  3070. ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c \
  3071.     userspace.c transports.c xp_socket.c mmap.c glob_wrapper.c");
  3072.  
  3073. ADD_SOURCES("win32", "glob.c readdir.c \
  3074.     registry.c select.c sendmail.c time.c winutil.c wsyslog.c globals.c");
  3075.  
  3076. PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/ win32/");
  3077.  
  3078. STDOUT.WriteBlankLines(1);
  3079.  
  3080.  
  3081. /* Can we build with IPv6 support? */
  3082. /* ARG_ENABLE("ipv6", "Disable IPv6 support (default is turn it on if available)", "yes"); */
  3083.  
  3084. var main_network_has_ipv6 = 0;
  3085. if (PHP_IPV6 == "yes") {
  3086.     main_network_has_ipv6 = CHECK_HEADER_ADD_INCLUDE("wspiapi.h", "CFLAGS") ? 1 : 0;
  3087. }
  3088. if (main_network_has_ipv6) {
  3089.     STDOUT.WriteLine("Enabling IPv6 support");
  3090. }
  3091. AC_DEFINE('HAVE_GETADDRINFO', main_network_has_ipv6);
  3092. AC_DEFINE('HAVE_GAI_STRERROR', main_network_has_ipv6);
  3093. AC_DEFINE('HAVE_IPV6', main_network_has_ipv6);
  3094.  
  3095. /* this allows up to 256 sockets to be select()ed in a single
  3096.  * call to select(), instead of the usual 64 */
  3097. /* ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", "256"); */
  3098. ADD_FLAG("CFLAGS", "/D FD_SETSIZE=" + parseInt(PHP_FD_SETSIZE));
  3099.  
  3100. AC_DEFINE('HAVE_USLEEP', 1);
  3101. AC_DEFINE('HAVE_STRCOLL', 1);
  3102.  
  3103. /* For snapshot builders, where can we find the additional
  3104.  * files that make up the snapshot template? */
  3105. /* ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no"); */
  3106.  
  3107. if (PHP_SNAPSHOT_TEMPLATE == "no") {
  3108.     /* default is as a sibling of the php_build dir */
  3109.     if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) {
  3110.         PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template");
  3111.     } else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) {
  3112.         PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template");
  3113.     }
  3114. }
  3115.  
  3116. DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);
  3117.  
  3118. if (PHP_DSP != "no") {
  3119.     if (FSO.FolderExists("tmp")) {
  3120.         FSO.DeleteFolder("tmp");
  3121.     }
  3122.     FSO.CreateFolder("tmp");
  3123. }
  3124.  
  3125. /* ARG_ENABLE("security-flags", "Disable the compiler security flags", "yes"); */
  3126. if (PHP_SECURITY_FLAGS == "yes") {
  3127.     ADD_FLAG("LDFLAGS", "/NXCOMPAT /DYNAMICBASE ");
  3128. }
  3129.  
  3130. /* ARG_ENABLE("static-analyze", "Enable the VC compiler static analyze", "no"); */
  3131. if (PHP_STATIC_ANALYZE == "yes") {
  3132.     ADD_FLAG("CFLAGS", " /analyze ");
  3133.     ADD_FLAG("CFLAGS", " /wd6308 ");
  3134. }
  3135. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\TSRM\\config.w32'));
  3136. // vim:ft=javascript
  3137. // $Id$
  3138.  
  3139. ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c tsrm_win32.c");
  3140.  
  3141. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\aolserver\\config.w32'));
  3142. // vim:ft=javascript
  3143. // $Id$
  3144.  
  3145. /* ARG_WITH('aolserver', 'Build AOLserver support', 'no'); */
  3146.  
  3147. if (PHP_AOLSERVER != "no") {
  3148.     if (PHP_ZTS == "no") {
  3149.         WARNING("AOLSERVER module requires an --enable-zts build of PHP");
  3150.     } else {
  3151.         if (CHECK_HEADER_ADD_INCLUDE("ns.h", "CFLAGS_AOLSERVER", PHP_AOLSERVER) && CHECK_LIB("nsd.lib", "aolserver", PHP_AOLSERVER)) {
  3152.             SAPI('aolserver', 'aolserver.c', 'php' + PHP_VERSION + 'aolserver.so', '/D XP_WIN32 ');
  3153.         } else {
  3154.             WARNING("sapi/aolserver not enabled: Could not find libraries/headers");
  3155.         }
  3156.     }
  3157. }
  3158. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\apache\\config.w32'));
  3159. // vim:ft=javascript
  3160. // $Id$
  3161.  
  3162. /* ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'no'); */
  3163.  
  3164. /* ARG_WITH('apache-includes', 'Where to find Apache 1.3 headers', null); */
  3165. /* ARG_WITH('apache-libs', 'Where to find Apache 1.3 libraries', null); */
  3166.  
  3167. if (PHP_APACHE != "no") {
  3168.     if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE", php_usual_include_suspects +
  3169.                 ";" + PROGRAM_FILES + "\\Apache Group\\Apache\\include" +
  3170.                 ";" + PHP_PHP_BUILD + "\\apache\\src\\include") &&
  3171.             CHECK_LIB("ApacheCore.lib", "apache", php_usual_lib_suspects +
  3172.                 ';' + PROGRAM_FILES + '\\Apache Group\\Apache\\libexec' +
  3173.                 ";" + PHP_PHP_BUILD + "\\apache\\src\\corer")) {
  3174.         // We need to play tricks to get our readdir.h used by apache
  3175.         // headers
  3176.         SAPI('apache', 'mod_php5.c sapi_apache.c php_apache.c',
  3177.                 'php' + PHP_VERSION + 'apache.dll',
  3178.                 '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32');
  3179.     } else {
  3180.         WARNING("Could not find apache libraries/headers");
  3181.     }
  3182. }
  3183. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\apache2filter\\config.w32'));
  3184. // vim:ft=javascript
  3185. // $Id$
  3186.  
  3187. /* ARG_ENABLE('apache2filter', 'Build Apache 2.x filter', 'no'); */
  3188.  
  3189. if (PHP_APACHE2FILTER != "no") {
  3190.     if (PHP_ZTS == "no") {
  3191.         WARNING("Apache2 module requires an --enable-zts build of PHP on windows");
  3192.     } else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2FILTER", PHP_PHP_BUILD + "\\include\\apache2") &&
  3193.             CHECK_LIB("libhttpd.lib", "apache2filter", PHP_PHP_BUILD + "\\lib\\apache2") &&
  3194.             CHECK_LIB("libapr.lib", "apache2filter", PHP_PHP_BUILD + "\\lib\\apache2") &&
  3195.             CHECK_LIB("libaprutil.lib", "apache2filter", PHP_PHP_BUILD + "\\lib\\apache2")
  3196.             ) {
  3197.         SAPI('apache2filter', 'sapi_apache2.c apache_config.c php_functions.c',
  3198.                 'php' + PHP_VERSION + 'apache2_filter.dll',
  3199.                 '/D PHP_APACHE2_EXPORTS /I win32');
  3200.     } else {
  3201.         WARNING("Could not find apache2 filter libraries/headers");
  3202.     }
  3203. }
  3204.  
  3205. /* ARG_ENABLE('apache2-2filter', 'Build Apache 2.2.x filter', 'no'); */
  3206.  
  3207. if (PHP_APACHE2_2FILTER != "no") {
  3208.     if (PHP_ZTS == "no") {
  3209.         WARNING("Apache2 module requires an --enable-zts build of PHP on windows");
  3210.     } else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2FILTER", PHP_PHP_BUILD + "\\include\\apache2_2") &&
  3211.             CHECK_LIB("libhttpd.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
  3212.             CHECK_LIB("libapr-1.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
  3213.             CHECK_LIB("libaprutil-1.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2")
  3214.             ) {
  3215.         SAPI('apache2_2filter', 'sapi_apache2.c apache_config.c php_functions.c',
  3216.                 'php' + PHP_VERSION + 'apache2_2_filter.dll',
  3217.                 '/D PHP_APACHE2_EXPORTS /I win32',
  3218.                 'sapi\\apache2_2filter');
  3219.     } else {
  3220.         WARNING("Could not find apache2.2 filter libraries/headers");
  3221.     }
  3222. }
  3223. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\apache2handler\\config.w32'));
  3224. // vim:ft=javascript
  3225. // $Id$
  3226.  
  3227. /* ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no'); */
  3228.  
  3229. if (PHP_APACHE2HANDLER != "no") {
  3230.     if (PHP_ZTS == "no") {
  3231.         WARNING("Apache 2.0 module requires an --enable-zts build of PHP on windows");
  3232.     } else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2HANDLER", PHP_PHP_BUILD + "\\include\\apache2") &&
  3233.             CHECK_LIB("libhttpd.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") &&
  3234.             CHECK_LIB("libapr.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") &&
  3235.             CHECK_LIB("libaprutil.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2")
  3236.             ) {
  3237.         SAPI('apache2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c',
  3238.                 'php' + PHP_VERSION + 'apache2.dll',
  3239.                 '/D PHP_APACHE2_EXPORTS /I win32');
  3240.     } else {
  3241.         WARNING("Could not find apache2 libraries/headers");
  3242.     }
  3243. }
  3244.  
  3245. /* ARG_ENABLE('apache2-2handler', 'Build Apache 2.2.x handler', 'no'); */
  3246.  
  3247. if (PHP_APACHE2_2HANDLER != "no") {
  3248.     if (PHP_ZTS == "no") {
  3249.         WARNING("Apache 2.2 module requires an --enable-zts build of PHP on windows");
  3250.     } else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2HANDLER", PHP_PHP_BUILD + "\\include\\apache2_2") &&
  3251.             CHECK_LIB("libhttpd.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
  3252.             CHECK_LIB("libapr-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
  3253.             CHECK_LIB("libaprutil-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2")
  3254.             ) {
  3255.         SAPI('apache2_2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c',
  3256.                 'php' + PHP_VERSION + 'apache2_2.dll',
  3257.                 '/D PHP_APACHE2_EXPORTS /I win32',
  3258.                 'sapi\\apache2_2handler');
  3259.     } else {
  3260.         WARNING("Could not find apache2.2 libraries/headers");
  3261.     }
  3262. }
  3263.  
  3264. /* ARG_ENABLE('apache2-4handler', 'Build Apache 2.4.x handler', 'no'); */
  3265. if (PHP_APACHE2_4HANDLER != "no") {
  3266.     if (PHP_ZTS == "no") {
  3267.         WARNING("Apache 2.4 module requires an --enable-zts build of PHP on windows");
  3268.     } else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_4HANDLER", PHP_PHP_BUILD + "\\include\\apache2_4") &&
  3269.             CHECK_LIB("libhttpd.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&
  3270.             CHECK_LIB("libapr-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&
  3271.             CHECK_LIB("libaprutil-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4")
  3272.             ) {
  3273.         SAPI('apache2_4handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c',
  3274.                 'php' + PHP_VERSION + 'apache2_4.dll',
  3275.                 '/D PHP_APACHE2_EXPORTS /I win32',
  3276.                 'sapi\\apache2handler');
  3277.     } else {
  3278.         WARNING("Could not find apache 2.4 libraries/headers");
  3279.     }
  3280. }
  3281.  
  3282. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\apache_hooks\\config.w32'));
  3283. // vim:ft=javascript
  3284. // $Id$
  3285.  
  3286. /* ARG_WITH('apache-hooks', 'Build Apache 1.3.x (hooks) version of PHP', 'no'); */
  3287.  
  3288. if (PHP_APACHE_HOOKS != "no") {
  3289.     if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE_HOOKS", php_usual_include_suspects +
  3290.                 ";" + PROGRAM_FILES + "\\Apache Group\\Apache\\include" +
  3291.                 ";" + PHP_PHP_BUILD + "\\apache\\src\\include") &&
  3292.             CHECK_LIB("ApacheCore.lib", "apache_hooks", php_usual_lib_suspects +
  3293.                 ';' + PROGRAM_FILES + '\\Apache Group\\Apache\\libexec' +
  3294.                 ";" + PHP_PHP_BUILD + "\\apache\\src\\corer")) {
  3295.         // We need to play tricks to get our readdir.h used by apache
  3296.         // headers
  3297.         SAPI('apache_hooks', 'mod_php5.c sapi_apache.c php_apache.c',
  3298.                 'php' + PHP_VERSION + 'apache_hooks.dll',
  3299.                 '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32');
  3300.     } else {
  3301.         WARNING("Could not find apache libraries/headers");
  3302.     }
  3303. }
  3304. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\cgi\\config.w32'));
  3305. // vim:ft=javascript
  3306. // $Id$
  3307.  
  3308. /* ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes'); */
  3309.  
  3310. if (PHP_CGI == "yes") {
  3311.     ADD_FLAG("LDFLAGS_CGI", "/stack:8388608");
  3312.     SAPI('cgi', 'cgi_main.c fastcgi.c', 'php-cgi.exe');
  3313.     ADD_FLAG('LIBS_CGI', 'ws2_32.lib kernel32.lib advapi32.lib');
  3314. }
  3315. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\cli\\config.w32'));
  3316. // vim:ft=javascript
  3317. // $Id$
  3318.  
  3319. /* ARG_ENABLE('cli', 'Build CLI version of PHP', 'yes'); */
  3320. /* ARG_ENABLE('crt-debug', 'Enable CRT memory dumps for debugging sent to STDERR', 'no'); */
  3321. /* ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no'); */
  3322.  
  3323. if (PHP_CLI == "yes") {
  3324.     SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe');
  3325.     ADD_FLAG("LIBS_CLI", "ws2_32.lib");
  3326.     if (PHP_CRT_DEBUG == "yes") {
  3327.         ADD_FLAG("CFLAGS_CLI", "/D PHP_WIN32_DEBUG_HEAP");
  3328.     }
  3329.     ADD_FLAG("LDFLAGS_CLI", "/stack:8388608");
  3330. }
  3331.  
  3332. if (PHP_CLI_WIN32 == "yes") {
  3333.     SAPI('cli_win32', 'cli_win32.c', 'php-win.exe');
  3334.     ADD_FLAG("LDFLAGS_CLI_WIN32", "/stack:8388608");
  3335. }
  3336.  
  3337. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\embed\\config.w32'));
  3338. // vim:ft=javascript
  3339. // $Id$
  3340.  
  3341. /* ARG_ENABLE('embed', 'Embedded SAPI library', 'no'); */
  3342.  
  3343. if (PHP_EMBED != "no") {
  3344.     SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib');
  3345.     PHP_INSTALL_HEADERS("sapi/embed", "php_embed.h");
  3346. }
  3347. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\isapi\\config.w32'));
  3348. // vim:ft=javascript
  3349. // $Id$
  3350.  
  3351. /* ARG_ENABLE('isapi', 'Build ISAPI version of PHP', 'no'); */
  3352.  
  3353. if (PHP_ISAPI == "yes") {
  3354.     if (PHP_ZTS == "no") {
  3355.         WARNING("ISAPI module requires an --enable-zts build of PHP");
  3356.     } else {
  3357.         SAPI('isapi', 'php5isapi.c', 'php' + PHP_VERSION + 'isapi.dll', '/D PHP5ISAPI_EXPORTS');
  3358.         ADD_FLAG('LDFLAGS_ISAPI', '/DEF:sapi\\isapi\\php5isapi.def');
  3359.     }
  3360. }
  3361. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\nsapi\\config.w32'));
  3362. // vim:ft=javascript
  3363. // $Id$
  3364.  
  3365. /* ARG_ENABLE('nsapi', 'Build NSAPI for Netscape/iPlanet/SunONE webservers', 'no'); */
  3366.  
  3367. /* ARG_WITH('nsapi-includes', 'Where to find NSAPI headers', null); */
  3368. /* ARG_WITH('nsapi-libs', 'Where to find NSAPI libraries', null); */
  3369.  
  3370. if (PHP_NSAPI != "no") {
  3371.     if (PHP_ZTS == "no") {
  3372.         WARNING("NSAPI module requires an --enable-zts build of PHP");
  3373.         PHP_NSAPI = "no"
  3374.     } else if (CHECK_HEADER_ADD_INCLUDE("nsapi.h", "CFLAGS_NSAPI",
  3375.             PHP_NSAPI + ';' + PHP_NSAPI_INCLUDES) &&
  3376.             CHECK_LIB("ns-httpd*.lib", "nsapi", PHP_NSAPI + ";" + PHP_NSAPI_LIBS)) {
  3377.         SAPI('nsapi', 'nsapi.c', 'php' + PHP_VERSION + 'nsapi.dll', '/D XP_WIN32 ');
  3378.     } else {
  3379.         WARNING("Could not find NSAPI headers/libraries");
  3380.     }
  3381. }
  3382. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\sapi\\pi3web\\config.w32'));
  3383. // vim:ft=javascript
  3384. // $Id$
  3385.  
  3386. /* ARG_WITH('pi3web', 'Pi3Web', 'no'); */
  3387.  
  3388. if (PHP_PI3WEB != "no") {
  3389.     if (CHECK_HEADER_ADD_INCLUDE('PiAPI.h', 'CFLAGS_PI3WEB', PHP_PHP_BUILD + "\\Pi3Web\\include;" + PHP_PI3WEB) &&
  3390.            CHECK_LIB('piapi.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) &&
  3391.            CHECK_LIB('pi2api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) &&
  3392.            CHECK_LIB('pi3api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB)) {
  3393.         SAPI('pi3web', 'pi3web_sapi.c', 'php' + PHP_VERSION + 'pi3web.dll', '/D PHP5PI3WEB_EXPORTS');
  3394.         AC_DEFINE('WITH_PI3WEB', 1);
  3395.     } else {
  3396.         WARNING('Pi3Web not enabled; headers/libraries not found');
  3397.     }
  3398. }
  3399. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\bcmath\\config.w32'));
  3400. // $Id$
  3401. // vim:ft=javascript
  3402.  
  3403. /* ARG_ENABLE("bcmath", "bc style precision math functions", "yes"); */
  3404.  
  3405. if (PHP_BCMATH == "yes") {
  3406.     EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src");
  3407.     ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \
  3408.         outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \
  3409.         num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \
  3410.         nearzero.c num2str.c raise.c rmzero.c str2num.c", "bcmath");
  3411.  
  3412.     AC_DEFINE('HAVE_BCMATH', 1, 'Have BCMATH library');
  3413. }
  3414. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\bz2\\config.w32'));
  3415. // $Id$
  3416. // vim:ft=javascript
  3417.  
  3418. /* ARG_WITH("bz2", "BZip2", "no"); */
  3419.  
  3420. if (PHP_BZ2 != "no") {
  3421.     if (CHECK_LIB("libbz2_a.lib;libbz2.lib", "bz2", PHP_BZ2) &&
  3422.             CHECK_HEADER_ADD_INCLUDE("bzlib.h", "CFLAGS_BZ2")) {
  3423.         EXTENSION("bz2", "bz2.c bz2_filter.c");
  3424.         AC_DEFINE('HAVE_BZ2', 1, 'Have BZ2 library');
  3425.         // BZ2 extension does this slightly differently from others
  3426.         if (PHP_BZ2_SHARED) {
  3427.             ADD_FLAG("CFLAGS_BZ2", "/D PHP_BZ2_EXPORTS ");
  3428.         }
  3429.     } else {
  3430.         WARNING("bz2 not enabled; libraries and headers not found");
  3431.     }
  3432. }
  3433. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\calendar\\config.w32'));
  3434. // $Id$
  3435. // vim:ft=javascript
  3436.  
  3437. /* ARG_ENABLE("calendar", "calendar conversion support", "yes"); */
  3438.  
  3439. if (PHP_CALENDAR == "yes") {
  3440.     EXTENSION("calendar", "calendar.c dow.c french.c gregor.c jewish.c \
  3441.         julian.c easter.c cal_unix.c");
  3442.     AC_DEFINE('HAVE_CALENDAR', 1, 'Have calendar');
  3443. }
  3444. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\com_dotnet\\config.w32'));
  3445. // $Id$
  3446. // vim:ft=javascript
  3447.  
  3448. /* ARG_ENABLE("com-dotnet", "COM and .Net support", "yes"); */
  3449.  
  3450. if (PHP_COM_DOTNET == "yes") {
  3451.     CHECK_LIB('oleaut32.lib', 'com_dotnet');
  3452.     EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \
  3453.         com_handlers.c com_iterator.c com_misc.c com_olechar.c \
  3454.         com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c");
  3455.     AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support');
  3456.     CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET');
  3457. }
  3458. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\ctype\\config.w32'));
  3459. // $Id$
  3460. // vim:ft=javascript
  3461.  
  3462. /* ARG_ENABLE("ctype", "ctype", "yes"); */
  3463.  
  3464. if (PHP_CTYPE == "yes") {
  3465.     EXTENSION("ctype", "ctype.c");
  3466.     AC_DEFINE('HAVE_CTYPE', 1, 'Have ctype');
  3467. }
  3468. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\curl\\config.w32'));
  3469. // $Id$
  3470. // vim:ft=javascript
  3471.  
  3472. /* ARG_WITH("curl", "cURL support", "no"); */
  3473.  
  3474. if (PHP_CURL != "no") {
  3475.     if (CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL) &&
  3476.             CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
  3477.             CHECK_LIB("ssleay32.lib", "curl", PHP_CURL) &&
  3478.             CHECK_LIB("libeay32.lib", "curl", PHP_CURL)
  3479.         && CHECK_LIB("winmm.lib", "curl", PHP_CURL)
  3480.         && CHECK_LIB("wldap32.lib", "curl", PHP_CURL)
  3481.         && (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) ||
  3482.             (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
  3483.         ) {
  3484.         EXTENSION("curl", "interface.c multi.c streams.c", true);
  3485.         AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
  3486.         AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in cURL');
  3487.         AC_DEFINE('HAVE_CURL_EASY_STRERROR', 1, 'Have curl_easy_strerror in cURL');
  3488.         AC_DEFINE('HAVE_CURL_MULTI_STRERROR', 1, 'Have curl_multi_strerror in cURL');
  3489.         AC_DEFINE('HAVE_CURL_VERSION_INFO', 1, 'Have curl_version_info in cURL');
  3490.         ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB");
  3491.         // TODO: check for curl_version_info
  3492.         // AC_DEFINE('PHP_CURL_URL_WRAPPERS', 0, 'Use curl for URL wrappers [experimental]');
  3493.     } else {
  3494.         WARNING("curl not enabled; libraries and headers not found");
  3495.     }
  3496. }
  3497. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\date\\config.w32'));
  3498. // $Id$
  3499. // vim:ft=javascript
  3500.  
  3501. EXTENSION("date", "php_date.c", false, "-Iext/date/lib");
  3502. ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c parse_iso_intervals.c interval.c", "date");
  3503. AC_DEFINE('HAVE_DATE', 1, 'Have date/time support');
  3504.  
  3505. ADD_FLAG('CFLAGS_DATE', "/wd4244");
  3506.  
  3507. var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
  3508. tl_config.WriteLine("#include \"config.w32.h\"");
  3509. tl_config.Close();
  3510.  
  3511. PHP_INSTALL_HEADERS("ext/date/", "php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h");
  3512. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\dba\\config.w32'));
  3513. // $Id$
  3514. // vim:ft=javascript
  3515.  
  3516. /* ARG_WITH("dba", "DBA support", "no"); */
  3517.  
  3518. if (PHP_DBA != "no") {
  3519.     if (CHECK_LIB("libdb31s.lib", "dba", PHP_DBA) &&
  3520.         CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) {
  3521.         EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c");
  3522.         ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba");
  3523.         ADD_SOURCES("ext/dba/libflatfile", "flatfile.c", "dba");
  3524.         ADD_SOURCES("ext/dba/libinifile", "inifile.c", "dba");
  3525.         AC_DEFINE('HAVE_DBA', 1, 'DBA support');
  3526.         ADD_FLAG("CFLAGS_DBA", "/D DBA_DB1=0 /D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\" /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1");
  3527.     } else {
  3528.         WARNING("dba not enabled; libraries and headers not found");
  3529.     }
  3530. }
  3531. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\enchant\\config.w32'));
  3532. // $Id$
  3533. // vim:ft=javascript
  3534.  
  3535. /* ARG_WITH("enchant", "Enchant Support", "no"); */
  3536.  
  3537. if (PHP_ENCHANT == "yes") {
  3538.     if (CHECK_HEADER_ADD_INCLUDE("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\enchant") &&
  3539.             CHECK_HEADER_ADD_INCLUDE("glib.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\glib-2.0") &&
  3540.             CHECK_LIB("libenchant.lib", "enchant", PHP_ENCHANT) ) {
  3541.         EXTENSION("enchant", "enchant.c");
  3542.         AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
  3543.         AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 1);
  3544.         ADD_FLAG("CFLAG_ENCHANT", "/D _WIN32");
  3545.     } else {
  3546.         WARNING('Could not find enchant.h; skipping');
  3547.     }
  3548. }
  3549. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\ereg\\config.w32'));
  3550. // $Id$
  3551. // vim:ft=javascript
  3552.  
  3553. /* ARG_WITH("ereg", "POSIX extended regular expressions", "yes"); */
  3554. if (PHP_EREG != "no") {
  3555.  
  3556.     EXTENSION("ereg", "ereg.c", PHP_EREG_SHARED, "-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp -Iext/ereg/regex");
  3557.     ADD_SOURCES("ext/ereg/regex", "regcomp.c regexec.c regerror.c regfree.c", "ereg");
  3558.     AC_DEFINE('REGEX', 1, 'Bundled regex');
  3559.     AC_DEFINE('HSREGEX', 1, 'Bundled regex');
  3560.     PHP_INSTALL_HEADERS("ext/ereg", "php_ereg.h php_regex.h regex/");
  3561. }
  3562. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\fileinfo\\config.w32'));
  3563. // $Id$
  3564. // vim:ft=javascript
  3565.  
  3566. /* ARG_ENABLE("fileinfo", "fileinfo support", "no"); */
  3567.  
  3568. if (PHP_FILEINFO != 'no') {
  3569.     LIBMAGIC_SOURCES=" apprentice.c apptype.c ascmagic.c \
  3570.             cdf.c cdf_time.c compress.c \
  3571.             encoding.c fsmagic.c funcs.c \
  3572.             is_tar.c magic.c print.c \
  3573.             readcdf.c readelf.c softmagic.c";
  3574.  
  3575.     if (VCVERS < 1500) {
  3576.         ADD_FLAG('CFLAGS', '/Zm1000');
  3577.     }
  3578.  
  3579.     EXTENSION('fileinfo', 'fileinfo.c', true, "/I" + configure_module_dirname + "/libmagic /I" + configure_module_dirname);
  3580.     ADD_SOURCES(configure_module_dirname + '\\libmagic', LIBMAGIC_SOURCES, "fileinfo");
  3581. }
  3582. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\filter\\config.w32'));
  3583. // $Id$
  3584. // vim:ft=javascript
  3585.  
  3586. /* ARG_ENABLE("filter", "Filter Support", "yes"); */
  3587.  
  3588. if (PHP_FILTER == "yes") {
  3589.     EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
  3590.     PHP_INSTALL_HEADERS("ext/filter", "php_filter.h");
  3591. }
  3592. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\ftp\\config.w32'));
  3593. // $Id$
  3594. // vim:ft=javascript
  3595.  
  3596. /* ARG_ENABLE("ftp", "ftp support", "yes"); */
  3597.  
  3598. if (PHP_FTP == "yes") {
  3599.     EXTENSION("ftp", "php_ftp.c ftp.c");
  3600.     AC_DEFINE('HAVE_FTP', 1, 'Have FTP support');
  3601. }
  3602. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\gd\\config.w32'));
  3603. // $Id$
  3604. // vim:ft=javascript
  3605.  
  3606. /* ARG_WITH("gd", "Bundled GD support", "yes,shared"); */
  3607. /* ARG_WITH("t1lib", "t1lib support", "yes"); */
  3608.  
  3609. if (PHP_GD != "no") {
  3610.     if (
  3611.         CHECK_LIB("vpxmt.lib", "gd", PHP_GD) &&
  3612.         CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) &&
  3613.         CHECK_LIB("freetype_a.lib;freetype.lib", "gd", PHP_GD) &&
  3614.         CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) &&
  3615.         CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
  3616.         CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD +  ";" + PHP_PHP_BUILD + "\\include\\libpng12") &&
  3617.         (CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) &&
  3618.          CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) &&
  3619.         (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) ||
  3620.             (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
  3621.         CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) &&
  3622.         CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")
  3623.         ) {
  3624.         if (PHP_T1LIB != "no") {
  3625.             if (CHECK_LIB("T1_StaticMD.lib", "gd", PHP_GD) &&
  3626.                 CHECK_HEADER_ADD_INCLUDE("t1lib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\t1lib")
  3627.                 ) {
  3628.                 ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBT1");
  3629.                 } else {
  3630.                 WARNING("t1lib not enabled; libraries and headers not found");
  3631.             }
  3632.         }
  3633.  
  3634.         CHECK_LIB("User32.lib", "gd", PHP_GD);
  3635.         CHECK_LIB("Gdi32.lib", "gd", PHP_GD);
  3636.  
  3637.         EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd", "php_gd2.dll");
  3638.         ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd_arc_f_buggy.c gd.c \
  3639.             gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \
  3640.             gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \
  3641.             gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
  3642.             gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c gd_security.c \
  3643.             gd_filter.c gd_pixelate.c gd_arc.c gd_rotate.c gd_color.c webpimg.c gd_webp.c ", "gd");
  3644.         AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
  3645.         ADD_FLAG("CFLAGS_GD", " \
  3646. /D HAVE_GD_DYNAMIC_CTX_EX=1 \
  3647. /D HAVE_GD_BUNDLED=1  \
  3648. /D HAVE_GD_GD2  \
  3649. /D HAVE_GD_GIF_READ=1  \
  3650. /D HAVE_GD_GIF_CREATE=1  \
  3651. /D HAVE_GDIMAGECOLORRESOLVE=1  \
  3652. /D HAVE_GD_IMAGESETBRUSH=1  \
  3653. /D HAVE_GD_IMAGESETTILE=1 \
  3654. /D HAVE_GD_FONTCACHESHUTDOWN=1 \
  3655. /D HAVE_GD_FONTMUTEX=1 \
  3656. /D HAVE_LIBFREETYPE=1 \
  3657. /D HAVE_GD_JPG  \
  3658. /D HAVE_GD_PNG  \
  3659. /D HAVE_GD_STRINGFTEX=1  \
  3660. /D HAVE_GD_STRINGTTF=1  \
  3661. /D HAVE_GD_WBMP  \
  3662. /D HAVE_GD_XBM  \
  3663. /D HAVE_GD_XPM  \
  3664. /D HAVE_GD_WEBP \
  3665. /D HAVE_LIBFREETYPE=1  \
  3666. /D HAVE_LIBGD13=1  \
  3667. /D HAVE_LIBGD15=1  \
  3668. /D HAVE_LIBGD20=1  \
  3669. /D HAVE_LIBGD204=1 \
  3670. /D HAVE_LIBJPEG  \
  3671. /D HAVE_LIBVPX \
  3672. /D HAVE_LIBPNG  \
  3673. /D HAVE_XPM  \
  3674. /D HAVE_COLORCLOSESTHWB  \
  3675. /D USE_GD_IMGSTRTTF  \
  3676. /D USE_GD_IOCTX \
  3677. /D MSWIN32 \
  3678.         ");
  3679.        
  3680.         PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
  3681.         } else {
  3682.         WARNING("gd not enabled; libraries and headers not found");
  3683.     }
  3684. }
  3685. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\gettext\\config.w32'));
  3686. // $Id$
  3687. // vim:ft=javascript
  3688.  
  3689. /* ARG_WITH("gettext", "gettext support", "no"); */
  3690.  
  3691. if (PHP_GETTEXT != "no") {
  3692.     if (CHECK_LIB("libintl_a.lib;libintl.lib", "gettext", PHP_GETTEXT) && CHECK_HEADER_ADD_INCLUDE("libintl.h", "CFLAGS_GETTEXT")) {
  3693.         EXTENSION("gettext", "gettext.c", PHP_GETTEXT_SHARED, "-DHAVE_BIND_TEXTDOMAIN_CODESET=1 -DHAVE_DNGETTEXT=1 -DHAVE_NGETTEXT=1 -DHAVE_LIBINTL=1 -DHAVE_DCNGETTEXT=1");
  3694.     } else {
  3695.         WARNING("gettext not enabled; libraries and headers not found");
  3696.     }
  3697. }
  3698. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\gmp\\config.w32'));
  3699. // $Id$
  3700. // vim:ft=javascript
  3701.  
  3702. /* ARG_WITH("gmp", "Include GNU MP support.", "no"); */
  3703.  
  3704. if (PHP_GMP != "no") {
  3705.     if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) &&
  3706.         CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP +  ";" + PHP_PHP_BUILD + "\\include\\mpir")) {
  3707.         EXTENSION("gmp", "gmp.c");
  3708.         AC_DEFINE('HAVE_GMP', 1, 'GMP support');
  3709.         AC_DEFINE('HAVE_MPIR', 1, 'MPIR support');
  3710.     } else {
  3711.         WARNING("GMP not enabled; libraries and headers not found");
  3712.     }
  3713. }
  3714. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\hash\\config.w32'));
  3715. // $Id$
  3716. // vim:ft=javascript
  3717.  
  3718. /* ARG_ENABLE("hash", "enable hash support", "yes"); */
  3719. /* ARG_WITH("mhash", "mhash support", "no"); */
  3720.  
  3721. if (PHP_MHASH != "no") {
  3722.     if (PHP_HASH == "no") {
  3723.         PHP_HASH = "yes";
  3724.     }
  3725.     AC_DEFINE('PHP_MHASH_BC', 1);
  3726. }
  3727.  
  3728. if (PHP_HASH != "no") {
  3729.     AC_DEFINE('HAVE_HASH_EXT', 1);
  3730.     EXTENSION("hash", "hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c "
  3731.         + "hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c "
  3732.         + "hash_adler32.c hash_crc32.c hash_joaat.c hash_fnv.c");
  3733.  
  3734.         PHP_INSTALL_HEADERS("ext/hash/", "php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h " +
  3735.         "php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h " +
  3736.         "php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h " +
  3737.         "php_hash_types.h");
  3738. }
  3739.  
  3740. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\iconv\\config.w32'));
  3741. // $Id$
  3742. // vim: ft=javascript
  3743.  
  3744. /* ARG_WITH("iconv", "iconv support", "yes"); */
  3745.  
  3746. if (PHP_ICONV != "no") {
  3747.     if ((CHECK_LIB("libiconv_a.lib", "iconv", PHP_ICONV) || CHECK_LIB("libiconv.lib", "iconv", PHP_ICONV) ||
  3748.             CHECK_LIB("iconv_a.lib", "iconv", PHP_ICONV) || CHECK_LIB("iconv.lib", "iconv", PHP_ICONV)) &&
  3749.         CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_ICONV", PHP_ICONV)) {
  3750.  
  3751.         EXTENSION("iconv", "iconv.c");
  3752.        
  3753.         AC_DEFINE("HAVE_ICONV", 1, "Define if iconv extension is enabled");
  3754.         AC_DEFINE("HAVE_LIBICONV", 1, "Define if libiconv is available");
  3755.         AC_DEFINE("ICONV_ALIASED_LIBICONV", 1, "The iconv function is called iconv() in libiconv");
  3756.         AC_DEFINE("PHP_ICONV_IMPL", "\"libiconv\"", "Which iconv implementation to use");
  3757.         AC_DEFINE("ICONV_SUPPORTS_ERRNO", 1, "Whether iconv supports errno or not");
  3758.         ADD_FLAG("CFLAGS_ICONV", "/D PHP_ICONV_EXPORTS ");
  3759.         if (!PHP_ICONV_SHARED) {
  3760.             ADD_DEF_FILE("ext\\iconv\\php_iconv.def");
  3761.         }
  3762.         PHP_INSTALL_HEADERS("", "ext/iconv");
  3763.     } else {
  3764.         WARNING("iconv support can't be enabled, libraries or headers are missing")
  3765.         PHP_ICONV = "no";
  3766.     }
  3767. }
  3768.  
  3769. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\imap\\config.w32'));
  3770. // $Id$
  3771. // vim:ft=javascript
  3772.  
  3773. /* ARG_WITH("imap", "IMAP Support", "no"); */
  3774.  
  3775. if (PHP_IMAP == "yes") {
  3776.     if (CHECK_LIB("cclient_a.lib;cclient.lib", "imap") &&
  3777.             (CHECK_HEADER_ADD_INCLUDE("c-client.h", "CFLAGS_IMAP")||
  3778.             CHECK_HEADER_ADD_INCLUDE("c-client/c-client.h", "CFLAGS_IMAP", null, null, true)) ||
  3779.             (CHECK_HEADER_ADD_INCLUDE("utf8aux.h", "CFLAGS_IMAP")||
  3780.             CHECK_HEADER_ADD_INCLUDE("c-client/utf8aux.h", "CFLAGS_IMAP", null, null, true))
  3781.             ) {
  3782.         CHECK_LIB("winmm.lib", "imap");
  3783.         CHECK_LIB("ws2_32.lib", "imap");
  3784.         CHECK_LIB("Secur32.lib", "imap");
  3785.         CHECK_LIB("crypt32.lib", "imap");
  3786.         EXTENSION("imap", "php_imap.c");
  3787.  
  3788.         ADD_FLAG("CFLAGS_IMAP", "/D HAVE_IMAP2000=1 /D HAVE_IMAP2004=1 /D HAVE_IMAP2007a=1 /D HAVE_IMAP2007b=1 /D HAVE_IMAP_SSL=1");
  3789.         AC_DEFINE('HAVE_IMAP', 1, 'Have IMAP support', true);
  3790.         AC_DEFINE('HAVE_NEW_MIME2TEXT', 1, 'Have utf8_mime2text', true);
  3791.         AC_DEFINE('HAVE_RFC822_OUTPUT_ADDRESS_LIST', 1, 'Have rfc822_output_address_list', true);
  3792.         AC_DEFINE('HAVE_IMAP_MUTF7', 1, 'Have modified utf7 support', true);
  3793.         AC_DEFINE('HAVE_NEW_MIME2TEXT', 1, 'Whether utf8_mime2text() has new signature');
  3794.     } else {
  3795.         WARNING("imap not enabled; libraries and headers not found");
  3796.     }
  3797. }
  3798. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\interbase\\config.w32'));
  3799. // $Id$
  3800. // vim:ft=javascript
  3801.  
  3802. /* ARG_WITH("interbase", "InterBase support", "no"); */
  3803.  
  3804. if (PHP_INTERBASE != "no") {
  3805.  
  3806.     if (CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_INTERBASE",
  3807.                 PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_INTERBASE) &&
  3808.             (CHECK_LIB("fbclient_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE) ||
  3809.              CHECK_LIB("gds32_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE))) {
  3810.  
  3811.         EXTENSION("interbase", "interbase.c ibase_query.c ibase_service.c ibase_events.c ibase_blobs.c");
  3812.         AC_DEFINE('HAVE_IBASE', 1, 'Have interbase library');
  3813.     } else {
  3814.         WARNING("interbase not enabled; libraries and headers not found");
  3815.     }
  3816. }
  3817. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\intl\\config.w32'));
  3818. // $Id$
  3819. // vim:ft=javascript
  3820.  
  3821. /* ARG_ENABLE("intl", "Enable internationalization support", "no"); */
  3822.  
  3823. if (PHP_INTL != "no") {
  3824.     if (CHECK_LIB("icuuc.lib", "intl", PHP_INTL) &&
  3825.                     CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
  3826.         // always build as shared - zend_strtod.c/ICU type conflict
  3827.         EXTENSION("intl", "php_intl.c intl_convert.c intl_error.c ", true,
  3828.                                 "/I \"" + configure_module_dirname + "\"");
  3829.         ADD_SOURCES(configure_module_dirname + "/collator", "\
  3830.                 collator.c \
  3831.                 collator_attr.c \
  3832.                 collator_class.c \
  3833.                 collator_compare.c \
  3834.                 collator_convert.c \
  3835.                 collator_create.c \
  3836.                 collator_error.c \
  3837.                 collator_is_numeric.c \
  3838.                 collator_locale.c \
  3839.                 collator_sort.c \
  3840.                 ", "intl");
  3841.         ADD_SOURCES(configure_module_dirname + "/common", "\
  3842.                 common_error.c \
  3843.                 ", "intl");
  3844.         ADD_SOURCES(configure_module_dirname + "/formatter", "\
  3845.                 formatter.c \
  3846.                 formatter_attr.c \
  3847.                 formatter_class.c \
  3848.                 formatter_data.c \
  3849.                 formatter_format.c \
  3850.                 formatter_main.c \
  3851.                 formatter_parse.c \
  3852.                 ", "intl");
  3853.         ADD_SOURCES(configure_module_dirname + "/locale", "\
  3854.                 locale.c \
  3855.                 locale_class.c \
  3856.                 locale_methods.c \
  3857.                 ", "intl");
  3858.         ADD_SOURCES(configure_module_dirname + "/msgformat", "\
  3859.                 msgformat.c \
  3860.                 msgformat_attr.c \
  3861.                 msgformat_class.c \
  3862.                 msgformat_data.c \
  3863.                 msgformat_format.c \
  3864.                 msgformat_helpers.cpp \
  3865.                 msgformat_parse.c \
  3866.                 ", "intl");
  3867.         ADD_SOURCES(configure_module_dirname + "/grapheme", "\
  3868.                                grapheme_string.c grapheme_util.c  \
  3869.                                ", "intl");
  3870.         ADD_SOURCES(configure_module_dirname + "/normalizer", "\
  3871.                 normalizer.c \
  3872.                 normalizer_class.c \
  3873.                 normalizer_normalize.c \
  3874.                 ", "intl");
  3875.         ADD_SOURCES(configure_module_dirname + "/dateformat", "\
  3876.                 dateformat.c \
  3877.                 dateformat_class.c \
  3878.                 dateformat_attr.c \
  3879.                 dateformat_format.c \
  3880.                 dateformat_parse.c \
  3881.                 dateformat_data.c \
  3882.                 ", "intl");
  3883.         ADD_SOURCES(configure_module_dirname + "/idn", "\
  3884.                 idn.c",
  3885.                 "intl");
  3886.         ADD_SOURCES(configure_module_dirname + "/resourcebundle", "\
  3887.                 resourcebundle.c \
  3888.                 resourcebundle_class.c \
  3889.                 resourcebundle_iterator.c",
  3890.                 "intl");
  3891.  
  3892.         if (CHECK_HEADER_ADD_INCLUDE("unicode/uspoof.h", "CFLAGS_INTL")) {
  3893.             ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\
  3894.                     spoofchecker.c \
  3895.                     spoofchecker_class.c \
  3896.                     spoofchecker_create.c \
  3897.                     spoofchecker_main.c",
  3898.                     "intl");
  3899.                     AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
  3900.         }
  3901.  
  3902.         ADD_SOURCES(configure_module_dirname + "/transliterator", "\
  3903.                 transliterator.c \
  3904.                 transliterator_class.c \
  3905.                 transliterator_methods.c",
  3906.                 "intl");
  3907.         ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib icule.lib iculx.lib");
  3908.         AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
  3909.     } else {
  3910.         WARNING("intl not enabled; libraries and/or headers not found");
  3911.     }
  3912. }
  3913. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\json\\config.w32'));
  3914. // $Id$
  3915. // vim:ft=javascript
  3916.  
  3917. /* ARG_ENABLE("json", "JavaScript Object Serialization support", "yes"); */
  3918.  
  3919. if (PHP_JSON != "no") {
  3920.     EXTENSION('json', 'json.c', PHP_JSON_SHARED, "");
  3921.     ADD_SOURCES(configure_module_dirname, "JSON_parser.c utf8_decode.c", "json");
  3922.     PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
  3923. }
  3924.  
  3925. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\ldap\\config.w32'));
  3926. // $Id$
  3927. // vim:ft=javascript
  3928.  
  3929. /* ARG_WITH("ldap", "LDAP support", "no"); */
  3930.  
  3931. if (PHP_LDAP != "no") {
  3932.  
  3933.     if (CHECK_HEADER_ADD_INCLUDE("ldap.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) &&
  3934.             CHECK_HEADER_ADD_INCLUDE("lber.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP)
  3935.             &&
  3936.             CHECK_LIB("ssleay32.lib", "ldap", PHP_LDAP) &&
  3937.             CHECK_LIB("libeay32.lib", "ldap", PHP_LDAP) &&
  3938.             CHECK_LIB("oldap32_a.lib", "ldap", PHP_LDAP) &&
  3939.             CHECK_LIB("olber32_a.lib", "ldap", PHP_LDAP)&&
  3940.             CHECK_LIB("libsasl.lib", "ldap", PHP_LDAP)) {
  3941.         EXTENSION('ldap', 'ldap.c');
  3942.  
  3943.         AC_DEFINE('HAVE_LDAP_PARSE_RESULT', 1);
  3944.         AC_DEFINE('HAVE_LDAP_PARSE_REFERENCE', 1);
  3945.         AC_DEFINE('HAVE_LDAP_START_TLS_S', 1);
  3946.         AC_DEFINE('HAVE_LDAP', 1);
  3947.         AC_DEFINE('HAVE_LDAP_SASL', 1);
  3948.         AC_DEFINE('HAVE_LDAP_SASL_SASL_H', 1);
  3949.         AC_DEFINE('LDAP_DEPRECATED', 1);
  3950.  
  3951.     } else {
  3952.         WARNING("ldap not enabled; libraries and headers not found");
  3953.     }
  3954. }
  3955.  
  3956. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\mbstring\\config.w32'));
  3957. // $Id$
  3958. // vim:ft=javascript
  3959.  
  3960. /* ARG_ENABLE("mbstring", "multibyte string functions", "no"); */
  3961. /* ARG_ENABLE("mbregex", "multibyte regex support", "no"); */
  3962. /* ARG_ENABLE("mbregex-backtrack", "check multibyte regex backtrack", "yes"); */
  3963.  
  3964. if (PHP_MBSTRING != "no") {
  3965.  
  3966.     FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
  3967.         "ext\\mbstring\\libmbfl\\config.h", true);
  3968.     FSO.CopyFile("ext\\mbstring\\oniguruma\\win32\\config.h",
  3969.         "ext\\mbstring\\oniguruma\\config.h", true);
  3970.    
  3971.     EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED,
  3972.         "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
  3973.         -Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
  3974.         /D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
  3975.         /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT");
  3976.    
  3977.     ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
  3978.         mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
  3979.         mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \
  3980.         mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_cp51932.c \
  3981.         mbfilter_euc_cn.c mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \
  3982.         mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \
  3983.         mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \
  3984.         mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c \
  3985.         mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \
  3986.         mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \
  3987.         mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \
  3988.         mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c mbfilter_sjis_2004.c \
  3989.         mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \
  3990.         mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \
  3991.         mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \
  3992.         mbfilter_koi8u.c mbfilter_cp1254.c mbfilter_euc_jp_2004.c \
  3993.         mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \
  3994.         mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c \
  3995.         mbfilter_sjis_mac.c \
  3996.         mbfilter_iso2022jp_2004.c mbfilter_iso2022jp_mobile.c \
  3997.         mbfilter_tl_jisx0201_jisx0208.c", "mbstring");
  3998.  
  3999.     ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
  4000.         mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
  4001.         mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
  4002.         mbfl_string.c mbfl_allocators.c", "mbstring");
  4003.  
  4004.     ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
  4005.         nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
  4006.         nls_ua.c nls_tr.c", "mbstring");
  4007.  
  4008.     AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support');
  4009.     AC_DEFINE('HAVE_MBSTR_CN', 1, 'CN');
  4010.     AC_DEFINE('HAVE_MBSTR_JA', 1, 'JA');
  4011.     AC_DEFINE('HAVE_MBSTR_KR', 1, 'KR');
  4012.     AC_DEFINE('HAVE_MBSTR_RU', 1, 'RU');
  4013.     AC_DEFINE('HAVE_MBSTR_TW', 1, 'TW');
  4014.  
  4015.     PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
  4016.  
  4017.     if (PHP_MBREGEX != "no") {
  4018.         AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h');
  4019.         AC_DEFINE('HAVE_MBREGEX', 1);
  4020.         AC_DEFINE('HAVE_ONIG', 1);
  4021.         if (PHP_MBREGEX_BACKTRACK != "no") {
  4022.             AC_DEFINE('USE_COMBINATION_EXPLOSION_CHECK', 1);
  4023.         }
  4024.         ADD_SOURCES("ext/mbstring/oniguruma", "regcomp.c regerror.c \
  4025.             regenc.c regexec.c reggnu.c regparse.c regposerr.c \
  4026.             regext.c regsyntax.c regtrav.c regversion.c st.c", "mbstring");
  4027.         ADD_SOURCES("ext/mbstring/oniguruma/enc", "ascii.c big5.c \
  4028.             euc_jp.c euc_kr.c euc_tw.c iso8859_1.c iso8859_2.c \
  4029.             iso8859_3.c iso8859_4.c iso8859_5.c iso8859_6.c \
  4030.             iso8859_7.c iso8859_8.c iso8859_9.c iso8859_10.c \
  4031.             iso8859_11.c iso8859_13.c iso8859_14.c iso8859_15.c iso8859_16.c \
  4032.             koi8.c koi8_r.c sjis.c utf8.c unicode.c utf16_be.c utf16_le.c \
  4033.             utf32_be.c utf32_le.c gb18030.c", "mbstring");
  4034.         ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
  4035.         PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h");
  4036.     }
  4037. }
  4038. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\mcrypt\\config.w32'));
  4039. // $Id$
  4040. // vim:ft=javascript
  4041.  
  4042. /* ARG_WITH("mcrypt", "mcrypt support", "no"); */
  4043.  
  4044. if (PHP_MCRYPT != "no") {
  4045.  
  4046.     if (CHECK_HEADER_ADD_INCLUDE('mcrypt.h', 'CFLAGS_MCRYPT') &&
  4047.             CHECK_LIB('libmcrypt_a.lib;libmcrypt.lib', 'mcrypt') &&
  4048.             CHECK_LIB('Advapi32.lib', 'mcrypt')
  4049.             ) {
  4050.  
  4051.         EXTENSION('mcrypt', 'mcrypt.c mcrypt_filter.c', false);
  4052.         AC_DEFINE('HAVE_LIBMCRYPT', 1);
  4053.         AC_DEFINE('HAVE_LIBMCRYPT24', 1);
  4054.     } else {
  4055.         WARNING("mcrypt not enabled; libraries and headers not found");
  4056.     }
  4057. }
  4058. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\mssql\\config.w32'));
  4059. // $Id$
  4060. // vim:ft=javascript
  4061.  
  4062. /* ARG_WITH("mssql", "mssql support", "no"); */
  4063.  
  4064. if (PHP_MSSQL != "no") {
  4065.     if (CHECK_LIB("ntwdblib.lib", "mssql", "\\MSSQL7\\DevTools\\Lib;\\MSSQL7\\DevTools\\Lib;" + PHP_MSSQL) &&
  4066.             CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_MSSQL", "\\MSSQL7\\DevTools\\Include;\\MSSQL7\\DevTools\\Include" + PHP_MSSQL)) {
  4067.         EXTENSION("mssql", "php_mssql.c");
  4068.         AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support');
  4069.         ADD_FLAG("CFLAGS_MSSQL", "/D DBNTWIN32=1 /D MSSQL70=1");
  4070.     } else {
  4071.         WARNING("mssql not enabled; libraries and headers not found");
  4072.     }
  4073. }
  4074.  
  4075. /* ARG_WITH("dblib", "mssql support with freetds", "no"); */
  4076.  
  4077. if (PHP_DBLIB != "no") {
  4078.     if (CHECK_LIB("dblib.lib", "dblib", PHP_PHP_BUILD + "\\freetds") &&
  4079.             CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_DBLIB", PHP_PHP_BUILD + "\\freetds;" + PHP_DBLIB)) {
  4080.         EXTENSION("dblib", "php_mssql.c", null, null, null, "ext\\dblib");
  4081.         AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support');
  4082.         ADD_FLAG("CFLAGS_DBLIB", "/D HAVE_FREETDS=1 /D DBNTWIN32=1 /D MSSQL70=1 /D MSSQL_EXPORTS /D COMPILE_DL_MSSQL");
  4083.     } else {
  4084.         WARNING("dblib not enabled; libraries and headers not found");
  4085.     }
  4086. }
  4087. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\mysqlnd\\config.w32'));
  4088. // $Id$
  4089. // vim:ft=javascript
  4090.  
  4091. /* ARG_WITH("mysqlnd", "Mysql Native Client Driver", "yes"); */
  4092. if (PHP_MYSQLND != "no") {
  4093.  
  4094.     if (CHECK_LIB("ws2_32.lib", "mysqlnd")) {
  4095.         mysqlnd_source =
  4096.             "mysqlnd.c " +
  4097.             "mysqlnd_alloc.c " +
  4098.             "mysqlnd_auth.c " +
  4099.             "mysqlnd_block_alloc.c " +
  4100.             "mysqlnd_bt.c " +
  4101.             "mysqlnd_charset.c " +
  4102.             "mysqlnd_debug.c " +
  4103.             "mysqlnd_driver.c " +
  4104.             "mysqlnd_ext_plugin.c " +
  4105.             "mysqlnd_loaddata.c " +
  4106.             "mysqlnd_reverse_api.c " +
  4107.             "mysqlnd_net.c " +
  4108.             "mysqlnd_plugin.c " +
  4109.             "mysqlnd_ps.c " +
  4110.             "mysqlnd_ps_codec.c " +
  4111.             "mysqlnd_result.c " +
  4112.             "mysqlnd_result_meta.c " +
  4113.             "mysqlnd_statistics.c " +
  4114.             "mysqlnd_wireprotocol.c " +
  4115.             "php_mysqlnd.c ";
  4116.         EXTENSION("mysqlnd", mysqlnd_source, false);
  4117.         if (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) ||
  4118.             (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
  4119.         {
  4120.             AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Compression support");
  4121.             AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "SSL support");
  4122.         }
  4123.         PHP_INSTALL_HEADERS("", "ext/mysqlnd");
  4124.     }
  4125. }
  4126. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\oci8\\config.w32'));
  4127. // $Id$
  4128. // vim:ft=javascript
  4129.  
  4130. if (PHP_OCI8 != "no" && PHP_OCI8_11G != "no") {
  4131.     if (!PHP_OCI8_SHARED && !PHP_OCI8_11G_SHARED) {
  4132.         WARNING("oci8 and oci8-11g provide the same extension and cannot both be built statically");
  4133.         PHP_OCI8 = "no"
  4134.         PHP_OCI8_11G = "no"
  4135.     }
  4136. }
  4137.  
  4138. /* ARG_WITH("oci8", "OCI8 support", "no"); */
  4139.  
  4140. if (PHP_OCI8 != "no") {
  4141.  
  4142.     oci8_dirs = new Array(
  4143.         PHP_OCI8
  4144.     );
  4145.  
  4146.     oci8_lib_paths = "";
  4147.     oci8_inc_paths = "";
  4148.  
  4149.     // find the Oracle install
  4150.     for (i = 0; i < oci8_dirs.length; i++) {
  4151.         oci8_lib_paths += oci8_dirs[i] + "\\lib;";
  4152.         oci8_lib_paths += oci8_dirs[i] + "\\lib\\msvc;";
  4153.         oci8_inc_paths += oci8_dirs[i] + "\\include;";
  4154.     }
  4155.  
  4156.     oci8_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;"
  4157.     oci8_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;";
  4158.  
  4159.     if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", oci8_inc_paths) &&
  4160.             CHECK_LIB("oci.lib", "oci8", oci8_lib_paths))
  4161.     {
  4162.         EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c');
  4163.  
  4164.         AC_DEFINE('HAVE_OCI8', 1);
  4165.         AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
  4166.         AC_DEFINE('HAVE_OCI_LOB_READ2', 1);
  4167.  
  4168.     } else {
  4169.         WARNING("oci8 not enabled: Oracle Database libraries or Oracle 10g Instant Client not found");
  4170.         PHP_OCI8 = "no"
  4171.     }
  4172. }
  4173.  
  4174. /* ARG_WITH("oci8-11g", "OCI8 support using Oracle 11g Instant Client", "no"); */
  4175.  
  4176. if (PHP_OCI8_11G != "no") {
  4177.  
  4178.     oci8_11g_dirs = new Array(
  4179.         PHP_OCI8_11G
  4180.     );
  4181.  
  4182.     oci8_11g_lib_paths = "";
  4183.     oci8_11g_inc_paths = "";
  4184.  
  4185.     // find the Oracle install
  4186.     for (i = 0; i < oci8_11g_dirs.length; i++) {
  4187.         oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib;";
  4188.         oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib\\msvc;";
  4189.         oci8_11g_inc_paths += oci8_11g_dirs[i] + "\\include;";
  4190.     }
  4191.  
  4192.     oci8_11g_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_11;"
  4193.     oci8_11g_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_11;";
  4194.  
  4195.     if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) &&
  4196.             CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths))
  4197.     {
  4198.         EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_11g")
  4199.  
  4200.         AC_DEFINE('HAVE_OCI8', 1);
  4201.         AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
  4202.         AC_DEFINE('HAVE_OCI_LOB_READ2', 1);
  4203.  
  4204.     } else {
  4205.         WARNING("oci8-11g not enabled: Oracle Database libraries or Oracle 11g Instant Client not found");
  4206.         PHP_OCI8_11G = "no"
  4207.     }
  4208. }
  4209. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\odbc\\config.w32'));
  4210. // $Id$
  4211. // vim:ft=javascript
  4212.  
  4213. /* ARG_ENABLE("odbc", "ODBC support", "yes"); */
  4214.  
  4215. if (PHP_ODBC == "yes") {
  4216.     if (CHECK_LIB("odbc32.lib", "odbc") && CHECK_LIB("odbccp32.lib", "odbc")
  4217.     && CHECK_HEADER_ADD_INCLUDE("sql.h", "CFLAGS_ODBC")
  4218.     && CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
  4219.         EXTENSION("odbc", "php_odbc.c");
  4220.         AC_DEFINE("HAVE_UODBC", 1, "ODBC support");
  4221.     } else {
  4222.         WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
  4223.         PHP_ODBC = "no"
  4224.     }
  4225. }configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\openssl\\config.w32'));
  4226. // $Id$
  4227. // vim:ft=javascript
  4228.  
  4229. /* ARG_WITH("openssl", "OpenSSL support", "no"); */
  4230.  
  4231. if (PHP_OPENSSL != "no") {
  4232.     if (CHECK_LIB("ssleay32.lib", "openssl", PHP_OPENSSL) &&
  4233.             CHECK_LIB("libeay32.lib", "openssl", PHP_OPENSSL) &&
  4234.             CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_OPENSSL")) {
  4235.         EXTENSION("openssl", "openssl.c xp_ssl.c");
  4236.  
  4237.         AC_DEFINE("HAVE_OPENSSL_EXT", PHP_OPENSSL_SHARED ? 0 : 1, "Have openssl");
  4238.         AC_DEFINE("HAVE_OPENSSL", 1);
  4239.         AC_DEFINE("HAVE_DSA_DEFAULT_METHOD", 1);
  4240.     }
  4241. }
  4242.  
  4243.  
  4244. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pcre\\config.w32'));
  4245. // $Id$
  4246. // vim:ft=javascript
  4247.  
  4248. EXTENSION("pcre", "php_pcre.c", false /* never shared */,
  4249.         "-Iext/pcre/pcrelib");
  4250. ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucd.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre");
  4251. ADD_DEF_FILE("ext\\pcre\\php_pcre.def");
  4252.  
  4253. AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library');
  4254. AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library');
  4255. PHP_PCRE="yes";
  4256. PHP_INSTALL_HEADERS("ext/pcre", "php_pcre.h pcrelib/");
  4257. ADD_FLAG("CFLAGS_PCRE", " /D HAVE_CONFIG_H");
  4258. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pgsql\\config.w32'));
  4259. // $Id$
  4260. // vim:ft=javascript
  4261.  
  4262. /* ARG_WITH("pgsql", "PostgreSQL support", "no"); */
  4263.  
  4264. if (PHP_PGSQL != "no") {
  4265.     if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
  4266.         CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) {
  4267.         EXTENSION("pgsql", "pgsql.c");
  4268.         AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
  4269.         ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE /D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND /D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA /D HAVE_PQFTABLE /D HAVE_PQESCAPE_CONN /D HAVE_PQESCAPE_BYTEA_CONN /D HAVE_PQFREEMEM /D HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT /D HAVE_PQPROTOCOLVERSION /D HAVE_PG_LO_CREATE");
  4270.     } else {
  4271.         WARNING("pgsql not enabled; libraries and headers not found");
  4272.     }
  4273. }
  4274. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pspell\\config.w32'));
  4275. // $Id$
  4276. // vim:ft=javascript
  4277.  
  4278. /* ARG_WITH("pspell", "pspell/aspell (whatever it's called this month) support", "no"); */
  4279.  
  4280. if (PHP_PSPELL != "no") {
  4281.  
  4282.     if (CHECK_HEADER_ADD_INCLUDE("pspell.h", "CFLAGS_PSPELL", PHP_PHP_BUILD + "\\include\\pspell;" + PHP_PSPELL) &&
  4283.             CHECK_LIB("aspell*.lib", "pspell", PHP_PSPELL)) {
  4284.         EXTENSION('pspell', 'pspell.c');
  4285.         AC_DEFINE('HAVE_PSPELL', 1);
  4286.     } else {
  4287.         WARNING("pspell not enabled; libraries and headers not found");
  4288.     }
  4289. }
  4290.  
  4291. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\reflection\\config.w32'));
  4292. // $Id$
  4293. // vim:ft=javascript
  4294.  
  4295. EXTENSION("reflection", "php_reflection.c", false /* never shared */);
  4296. AC_DEFINE('HAVE_REFLECTION', 1, 'Reflection support enabled');
  4297. PHP_REFLECTION="yes";configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\session\\config.w32'));
  4298. // $Id$
  4299. // vim:ft=javascript
  4300.  
  4301. /* ARG_ENABLE("session", "session support", "yes"); */
  4302.  
  4303. if (PHP_SESSION == "yes") {
  4304.     EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */);
  4305.     AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
  4306.     PHP_INSTALL_HEADERS("ext/session/", "mod_mm.h php_session.h mod_files.h mod_user.h");
  4307. }
  4308. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\shmop\\config.w32'));
  4309. // $Id$
  4310. // vim:ft=javascript
  4311.  
  4312. /* ARG_ENABLE("shmop", "shmop support", "no"); */
  4313.  
  4314. if (PHP_SHMOP == "yes") {
  4315.     EXTENSION("shmop", "shmop.c");
  4316.     AC_DEFINE('HAVE_SHMOP', 1, 'Have SHMOP support');
  4317. }
  4318. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\snmp\\config.w32'));
  4319. // $Id$
  4320. // vim:ft=javascript
  4321.  
  4322. /* ARG_WITH("snmp", "SNMP support", "no"); */
  4323.  
  4324. if (PHP_SNMP != "no") {
  4325.     if (CHECK_HEADER_ADD_INCLUDE("snmp.h", "CFLAGS_SNMP", PHP_PHP_BUILD + "\\include\\net-snmp;" + PHP_SNMP)) {
  4326.         if (CHECK_LIB("netsnmp.lib", "snmp", PHP_SNMP)) {
  4327.             EXTENSION('snmp', 'snmp.c');
  4328.             CHECK_LIB("libeay32.lib", "snmp", PHP_SNMP)
  4329.             AC_DEFINE('HAVE_SNMP', 1);
  4330.             AC_DEFINE("HAVE_NET_SNMP", 1);
  4331.         } else {
  4332.             WARNING("snmp not enabled; libraries and headers not found");
  4333.         }
  4334.     } else {
  4335.         WARNING("snmp not enabled; libraries and headers not found");
  4336.     }
  4337. }
  4338.  
  4339. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\sockets\\config.w32'));
  4340. // $Id$
  4341. // vim:ft=javascript
  4342.  
  4343. /* ARG_ENABLE("sockets", "SOCKETS support", "no"); */
  4344.  
  4345. if (PHP_SOCKETS != "no") {
  4346.     if (CHECK_LIB("ws2_32.lib", "sockets", PHP_SOCKETS)
  4347.     && CHECK_LIB("Iphlpapi.lib", "sockets", PHP_SOCKETS)
  4348.     && CHECK_HEADER_ADD_INCLUDE("winsock.h", "CFLAGS_SOCKETS")) {
  4349.         EXTENSION('sockets', 'sockets.c multicast.c');
  4350.         AC_DEFINE('HAVE_SOCKETS', 1);
  4351.         PHP_INSTALL_HEADERS("ext/sockets", "php_sockets.h");
  4352.     } else {
  4353.         WARNING("sockets not enabled; libraries and headers not found");
  4354.     }
  4355. }
  4356.  
  4357. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\spl\\config.w32'));
  4358. // $Id$
  4359. // vim:ft=javascript
  4360.  
  4361. EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */);
  4362. AC_DEFINE('HAVE_SPL', 1);
  4363. PHP_SPL="yes";
  4364. PHP_INSTALL_HEADERS("ext/spl", "php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h");
  4365. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\sqlite3\\config.w32'));
  4366. // $Id$
  4367. // vim:ft=javascript
  4368.  
  4369. /* ARG_WITH("sqlite3", "SQLite 3 support", "no"); */
  4370.  
  4371. if (PHP_SQLITE3 != "no") {
  4372.     ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 ");
  4373.     EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname);
  4374.  
  4375.     ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");
  4376.  
  4377.     AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
  4378.     PHP_INSTALL_HEADERS("ext/sqlite3", "libsqlite/sqlite3.h");
  4379. }
  4380. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\standard\\config.w32'));
  4381. // vim:ft=javascript
  4382. // $Id$
  4383.  
  4384. /* ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", ""); */
  4385.  
  4386. AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);
  4387. AC_DEFINE("PHP_USE_PHP_CRYPT_R", 1);
  4388.  
  4389. CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib");
  4390.  
  4391. EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
  4392.     crc32.c crypt.c crypt_freesec.c crypt_blowfish.c crypt_sha256.c \
  4393.     crypt_sha512.c  php_crypt_r.c \
  4394.     cyr_convert.c datetime.c dir.c dl.c dns.c dns_win32.c exec.c \
  4395.     file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \
  4396.     info.c iptc.c lcg.c link_win32.c mail.c math.c md5.c metaphone.c microtime.c \
  4397.     pack.c pageinfo.c quot_print.c rand.c soundex.c \
  4398.     string.c scanf.c syslog.c type.c uniqid.c url.c var.c \
  4399.     versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \
  4400.     url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
  4401.     php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
  4402.     user_filters.c uuencode.c filters.c proc_open.c \
  4403.     streamsfuncs.c http.c flock_compat.c", false /* never shared */);
  4404.     PHP_INSTALL_HEADERS("", "ext/standard");
  4405. if (PHP_MBREGEX != "no") {
  4406.     CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")  
  4407. }
  4408. PHP_INSTALL_HEADERS("", "ext/standard");
  4409. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\sybase_ct\\config.w32'));
  4410.  
  4411. // $Id$
  4412. // vim:ft=javascript
  4413.  
  4414. /* ARG_WITH("sybase-ct", "SYBASE_CT support", "no"); */
  4415.  
  4416. if (PHP_SYBASE_CT != "no") {
  4417.  
  4418.     if (CHECK_HEADER_ADD_INCLUDE("ctpublic.h", "CFLAGS_SYBASE_CT", PHP_PHP_BUILD + "\\sybase\\include;" + PHP_SYBASE_CT) &&
  4419.             CHECK_LIB("libcs.lib", "sybase_ct", PHP_PHP_BUILD + "\\sybase\\lib;" + PHP_SYBASE_CT) &&
  4420.             CHECK_LIB("libct.lib", "sybase_ct", PHP_PHP_BUILD + "\\sybase\\lib;" + PHP_SYBASE_CT)) {
  4421.         EXTENSION('sybase_ct', 'php_sybase_ct.c');
  4422.         AC_DEFINE('HAVE_SYBASE_CT', 1);
  4423.     } else {
  4424.         WARNING("sybase_ct not enabled; libraries and headers not found");
  4425.     }
  4426. }
  4427.  
  4428. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\tidy\\config.w32'));
  4429. // $Id$
  4430. // vim:ft=javascript
  4431.  
  4432. /* ARG_WITH("tidy", "TIDY support", "no"); */
  4433.  
  4434. if (PHP_TIDY != "no") {
  4435.     if (CHECK_LIB("libtidy_a.lib;libtidy.lib", "tidy", PHP_TIDY) &&
  4436.             (
  4437.                 CHECK_HEADER_ADD_INCLUDE("tidy.h", "CFLAGS_TIDY") ||
  4438.                 CHECK_HEADER_ADD_INCLUDE("tidy/tidy.h", "CFLAGS_TIDY", null, null, true) ||
  4439.                 CHECK_HEADER_ADD_INCLUDE("libtidy/tidy.h", "CFLAGS_TIDY", null, null, true)
  4440.             )) {
  4441.         EXTENSION("tidy", "tidy.c");
  4442.         AC_DEFINE('HAVE_TIDY', 1, 'Have TIDY library');
  4443.         if (!PHP_TIDY_SHARED) {
  4444.             ADD_DEF_FILE("ext\\tidy\\php_tidy.def");
  4445.         }
  4446.     } else {
  4447.         WARNING("tidy not enabled; libraries and headers not found");
  4448.     }
  4449. }
  4450.  
  4451. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\tokenizer\\config.w32'));
  4452. // $Id$
  4453. // vim:ft=javascript
  4454.  
  4455. /* ARG_ENABLE("tokenizer", "tokenizer support", "yes"); */
  4456.  
  4457. if (PHP_TOKENIZER == "yes") {
  4458.     EXTENSION("tokenizer", "tokenizer.c tokenizer_data.c");
  4459.     AC_DEFINE("HAVE_TOKENIZER", 1, "Tokenizer support");
  4460. }
  4461.  
  4462.  
  4463. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\zip\\config.w32'));
  4464. // $Id$
  4465. // vim:ft=javascript
  4466.  
  4467. /* ARG_ENABLE("zip", "ZIP support", "yes"); */
  4468.  
  4469. if (PHP_ZIP != "no") {
  4470.     if (CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_ZIP", "..\\zlib;" + PHP_ZIP) &&
  4471.         (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib", "zip", PHP_ZIP) ||  CHECK_LIB("zlib.lib", "zip", PHP_ZIP))) ||
  4472.             (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "zip", PHP_ZIP)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
  4473.         ) {
  4474.         EXTENSION('zip', 'php_zip.c zip_stream.c');
  4475.         ADD_SOURCES(configure_module_dirname + "/lib", "zip_add.c zip_error.c zip_fclose.c \
  4476.                     zip_fread.c zip_open.c zip_source_filep.c  \
  4477.                     zip_strerror.c zip_close.c zip_error_get.c \
  4478.                     zip_file_error_get.c zip_free.c zip_rename.c \
  4479.                     zip_source_free.c zip_unchange_all.c zip_delete.c \
  4480.                     zip_error_get_sys_type.c zip_file_get_offset.c \
  4481.                     zip_get_name.c zip_replace.c zip_source_function.c \
  4482.                     zip_unchange.c zip_dirent.c zip_error_strerror.c \
  4483.                     zip_filerange_crc.c zip_file_strerror.c zip_get_num_files.c \
  4484.                     zip_get_archive_flag.c zip_set_archive_flag.c \
  4485.                     zip_set_name.c zip_source_zip.c zip_unchange_data.c \
  4486.                     zip_entry_free.c zip_error_to_str.c zip_fopen.c \
  4487.                     zip_name_locate.c zip_source_buffer.c zip_stat.c \
  4488.                     zip_entry_new.c zip_err_str.c zip_fopen_index.c \
  4489.                     zip_new.c zip_source_file.c zip_stat_index.c \
  4490.                     zip_get_archive_comment.c zip_get_file_comment.c \
  4491.                     zip_set_archive_comment.c zip_set_file_comment.c \
  4492.                     zip_unchange_archive.c zip_memdup.c zip_stat_init.c \
  4493.                     zip_add_dir.c zip_file_error_clear.c zip_error_clear.c \
  4494.                     zip_fdopen.c zip_fopen_encrypted.c zip_fopen_index_encrypted.c \
  4495.                     zip_get_compression_implementation.c zip_get_encryption_implementation.c \
  4496.                     zip_get_file_extra.c zip_get_num_entries.c zip_set_default_password.c \
  4497.                     zip_set_file_extra.c zip_source_close.c zip_source_crc.c \
  4498.                     zip_source_deflate.c zip_source_error.c zip_source_layered.c \
  4499.                     zip_source_open.c zip_source_pkware.c zip_source_pop.c \
  4500.                     zip_source_read.c zip_source_stat.c", "zip");
  4501.  
  4502.         AC_DEFINE('HAVE_ZIP', 1);
  4503.     } else {
  4504.         WARNING("zip not enabled; libraries and headers not found");
  4505.     }
  4506. }
  4507.  
  4508. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\zlib\\config.w32'));
  4509. // $Id$
  4510. // vim:ft=javascript
  4511.  
  4512. /* ARG_ENABLE("zlib", "ZLIB support", "yes"); */
  4513.  
  4514. if (PHP_ZLIB == "yes") {
  4515.     if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_ZLIB) &&
  4516.         CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)) {
  4517.  
  4518.         EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS");
  4519.         AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support");
  4520.  
  4521.         if (!PHP_ZLIB_SHARED) {
  4522.             ADD_DEF_FILE("ext\\zlib\\php_zlib.def");
  4523.         }
  4524.     } else {
  4525.         WARNING("zlib support can't be enabled, zlib is missing")
  4526.         PHP_ZLIB = "no"
  4527.     }
  4528. }
  4529.  
  4530.  
  4531. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\libxml\\config.w32'));
  4532. // $Id$
  4533. // vim:ft=javascript
  4534.  
  4535. /* ARG_WITH("libxml", "LibXML support", "yes"); */
  4536.  
  4537. if (PHP_LIBXML == "yes") {
  4538.     if (CHECK_LIB("libxml2_a_dll.lib;libxml2_a.lib", "libxml") &&
  4539.             CHECK_LIB("libiconv_a.lib;iconv_a.lib;libiconv.lib;iconv.lib", "libxml") &&
  4540.             CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML") &&
  4541.             ADD_EXTENSION_DEP('libxml', 'iconv')) {
  4542.  
  4543.         EXTENSION("libxml", "libxml.c", false /* never shared */);
  4544.         AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
  4545.         ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC /D LIBXML_STATIC_FOR_DLL /D HAVE_WIN32_THREADS ");
  4546.         if (!PHP_LIBXML_SHARED) {
  4547.             ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
  4548.         }
  4549.         PHP_INSTALL_HEADERS("ext/libxml/", "php_libxml.h");
  4550.     } else {
  4551.         WARNING("libxml support can't be enabled, iconv or libxml are missing")
  4552.         PHP_LIBXML = "no"
  4553.     }
  4554. }
  4555. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\dom\\config.w32'));
  4556. // $Id$
  4557. // vim:ft=javascript
  4558.  
  4559. /* ARG_WITH("dom", "DOM support", "yes"); */
  4560.  
  4561. if (PHP_DOM == "yes") {
  4562.     if (PHP_LIBXML == "yes" && ADD_EXTENSION_DEP('dom', 'libxml')) {
  4563.         EXTENSION("dom", "php_dom.c attr.c document.c domerrorhandler.c \
  4564.             domstringlist.c domexception.c namelist.c processinginstruction.c \
  4565.             cdatasection.c documentfragment.c domimplementation.c element.c \
  4566.             node.c string_extend.c characterdata.c documenttype.c \
  4567.             domimplementationlist.c entity.c nodelist.c text.c comment.c \
  4568.             domconfiguration.c domimplementationsource.c entityreference.c \
  4569.             notation.c xpath.c dom_iterators.c typeinfo.c domerror.c \
  4570.             domlocator.c namednodemap.c userdatahandler.c");
  4571.  
  4572.         AC_DEFINE("HAVE_DOM", 1, "DOM support");
  4573.  
  4574.         if (!PHP_DOM_SHARED) {
  4575.             ADD_FLAG("CFLAGS_DOM", "/D LIBXML_STATIC ");
  4576.         }
  4577.         PHP_INSTALL_HEADERS("ext/dom", "xml_common.h");
  4578.     } else {
  4579.         WARNING("dom support can't be enabled, libxml is not enabled")
  4580.         PHP_DOM = "no"
  4581.     }
  4582. }
  4583. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\exif\\config.w32'));
  4584. // $Id$
  4585. // vim:ft=javascript
  4586.  
  4587. /* ARG_ENABLE("exif", "exif", "no"); */
  4588.  
  4589. if (PHP_EXIF == "yes") {
  4590.     if (ADD_EXTENSION_DEP('exif', 'mbstring')) {
  4591.         EXTENSION("exif", "exif.c");
  4592.         AC_DEFINE('HAVE_EXIF', 1, 'Have exif');
  4593.     } else {
  4594.         WARNING("exif support can't be enabled, libxml is not enabled")
  4595.         PHP_EXIF = "no"
  4596.     }
  4597. }
  4598. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\mysql\\config.w32'));
  4599. // $Id$
  4600. // vim:ft=javascript
  4601.  
  4602. /* ARG_WITH("mysql", "MySQL support", "no"); */
  4603.  
  4604. if (PHP_MYSQL != "no") {
  4605.     if ((PHP_MYSQL == "yes" || PHP_MYSQL == "mysqlnd")) {
  4606.         AC_DEFINE('MYSQL_USE_MYSQLND', 1, 'Using MySQL native driver');
  4607.         if (!ADD_EXTENSION_DEP('mysql', 'mysqlnd', true)) {
  4608.             PHP_MYSQL = "no";
  4609.             WARNING("mysql not enabled; mysqlnd is not enabled");
  4610.         } else {
  4611.             EXTENSION("mysql", "php_mysql.c");
  4612.             AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
  4613.             MESSAGE("\tusing mysqlnd build");
  4614.         }
  4615.     } else if (PHP_MYSQL != "") {
  4616.         if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) &&
  4617.             CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL",
  4618.             PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) {
  4619.             EXTENSION("mysql", "php_mysql.c");
  4620.             AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
  4621.             MESSAGE("\tusing libmysql");
  4622.         } else {
  4623.             WARNING("mysql not enabled; libraries and headers not found");
  4624.         }
  4625.     }
  4626. }
  4627. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\mysqli\\config.w32'));
  4628. // $Id$
  4629. // vim:ft=javascript
  4630.  
  4631. // Note: The extension name is "mysqli", you enable it with "--with-mysqli".
  4632. // Passing value "mysqlnd" to it enables the bundled
  4633. // client library to connect to the MySQL server, i.e. no external MySQL
  4634. // client library is needed to perform the build.
  4635.  
  4636. /* ARG_WITH("mysqli", "MySQLi support", "no"); */
  4637.  
  4638. if (PHP_MYSQLI != "no") {
  4639.     mysqli_source =
  4640.         "mysqli.c " +
  4641.         "mysqli_api.c " +
  4642.         "mysqli_driver.c " +
  4643.         "mysqli_embedded.c " +
  4644.         "mysqli_exception.c " +
  4645.         "mysqli_fe.c " +
  4646.         "mysqli_nonapi.c " +
  4647.         "mysqli_prop.c " +
  4648.         "mysqli_result_iterator.c " +
  4649.         "mysqli_report.c " +
  4650.         "mysqli_warning.c";
  4651.  
  4652.     if (PHP_MYSQLI == "yes" || PHP_MYSQLI == "mysqlnd") {
  4653.         EXTENSION("mysqli", mysqli_source);
  4654.         AC_DEFINE('MYSQLI_USE_MYSQLND', 1, 'Using MySQL native driver');
  4655.         AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
  4656.         ADD_EXTENSION_DEP('mysqli', 'mysqlnd', true);
  4657.         MESSAGE("\tmysqlnd build");
  4658.         PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
  4659.     } else {
  4660.         if (CHECK_LIB("libmysql.lib", "mysqli", PHP_MYSQLI) &&
  4661.             CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI +
  4662.                                         "\\include;" + PHP_PHP_BUILD +
  4663.                                         "\\include\\mysql;" + PHP_MYSQLI)) {
  4664.             EXTENSION("mysqli", mysqli_source);
  4665.             AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
  4666.             MESSAGE("\tlibmysql build");
  4667.             PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
  4668.         } else {
  4669.             WARNING("mysqli not enabled; libraries and headers not found");
  4670.             PHP_MYSQLI = "no"
  4671.         }
  4672.     }
  4673. }
  4674. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo\\config.w32'));
  4675. // $Id$
  4676. // vim:ft=javascript
  4677.  
  4678. /* ARG_ENABLE("pdo", "Enable PHP Data Objects support", "no"); */
  4679.  
  4680. if (PHP_PDO != "no") {
  4681.     EXTENSION('pdo', 'pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c', false /* force static, PHP_PDO_SHARED is broken yet somehow */);
  4682.     ADD_EXTENSION_DEP('pdo', 'spl', true);
  4683.     PHP_INSTALL_HEADERS("ext/pdo", "php_pdo.h php_pdo_driver.h");
  4684. }
  4685. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo_dblib\\config.w32'));
  4686. // $Id$
  4687. // vim:ft=javascript
  4688.  
  4689. /* ARG_WITH("pdo-dblib", "freetds dblib (Sybase, MS-SQL) support for PDO", "no"); */
  4690.  
  4691. if (PHP_PDO_DBLIB != "no") {
  4692.     /* if they pointed us to a freetds dir, pick that up,
  4693.      * otherwise we'll poke around and look for MSSQL libs */
  4694.  
  4695.     if (CHECK_LIB("sybdb.lib", "pdo_dblib", PHP_PDO_DBLIB) &&
  4696.             CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_PDO_DBLIB",
  4697.                 PHP_PDO_DBLIB, null, null, true))
  4698.     {
  4699.         EXTENSION("pdo_dblib", "pdo_dblib.c dblib_driver.c dblib_stmt.c");
  4700.         ADD_FLAG('CFLAGS_PDO_DBLIB', "/D PDO_DBLIB_FLAVOUR=\\\"freetds\\\"");
  4701.         ADD_EXTENSION_DEP('pdo_dblib', 'pdo');
  4702.     } else {
  4703.         WARNING("pdo_dblib not enabled, libraries or headers not found")
  4704.     }
  4705. }
  4706.  
  4707. /* ARG_WITH("pdo-mssql", "Native MS-SQL support for PDO", "no"); */
  4708.  
  4709. if (PHP_PDO_MSSQL != "no") {
  4710.     /* if they pointed us to a freetds dir, pick that up,
  4711.      * otherwise we'll poke around and look for MSSQL libs */
  4712.  
  4713.     pdo_mssql_locations = new Array(
  4714.         PHP_PDO_MSSQL,
  4715.         "\\Program Files\\Microsoft SQL Server\\80",
  4716.         "\\MSSQL8",
  4717.         "\\MSSQL7",
  4718.         PHP_PHP_BUILD + "\\MSSQL80"
  4719.     );
  4720.     PDO_DBLIB_FLAVOUR = 0;
  4721.  
  4722.     if (CHECK_LIB("sybdb.lib", "pdo_mssql", PHP_PDO_MSSQL) &&
  4723.             CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_PDO_MSSQL",
  4724.             PHP_PDO_MSSQL, null, null, true)) {
  4725.         /* smells like FreeTDS (or maybe native sybase dblib) */
  4726.         PDO_DBLIB_FLAVOUR = "freetds";
  4727.     } else {
  4728.        
  4729.         for (i = 0; i < pdo_mssql_locations.length; i++) {
  4730.             if (CHECK_LIB("ntwdblib.lib", "pdo_mssql",
  4731.                     pdo_mssql_locations[i] + "\\DevTools\\Lib") &&
  4732.                     CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_PDO_MSSQL",
  4733.                     pdo_mssql_locations[i] + "\\DevTools\\Include",
  4734.                     null, null, true)) {
  4735.                 if (pdo_mssql_locations[i] == 'yes') {
  4736.                     PDO_DBLIB_FLAVOUR = 70;
  4737.                 } else {
  4738.                     pdo_mssql_locations[i].match(new RegExp("(\\d)"));
  4739.                     PDO_DBLIB_FLAVOUR = RegExp.$1 + 0;
  4740.                 }
  4741.                 break;
  4742.             }
  4743.         }
  4744.     }
  4745.  
  4746.     if (PDO_DBLIB_FLAVOUR != 0) {
  4747.         EXTENSION("pdo_mssql", "pdo_dblib.c dblib_driver.c dblib_stmt.c", null, null, null, "ext\\pdo_mssql");
  4748.         if (PDO_DBLIB_FLAVOUR != "freetds") {
  4749.             ADD_FLAG("CFLAGS_PDO_MSSQL", "/DPHP_DBLIB_IS_MSSQL=1 /DDBNTWIN32=1 /DMSSQL" + PDO_DBLIB_FLAVOUR + "0=1 /DMSSQL_VERSION=\\\"" + PDO_DBLIB_FLAVOUR + ".0\\\"");
  4750.             ADD_FLAG("CFLAGS_PDO_MSSQL", "/DPDO_DBLIB_IS_MSSQL=" + PDO_DBLIB_FLAVOUR);
  4751.             PDO_DBLIB_FLAVOUR = "MSSQL_" + PDO_DBLIB_FLAVOUR;
  4752.         }
  4753.         ADD_FLAG('CFLAGS_PDO_MSSQL', "/D PDO_DBLIB_FLAVOUR=\\\"" + PDO_DBLIB_FLAVOUR + "\\\"");
  4754.         ADD_EXTENSION_DEP('pdo_mssql', 'pdo');
  4755.     } else {
  4756.         WARNING("pdo_mssql not enabled, libraries or headers not found")
  4757.     }
  4758. }
  4759. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo_firebird\\config.w32'));
  4760. // $Id$
  4761. // vim:ft=javascript
  4762.  
  4763. /* ARG_WITH("pdo-firebird", "Firebird support for PDO", "no"); */
  4764.  
  4765. if (PHP_PDO_FIREBIRD != "no") {
  4766.  
  4767.     if ((CHECK_LIB("fbclient_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD)
  4768.             || CHECK_LIB("gds32_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD)
  4769.         ) && CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_PDO_FIREBIRD",
  4770.                 PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD)
  4771.         ) {
  4772.  
  4773.         EXTENSION("pdo_firebird", "pdo_firebird.c firebird_driver.c firebird_statement.c");
  4774.     } else {
  4775.         WARNING("pdo_firebird not enabled; libraries and headers not found");
  4776.     }
  4777.     ADD_EXTENSION_DEP('pdo_firebird', 'pdo');
  4778. }
  4779. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo_mysql\\config.w32'));
  4780. // $Id$
  4781. // vim:ft=javascript
  4782.  
  4783. /* ARG_WITH("pdo-mysql", "MySQL support for PDO", "no"); */
  4784.  
  4785. if (PHP_PDO_MYSQL != "no") {
  4786.     if (PHP_PDO_MYSQL == "yes" || PHP_PDO_MYSQL == "mysqlnd") {
  4787.         AC_DEFINE('PDO_USE_MYSQLND', 1, 'Using MySQL native driver');
  4788.         STDOUT.WriteLine("INFO: mysqlnd build");
  4789.         EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c");
  4790.         ADD_EXTENSION_DEP('pdo_mysql', 'pdo');
  4791.     } else {
  4792.         if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) &&
  4793.                 CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) {
  4794.             EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c");
  4795.         } else {
  4796.             WARNING("pdo_mysql not enabled; libraries and headers not found");
  4797.         }
  4798.     }
  4799. }
  4800. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo_oci\\config.w32'));
  4801. // $Id$
  4802. // vim:ft=javascript
  4803.  
  4804. /* ARG_WITH("pdo-oci", "Oracle OCI support for PDO", "no"); */
  4805.  
  4806. if (PHP_PDO_OCI != "no") {
  4807.  
  4808.     pdo_oci_dirs = new Array(
  4809.         PHP_PDO_OCI,
  4810.         PHP_PDO_OCI + "\\oci",
  4811.         PHP_PHP_BUILD + "\\instantclient10_*\\sdk",
  4812.         PHP_PHP_BUILD + "\\oci92"
  4813.     );
  4814.  
  4815.     pdo_oci_lib_paths = "";
  4816.     pdo_oci_inc_paths = "";
  4817.  
  4818.     // find the oracle install
  4819.     for (i = 0; i < pdo_oci_dirs.length; i++) {
  4820.         pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib;";
  4821.         pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib\\msvc;";
  4822.         pdo_oci_inc_paths += pdo_oci_dirs[i] + "\\include;";
  4823.     }
  4824.    
  4825.     pdo_oci_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;"
  4826.     pdo_oci_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;";
  4827.  
  4828.     pdo_oci_header = CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_PDO_OCI", pdo_oci_inc_paths, null, null, true);
  4829.  
  4830.     if (pdo_oci_header && CHECK_LIB("oci.lib", "pdo_oci", pdo_oci_lib_paths)) {
  4831.  
  4832.         pdo_oci_inc_dir = FSO.GetParentFolderName(pdo_oci_header);
  4833.  
  4834.         EXTENSION('pdo_oci', 'pdo_oci.c oci_driver.c oci_statement.c');
  4835.  
  4836.         /* probe for some functions not present in older versions */
  4837.         pdo_oci_inc_dir = FSO.GetFolder(pdo_oci_header);
  4838.         CHECK_FUNC_IN_HEADER('oci.h', 'OCIEnvCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI');
  4839.         CHECK_FUNC_IN_HEADER('ociap.h', 'OCIStmtFetch2', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI');
  4840.         CHECK_FUNC_IN_HEADER('ociap.h', 'OCIEnvNlsCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI');
  4841.  
  4842.     } else {
  4843.         WARNING("pdo-oci not enabled; libraries and headers not found");
  4844.     }
  4845.     ADD_EXTENSION_DEP('pdo_oci', 'pdo');
  4846. }
  4847. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo_odbc\\config.w32'));
  4848. // $Id$
  4849. // vim:ft=javascript
  4850.  
  4851. /* ARG_WITH("pdo-odbc", "ODBC support for PDO", "no"); */
  4852.  
  4853. if (PHP_PDO_ODBC != "no") {
  4854.     if (CHECK_LIB("odbc32.lib", "pdo_odbc") && CHECK_LIB("odbccp32.lib", "pdo_odbc")
  4855.     && CHECK_HEADER_ADD_INCLUDE('sql.h', 'CFLAGS_PDO_ODBC')
  4856.     && CHECK_HEADER_ADD_INCLUDE('sqlext.h', 'CFLAGS_PDO_ODBC')) {
  4857.  
  4858.         EXTENSION("pdo_odbc", "pdo_odbc.c odbc_driver.c odbc_stmt.c");
  4859.         ADD_EXTENSION_DEP('pdo_odbc', 'pdo');
  4860.  
  4861.     } else {
  4862.         WARNING("pdo_odbc support can't be enabled, headers or libraries are missing (SDK)")
  4863.         PHP_PDO_ODBC = "no"
  4864.     }
  4865. }
  4866.  
  4867.  
  4868. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo_pgsql\\config.w32'));
  4869. // $Id$
  4870. // vim:ft=javascript
  4871.  
  4872. /* ARG_WITH("pdo-pgsql", "PostgreSQL support for PDO", "no"); */
  4873.  
  4874. if (PHP_PDO_PGSQL != "no") {
  4875.     if (CHECK_LIB("libpq.lib", "pdo_pgsql", PHP_PDO_PGSQL) &&
  4876.             CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;")) {
  4877.         EXTENSION("pdo_pgsql", "pdo_pgsql.c pgsql_driver.c pgsql_statement.c");
  4878.  
  4879.         if (CHECK_HEADER_ADD_INCLUDE("pg_config.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) {
  4880.             ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PG_CONFIG_H");
  4881.         }
  4882.  
  4883.         AC_DEFINE('HAVE_PDO_PGSQL',     1, 'Have PostgreSQL library');
  4884.         AC_DEFINE('HAVE_PQESCAPE_BYTEA_CONN',   1, 'Have PQescapeByteaConn');
  4885.         AC_DEFINE('HAVE_PQESCAPE_CONN',     1, 'Have PQescapeConn');
  4886.         AC_DEFINE('HAVE_PQPREPARE',         1, 'Have PQprepare');
  4887.         ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PQPARAMETERSTATUS=1 /D HAVE_PQPROTOCOLVERSION=1 /D HAVE_PGTRANSACTIONSTATUS=1 /D HAVE_PQUNESCAPEBYTEA=1 /D HAVE_PQRESULTERRORFIELD=1 /D HAVE_PQESCAPE_CONN=1 /D HAVE_PQESCAPE_BYTEA_CONN=1");
  4888.         ADD_EXTENSION_DEP('pdo_pgsql', 'pdo');
  4889.     } else {
  4890.         WARNING("pdo_pgsql not enabled; libraries and headers not found");
  4891.     }
  4892. }
  4893. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\pdo_sqlite\\config.w32'));
  4894. // $Id$
  4895. // vim:ft=javascript
  4896.  
  4897. /* ARG_WITH("pdo-sqlite", "for pdo_sqlite support", "no"); */
  4898.  
  4899. if (PHP_PDO_SQLITE != "no") {
  4900.     EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c", null, "/DSQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /I" + configure_module_dirname + "/../sqlite3/libsqlite /I" + configure_module_dirname);
  4901.    
  4902.     ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
  4903.     // If pdo_sqlite is static, and sqlite3 is also static, then we don't add a second copy of the sqlite3 libs
  4904.     if (PHP_PDO_SQLITE_SHARED || PHP_SQLITE3_SHARED || PHP_SQLITE3 == 'no') {
  4905.         ADD_SOURCES(configure_module_dirname + "/../sqlite3/libsqlite", "sqlite3.c", "pdo_sqlite");
  4906.     }
  4907. }
  4908.  
  4909. /* ARG_WITH("pdo-sqlite-external", "for pdo_sqlite support from an external dll", "no"); */
  4910. if (PHP_PDO_SQLITE_EXTERNAL != "no") {
  4911.     if (CHECK_HEADER_ADD_INCLUDE("sqlite3.h", "CFLAGS_PDO_SQLITE_EXTERNAL", PHP_PDO_SQLITE_EXTERNAL + ";" + PHP_PHP_BUILD + "\\include\\sqlite3") &&
  4912.     CHECK_LIB("sqlite3-import.lib", "pdo_sqlite_external", PHP_PDO_SQLITE_EXTERNAL + ";" + PHP_PHP_BUILD + "\\lib")
  4913.     && ADD_EXTENSION_DEP('pdo_sqlite_external', 'pdo') ) {
  4914.         EXTENSION("pdo_sqlite_external", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c", null, "/I" + configure_module_dirname, null, "ext\\pdo_sqlite_external");
  4915.     } else {
  4916.         WARNING("pdo-sqlite-external support can't be enabled, libraries or headers are missing")
  4917.         PHP_PDO_SQLITE_EXTERNAL = "no"
  4918.     }
  4919. }
  4920. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\phar\\config.w32'));
  4921. // $Id$
  4922. // vim:ft=javascript
  4923.  
  4924. /* ARG_ENABLE("phar", "disable phar support", "yes"); */
  4925. /* ARG_ENABLE("phar-native-ssl", "enable phar with native OpenSSL support", "no"); */
  4926.  
  4927. if (PHP_PHAR_NATIVE_SSL != "no") {
  4928.     PHP_PHAR = PHP_PHAR_NATIVE_SSL;
  4929. }
  4930.  
  4931. if (PHP_PHAR != "no") {
  4932.     EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c");
  4933.     if (PHP_PHAR_SHARED || (PHP_PHAR_NATIVE_SSL_SHARED && PHP_SNAPSHOT_BUILD == "no")) {
  4934.         ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_PHAR ");
  4935.     }
  4936.     if (PHP_PHAR_NATIVE_SSL != "no") {
  4937.         if (CHECK_LIB("libeay32st.lib", "phar")) {
  4938.             /* We don't really need GDI for this, but there's no
  4939.             way to avoid linking it in the static openssl build */
  4940.             ADD_FLAG("LIBS_PHAR", "libeay32st.lib gdi32.lib");
  4941.             if (PHP_DEBUG == "no") {
  4942.                 /* Silence irrelevant-to-us warning in release builds */
  4943.                 ADD_FLAG("LDFLAGS_PHAR", "/IGNORE:4089 ");
  4944.             }
  4945.             AC_DEFINE('PHAR_HAVE_OPENSSL', 1);
  4946.             STDOUT.WriteLine('        Native OpenSSL support in Phar enabled');
  4947.         } else {
  4948.             WARNING('Could not enable native OpenSSL support in Phar');
  4949.         }
  4950.     } else {
  4951.         if (PHP_OPENSSL != "no" && !PHP_OPENSSL_SHARED && !PHP_PHAR_SHARED) {
  4952.             AC_DEFINE('PHAR_HAVE_OPENSSL', 1);
  4953.             STDOUT.WriteLine('        Native OpenSSL support in Phar enabled');
  4954.         } else {
  4955.             STDOUT.WriteLine('        Native OpenSSL support in Phar disabled');
  4956.         }
  4957.     }
  4958.     if (PHP_HASH != "no") {
  4959.         if (!PHP_HASH_SHARED) {
  4960.             AC_DEFINE("PHAR_HASH_OK", 1);
  4961.         } else {
  4962.             WARNING('Phar: sha256/sha512 signature support disabled if ext/hash is built shared');
  4963.         }
  4964.     }
  4965.     ADD_EXTENSION_DEP('phar', 'spl', true);
  4966. }
  4967. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\simplexml\\config.w32'));
  4968. // $Id$
  4969. // vim:ft=javascript
  4970.  
  4971. /* ARG_WITH("simplexml", "Simple XML support", "yes"); */
  4972.  
  4973. if (PHP_SIMPLEXML == "yes") {
  4974.     if(PHP_LIBXML == "yes"
  4975.     && ADD_EXTENSION_DEP('simplexml', 'libxml')) {
  4976.         EXTENSION("simplexml", "simplexml.c sxe.c");
  4977.         AC_DEFINE("HAVE_SIMPLEXML", 1, "Simple XML support");
  4978.         if (!PHP_SIMPLEXML_SHARED) {
  4979.             ADD_FLAG("CFLAGS_SIMPLEXML", "/D LIBXML_STATIC");
  4980.         }
  4981.  
  4982.         if (!ADD_EXTENSION_DEP('simplexml', 'spl', true)) {
  4983.             MESSAGE("\tSPL support in simplexml disabled");
  4984.         }
  4985.         ADD_FLAG("CFLAGS_SIMPLEXML", "/D PHP_SIMPLEXML_EXPORTS ");
  4986.     } else {
  4987.         PHP_SIMPLEXML = "no";
  4988.         WARNING("simplexml not enabled; libraries and headers not found");
  4989.     }
  4990. }
  4991. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\soap\\config.w32'));
  4992. // $Id$
  4993. // vim:ft=javascript
  4994.  
  4995. /* ARG_ENABLE("soap", "SOAP support", "no"); */
  4996.  
  4997. if (PHP_SOAP != "no") {
  4998.     if (PHP_LIBXML == "yes" && ADD_EXTENSION_DEP('soap', 'libxml')) {
  4999.         EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c');
  5000.         AC_DEFINE('HAVE_PHP_SOAP', 1, "SOAP support");
  5001.  
  5002.         if (!PHP_SOAP_SHARED) {
  5003.             ADD_FLAG('CFLAGS_SOAP', "/D LIBXML_STATIC ");
  5004.         }
  5005.     } else {
  5006.             WARNING("soap not enabled, libxml not found");
  5007.             PHP_SOAP = "no"
  5008.     }
  5009. }
  5010. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\wddx\\config.w32'));
  5011. // $Id$
  5012. // vim:ft=javascript
  5013.  
  5014. /* ARG_WITH("wddx", "WDDX support", "yes"); */
  5015.  
  5016. if (PHP_WDDX == "yes" && PHP_LIBXML == "yes") {
  5017.     EXTENSION("wddx", "wddx.c");
  5018.     AC_DEFINE("HAVE_WDDX", 1, "WDDX support");
  5019.     ADD_EXTENSION_DEP('wddx', 'libxml');
  5020.     CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_WDDX", "ext/date/lib");
  5021. }
  5022.  
  5023.  
  5024. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\xml\\config.w32'));
  5025. // $Id$
  5026. // vim:ft=javascript
  5027.  
  5028. /* ARG_WITH("xml", "XML support", "yes"); */
  5029.  
  5030. if (PHP_XML == "yes") {
  5031.     if (PHP_LIBXML == "yes"
  5032.     && ADD_EXTENSION_DEP('xml', 'libxml')) {
  5033.         EXTENSION("xml", "xml.c compat.c");
  5034.         AC_DEFINE("HAVE_XML", 1, "XML support");
  5035.         if (!PHP_XML_SHARED) {
  5036.             ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC ");
  5037.         }
  5038.         PHP_INSTALL_HEADERS("", "ext/xml");
  5039.     } else {
  5040.         WARNING("xml support can't be enabled, libraries or headers are missing")
  5041.         PHP_ZLIB = "no"
  5042.     }
  5043. }
  5044. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\xmlreader\\config.w32'));
  5045. // $Id$
  5046. // vim:ft=javascript
  5047.  
  5048. /* ARG_ENABLE("xmlreader", "XMLReader support", "yes"); */
  5049.  
  5050. if (PHP_XMLREADER == "yes" && PHP_LIBXML == "yes") {
  5051.     EXTENSION("xmlreader", "php_xmlreader.c");
  5052.     AC_DEFINE("HAVE_XMLREADER", 1, "XMLReader support");
  5053.     if (!PHP_XMLREADER_SHARED) {
  5054.         ADD_FLAG("CFLAGS_XMLREADER", "/D LIBXML_STATIC");
  5055.     }
  5056.     ADD_EXTENSION_DEP('xmlreader', 'libxml');
  5057. }
  5058.  
  5059. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\xmlrpc\\config.w32'));
  5060. // $Id$
  5061. // vim:ft=javascript
  5062.  
  5063. /* ARG_WITH("xmlrpc", "XMLRPC-EPI support", "no"); */
  5064.  
  5065. if (PHP_XMLRPC != "no") {
  5066.     if (CHECK_HEADER_ADD_INCLUDE("xmlrpc.h", "CFLAGS_XMLRPC", configure_module_dirname + "/libxmlrpc")
  5067.         && CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS")
  5068.         && ADD_EXTENSION_DEP('xmlrpc', 'libxml')) {
  5069.         EXTENSION('xmlrpc', 'xmlrpc-epi-php.c', PHP_XMLRPC_SHARED, "-DVERSION=\"0.50\"");
  5070.         ADD_SOURCES(configure_module_dirname + "/libxmlrpc", "base64.c simplestring.c xml_to_dandarpc.c \
  5071.         xmlrpc_introspection.c encodings.c system_methods.c xml_to_xmlrpc.c \
  5072.         queue.c xml_element.c xmlrpc.c xml_to_soap.c", "xmlrpc");
  5073.  
  5074.     } else {
  5075.         WARNING("xmlrpc support can't be enabled, libraries or headers are missing")
  5076.         PHP_XMLRPC = "no";
  5077.     }
  5078. }
  5079.  
  5080. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\xmlwriter\\config.w32'));
  5081. // $Id$
  5082. // vim:ft=javascript
  5083.  
  5084. /* ARG_ENABLE("xmlwriter", "XMLWriter support", "yes"); */
  5085.  
  5086. if (PHP_XMLWRITER == "yes" && PHP_LIBXML == "yes") {
  5087.     if (CHECK_HEADER_ADD_INCLUDE('libxml/xmlwriter.h', 'CFLAGS_XMLWRITER', PHP_XMLWRITER)) {
  5088.         EXTENSION("xmlwriter", "php_xmlwriter.c");
  5089.         AC_DEFINE("HAVE_XMLWRITER", 1, "XMLWriter support");
  5090.         if (!PHP_XMLWRITER_SHARED) {
  5091.             ADD_FLAG("CFLAGS_XMLWRITER", "/D LIBXML_STATIC");
  5092.         }
  5093.         ADD_EXTENSION_DEP('xmlwriter', 'libxml');
  5094.     } else {
  5095.         WARNING('Could not find xmlwriter.h');
  5096.     }
  5097. }
  5098.  
  5099. configure_module_dirname = condense_path(FSO.GetParentFolderName('C:\\xampp\\phpSrc\\ext\\xsl\\config.w32'));
  5100. // $Id$
  5101. // vim: ft=javascript
  5102.  
  5103. /* ARG_WITH("xsl", "xsl support", "no"); */
  5104.  
  5105. if (PHP_XSL != "no") {
  5106.     if (PHP_DOM == "yes" && PHP_LIBXML == "yes"
  5107.     && ADD_EXTENSION_DEP('xsl', 'libxml')
  5108.     && ADD_EXTENSION_DEP('xsl', 'dom')) {
  5109.         var ext_xsl_lib_found = false;
  5110.         var ext_exslt_lib_found = false;
  5111.  
  5112.         if (CHECK_LIB("libxslt_a.lib", "xsl", PHP_XSL)) {
  5113.             ext_xsl_lib_found = true;
  5114.             ADD_FLAG("CFLAGS_XSL", "/D LIBXSLT_STATIC ");
  5115.             if (CHECK_LIB("libexslt_a.lib", "xsl", PHP_XSL)) {
  5116.                 ADD_FLAG("CFLAGS_XSL", "/D LIBEXSLT_STATIC ");
  5117.                 ext_exslt_lib_found = true;
  5118.             }
  5119.         } else if (CHECK_LIB("libxslt.lib", "xsl", PHP_XSL)) {
  5120.             ext_xsl_lib_found = true;
  5121.             if (CHECK_LIB("libexslt.lib", "xsl", PHP_XSL)) {
  5122.                 ext_exslt_lib_found = true;
  5123.             }
  5124.         }
  5125.  
  5126.         if (ext_xsl_lib_found && CHECK_HEADER_ADD_INCLUDE("libxslt\\xslt.h", "CFLAGS_XSL")) {
  5127.             if (ext_exslt_lib_found) {
  5128.                 if (CHECK_HEADER_ADD_INCLUDE("libexslt\\exslt.h", "CFLAGS_XSL")) {
  5129.                     AC_DEFINE("HAVE_XSL_EXSLT", 1, "");
  5130.                 }
  5131.             }
  5132.             EXTENSION("xsl", "php_xsl.c xsltprocessor.c", PHP_XSL_SHARED);
  5133.             AC_DEFINE("HAVE_XSL", 1, "Define if xsl extension is enabled");
  5134.             if (! PHP_XSL_SHARED) {
  5135.                 ADD_FLAG("CFLAGS_XSL", "/D DOM_EXPORTS /D LIBXML_STATIC");
  5136.             } else {
  5137.                 if (PHP_DEBUG == "yes") {
  5138.                     ADD_FLAG("LDFLAGS_XSL", "/nodefaultlib:msvcrt");
  5139.                 }
  5140.             }
  5141.            
  5142.         } else {
  5143.             WARNING("xsl not enabled; libraries and headers not found");
  5144.         }
  5145.     } else {
  5146.         WARNING("xsl not enabled; DOM extension required");
  5147.     }
  5148. }
  5149.  
  5150. // vim:ft=javascript
  5151. // $Id$
  5152. // tail end of configure
  5153.  
  5154. if (!MODE_PHPIZE && sapi_enabled.length < 1) {
  5155.     MESSAGE("");
  5156.     ERROR("No SAPI selected, please enable at least one SAPI.");
  5157. }
  5158.  
  5159. generate_files();
Add Comment
Please, Sign In to add comment