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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 3 additions & 7 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)