pajoye                                   Mon, 13 Dec 2010 20:55:13 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=306347

Log:
- phpize support merge from 5.3

Changed paths:
    U   php/php-src/trunk/win32/build/Makefile
    U   php/php-src/trunk/win32/build/buildconf.js
    U   php/php-src/trunk/win32/build/config.w32
    U   php/php-src/trunk/win32/build/configure.tail
    U   php/php-src/trunk/win32/build/confutils.js

Modified: php/php-src/trunk/win32/build/Makefile
===================================================================
--- php/php-src/trunk/win32/build/Makefile	2010-12-13 20:46:57 UTC (rev 306346)
+++ php/php-src/trunk/win32/build/Makefile	2010-12-13 20:55:13 UTC (rev 306347)
@@ -152,12 +152,24 @@
 	$(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)"

 # need to redirect, since INSTALL is a file in the root...
-install: really-install install-headers install-lib
+install: really-install install-devel install-lib

 install-lib:
 	@if not exist $(PHP_PREFIX)\lib mkdir $(PHP_PREFIX)\lib >nul
 	@copy $(BUILD_DIR)\$(PHPLIB) $(PHP_PREFIX)\lib /y >nul

+install-devel: install-headers
+	@if not exist $(PHP_PREFIX)\script mkdir $(PHP_PREFIX)\script >nul
+	@if not exist $(PHP_PREFIX)\build mkdir $(PHP_PREFIX)\build >nul
+	@copy win32\build\confutils.js $(PHP_PREFIX)\script\ /y >nul
+	@copy win32\build\configure.tail $(PHP_PREFIX)\script\ /y >nul
+	@copy win32\build\config.w32.phpize.in $(PHP_PREFIX)\script\ /y >nul
+	@copy win32\build\Makefile.phpize $(PHP_PREFIX)\script\ /y >nul
+	@copy win32\build\phpize.bat $(PHP_PREFIX)\ /y >nul
+	@copy win32\build\template.rc $(PHP_PREFIX)\build\ /y >nul
+	@copy $(BUILD_DIR)\devel\config.phpize.js $(PHP_PREFIX)\script\ /y >nul
+	@copy $(BUILD_DIR)\devel\phpize.js $(PHP_PREFIX)\script\ /y >nul
+
 really-install:
 	@if not exist $(PHP_PREFIX) mkdir $(PHP_PREFIX)
 	@echo Installing files under $(PHP_PREFIX)
@@ -166,5 +178,3 @@
 	@echo Registering event source with syslog (requires admin rights)
 	@echo It's okay for this step to fail:
 	-$(PHP_PREFIX)\php.exe -n -dextension_dir=$(PHP_PREFIX) win32/build/registersyslog.php $(PHP_PREFIX)\$(PHPDLL)
-
-

Modified: php/php-src/trunk/win32/build/buildconf.js
===================================================================
--- php/php-src/trunk/win32/build/buildconf.js	2010-12-13 20:46:57 UTC (rev 306346)
+++ php/php-src/trunk/win32/build/buildconf.js	2010-12-13 20:55:13 UTC (rev 306347)
@@ -209,6 +209,7 @@

 // Write the head of the configure script
 C.WriteLine("/* This file automatically generated from win32/build/confutils.js */");
+C.WriteLine("MODE_PHPIZE=false;");
 C.Write(file_get_contents("win32/build/confutils.js"));

 // If project files were requested, pull in the code to generate them

Modified: php/php-src/trunk/win32/build/config.w32
===================================================================
--- php/php-src/trunk/win32/build/config.w32	2010-12-13 20:46:57 UTC (rev 306346)
+++ php/php-src/trunk/win32/build/config.w32	2010-12-13 20:55:13 UTC (rev 306347)
@@ -204,6 +204,9 @@

 if (PHP_ZTS == "yes") {
 	ADD_FLAG("CFLAGS", "/D ZTS=1");
+	ADD_FLAG("ZTS", "1");
+} else {
+	ADD_FLAG("ZTS", "0");
 }

 DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");
@@ -356,7 +359,7 @@
 ADD_SOURCES("win32", "glob.c readdir.c \
 	registry.c select.c sendmail.c time.c winutil.c wsyslog.c globals.c");

-PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/");
+PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/ win32/");

 STDOUT.WriteBlankLines(1);


Modified: php/php-src/trunk/win32/build/configure.tail
===================================================================
--- php/php-src/trunk/win32/build/configure.tail	2010-12-13 20:46:57 UTC (rev 306346)
+++ php/php-src/trunk/win32/build/configure.tail	2010-12-13 20:55:13 UTC (rev 306347)
@@ -2,7 +2,7 @@
 // $Id$
 // tail end of configure

-if (sapi_enabled.length < 1) {
+if (!MODE_PHPIZE && sapi_enabled.length < 1) {
 	MESSAGE("");
 	ERROR("No SAPI selected, please enable at least one SAPI.");
 }

Modified: php/php-src/trunk/win32/build/confutils.js
===================================================================
--- php/php-src/trunk/win32/build/confutils.js	2010-12-13 20:46:57 UTC (rev 306346)
+++ php/php-src/trunk/win32/build/confutils.js	2010-12-13 20:55:13 UTC (rev 306347)
@@ -58,11 +58,18 @@
 	PROGRAM_FILES = "C:\\Program Files";
 }

-if (!FSO.FileExists("README.SVN-RULES")) {
-	STDERR.WriteLine("Must be run from the root of the php source");
-	WScript.Quit(10);
+if (MODE_PHPIZE) {
+	if (!FSO.FileExists("config.w32")) {
+		STDERR.WriteLine("Must be run from the root of the extension source");
+		WScript.Quit(10);
+	}
+} else {
+	if (!FSO.FileExists("README.SVN-RULES")) {
+		STDERR.WriteLine("Must be run from the root of the php source");
+		WScript.Quit(10);
+	}
 }
-
+
 var CWD = WshShell.CurrentDirectory;

 if (typeof(CWD) == "undefined") {
@@ -109,7 +116,9 @@
 extension_include_code = "";
 extension_module_ptrs = "";

-get_version_numbers();
+if (!MODE_PHPIZE) {
+	get_version_numbers();
+}

 /* execute a command and return the output as a string */
 function execute(command_line)
@@ -333,7 +342,13 @@
 				arg.seen = true;

 				analyzed = analyze_arg(argval);
-				shared = analyzed[0];
+
+				/* Force shared when called after phpize */
+				if (MODE_PHPIZE) {
+					shared = "shared";
+				} else {
+					shared = analyzed[0];
+				}
 				argval = analyzed[1];

 				if (argname == arg.imparg) {
@@ -975,13 +990,21 @@
 			creditspath + '\\template.rc');
 		return resname;
 	}
-
-	MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");
-	MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
-		' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'
-		+ makefiletarget + '\\"" /d URL="\\"' + project_url +
-		'\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
-		'\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" win32\\build\\template.rc');
+	if (MODE_PHPIZE) {
+		MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": $(PHP_DIR)\\build\\template.rc");
+		MFO.WriteLine("\t$(RC)  /I $(PHP_DIR)/include /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
+			' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'
+			+ makefiletarget + '\\"" /d URL="\\"' + project_url +
+			'\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
+			'\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" $(PHP_DIR)\\build\\template.rc');
+	} else {
+		MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");
+		MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
+			' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'
+			+ makefiletarget + '\\"" /d URL="\\"' + project_url +
+			'\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
+			'\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" win32\\build\\template.rc');
+	}
 	MFO.WriteBlankLines(1);
 	return resname;
 }
@@ -1020,7 +1043,11 @@

 	MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
 	MFO.WriteLine("\...@echo SAPI " + sapiname_for_printing + " build complete");
-	MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
+	if (MODE_PHPIZE) {
+		MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
+	} else {
+		MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
+	}

 	if (makefiletarget.match(new RegExp("\\.dll$"))) {
 		ldflags = "/dll $(LDFLAGS)";
@@ -1033,11 +1060,20 @@
 		manifest = "-...@$(_VC_MANIFEST_EMBED_EXE)";
 	}

-	if (ld) {
-		MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
+	if (MODE_PHPIZE) {
+		if (ld) {
+			MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
+		} else {
+			ld = "@$(CC)";
+			MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
+		}
 	} else {
-		ld = "@$(CC)";
-		MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
+		if (ld) {
+			MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
+		} else {
+			ld = "@$(CC)";
+			MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
+		}
 	}

 	if (manifest) {
@@ -1202,8 +1238,13 @@

 		MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);
 		MFO.WriteBlankLines(1);
-		MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
-		MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
+		if (MODE_PHPIZE) {
+			MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
+			MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
+		} else {
+			MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
+			MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
+		}
 		MFO.WriteLine("\...@$(_VC_MANIFEST_EMBED_DLL)");
 		MFO.WriteBlankLines(1);

@@ -1317,7 +1358,7 @@
 		obj = src.replace(re, ".obj");
 		tv += " " + sub_build + obj;

-		if (PHP_ONE_SHOT == "yes") {
+		if (!MODE_PHPIZE && PHP_ONE_SHOT == "yes") {
 			if (i > 0) {
 				objs_line += " " + sub_build + obj;
 				srcs_line += " " + dir + "\\" + src;
@@ -1331,7 +1372,7 @@
 		}
 	}

-	if (PHP_ONE_SHOT == "yes") {
+	if (!MODE_PHPIZE && PHP_ONE_SHOT == "yes") {
 		MFO.WriteLine(objs_line + ": " + srcs_line);
 		MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) /Fo" + sub_build + " $(" + bd_flags_name + ") /c " + srcs_line);
 	}
@@ -1483,11 +1524,11 @@
 	STDOUT.WriteLine("Enabled extensions:");
 	output_as_table(["Extension", "Mode"], extensions_enabled.sort());
 	STDOUT.WriteBlankLines(2);
-
-	STDOUT.WriteLine("Enabled SAPI:");
-	output_as_table(["Sapi Name"], sapi_enabled);
-	STDOUT.WriteBlankLines(2);
-
+	if (!MODE_PHPIZE) {
+		STDOUT.WriteLine("Enabled SAPI:");
+		output_as_table(["Sapi Name"], sapi_enabled);
+		STDOUT.WriteBlankLines(2);
+	}
 	ar[0] = ['Build type', PHP_DEBUG == "yes" ? "Debug" : "Release"];
 	ar[1] = ['Thread Safety', PHP_ZTS == "yes" ? "Yes" : "No"];
 	ar[2] = ['Compiler', VC_VERSIONS[VCVERS]];
@@ -1534,9 +1575,11 @@

 	STDOUT.WriteLine("Generating files...");
 	generate_makefile();
-	generate_internal_functions();
-	generate_config_h();
-
+	if (!MODE_PHPIZE) {
+		generate_internal_functions();
+		generate_config_h();
+		generate_phpize();
+	}
 	STDOUT.WriteLine("Done.");
 	STDOUT.WriteBlankLines(1);
 	write_summary();
@@ -1610,13 +1653,54 @@
 	outfile.Close();
 }

+function generate_phpize()
+{
+	STDOUT.WriteLine("Generating phpize");
+	dest = get_define("BUILD_DIR") + '/devel';
+
+	if (!FSO.FolderExists(dest)) {
+		FSO.CreateFolder(dest);
+	}
+
+	var MF = FSO.CreateTextFile(dest + "/phpize.js", true);
+	prefix = get_define("PHP_PREFIX");
+	prefix = prefix.replace(new RegExp("/", "g"), "\\");
+	prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\");
+	MF.WriteLine("var PHP_PREFIX=" + '"' + prefix + '"');
+	MF.WriteLine("var PHP_ZTS=" + '"' + (PHP_ZTS.toLowerCase() == "yes" ? "Yes" : "No") + '"');
+	MF.WriteLine("var VC_VERSION=" + VCVERS);
+	MF.WriteLine("var PHP_VERSION=" + PHP_VERSION);
+	MF.WriteLine("var PHP_MINOR_VERSION=" + PHP_MINOR_VERSION);
+	MF.WriteLine("var PHP_RELEASE_VERSION=" + PHP_RELEASE_VERSION);
+	MF.WriteBlankLines(2);
+	MF.WriteLine("/* Genereted win32/build/phpize.js.in */");
+	MF.WriteBlankLines(1);
+	MF.Write(file_get_contents("win32/build/phpize.js.in"));
+	MF.Close();
+
+	/* Generate flags file */
+	/* spit out variable definitions */
+	CJ = FSO.CreateTextFile(dest + "/config.phpize.js");
+/*
+	function escape(in) {
+		val = t.replace(new RegExp('("\\\\)', "g"), '\\$1');
+	}
+*/
+	//if (typeof t == "string") {
+
+	CJ.WriteLine("var PHP_ZTS =" + '"' + PHP_ZTS + '"');
+	CJ.WriteLine("var PHP_LIB =" + '"' + get_define('PHPLIB') + '"');
+
+	CJ.WriteBlankLines(1);
+	CJ.Close();
+}
+
 function generate_makefile()
 {
 	STDOUT.WriteLine("Generating Makefile");
 	var MF = FSO.CreateTextFile("Makefile", true);

 	MF.WriteLine("# Generated by configure.js");
-
 	/* spit out variable definitions */
 	var keys = (new VBArray(configure_subst.Keys())).toArray();
 	var i;
@@ -1633,8 +1717,12 @@
 	}

 	MF.WriteBlankLines(1);
+	if (MODE_PHPIZE) {
+		var TF = FSO.OpenTextFile(PHP_DIR + "/script/Makefile.phpize", 1);
+	} else {
+		var TF = FSO.OpenTextFile("win32/build/Makefile", 1);
+	}

-	var TF = FSO.OpenTextFile("win32/build/Makefile", 1);
 	MF.Write(TF.ReadAll());

 	MF.WriteLine("install-headers:");
@@ -1903,11 +1991,12 @@
 // and you can then build everything, ignoring fatal errors within a module
 // by running "nmake snap"
 PHP_SNAPSHOT_BUILD = "no";
-ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no');
+if (!MODE_PHPIZE) {
+	ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no');

-// one-shot build optimizes build by asking compiler to build
-// several objects at once, reducing overhead of starting new
-// compiler processes.
-ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no');
+	// one-shot build optimizes build by asking compiler to build
+	// several objects at once, reducing overhead of starting new
+	// compiler processes.
+	ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no');
+}

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

Reply via email to