wez             Tue Dec  2 21:47:46 2003 EDT

  Modified files:              
    /php-src/ext/libxml config.w32 
    /php-src/ext/zlib   config.w32 
    /php-src/sapi/apache        config.w32 
    /php-src/win32/build        config.w32 confutils.js 
  Log:
  some tweaks for Frank
  
Index: php-src/ext/libxml/config.w32
diff -u php-src/ext/libxml/config.w32:1.1 php-src/ext/libxml/config.w32:1.2
--- php-src/ext/libxml/config.w32:1.1   Tue Dec  2 18:16:53 2003
+++ php-src/ext/libxml/config.w32       Tue Dec  2 21:47:43 2003
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1 2003/12/02 23:16:53 wez Exp $
+// $Id: config.w32,v 1.2 2003/12/03 02:47:43 wez Exp $
 // vim:ft=javascript
 
 ARG_WITH("libxml", "LibXML support", "yes");
@@ -6,7 +6,10 @@
 if (PHP_LIBXML == "yes") {
        EXTENSION("libxml", "libxml.c", false /* never shared */);
        AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
-       ADD_FLAG("LIBS_LIBXML", "libxml2.lib iconv.lib");
+
+       CHECK_LIB("iconv.lib", "libxml", php_usual_lib_suspects);
+       CHECK_LIB("libxml2.lib", "libxml", php_usual_lib_suspects);
+       CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS", 
php_usual_include_suspects);
 }
 
 
Index: php-src/ext/zlib/config.w32
diff -u php-src/ext/zlib/config.w32:1.1 php-src/ext/zlib/config.w32:1.2
--- php-src/ext/zlib/config.w32:1.1     Tue Dec  2 18:17:01 2003
+++ php-src/ext/zlib/config.w32 Tue Dec  2 21:47:44 2003
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1 2003/12/02 23:17:01 wez Exp $
+// $Id: config.w32,v 1.2 2003/12/03 02:47:44 wez Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zlib", "ZLIB support", "yes");
@@ -6,7 +6,8 @@
 if (PHP_ZLIB == "yes") {
        EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c", null, "/D ZLIB_EXPORTS");
        AC_DEFINE("HAVE_ZLIB", 1, "Tokenizer support");
-       ADD_FLAG("LIBS_ZLIB", "zlib.lib");
+       CHECK_LIB("zlib.lib", "zlib", "..\\zlib;" + php_usual_lib_suspects);
+       CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + 
php_usual_include_suspects);
 }
 
 
Index: php-src/sapi/apache/config.w32
diff -u php-src/sapi/apache/config.w32:1.2 php-src/sapi/apache/config.w32:1.3
--- php-src/sapi/apache/config.w32:1.2  Tue Dec  2 19:27:44 2003
+++ php-src/sapi/apache/config.w32      Tue Dec  2 21:47:45 2003
@@ -1,5 +1,5 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.2 2003/12/03 00:27:44 wez Exp $
+// $Id: config.w32,v 1.3 2003/12/03 02:47:45 wez Exp $
 
 ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'yes');
 
@@ -8,33 +8,19 @@
 
 if (PHP_APACHE == "yes") {
 
-       if (PHP_APACHE_INCLUDES == null) {
-               if (FSO.FileExists('C:\\Program Files\\Apache 
Group\\Apache\\include\\httpd.h')) {
-                       PHP_APACHE_INCLUDES = "C:\\Program Files\\Apache 
Group\\Apache\\include";
-               } else if (FSO.FileExists(PHP_PHP_BUILD + 
"\\apache\\src\\include\\httpd.h")) {
-                       PHP_APACHE_INCLUDES = PHP_PHP_BUILD + "\\apache\\src\\include";
-               }
-       }
-
-       if (!FSO.FileExists(PHP_APACHE_INCLUDES + "\\httpd.h")) {
+       if (!CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE", 
php_usual_include_suspects +
+                       ";C:\\Program Files\\Apache Group\\Apache\\include" +
+                       ";..\\php_build\\apache\\src\\include")) {
                ERROR("Could not find apache headers");
        }
 
-       if (PHP_APACHE_LIBS == null) {
-               if (FSO.FileExists('C:\\Program Files\\Apache 
Group\\Apache\\libexec\\ApacheCore.lib')) {
-                       PHP_APACHE_LIBS = "C:\\Program Files\\Apache 
Group\\Apache\\libexec";
-               } else if (FSO.FileExists(PHP_PHP_BUILD + 
"\\apache\\src\\corer\\ApacheCore.lib")) {
-                       PHP_APACHE_LIBS = PHP_PHP_BUILD + "\\apache\\src\\corer";
-               }
-       }
-
-       if (!FSO.FileExists(PHP_APACHE_LIBS + "\\ApacheCore.lib")) {
+       if (!CHECK_LIB("ApacheCore.lib", "apache", php_usual_lib_suspects +
+                       ';C:\\Program Files\\Apache Group\\Apache\\libexec' +
+                       ';..\\php_build\\apache\\src\\corer')) {
                ERROR("Could not find apache libraries");
        }
 
-
        SAPI('apache', 'mod_php5.c sapi_apache.c php_apache.c',
                        'php' + PHP_VERSION + 'apache.dll',
-                       '/D APACHEPHP4_EXPORTS /D APACHE_READDIR_H /I "' + 
PHP_APACHE_INCLUDES + '"');
-       ADD_FLAG('LIBS_APACHE', '/libpath:"' + PHP_APACHE_LIBS + '" ApacheCore.lib');
+                       '/D APACHEPHP4_EXPORTS /D APACHE_READDIR_H');
 }
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.4 php-src/win32/build/config.w32:1.5
--- php-src/win32/build/config.w32:1.4  Tue Dec  2 20:10:03 2003
+++ php-src/win32/build/config.w32      Tue Dec  2 21:47:45 2003
@@ -1,5 +1,5 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.4 2003/12/03 01:10:03 wez Exp $
+// $Id: config.w32,v 1.5 2003/12/03 02:47:45 wez Exp $
 // "Master" config file; think of it as a configure.in
 // equivalent.
 
@@ -19,8 +19,7 @@
 // Configures the hard-coded installation dir
 ARG_ENABLE('prefix', 'where PHP will be installed', 'C:\\php5');
 
-DEFINE("BASE_INCLUDES", "/I . /I main /I regex /I Zend /I TSRM \
-/I $(PHP_BUILD)\\include");
+DEFINE("BASE_INCLUDES", "/I . /I main /I regex /I Zend /I TSRM ");
 
 // CFLAGS for building the PHP dll
 DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP4DLLTS_EXPORTS /D PHP_EXPORTS \
@@ -89,18 +88,32 @@
 // that we need
 ARG_WITH('php-build', 'Path to where you extracted 
http://www.php.net/extra/win32build.zip. Assumes that it is a sibling of this source 
dir (..\\php_build) if not specified', 'no');
 
-if (PHP_PHP_BUILD == "no") {
-       if (FSO.FolderExists("..\\php_build")) {
-               PHP_PHP_BUILD = "..\\php_build";
+var php_usual_include_suspects = 
"..\\php_build\\include;..\\win32build\\include;..\\bindlib_w32";
+var php_usual_lib_suspects = "..\\php_build\\lib;..\\win32build\\lib;..\\bindlib_w32";
+
+// Poke around for some headers
+function probe_basic_headers()
+{
+       var p;
+
+       if (PHP_PHP_BUILD != "no") {
+               php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";
+               php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";
        }
-}
 
-if (!FSO.FolderExists(PHP_PHP_BUILD)) {
-       WARNING("Could not find the php_build dir; please specify it\r\n\
-using the --with-php-build option to configure");
+       p = CHECK_HEADER_ADD_INCLUDE("arpa\\nameser.h", "CFLAGS", 
php_usual_include_suspects);
+
+       // hack to catch common location of libs
+       if (typeof(p) == "string") {
+               p = p.replace(new RegExp("include$"), "lib");
+               ADD_FLAG("LDFLAGS", '/libpath:"' + p + '" ');
+               php_usual_lib_suspects += ";" + p;
+       }
 }
 
-DEFINE("PHP_BUILD", PHP_PHP_BUILD);
+probe_basic_headers();
+
+//DEFINE("PHP_BUILD", PHP_PHP_BUILD);
 
 STDOUT.WriteBlankLines(1);
 STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));
Index: php-src/win32/build/confutils.js
diff -u php-src/win32/build/confutils.js:1.3 php-src/win32/build/confutils.js:1.4
--- php-src/win32/build/confutils.js:1.3        Tue Dec  2 19:56:14 2003
+++ php-src/win32/build/confutils.js    Tue Dec  2 21:47:45 2003
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-// $Id: confutils.js,v 1.3 2003/12/03 00:56:14 wez Exp $
+// $Id: confutils.js,v 1.4 2003/12/03 02:47:45 wez Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -267,49 +267,111 @@
        configure_subst.Add(name, value);
 }
 
-function PATH_PROG(progname, def, additional_paths)
-{
-       var i;
-       var found = false;
-       var p = def;
-       var exe;
-
-       exe = progname + ".exe";
-       STDOUT.Write("Checking for " + progname + " ... ");
-
-       if (additional_paths != null) {
-               for (i = 0; i < additional_paths.length; i++) {
-                       p = FSO.BuildPath(additional_paths[i], exe);
-                       if (FSO.FileExists(p)) {
+// Searches a set of paths for a file;
+// returns the dir in which the file was found,
+// true if it was found in the default env path,
+// or false if it was not found at all.
+// env_name is the optional name of an env var
+// specifying the default path to search
+function search_paths(thing_to_find, explicit_path, env_name)
+{
+       var i, found = false, place = false, file, env;
+
+       STDOUT.Write("Checking for " + thing_to_find + " ... ");
+
+       if (explicit_path != null) {
+               if (typeof(explicit_path) == "string") {
+                       explicit_path = explicit_path.split(";");
+               }
+
+               for (i = 0; i < explicit_path.length; i++) {
+                       file = 
FSO.BuildPath(FSO.GetAbsolutePathName(explicit_path[i]), thing_to_find);
+                       if (FSO.FileExists(file)) {
                                found = true;
+                               place = explicit_path[i];
                                break;
                        }
                }
        }
 
-       if (!found) {
-               path = WshShell.Environment("Process").Item("PATH");
-               path = path.split(";");
-               for (i = 0; i < path.length; i++) {
-                       p = FSO.BuildPath(path[i], exe);
-                       if (FSO.FileExists(p)) {
-                               // If we find it in the PATH, don't bother
-                               // making it fully qualified
+       if (!found && env_name != null) {
+               env = WshShell.Environment("Process").Item(env_name);
+               env = env.split(";");
+               for (i = 0; i < env.length; i++) {
+                       file = FSO.BuildPath(env[i], thing_to_find);
+                       if (FSO.FileExists(file)) {
                                found = true;
-                               p = exe;
+                               place = true;
                                break;
                        }
                }
        }
-       if (!found) {
-               p = def;
-       }
-       if (p == null) {
-               STDOUT.WriteLine(" <not found>");
+
+       if (found && place == true) {
+               STDOUT.WriteLine(" <in default path>");
+       } else if (found) {
+               STDOUT.WriteLine(" " + place);
        } else {
-               STDOUT.WriteLine(p);
+               STDOUT.WriteLine(" <not found>");
+       }
+       return place;
+}
+
+function PATH_PROG(progname, def, additional_paths)
+{
+       var exe;
+       var place;
+
+       exe = progname + ".exe";
+
+       place = search_paths(exe, additional_paths, "PATH");
+
+       if (place == true) {
+               place = exe;
        }
-       DEFINE(progname.toUpperCase(), p);
+
+       if (place) {
+               DEFINE(progname.toUpperCase(), place);
+       }
+       return place;
+}
+
+function CHECK_LIB(libname, target, path_to_check)
+{
+       var p = search_paths(libname, path_to_check, "LIBS");
+       var have = 0;
+
+       if (typeof(p) == "string") {
+               ADD_FLAG("LDFLAGS_" + target.toUpperCase(), '/libpath:"' + p + '" ');
+               ADD_FLAG("LIBS_" + target.toUpperCase(), libname);
+               have = 1;
+       }
+
+//     AC_DEFINE("HAVE_" + header_name.toUpperCase().replace(new RegExp("/\\\\-\.", 
"g"), "_"), have);
+
+       return p;
+
+}
+
+function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env)
+{
+       if (use_env == null) {
+               use_env = true;
+       }
+       var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null);
+       var have = 0;
+       var sym;
+
+       if (typeof(p) == "string") {
+               ADD_FLAG(flag_name, '/I "' + p + '" ');
+               have = 1;
+       }
+
+       sym = header_name.toUpperCase();
+       sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_");
+
+       AC_DEFINE("HAVE_" + sym, have);
+
        return p;
 }
 
@@ -445,6 +507,7 @@
        }
 
        file_list = file_list.split(new RegExp("\\s+"));
+       file_list.sort();
 
        var re = new RegExp("\.[a-z0-9A-Z]+$");
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to