Skip to content

Commit 52dba99

Browse files
committed
Sync headers installation
This syncs the installed sapi and extension headers on *nix and Windows systems by installing only what is intended outside of php-src. - ext/gd: without gd_arginfo.h and gd_compat.h - ext/hash: php_hash_joaat.h and php_hash_fnv.h added also on Windows installation; xxhash/xxhash.h added on both installations as it is included in php_hash_xxhash.h; Include path for xxhash.h changed to relative so the php_hash_xxhash.h can be included outside of php-src; Redundant include flags removed - ext/iconv: without iconv_arginfo.h - ext/mysqli: mysqli_mysqlnd.h was missing on Windows - ext/phar: php_phar.h was missing on Windows - ext/sodium: php_libsodium.h was missing on *nix - ext/xml: without xml_arginfo.h - sapi/cli: cli.h was missing on Windows Closes GH-13210 Closes GH-13213
1 parent c1c106e commit 52dba99

30 files changed

+35
-42
lines changed

ext/date/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ tl_config.WriteLine("#define timelib_strndup estrndup");
1919
tl_config.WriteLine("#define timelib_free efree");
2020
tl_config.Close();
2121

22-
PHP_INSTALL_HEADERS("ext/date/", "php_date.h lib/timelib.h lib/timelib_config.h");
22+
PHP_INSTALL_HEADERS("ext/date", "php_date.h lib/timelib.h lib/timelib_config.h");
2323
AC_DEFINE('HAVE_TIMELIB_CONFIG_H', 1, 'Have timelib_config.h')

ext/dom/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if test "$PHP_DOM" != "no"; then
4949
PHP_ADD_BUILD_DIR($ext_builddir/$LEXBOR_DIR/ns)
5050
PHP_ADD_BUILD_DIR($ext_builddir/$LEXBOR_DIR/tag)
5151
PHP_SUBST(DOM_SHARED_LIBADD)
52-
PHP_INSTALL_HEADERS([ext/dom/xml_common.h ext/dom/xpath_callbacks.h])
52+
PHP_INSTALL_HEADERS([ext/dom], [xml_common.h xpath_callbacks.h])
5353
PHP_ADD_EXTENSION_DEP(dom, libxml)
5454
])
5555
fi

ext/filter/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ if test "$PHP_FILTER" != "no"; then
88
PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
99
PHP_SUBST(FILTER_SHARED_LIBADD)
1010

11-
PHP_INSTALL_HEADERS([ext/filter/php_filter.h])
11+
PHP_INSTALL_HEADERS([ext/filter], [php_filter.h])
1212
PHP_ADD_EXTENSION_DEP(filter, pcre)
1313
fi

ext/gd/config.m4

+2-3
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ dnl Various checks for GD features
235235
PHP_NEW_EXTENSION(gd, gd.c $extra_sources, $ext_shared,, \\$(GD_CFLAGS))
236236
PHP_ADD_BUILD_DIR($ext_builddir/libgd)
237237
GD_CFLAGS="-Wno-strict-prototypes -I$ext_srcdir/libgd $GD_CFLAGS"
238-
GD_HEADER_DIRS="ext/gd/ ext/gd/libgd/"
238+
PHP_INSTALL_HEADERS([ext/gd], [php_gd.h libgd/])
239239

240240
PHP_TEST_BUILD(foobar, [], [
241241
AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])
@@ -250,13 +250,12 @@ dnl Various checks for GD features
250250
PHP_GD_CHECK_VERSION
251251

252252
PHP_NEW_EXTENSION(gd, gd.c $extra_sources, $ext_shared)
253-
GD_HEADER_DIRS="ext/gd/"
253+
PHP_INSTALL_HEADERS([ext/gd], [php_gd.h])
254254
PHP_CHECK_LIBRARY(gd, gdImageCreate, [], [
255255
AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])
256256
], [ $GD_SHARED_LIBADD ])
257257
fi
258258

259-
PHP_INSTALL_HEADERS([$GD_HEADER_DIRS])
260259
PHP_SUBST(GD_CFLAGS)
261260
PHP_SUBST(GDLIB_CFLAGS)
262261
PHP_SUBST(GDLIB_LIBS)

ext/gd/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if (PHP_GD != "no") {
7575
ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt");
7676
}
7777

78-
PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
78+
PHP_INSTALL_HEADERS("ext/gd", "php_gd.h libgd/");
7979
} else {
8080
WARNING("gd not enabled; libraries and headers not found");
8181
}

ext/gmp/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if test "$PHP_GMP" != "no"; then
2727
PHP_ADD_INCLUDE($PHP_GMP/include)
2828
fi
2929

30-
PHP_INSTALL_HEADERS([ext/gmp/php_gmp_int.h])
30+
PHP_INSTALL_HEADERS([ext/gmp], [php_gmp_int.h])
3131

3232
PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
3333
PHP_SUBST(GMP_SHARED_LIBADD)

ext/hash/config.m4

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ else
3232
fi
3333

3434
PHP_ADD_BUILD_DIR(ext/hash/murmur, 1)
35-
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -I@ext_srcdir@/xxhash"
3635

3736
EXT_HASH_SOURCES="hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c \
3837
hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c hash_adler32.c \
@@ -42,7 +41,7 @@ EXT_HASH_HEADERS="php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h \
4241
php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h \
4342
php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h \
4443
php_hash_fnv.h php_hash_joaat.h php_hash_sha3.h php_hash_murmur.h \
45-
php_hash_xxhash.h"
44+
php_hash_xxhash.h xxhash/xxhash.h"
4645

4746
PHP_NEW_EXTENSION(hash, $EXT_HASH_SOURCES, 0,,$PHP_HASH_CFLAGS)
4847
PHP_INSTALL_HEADERS(ext/hash, $EXT_HASH_HEADERS)

ext/hash/config.w32

+3-7
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,9 @@ if (!CHECK_HEADER_ADD_INCLUDE('PMurHash.h', 'CFLAGS_HASH', hash_murmur_dir)) {
3535
}
3636
ADD_SOURCES(hash_murmur_dir, 'PMurHash.c PMurHash128.c', 'hash');
3737

38-
var hash_xxhash_dir = 'ext/hash/xxhash';
39-
if (!CHECK_HEADER_ADD_INCLUDE('xxhash.h', 'CFLAGS_HASH', hash_xxhash_dir)) {
40-
ERROR('Unable to locate xxhash headers');
41-
}
42-
43-
PHP_INSTALL_HEADERS('ext/hash/', 'php_hash.h php_hash_md.h php_hash_sha.h ' +
38+
PHP_INSTALL_HEADERS('ext/hash', 'php_hash.h php_hash_md.h php_hash_sha.h ' +
4439
'php_hash_ripemd.h php_hash_haval.h php_hash_tiger.h ' +
4540
'php_hash_gost.h php_hash_snefru.h php_hash_whirlpool.h ' +
4641
'php_hash_adler32.h php_hash_crc32.h php_hash_sha3.h ' +
47-
'php_hash_murmur.h php_hash_xxhash.h');
42+
'php_hash_murmur.h php_hash_xxhash.h php_hash_fnv.h ' +
43+
'php_hash_joaat.h xxhash/xxhash.h');

ext/hash/php_hash_xxhash.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define PHP_HASH_XXHASH_H
1919

2020
#define XXH_INLINE_ALL 1
21-
#include "xxhash.h"
21+
#include "xxhash/xxhash.h"
2222

2323
typedef struct {
2424
XXH32_state_t s;

ext/iconv/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int main(void) {
149149

150150
PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
151151
PHP_SUBST(ICONV_SHARED_LIBADD)
152-
PHP_INSTALL_HEADERS([ext/iconv/])
152+
PHP_INSTALL_HEADERS([ext/iconv], [php_iconv.h])
153153
else
154154
AC_MSG_ERROR(Please reinstall the iconv library.)
155155
fi

ext/iconv/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (PHP_ICONV != "no") {
1717
if (!PHP_ICONV_SHARED) {
1818
ADD_DEF_FILE("ext\\iconv\\php_iconv.def");
1919
}
20-
PHP_INSTALL_HEADERS("", "ext/iconv");
20+
PHP_INSTALL_HEADERS("ext/iconv", "php_iconv.h");
2121
} else {
2222
WARNING("iconv support can't be enabled, libraries or headers are missing")
2323
PHP_ICONV = "no";

ext/json/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ ADD_SOURCES(configure_module_dirname, "json_encoder.c json_parser.tab.c json_sca
66

77
ADD_MAKEFILE_FRAGMENT();
88

9-
PHP_INSTALL_HEADERS("ext/json/", "php_json.h php_json_parser.h php_json_scanner.h");
9+
PHP_INSTALL_HEADERS("ext/json", "php_json.h php_json_parser.h php_json_scanner.h");

ext/libxml/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (PHP_LIBXML == "yes") {
1515
if (!PHP_LIBXML_SHARED) {
1616
ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
1717
}
18-
PHP_INSTALL_HEADERS("ext/libxml/", "php_libxml.h");
18+
PHP_INSTALL_HEADERS("ext/libxml", "php_libxml.h");
1919
} else {
2020
WARNING("libxml support can't be enabled, iconv or libxml are missing")
2121
PHP_LIBXML = "no"

ext/libxml/config0.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ if test "$PHP_LIBXML" != "no"; then
1212
PHP_SETUP_LIBXML(LIBXML_SHARED_LIBADD, [
1313
AC_DEFINE(HAVE_LIBXML,1,[ ])
1414
PHP_NEW_EXTENSION(libxml, [libxml.c mime_sniff.c], $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
15-
PHP_INSTALL_HEADERS([ext/libxml/php_libxml.h])
15+
PHP_INSTALL_HEADERS([ext/libxml], [php_libxml.h])
1616
])
1717
fi

ext/mysqli/config.m4

+2-6
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ if test "$PHP_MYSQLI" != "no"; then
6565
mysqli_exception.c mysqli_result_iterator.c"
6666
PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
6767
PHP_SUBST(MYSQLI_SHARED_LIBADD)
68-
PHP_INSTALL_HEADERS([ext/mysqli/php_mysqli_structs.h])
69-
70-
if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then
71-
PHP_ADD_EXTENSION_DEP(mysqli, mysqlnd)
72-
PHP_INSTALL_HEADERS([ext/mysqli/mysqli_mysqlnd.h])
73-
fi
68+
PHP_INSTALL_HEADERS([ext/mysqli], [php_mysqli_structs.h mysqli_mysqlnd.h])
69+
PHP_ADD_EXTENSION_DEP(mysqli, mysqlnd)
7470
fi

ext/mysqli/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ if (PHP_MYSQLI != "no") {
2222
if (PHP_MYSQLI != "no") {
2323
EXTENSION("mysqli", mysqli_source, PHP_MYSQLI_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
2424
ADD_EXTENSION_DEP('mysqli', 'mysqlnd', true);
25-
PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
25+
PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h mysqli_mysqlnd.h");
2626
}
2727
}

ext/pdo/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if test "$PHP_PDO" != "no"; then
1111

1212
PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c, $ext_shared)
1313
PHP_ADD_EXTENSION_DEP(pdo, spl, true)
14-
PHP_INSTALL_HEADERS(ext/pdo, [php_pdo.h php_pdo_driver.h php_pdo_error.h])
14+
PHP_INSTALL_HEADERS([ext/pdo], [php_pdo.h php_pdo_driver.h php_pdo_error.h])
1515

1616
dnl so we always include the known-good working hack.
1717
PHP_ADD_MAKEFILE_FRAGMENT

ext/phar/config.w32

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ if (PHP_PHAR != "no") {
3535
}
3636
}
3737
ADD_EXTENSION_DEP('phar', 'spl', true);
38+
PHP_INSTALL_HEADERS("ext/phar", "php_phar.h");
3839

3940
ADD_MAKEFILE_FRAGMENT();
4041
}

ext/session/config.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if test "$PHP_SESSION" != "no"; then
1818
PHP_ADD_EXTENSION_DEP(session, hash, true)
1919
PHP_ADD_EXTENSION_DEP(session, spl)
2020
PHP_SUBST(SESSION_SHARED_LIBADD)
21-
PHP_INSTALL_HEADERS(ext/session, [php_session.h mod_files.h mod_user.h])
21+
PHP_INSTALL_HEADERS([ext/session], [php_session.h mod_files.h mod_user.h])
2222
AC_DEFINE(HAVE_PHP_SESSION,1,[ ])
2323
fi
2424

@@ -38,6 +38,6 @@ if test "$PHP_MM" != "no"; then
3838

3939
PHP_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/$PHP_LIBDIR, SESSION_SHARED_LIBADD)
4040
PHP_ADD_INCLUDE($MM_DIR/include)
41-
PHP_INSTALL_HEADERS([ext/session/mod_mm.h])
41+
PHP_INSTALL_HEADERS([ext/session], [mod_mm.h])
4242
AC_DEFINE(HAVE_LIBMM, 1, [Whether you have libmm])
4343
fi

ext/session/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ ARG_ENABLE("session", "session support", "yes");
55
if (PHP_SESSION == "yes") {
66
EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
77
AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
8-
PHP_INSTALL_HEADERS("ext/session/", "mod_mm.h php_session.h mod_files.h mod_user.h");
8+
PHP_INSTALL_HEADERS("ext/session", "mod_mm.h php_session.h mod_files.h mod_user.h");
99
}

ext/simplexml/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if test "$PHP_SIMPLEXML" != "no"; then
1313
PHP_SETUP_LIBXML(SIMPLEXML_SHARED_LIBADD, [
1414
AC_DEFINE(HAVE_SIMPLEXML,1,[ ])
1515
PHP_NEW_EXTENSION(simplexml, simplexml.c, $ext_shared)
16-
PHP_INSTALL_HEADERS([ext/simplexml/php_simplexml.h ext/simplexml/php_simplexml_exports.h])
16+
PHP_INSTALL_HEADERS([ext/simplexml], [php_simplexml.h php_simplexml_exports.h])
1717
PHP_SUBST(SIMPLEXML_SHARED_LIBADD)
1818
])
1919
PHP_ADD_EXTENSION_DEP(simplexml, libxml)

ext/simplexml/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (PHP_SIMPLEXML == "yes") {
2121
MESSAGE("\tSPL support in simplexml disabled");
2222
}
2323
ADD_FLAG("CFLAGS_SIMPLEXML", "/D PHP_SIMPLEXML_EXPORTS ");
24-
PHP_INSTALL_HEADERS("ext/simplexml/", "php_simplexml.h php_simplexml_exports.h");
24+
PHP_INSTALL_HEADERS("ext/simplexml", "php_simplexml.h php_simplexml_exports.h");
2525
} else {
2626
PHP_SIMPLEXML = "no";
2727
WARNING("simplexml not enabled; libraries and headers not found");

ext/sockets/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ if test "$PHP_SOCKETS" != "no"; then
103103
[sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c],
104104
[$ext_shared],,
105105
$PHP_SOCKETS_CFLAGS)
106-
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
106+
PHP_INSTALL_HEADERS([ext/sockets], [php_sockets.h])
107107
fi

ext/sodium/config.m4

+1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ if test "$PHP_SODIUM" != "no"; then
1515
SODIUM_COMPILER_FLAGS="$LIBSODIUM_CFLAGS -Wno-type-limits"
1616
AX_CHECK_COMPILE_FLAG([-Wno-logical-op], SODIUM_COMPILER_FLAGS="$SODIUM_COMPILER_FLAGS -Wno-logical-op", , [-Werror])
1717
PHP_NEW_EXTENSION(sodium, libsodium.c sodium_pwhash.c, $ext_shared, , $SODIUM_COMPILER_FLAGS)
18+
PHP_INSTALL_HEADERS([ext/sodium], [php_libsodium.h])
1819
PHP_SUBST(SODIUM_SHARED_LIBADD)
1920
fi

ext/sodium/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if (PHP_SODIUM != "no") {
66
if (CHECK_LIB("libsodium.lib", "sodium", PHP_SODIUM) && CHECK_HEADER_ADD_INCLUDE("sodium.h", "CFLAGS_SODIUM")) {
77
EXTENSION("sodium", "libsodium.c sodium_pwhash.c");
88
AC_DEFINE('HAVE_LIBSODIUMLIB', 1 , 'Have the Sodium library');
9-
PHP_INSTALL_HEADERS("ext/sodium/", "php_libsodium.h");
9+
PHP_INSTALL_HEADERS("ext/sodium", "php_libsodium.h");
1010
} else {
1111
WARNING("libsodium not enabled; libraries and headers not found");
1212
}

ext/xml/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ if test "$PHP_XML" != "no"; then
3232

3333
PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
3434
PHP_SUBST(XML_SHARED_LIBADD)
35-
PHP_INSTALL_HEADERS([ext/xml/])
35+
PHP_INSTALL_HEADERS([ext/xml], [expat_compat.h php_xml.h])
3636
AC_DEFINE(HAVE_XML, 1, [ ])
3737
fi

ext/xml/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (PHP_XML == "yes") {
1313
if (!PHP_XML_SHARED) {
1414
ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC ");
1515
}
16-
PHP_INSTALL_HEADERS("", "ext/xml");
16+
PHP_INSTALL_HEADERS("ext/xml", "expat_compat.h php_xml.h");
1717
} else {
1818
WARNING("xml support can't be enabled, libraries or headers are missing")
1919
PHP_XML = "no"

sapi/cli/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ if test "$PHP_CLI" != "no"; then
5656

5757
PHP_OUTPUT(sapi/cli/php.1)
5858

59-
PHP_INSTALL_HEADERS([sapi/cli/cli.h])
59+
PHP_INSTALL_HEADERS([sapi/cli], [cli.h])
6060
fi
6161
AC_MSG_RESULT($PHP_CLI)

sapi/cli/config.w32

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ if (PHP_CLI == "yes") {
88
ADD_FLAG("LIBS_CLI", "ws2_32.lib");
99
ADD_FLAG("LIBS_CLI", "shell32.lib");
1010
ADD_FLAG("LDFLAGS_CLI", "/stack:67108864");
11+
PHP_INSTALL_HEADERS("sapi/cli", "cli.h");
1112

1213
if (CHECK_LIB("edit_a.lib;edit.lib", "cli", PHP_CLI) &&
1314
CHECK_HEADER_ADD_INCLUDE("editline/readline.h", "CFLAGS_CLI")) {

sapi/embed/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if test "$PHP_EMBED" != "no"; then
2626
if test "$PHP_EMBED_TYPE" != "no"; then
2727
PHP_SUBST(LIBPHP_CFLAGS)
2828
PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
29-
PHP_INSTALL_HEADERS([sapi/embed/php_embed.h])
29+
PHP_INSTALL_HEADERS([sapi/embed], [php_embed.h])
3030
fi
3131
AC_MSG_RESULT([$PHP_EMBED_TYPE])
3232
else

0 commit comments

Comments
 (0)