]> granicus.if.org Git - php/commitdiff
Fix libxml to use static lib if found.
authorWez Furlong <wez@php.net>
Thu, 4 Dec 2003 13:38:47 +0000 (13:38 +0000)
committerWez Furlong <wez@php.net>
Thu, 4 Dec 2003 13:38:47 +0000 (13:38 +0000)
Disable apache and isapi by default.
Add some smarts so that we can really build extensions and SAPI found in php-src/pecl and/or php-src/../pecl.
Only include a logo in the resources if we are building an .exe.

ext/libxml/config.w32
sapi/apache/config.w32
sapi/isapi/config.w32
win32/build/buildconf.js
win32/build/confutils.js
win32/build/template.rc

index cd296dd7a31873257f4a663b0f0951ffc3c8cae8..c1809a4e88b638223c8c0bb1d29d77aba6c9df74 100644 (file)
@@ -4,13 +4,14 @@
 ARG_WITH("libxml", "LibXML support", "yes");
 
 if (PHP_LIBXML == "yes") {
-       EXTENSION("libxml", "libxml.c", false /* never shared */);
-       AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
 
-       CHECK_LIB("iconv.lib", "libxml");
-       CHECK_LIB("libxml2.lib", "libxml");
-       CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS");
-       ADD_FLAG("CFLAGS", "/D LIBXML_THREAD_ENABLED");
+       if ((CHECK_LIB("libxml2_a.lib", "libxml") || CHECK_LIB("libxml2.lib", "libxml")) &&
+                       CHECK_LIB("iconv.lib", "libxml") &&
+                       CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS")) {
+               EXTENSION("libxml", "libxml.c", false /* never shared */);
+               AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
+               ADD_FLAG("CFLAGS", "/D LIBXML_THREAD_ENABLED");
+       }
 }
 
 
index 93b70948dbf9926df9b83f30533424353cf79961..32ccb92381f19b05d94e5d8746ec50e4766ea6b8 100644 (file)
@@ -1,7 +1,7 @@
 // vim:ft=javascript
 // $Id$
 
-ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'yes');
+ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'no');
 
 ARG_WITH('apache-includes', 'Where to find Apache 1.3 headers', null);
 ARG_WITH('apache-libs', 'Where to find Apache 1.3 libraries', null);
index c1a97656410248dad6c6391aef633db9fe8ca16e..957fd016355c276743385ca56cdadb5790e9f23d 100644 (file)
@@ -1,7 +1,7 @@
 // vim:ft=javascript
 // $Id$
 
-ARG_ENABLE('isapi', 'Build ISAPI version of PHP', 'yes');
+ARG_ENABLE('isapi', 'Build ISAPI version of PHP', 'no');
 
 if (PHP_ISAPI == "yes") {
        SAPI('isapi', 'php4isapi.c', 'php' + PHP_VERSION + 'isapi.dll', '/D PHP4ISAPI_EXPORTS');
index 33a7bb4adb88910955f227ba052f1491ba5ba251..0df49c0c56c6160e346f05b409049c20cb7ad66c 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: buildconf.js,v 1.4 2003-12-04 01:59:46 wez Exp $
+// $Id: buildconf.js,v 1.5 2003-12-04 13:38:47 wez Exp $
 /*
   +----------------------------------------------------------------------+
   | PHP Version 5                                                        |
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: buildconf.js,v 1.4 2003-12-04 01:59:46 wez Exp $ */
+/* $Id: buildconf.js,v 1.5 2003-12-04 13:38:47 wez Exp $ */
 // This generates a configure script for win32 build
 
 WScript.StdOut.WriteLine("Rebuilding configure.js");
@@ -25,6 +25,7 @@ var FSO = WScript.CreateObject("Scripting.FileSystemObject");
 var C = FSO.CreateTextFile("configure.js", true);
 
 var modules = "";
+var seen = new Array();
 
 function file_get_contents(filename)
 {
@@ -42,12 +43,34 @@ function find_config_w32(dirname)
 
        var f = FSO.GetFolder(dirname);
        var     fc = new Enumerator(f.SubFolders);
-       var c;
+       var c, i, ok, n;
        for (; !fc.atEnd(); fc.moveNext())
        {
+               ok = true;
+               /* check if we already picked up a module with the same dirname;
+                * if we have, don't include it here */
+               n = FSO.GetFileName(fc.item());
+               
+               if (n == 'CVS' || n == 'tests')
+                       continue;
+                       
+       //      WScript.StdOut.WriteLine("checking " + dirname + "/" + n);
+               for (i = 0; i < seen.length; i++) {
+                       if (seen[i] == n) {
+                               ok = false;
+                               break;
+                       }
+               }
+               if (!ok) {
+                       WScript.StdOut.WriteLine("Skipping " + dirname + "/" + n + " -- already have a module with that name");
+                       continue;
+               }
+               seen[seen.length] = n;
+                       
                c = FSO.BuildPath(fc.item(), "config.w32");
                if (FSO.FileExists(c)) {
                        //WScript.StdOut.WriteLine(c);
+                       modules += "configure_module_dirname = condense_path(FSO.GetParentFolderName('" + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n";
                        modules += file_get_contents(c);
                }
        }
@@ -69,6 +92,7 @@ modules = file_get_contents("win32/build/config.w32");
 find_config_w32("sapi");
 find_config_w32("ext");
 find_config_w32("pecl");
+find_config_w32("..\\pecl");
 
 // Look for ARG_ENABLE or ARG_WITH calls
 re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm");
index c5278ed307902d50ad2d4afe4cf4bfbb5c826575..ad8ee08d72c138ded43c497150e11d248b94e6c2 100644 (file)
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-// $Id: confutils.js,v 1.14 2003-12-04 12:34:29 rrichards Exp $
+// $Id: confutils.js,v 1.15 2003-12-04 13:38:47 wez Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -31,8 +31,12 @@ if (PROGRAM_FILES == null) {
        PROGRAM_FILES = "C:\\Program Files\\";
 }
 
-STDOUT.WriteLine("program files " + PROGRAM_FILES);
+if (!FSO.FileExists("README.CVS-RULES")) {
+       STDERR.WriteLine("Must be run from the root of the php source");
+       WScript.Quit(10);
+}
 
+// TODO: pick this up from configure.in
 var PHP_VERSION = 5;
 
 configure_args = new Array();
@@ -44,6 +48,20 @@ build_dirs = new Array();
 extension_include_code = "";
 extension_module_ptrs = "";
 
+function condense_path(path)
+{
+       var cd = WshShell.CurrentDirectory;
+
+       path = FSO.GetAbsolutePathName(path);
+
+       if (path.substr(0, cd.length).toLowerCase()
+                       == cd.toLowerCase() &&
+                       (path.charCodeAt(cd.length) == 92 || path.charCodeAt(cd.length) == 47)) {
+               return path.substr(cd.length + 1);
+       }
+       return path;
+}
+
 function ConfigureArg(type, optname, helptext, defval)
 {
        var opptype = type == "enable" ? "disable" : "without";
@@ -425,6 +443,7 @@ function generate_version_info_resource(makefiletarget, creditspath)
        var res_prod_name = res_desc;
        var credits;
        var thanks = "";
+       var logo = "";
 
        if (FSO.FileExists(creditspath + '/CREDITS')) {
                credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1);
@@ -437,9 +456,13 @@ function generate_version_info_resource(makefiletarget, creditspath)
                }
                credits.Close();
        }
+
+       if (makefiletarget.match(new RegExp("\\.exe$"))) {
+               logo = " /D WANT_LOGO ";
+       }
        
        MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");
-       MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname +
+       MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo +
                ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' + makefiletarget +
                '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d THANKS_GUYS="\\"' +
                thanks + '\\"" win32\\build\\template.rc');
@@ -454,7 +477,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags)
        var ldflags;
        var resname;
 
-       STDOUT.WriteLine("Enabling sapi/" + sapiname);
+       STDOUT.WriteLine("Enabling SAPI " + configure_module_dirname);
 
        MFO.WriteBlankLines(1);
        MFO.WriteLine("# objects for SAPI " + sapiname);
@@ -464,16 +487,16 @@ function SAPI(sapiname, file_list, makefiletarget, cflags)
                ADD_FLAG('CFLAGS_' + SAPI, cflags);
        }
 
-       ADD_SOURCES("sapi/" + sapiname, file_list, sapiname);
+       ADD_SOURCES(configure_module_dirname, file_list, sapiname);
        MFO.WriteBlankLines(1);
        MFO.WriteLine("# SAPI " + sapiname);
        MFO.WriteBlankLines(1);
 
        /* generate a .res file containing version information */
-       resname = generate_version_info_resource(makefiletarget, "sapi/" + sapiname);
+       resname = generate_version_info_resource(makefiletarget, configure_module_dirname);
        
        MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
-       MFO.WriteLine("\t@echo SAPI " + sapiname + " build complete");
+       MFO.WriteLine("\t@echo SAPI " + configure_module_dirname + "/" + sapiname + " build complete");
        MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
 
        if (makefiletarget.match(new RegExp("\\.dll$"))) {
@@ -512,11 +535,11 @@ function EXTENSION(extname, file_list, shared, cflags)
        }
 
        if (shared) {
-               STDOUT.WriteLine("Enabling ext/" + extname + " [shared]");
+               STDOUT.WriteLine("Enabling extension " + configure_module_dirname + " [shared]");
                cflags = "/D COMPILE_DL_" + EXT + " /D " + EXT + "_EXPORTS=1 " + cflags;
                ADD_FLAG("CFLAGS_PHP", "/D COMPILE_DL_" + EXT);
        } else {
-               STDOUT.WriteLine("Enabling ext/" + extname);
+               STDOUT.WriteLine("Enabling extension " + configure_module_dirname);
        }
 
        MFO.WriteBlankLines(1);
@@ -524,13 +547,13 @@ function EXTENSION(extname, file_list, shared, cflags)
        MFO.WriteBlankLines(1);
 
 
-       ADD_SOURCES("ext/" + extname, file_list, extname);
+       ADD_SOURCES(configure_module_dirname, file_list, extname);
        
        MFO.WriteBlankLines(1);
 
        if (shared) {
                dllname = "php_" + extname + ".dll";
-               var resname = generate_version_info_resource(dllname, "ext/" + extname);
+               var resname = generate_version_info_resource(dllname, configure_module_dirname);
        
                MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
                MFO.WriteLine("\t$(LD) /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname);
@@ -559,7 +582,7 @@ function EXTENSION(extname, file_list, shared, cflags)
                        if (s.match(re)) {
                                c = file_get_contents(s);
                                if (c.match("phpext_")) {
-                                       extension_include_code += '#include "ext/' + extname + '/' + FSO.GetFileName(s) + '"\r\n';
+                                       extension_include_code += '#include "' + configure_module_dirname + '/' + FSO.GetFileName(s) + '"\r\n';
                                }
                        }
                }
index 61bff04a372529f57baac12d677da11b39e57500..3160c58a6b5959b3627cfc94935a0d81a27ff7aa 100644 (file)
@@ -15,7 +15,9 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 # define THANKS_GUYS ""
 #endif
 
+#ifdef WANT_LOGO
 0 ICON win32\build\php.ico
+#endif
 
 #define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build
 #define XSTRVER3(maj, min, rel) #maj "." #min "." #rel