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");
+ }
}
-// $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 |
+----------------------------------------------------------------------+
*/
-/* $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");
var C = FSO.CreateTextFile("configure.js", true);
var modules = "";
+var seen = new Array();
function file_get_contents(filename)
{
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);
}
}
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");
+----------------------------------------------------------------------+
*/
-// $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;
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();
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";
var res_prod_name = res_desc;
var credits;
var thanks = "";
+ var logo = "";
if (FSO.FileExists(creditspath + '/CREDITS')) {
credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1);
}
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');
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);
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$"))) {
}
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);
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);
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';
}
}
}