pajoye                                   Sat, 11 Dec 2010 22:18:10 +0000

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

Log:
- add PHP_INSTALL_HEADERS to all parts (core&exts) exposing headers, generate 
the install-headers cmd

Changed paths:
    U   php/php-src/trunk/ext/date/config.w32
    U   php/php-src/trunk/ext/dom/config.w32
    U   php/php-src/trunk/ext/ereg/config.w32
    U   php/php-src/trunk/ext/filter/config.w32
    U   php/php-src/trunk/ext/gd/config.w32
    U   php/php-src/trunk/ext/hash/config.w32
    U   php/php-src/trunk/ext/iconv/config.w32
    U   php/php-src/trunk/ext/json/config.w32
    U   php/php-src/trunk/ext/libxml/config.w32
    U   php/php-src/trunk/ext/mbstring/config.w32
    U   php/php-src/trunk/ext/mysqli/config.w32
    U   php/php-src/trunk/ext/mysqlnd/config.w32
    U   php/php-src/trunk/ext/pcre/config.w32
    U   php/php-src/trunk/ext/pdo/config.w32
    U   php/php-src/trunk/ext/session/config.w32
    U   php/php-src/trunk/ext/sockets/config.w32
    U   php/php-src/trunk/ext/spl/config.w32
    U   php/php-src/trunk/ext/sqlite3/config.w32
    U   php/php-src/trunk/ext/standard/config.w32
    U   php/php-src/trunk/ext/xml/config.w32
    U   php/php-src/trunk/main/php.h
    U   php/php-src/trunk/sapi/embed/config.w32
    U   php/php-src/trunk/win32/build/config.w32
    U   php/php-src/trunk/win32/build/confutils.js
    U   php/php-src/trunk/win32/syslog.reg

Modified: php/php-src/trunk/ext/date/config.w32
===================================================================
--- php/php-src/trunk/ext/date/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/date/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -7,6 +7,8 @@

 ADD_FLAG('CFLAGS_DATE', "/wd4244");

+PHP_INSTALL_HEADERS("ext/date/", "php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h");
+
 var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
 tl_config.WriteLine("#include \"config.w32.h\"");
 tl_config.Close();

Modified: php/php-src/trunk/ext/dom/config.w32
===================================================================
--- php/php-src/trunk/ext/dom/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/dom/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -19,6 +19,7 @@
 		if (!PHP_DOM_SHARED) {
 			ADD_FLAG("CFLAGS_DOM", "/D LIBXML_STATIC ");
 		}
+		PHP_INSTALL_HEADERS("ext/dom", "xml_common.h");
 	} else {
 		WARNING("dom support can't be enabled, libxml is not enabled")
 		PHP_DOM = "no"

Modified: php/php-src/trunk/ext/ereg/config.w32
===================================================================
--- php/php-src/trunk/ext/ereg/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/ereg/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -8,4 +8,5 @@
 	ADD_SOURCES("ext/ereg/regex", "regcomp.c regexec.c regerror.c regfree.c", "ereg");
 	AC_DEFINE('REGEX', 1, 'Bundled regex');
 	AC_DEFINE('HSREGEX', 1, 'Bundled regex');
-}
\ No newline at end of file
+	PHP_INSTALL_HEADERS("ext/ereg", "php_ereg.h php_regex.h regex/");
+}

Modified: php/php-src/trunk/ext/filter/config.w32
===================================================================
--- php/php-src/trunk/ext/filter/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/filter/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -5,4 +5,5 @@

 if (PHP_FILTER == "yes") {
 	EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
+	PHP_INSTALL_HEADERS("ext/filter", "php_filter.h");
 }

Modified: php/php-src/trunk/ext/gd/config.w32
===================================================================
--- php/php-src/trunk/ext/gd/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/gd/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -70,6 +70,8 @@
 /D USE_GD_IOCTX \
 /D MSWIN32 \
 		");
+
+		PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
 		} else {
 		WARNING("gd not enabled; libraries and headers not found");
 	}

Modified: php/php-src/trunk/ext/hash/config.w32
===================================================================
--- php/php-src/trunk/ext/hash/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/hash/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -16,5 +16,10 @@
 	EXTENSION("hash", "hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c "
 		+ "hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c "
 		+ "hash_adler32.c hash_crc32.c hash_salsa.c hash_joaat.c hash_fnv.c");
+
+		PHP_INSTALL_HEADERS("ext/hash/", "php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h " +
+		"php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h " +
+		"php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h php_hash_salsa.h " +
+		"php_hash_types.h");
 }


Modified: php/php-src/trunk/ext/iconv/config.w32
===================================================================
--- php/php-src/trunk/ext/iconv/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/iconv/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -19,6 +19,7 @@
 		if (!PHP_ICONV_SHARED) {
 			ADD_DEF_FILE("ext\\iconv\\php_iconv.def");
 		}
+		PHP_INSTALL_HEADERS("", "ext/iconv");
 	} else {
 		WARNING("iconv support can't be enabled, libraries or headers are missing")
 		PHP_ICONV = "no";

Modified: php/php-src/trunk/ext/json/config.w32
===================================================================
--- php/php-src/trunk/ext/json/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/json/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -6,5 +6,6 @@
 if (PHP_JSON != "no") {
 	EXTENSION('json', 'json.c', PHP_JSON_SHARED, "");
 	ADD_SOURCES(configure_module_dirname, "JSON_parser.c utf8_decode.c utf8_to_utf16.c", "json");
+	PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
 }


Modified: php/php-src/trunk/ext/libxml/config.w32
===================================================================
--- php/php-src/trunk/ext/libxml/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/libxml/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -15,6 +15,7 @@
 		if (!PHP_LIBXML_SHARED) {
 			ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
 		}
+		PHP_INSTALL_HEADERS("ext/libxml/", "php_libxml.h");
 	} else {
 		WARNING("libxml support can't be enabled, iconv or libxml are missing")
 		PHP_LIBXML = "no"

Modified: php/php-src/trunk/ext/mbstring/config.w32
===================================================================
--- php/php-src/trunk/ext/mbstring/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/mbstring/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -54,6 +54,8 @@
 	AC_DEFINE('HAVE_MBSTR_RU', 1, 'RU');
 	AC_DEFINE('HAVE_MBSTR_TW', 1, 'TW');

+	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");
+
 	if (PHP_MBREGEX != "no") {
 		AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h');
 		AC_DEFINE('HAVE_MBREGEX', 1);
@@ -72,5 +74,6 @@
 			koi8.c koi8_r.c sjis.c utf8.c unicode.c utf16_be.c utf16_le.c \
 			utf32_be.c utf32_le.c gb18030.c", "mbstring");
 		ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
+		PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h");
 	}
 }

Modified: php/php-src/trunk/ext/mysqli/config.w32
===================================================================
--- php/php-src/trunk/ext/mysqli/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/mysqli/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -28,6 +28,7 @@
 		AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
 		ADD_EXTENSION_DEP('mysqli', 'mysqlnd', true);
 		MESSAGE("\tmysqlnd build");
+		PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
 	} else {
 		if (CHECK_LIB("libmysql.lib", "mysqli", PHP_MYSQLI) &&
 			CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI +
@@ -36,6 +37,7 @@
 			EXTENSION("mysqli", mysqli_source);
 			AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
 			MESSAGE("\tlibmysql build");
+			PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
 		} else {
 			WARNING("mysqli not enabled; libraries and headers not found");
 			PHP_MYSQLI = "no"

Modified: php/php-src/trunk/ext/mysqlnd/config.w32
===================================================================
--- php/php-src/trunk/ext/mysqlnd/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/mysqlnd/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -25,5 +25,6 @@
 		{
 			AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Compression support");
 		}
+		PHP_INSTALL_HEADERS("", "ext/mysqlnd");
 	}
 }

Modified: php/php-src/trunk/ext/pcre/config.w32
===================================================================
--- php/php-src/trunk/ext/pcre/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/pcre/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -9,3 +9,4 @@
 AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library');
 AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library');
 PHP_PCRE="yes";
+PHP_INSTALL_HEADERS("ext/pcre", "php_pcre.h pcrelib/");

Modified: php/php-src/trunk/ext/pdo/config.w32
===================================================================
--- php/php-src/trunk/ext/pdo/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/pdo/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -6,4 +6,5 @@
 if (PHP_PDO != "no") {
 	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 */);
 	ADD_EXTENSION_DEP('pdo', 'spl', true);
+	PHP_INSTALL_HEADERS("ext/pdo", "php_pdo.h php_pdo_driver.h");
 }

Modified: php/php-src/trunk/ext/session/config.w32
===================================================================
--- php/php-src/trunk/ext/session/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/session/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -6,6 +6,5 @@
 if (PHP_SESSION == "yes") {
 	EXTENSION("session", "session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */);
 	AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
+	PHP_INSTALL_HEADERS("ext/session/", "mod_mm.h");
 }
-
-

Modified: php/php-src/trunk/ext/sockets/config.w32
===================================================================
--- php/php-src/trunk/ext/sockets/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/sockets/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -8,6 +8,7 @@
 	&& CHECK_HEADER_ADD_INCLUDE("winsock.h", "CFLAGS_SOCKETS")) {
 		EXTENSION('sockets', 'sockets.c');
 		AC_DEFINE('HAVE_SOCKETS', 1);
+		PHP_INSTALL_HEADERS("ext/sockets", "php_sockets.h");
 	} else {
 		WARNING("sockets not enabled; libraries and headers not found");
 	}

Modified: php/php-src/trunk/ext/spl/config.w32
===================================================================
--- php/php-src/trunk/ext/spl/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/spl/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -4,3 +4,4 @@
 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 */);
 AC_DEFINE('HAVE_SPL', 1);
 PHP_SPL="yes";
+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");

Modified: php/php-src/trunk/ext/sqlite3/config.w32
===================================================================
--- php/php-src/trunk/ext/sqlite3/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/sqlite3/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -10,4 +10,5 @@
 	ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");

 	AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
+	PHP_INSTALL_HEADERS("ext/sqlite3", "libsqlite/sqlite3.h");
 }

Modified: php/php-src/trunk/ext/standard/config.w32
===================================================================
--- php/php-src/trunk/ext/standard/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/standard/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -21,7 +21,7 @@
 	php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
 	user_filters.c uuencode.c filters.c proc_open.c \
 	streamsfuncs.c http.c flock_compat.c", false /* never shared */);
-
+	PHP_INSTALL_HEADERS("", "ext/standard");
 if (PHP_MBREGEX != "no") {
 	CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")
 }

Modified: php/php-src/trunk/ext/xml/config.w32
===================================================================
--- php/php-src/trunk/ext/xml/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/ext/xml/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -11,8 +11,9 @@
 		if (!PHP_XML_SHARED) {
 			ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC ");
 		}
+		PHP_INSTALL_HEADERS("", "ext/xml");
 	} else {
 		WARNING("xml support can't be enabled, libraries or headers are missing")
 		PHP_ZLIB = "no"
 	}
-}
\ No newline at end of file
+}

Modified: php/php-src/trunk/main/php.h
===================================================================
--- php/php-src/trunk/main/php.h	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/main/php.h	2010-12-11 22:18:10 UTC (rev 306241)
@@ -147,7 +147,11 @@
 #endif

 #ifndef HAVE_SOCKLEN_T
+# if PHP_WIN32
+typedef int socklen_t;
+# else
 typedef unsigned int socklen_t;
+# endif
 #endif

 #define CREATE_MUTEX(a, b)

Modified: php/php-src/trunk/sapi/embed/config.w32
===================================================================
--- php/php-src/trunk/sapi/embed/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/sapi/embed/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -5,4 +5,5 @@

 if (PHP_EMBED != "no") {
 	SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib');
+	PHP_INSTALL_HEADERS("sapi/embed", "php_embed.h");
 }

Modified: php/php-src/trunk/win32/build/config.w32
===================================================================
--- php/php-src/trunk/win32/build/config.w32	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/win32/build/config.w32	2010-12-11 22:18:10 UTC (rev 306241)
@@ -356,7 +356,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/ include/ main/ main/streams/");
+PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/");

 STDOUT.WriteBlankLines(1);


Modified: php/php-src/trunk/win32/build/confutils.js
===================================================================
--- php/php-src/trunk/win32/build/confutils.js	2010-12-11 22:07:04 UTC (rev 306240)
+++ php/php-src/trunk/win32/build/confutils.js	2010-12-11 22:18:10 UTC (rev 306241)
@@ -1631,6 +1631,18 @@

 	var TF = FSO.OpenTextFile("win32/build/Makefile", 1);
 	MF.Write(TF.ReadAll());
+
+	MF.WriteLine("install-headers:");
+	MF.WriteLine("	@if not exist $(PHP_PREFIX)\\include mkdir $(PHP_PREFIX)\\include >nul");
+	MF.WriteLine("	@for %D in ($(INSTALL_HEADERS_DIR)) do @if not exist $(PHP_PREFIX)\\include\\%D mkdir $(PHP_PREFIX)\\include\\%D >nul");
+	for (i in headers_install) {
+		if (headers_install[i][2] != "") {
+				MF.WriteLine("	@if not exist $(PHP_PREFIX)\\include\\" + headers_install[i][2] + " mkdir $(PHP_PREFIX)\\include\\" +
+												headers_install[i][2] + ">nul");
+				MF.WriteLine("	@copy " + headers_install[i][0] + " " + "$(PHP_PREFIX)\\include\\" + headers_install[i][2] + " /y >nul");
+		}
+	}
+	MF.WriteLine("	@for %D in ($(INSTALL_HEADERS_DIR)) do @copy %D*.h $(PHP_PREFIX)\\include\\%D /y >nul");
 	TF.Close();

 	MF.WriteBlankLines(2);
@@ -1851,25 +1863,36 @@
 	return items;
 }

-function PHP_INSTALL_HEADERS(headers_list)
+function PHP_INSTALL_HEADERS(dir, headers_list)
 {
 	headers_list = headers_list.split(new RegExp("\\s+"));
 	headers_list.sort();
+	if (dir.length > 0 && dir.substr(dir.length - 1) != '/') {
+		dir += '/';
+	}
+	dir = dir.replace(new RegExp("/", "g"), "\\");

 	for (i in headers_list) {
 		src = headers_list[i];
 		src = src.replace(new RegExp("/", "g"), "\\");
-		isdir = FSO.FolderExists(src);
-		isfile = FSO.FileExists(src);
+		isdir = FSO.FolderExists(dir + src);
+		isfile = FSO.FileExists(dir + src);
 		if (isdir) {
-			headers_install[headers_install.length] = [src, 'dir'];
-			ADD_FLAG("INSTALL_HEADERS_DIR", src);
+			if (src.length > 0 && src.substr(src.length - 1) != '/') {
+				src += '\\';
+			}
+			headers_install[headers_install.length] = [dir + src, 'dir',''];
+			ADD_FLAG("INSTALL_HEADERS_DIR", dir + src);
 		} else if (isfile) {
-			headers_install[headers_install.length] = [src, 'file'];
-			ADD_FLAG("INSTALL_HEADERS", src);
+			dirname = FSO.GetParentFolderName(dir + src);
+			headers_install[headers_install.length] = [dir + src, 'file', dirname];
+			ADD_FLAG("INSTALL_HEADERS", dir + src);
+		} else {
+			STDOUT.WriteLine(headers_list);
+			ERROR("Cannot find header " + dir + src);
 		}
 	}
-	output_as_table(["Headers", "Type"], headers_install);
+	output_as_table(["Headers", "Type", "target"], headers_install);
 }

 // for snapshot builders, this option will attempt to enable everything

Modified: php/php-src/trunk/win32/syslog.reg
===================================================================
(Binary files differ)
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to