From: Pierre Joye Date: Sat, 11 Dec 2010 22:18:10 +0000 (+0000) Subject: - add PHP_INSTALL_HEADERS to all parts (core&exts) exposing headers, generate the... X-Git-Tag: php-5.4.0alpha1~191^2~528 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7ffa09e18137de43c91ac5f2120c170679baeae;p=php - add PHP_INSTALL_HEADERS to all parts (core&exts) exposing headers, generate the install-headers cmd --- diff --git a/ext/date/config.w32 b/ext/date/config.w32 index 368ddef97a..85b0e6519b 100755 --- a/ext/date/config.w32 +++ b/ext/date/config.w32 @@ -7,6 +7,8 @@ AC_DEFINE('HAVE_DATE', 1, 'Have date/time support'); 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(); diff --git a/ext/dom/config.w32 b/ext/dom/config.w32 index 8fba39336a..cbe15af1ab 100644 --- a/ext/dom/config.w32 +++ b/ext/dom/config.w32 @@ -19,6 +19,7 @@ if (PHP_DOM == "yes") { 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" diff --git a/ext/ereg/config.w32 b/ext/ereg/config.w32 index 8b383ddfeb..18a002b44d 100644 --- a/ext/ereg/config.w32 +++ b/ext/ereg/config.w32 @@ -8,4 +8,5 @@ if (PHP_EREG != "no") { 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/"); +} diff --git a/ext/filter/config.w32 b/ext/filter/config.w32 index 083555a4c7..b74f3a2fd0 100644 --- a/ext/filter/config.w32 +++ b/ext/filter/config.w32 @@ -5,4 +5,5 @@ ARG_ENABLE("filter", "Filter Support", "yes"); 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"); } diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index b05dbe445e..38292d52f4 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -70,6 +70,8 @@ if (PHP_GD != "no") { /D USE_GD_IOCTX \ /D MSWIN32 \ "); + + PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" ); } else { WARNING("gd not enabled; libraries and headers not found"); } diff --git a/ext/hash/config.w32 b/ext/hash/config.w32 index 3fd736bf17..6a2fcff18f 100644 --- a/ext/hash/config.w32 +++ b/ext/hash/config.w32 @@ -16,5 +16,10 @@ if (PHP_HASH != "no") { 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"); } diff --git a/ext/iconv/config.w32 b/ext/iconv/config.w32 index 7bc649e2ad..00ab272423 100644 --- a/ext/iconv/config.w32 +++ b/ext/iconv/config.w32 @@ -19,6 +19,7 @@ if (PHP_ICONV != "no") { 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"; diff --git a/ext/json/config.w32 b/ext/json/config.w32 index a3559e08b7..06a48e05ed 100644 --- a/ext/json/config.w32 +++ b/ext/json/config.w32 @@ -6,5 +6,6 @@ ARG_ENABLE("json", "JavaScript Object Serialization support", "yes"); 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"); } diff --git a/ext/libxml/config.w32 b/ext/libxml/config.w32 index 7c9988f7e9..92144f9ad0 100644 --- a/ext/libxml/config.w32 +++ b/ext/libxml/config.w32 @@ -15,6 +15,7 @@ if (PHP_LIBXML == "yes") { 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" diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32 index 2fdd9d3514..ae0972f62a 100644 --- a/ext/mbstring/config.w32 +++ b/ext/mbstring/config.w32 @@ -54,6 +54,8 @@ if (PHP_MBSTRING != "no") { 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 @@ if (PHP_MBSTRING != "no") { 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"); } } diff --git a/ext/mysqli/config.w32 b/ext/mysqli/config.w32 index 30def9424d..ab8bcd0087 100644 --- a/ext/mysqli/config.w32 +++ b/ext/mysqli/config.w32 @@ -28,6 +28,7 @@ if (PHP_MYSQLI != "no") { 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 @@ if (PHP_MYSQLI != "no") { 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" diff --git a/ext/mysqlnd/config.w32 b/ext/mysqlnd/config.w32 index ba0ebd90ad..4a32cbcb9d 100644 --- a/ext/mysqlnd/config.w32 +++ b/ext/mysqlnd/config.w32 @@ -25,5 +25,6 @@ if (PHP_MYSQLND != "no") { { AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Compression support"); } + PHP_INSTALL_HEADERS("", "ext/mysqlnd"); } } diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32 index 05b3abcd1a..5d6fa90594 100644 --- a/ext/pcre/config.w32 +++ b/ext/pcre/config.w32 @@ -9,3 +9,4 @@ ADD_DEF_FILE("ext\\pcre\\php_pcre.def"); 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/"); diff --git a/ext/pdo/config.w32 b/ext/pdo/config.w32 index 9fb3801981..c85f2e55e4 100755 --- a/ext/pdo/config.w32 +++ b/ext/pdo/config.w32 @@ -6,4 +6,5 @@ ARG_ENABLE("pdo", "Enable PHP Data Objects support", "no"); 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"); } diff --git a/ext/session/config.w32 b/ext/session/config.w32 index fd568f3c3e..27114f11d3 100644 --- a/ext/session/config.w32 +++ b/ext/session/config.w32 @@ -6,6 +6,5 @@ ARG_ENABLE("session", "session support", "yes"); 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"); } - - diff --git a/ext/sockets/config.w32 b/ext/sockets/config.w32 index 1672f85b15..8b63381900 100644 --- a/ext/sockets/config.w32 +++ b/ext/sockets/config.w32 @@ -8,6 +8,7 @@ if (PHP_SOCKETS != "no") { && 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"); } diff --git a/ext/spl/config.w32 b/ext/spl/config.w32 index e594b0eb48..77cbd20346 100644 --- a/ext/spl/config.w32 +++ b/ext/spl/config.w32 @@ -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"); diff --git a/ext/sqlite3/config.w32 b/ext/sqlite3/config.w32 index 4d9dca40ae..01e4625fed 100644 --- a/ext/sqlite3/config.w32 +++ b/ext/sqlite3/config.w32 @@ -10,4 +10,5 @@ if (PHP_SQLITE3 != "no") { ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3"); AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support"); + PHP_INSTALL_HEADERS("ext/sqlite3", "libsqlite/sqlite3.h"); } diff --git a/ext/standard/config.w32 b/ext/standard/config.w32 index 70b250137a..a03235822c 100644 --- a/ext/standard/config.w32 +++ b/ext/standard/config.w32 @@ -21,7 +21,7 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \ 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") } diff --git a/ext/xml/config.w32 b/ext/xml/config.w32 index ed0352701b..4ee0bd1602 100644 --- a/ext/xml/config.w32 +++ b/ext/xml/config.w32 @@ -11,8 +11,9 @@ if (PHP_XML == "yes") { 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 +} diff --git a/main/php.h b/main/php.h index 2db910eb56..ca31fbf9d1 100644 --- a/main/php.h +++ b/main/php.h @@ -147,7 +147,11 @@ END_EXTERN_C() #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) diff --git a/sapi/embed/config.w32 b/sapi/embed/config.w32 index 8ea0781ed3..f3cc60d600 100644 --- a/sapi/embed/config.w32 +++ b/sapi/embed/config.w32 @@ -5,4 +5,5 @@ ARG_ENABLE('embed', 'Embedded SAPI library', 'no'); if (PHP_EMBED != "no") { SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib'); + PHP_INSTALL_HEADERS("sapi/embed", "php_embed.h"); } diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 6d9375205f..2eaa8b3adb 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -356,7 +356,7 @@ ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c 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); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 4fdbaac33a..9a00f55ded 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1631,6 +1631,18 @@ function generate_makefile() 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 @@ function _inner_glob(base, p, parts) 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 diff --git a/win32/syslog.reg b/win32/syslog.reg index 2baa88e366..4d3e273970 100644 --- a/win32/syslog.reg +++ b/win32/syslog.reg @@ -1,5 +1,5 @@ REGEDIT4 -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.1.0-dev] +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.3.99-dev] "TypesSupported"=dword:00000007 -"EventMessageFile"="C:\\php5\\php5ts.dll" +"EventMessageFile"="g:\\test\\srcinstall6\\php5ts_debug.dll"