Skip to content

Commit 5808d5a

Browse files
committed
Sync cache variable names and update patches
1 parent 4627425 commit 5808d5a

File tree

13 files changed

+74
-59
lines changed

13 files changed

+74
-59
lines changed

cmake/cmake/Requirements.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ message(CHECK_START "Checking system character set")
4040
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR)
4141
# EBCDIC targets are obsolete, assume that target uses ASCII when
4242
# cross-compiling without emulator.
43-
set(PHP_HAS_EBCDIC_EXITCODE 1)
43+
set(PHP_EBCDIC_EXITCODE 1)
4444
endif()
4545

4646
cmake_push_check_state(RESET)
4747
set(CMAKE_REQUIRED_QUIET TRUE)
4848
check_source_runs(C [[
4949
int main(void) { return (unsigned char)'A' != (unsigned char)0xC1; }
50-
]] PHP_HAS_EBCDIC)
50+
]] PHP_EBCDIC)
5151
cmake_pop_check_state()
5252

53-
if(PHP_HAS_EBCDIC)
53+
if(PHP_EBCDIC)
5454
message(CHECK_FAIL "EBCDIC")
5555
message(FATAL_ERROR "PHP does not support EBCDIC targets.")
5656
else()

cmake/cmake/checks/CheckGethostbynameR.cmake

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ systems:
1010
* Haiku: network library has it for internal purposes, not intended for usage
1111
from the system headers.
1212
13+
Result variables:
14+
15+
* HAVE_FUNC_GETHOSTBYNAME_R_6
16+
* HAVE_FUNC_GETHOSTBYNAME_R_5
17+
* HAVE_FUNC_GETHOSTBYNAME_R_3
18+
* HAVE_GETHOSTBYNAME_R
19+
1320
See also:
1421
https://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
1522
#]=============================================================================]
@@ -18,6 +25,15 @@ include(CheckPrototypeDefinition)
1825
include(CMakePushCheckState)
1926
include(PHP/SearchLibraries)
2027

28+
set(HAVE_FUNC_GETHOSTBYNAME_R_6 FALSE)
29+
set(HAVE_FUNC_GETHOSTBYNAME_R_5 FALSE)
30+
set(HAVE_FUNC_GETHOSTBYNAME_R_3 FALSE)
31+
set(HAVE_GETHOSTBYNAME_R FALSE)
32+
33+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
34+
return()
35+
endif()
36+
2137
function(_php_check_gethostbyname_r)
2238
# Check whether gethostname_r() is available. On systems that have it, it is
2339
# mostly in the default libraries (C library) - Linux, Solaris 11.4...
@@ -26,18 +42,16 @@ function(_php_check_gethostbyname_r)
2642
HEADERS netdb.h
2743
LIBRARIES
2844
nsl # Solaris <= 11.3, illumos
29-
RESULT_VARIABLE PHP_HAS_GETHOSTBYNAME_R
30-
LIBRARY_VARIABLE PHP_HAS_GETHOSTBYNAME_R_LIBRARY
45+
RESULT_VARIABLE PHP_HAVE_GETHOSTBYNAME_R
46+
LIBRARY_VARIABLE PHP_HAVE_GETHOSTBYNAME_R_LIBRARY
3147
)
32-
if(NOT PHP_HAS_GETHOSTBYNAME_R)
48+
49+
if(NOT PHP_HAVE_GETHOSTBYNAME_R)
3350
return()
3451
endif()
3552

36-
if(
37-
DEFINED PHP_HAS_GETHOSTBYNAME_R_6
38-
OR DEFINED PHP_HAS_GETHOSTBYNAME_R_5
39-
OR DEFINED PHP_HAS_GETHOSTBYNAME_R_3
40-
)
53+
# Skip in consecutive configuration phases.
54+
if(DEFINED PHP_HAVE_FUNC_GETHOSTBYNAME_R_6)
4155
return()
4256
endif()
4357

@@ -53,9 +67,9 @@ function(_php_check_gethostbyname_r)
5367
size_t buflen, struct hostent **result, int *h_errnop)"
5468
"0"
5569
netdb.h
56-
PHP_HAS_GETHOSTBYNAME_R_6
70+
PHP_HAVE_FUNC_GETHOSTBYNAME_R_6
5771
)
58-
if(PHP_HAS_GETHOSTBYNAME_R_6)
72+
if(PHP_HAVE_FUNC_GETHOSTBYNAME_R_6)
5973
cmake_pop_check_state()
6074
message(CHECK_PASS "six")
6175
return()
@@ -68,9 +82,9 @@ function(_php_check_gethostbyname_r)
6882
char *buffer, int buflen, int *h_errnop)"
6983
"0"
7084
netdb.h
71-
PHP_HAS_GETHOSTBYNAME_R_5
85+
PHP_HAVE_FUNC_GETHOSTBYNAME_R_5
7286
)
73-
if(PHP_HAS_GETHOSTBYNAME_R_5)
87+
if(PHP_HAVE_FUNC_GETHOSTBYNAME_R_5)
7488
cmake_pop_check_state()
7589
message(CHECK_PASS "five")
7690
return()
@@ -83,9 +97,9 @@ function(_php_check_gethostbyname_r)
8397
struct hostent_data *data)"
8498
"0"
8599
netdb.h
86-
PHP_HAS_GETHOSTBYNAME_R_3
100+
PHP_HAVE_FUNC_GETHOSTBYNAME_R_3
87101
)
88-
if(PHP_HAS_GETHOSTBYNAME_R_3)
102+
if(PHP_HAVE_FUNC_GETHOSTBYNAME_R_3)
89103
cmake_pop_check_state()
90104
message(CHECK_PASS "three")
91105
return()
@@ -97,19 +111,21 @@ endfunction()
97111

98112
_php_check_gethostbyname_r()
99113

100-
set(HAVE_FUNC_GETHOSTBYNAME_R_6 "${PHP_HAS_GETHOSTBYNAME_R_6}")
101-
set(HAVE_FUNC_GETHOSTBYNAME_R_5 "${PHP_HAS_GETHOSTBYNAME_R_5}")
102-
set(HAVE_FUNC_GETHOSTBYNAME_R_3 "${PHP_HAS_GETHOSTBYNAME_R_3}")
114+
set(HAVE_FUNC_GETHOSTBYNAME_R_6 "${PHP_HAVE_FUNC_GETHOSTBYNAME_R_6}")
115+
set(HAVE_FUNC_GETHOSTBYNAME_R_5 "${PHP_HAVE_FUNC_GETHOSTBYNAME_R_5}")
116+
set(HAVE_FUNC_GETHOSTBYNAME_R_3 "${PHP_HAVE_FUNC_GETHOSTBYNAME_R_3}")
103117

104118
if(
105119
HAVE_FUNC_GETHOSTBYNAME_R_6
106120
OR HAVE_FUNC_GETHOSTBYNAME_R_5
107121
OR HAVE_FUNC_GETHOSTBYNAME_R_3
108122
)
109123
set(HAVE_GETHOSTBYNAME_R TRUE)
110-
if(PHP_HAS_GETHOSTBYNAME_R_LIBRARY)
111-
target_link_libraries(php_config INTERFACE ${PHP_HAS_GETHOSTBYNAME_R_LIBRARY})
124+
125+
if(PHP_HAVE_GETHOSTBYNAME_R_LIBRARY)
126+
target_link_libraries(
127+
php_config
128+
INTERFACE ${PHP_HAVE_GETHOSTBYNAME_R_LIBRARY}
129+
)
112130
endif()
113-
else()
114-
set(HAVE_GETHOSTBYNAME_R FALSE)
115131
endif()

cmake/cmake/platforms/Windows.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
6565
set(HAVE_STDINT_H TRUE) # Defined by check_type_size().
6666
set(HAVE_STRUCT_FLOCK FALSE)
6767
set(HAVE_SYS_TYPES_H TRUE) # Defined by check_type_size().
68+
set(PHP_EBCDIC FALSE)
6869
set(PHP_EXT_FILEINFO_HAVE_STRCASESTR FALSE)
6970
set(PHP_EXT_FILEINFO_HAVE_STRNDUP FALSE)
7071
set(PHP_EXT_FILEINFO_HAVE_UTIMES FALSE)
@@ -81,13 +82,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
8182
set(PHP_EXT_SOCKETS_HAVE_SA_SS_FAMILY FALSE)
8283
set(PHP_EXT_SOCKETS_HAVE_SOCKATMARK FALSE)
8384
set(PHP_EXT_SOCKETS_HAVE_SYS_SOCKIO_H FALSE)
84-
set(PHP_HAS_EBCDIC FALSE)
8585
set(PHP_HAS_FFP_CONTRACT_OFF_C FALSE)
8686
set(PHP_HAS_FNO_COMMON_C FALSE)
8787
set(PHP_HAS_FNO_COMMON_CXX FALSE)
8888
set(PHP_HAS_GETHOSTBYADDR TRUE)
8989
set(PHP_HAS_GETHOSTBYADDR_LIBRARY ws2_32)
90-
set(PHP_HAS_GETHOSTBYNAME_R FALSE)
9190
set(PHP_HAS_INET_ATON FALSE)
9291
set(PHP_HAS_INET_NTOA FALSE)
9392
set(PHP_HAS_INET_NTOP TRUE)

cmake/ext/posix/cmake/CheckTtynameR.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ include(PHP/SystemExtensions)
1818
function(_php_ext_posix_check_ttyname_r result)
1919
set(${result} FALSE)
2020

21-
if(PHP_EXT_POSIX_HAS_TTYNAME_R)
21+
if(PHP_EXT_POSIX_HAVE_TTYNAME_R)
2222
set(${result} TRUE)
2323
return(PROPAGATE ${result})
2424
endif()
2525

26-
if(DEFINED PHP_EXT_POSIX_HAS_TTYNAME_R_SYMBOL)
26+
if(DEFINED PHP_EXT_POSIX_HAVE_TTYNAME_R_SYMBOL)
2727
return(PROPAGATE ${result})
2828
endif()
2929

@@ -46,10 +46,10 @@ function(_php_ext_posix_check_ttyname_r result)
4646
"int ttyname_r(int fd, char *buf, size_t buflen)"
4747
"0"
4848
"unistd.h"
49-
PHP_EXT_POSIX_HAS_TTYNAME_R_SYMBOL
49+
PHP_EXT_POSIX_HAVE_TTYNAME_R_SYMBOL
5050
)
5151

52-
if(NOT PHP_EXT_POSIX_HAS_TTYNAME_R_SYMBOL)
52+
if(NOT PHP_EXT_POSIX_HAVE_TTYNAME_R_SYMBOL)
5353
message(CHECK_FAIL "no (non-standard declaration)")
5454
cmake_pop_check_state()
5555
return(PROPAGATE ${result})
@@ -58,9 +58,9 @@ function(_php_ext_posix_check_ttyname_r result)
5858
if(
5959
CMAKE_CROSSCOMPILING
6060
AND NOT CMAKE_CROSSCOMPILING_EMULATOR
61-
AND NOT DEFINED PHP_EXT_POSIX_HAS_TTYNAME_R_EXITCODE
61+
AND NOT DEFINED PHP_EXT_POSIX_HAVE_TTYNAME_R_EXITCODE
6262
)
63-
set(PHP_EXT_POSIX_HAS_TTYNAME_R_EXITCODE 0)
63+
set(PHP_EXT_POSIX_HAVE_TTYNAME_R_EXITCODE 0)
6464
endif()
6565

6666
# PHP Autotools-based build system check uses a different return below due
@@ -84,10 +84,10 @@ function(_php_ext_posix_check_ttyname_r result)
8484

8585
return ttyname_r(0, buf, buflen) ? 1 : 0;
8686
}
87-
]] PHP_EXT_POSIX_HAS_TTYNAME_R)
87+
]] PHP_EXT_POSIX_HAVE_TTYNAME_R)
8888
cmake_pop_check_state()
8989

90-
if(PHP_EXT_POSIX_HAS_TTYNAME_R)
90+
if(PHP_EXT_POSIX_HAVE_TTYNAME_R)
9191
set(${result} TRUE)
9292
message(CHECK_PASS "yes")
9393
else()

patches/8.3/cmake.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ index ae434fef976..87545d9162e 100644
153153
+CMakeLists.txt.user
154154
+CMakeScripts/
155155
diff --git a/run-tests.php b/run-tests.php
156-
index d51ab99a205..9211cbb3e27 100755
156+
index 8fb638ed3e8..5193b8e5af1 100755
157157
--- a/run-tests.php
158158
+++ b/run-tests.php
159-
@@ -885,10 +885,12 @@ function write_information(): void
159+
@@ -891,10 +891,12 @@ function write_information(): void
160160
<?php
161161
$exts = get_loaded_extensions();
162162
$ext_dir = ini_get('extension_dir');
@@ -173,7 +173,7 @@ index d51ab99a205..9211cbb3e27 100755
173173
}
174174
}
175175
}
176-
@@ -978,7 +980,7 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
176+
@@ -984,7 +986,7 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
177177

178178
$failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep;
179179
$failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n";
@@ -182,7 +182,7 @@ index d51ab99a205..9211cbb3e27 100755
182182

183183
if (!IS_WINDOWS) {
184184
/* If PHP_AUTOCONF is set, use it; otherwise, use 'autoconf'. */
185-
@@ -989,7 +991,9 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
185+
@@ -995,7 +997,9 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
186186
}
187187

188188
/* Always use the generated libtool - Mac OSX uses 'glibtool' */
@@ -193,7 +193,7 @@ index d51ab99a205..9211cbb3e27 100755
193193

194194
/* Use shtool to find out if there is glibtool present (MacOSX) */
195195
$sys_libtool_path = shell_exec(__DIR__ . '/build/shtool path glibtool libtool');
196-
@@ -1011,9 +1015,17 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
196+
@@ -1017,9 +1021,17 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
197197
}
198198

199199
$ldd = shell_exec("ldd $php 2>/dev/null");

patches/8.3/dmalloc.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See: https://github.com/php/php-src/pull/8465
1010
1 file changed, 2 insertions(+), 1 deletion(-)
1111

1212
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
13-
index 9eaeb4779f4..77932ca4e9c 100644
13+
index 8d67fb2864c..2af07fe44ba 100644
1414
--- a/sapi/cli/php_cli_server.c
1515
+++ b/sapi/cli/php_cli_server.c
1616
@@ -15,6 +15,8 @@

patches/8.4/cmake.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ index e691bd3964b..191fcd70eb5 100644
153153
+CMakeLists.txt.user
154154
+CMakeScripts/
155155
diff --git a/run-tests.php b/run-tests.php
156-
index 4654ead998f..a36dbf0f24a 100755
156+
index c80dd71688f..3d724fa6871 100755
157157
--- a/run-tests.php
158158
+++ b/run-tests.php
159-
@@ -865,10 +865,12 @@ function write_information(array $user_tests, $phpdbg): void
159+
@@ -871,10 +871,12 @@ function write_information(array $user_tests, $phpdbg): void
160160
<?php
161161
$exts = get_loaded_extensions();
162162
$ext_dir = ini_get('extension_dir');
@@ -173,7 +173,7 @@ index 4654ead998f..a36dbf0f24a 100755
173173
}
174174
}
175175
}
176-
@@ -957,7 +959,7 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
176+
@@ -963,7 +965,7 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
177177

178178
$failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep;
179179
$failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n";
@@ -182,7 +182,7 @@ index 4654ead998f..a36dbf0f24a 100755
182182

183183
if (!IS_WINDOWS) {
184184
/* If PHP_AUTOCONF is set, use it; otherwise, use 'autoconf'. */
185-
@@ -968,7 +970,9 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
185+
@@ -974,7 +976,9 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
186186
}
187187

188188
/* Always use the generated libtool - Mac OSX uses 'glibtool' */
@@ -193,7 +193,7 @@ index 4654ead998f..a36dbf0f24a 100755
193193

194194
/* Use shtool to find out if there is glibtool present (MacOSX) */
195195
$sys_libtool_path = shell_exec(__DIR__ . '/build/shtool path glibtool libtool');
196-
@@ -990,9 +994,17 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
196+
@@ -996,9 +1000,17 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
197197
}
198198

199199
$ldd = shell_exec("ldd $php 2>/dev/null");

patches/8.4/dmalloc.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See: https://github.com/php/php-src/pull/8465
1010
1 file changed, 2 insertions(+), 1 deletion(-)
1111

1212
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
13-
index 10c07787957..390d0da933b 100644
13+
index 68c4b3b411d..9fd6bfe0dd5 100644
1414
--- a/sapi/cli/php_cli_server.c
1515
+++ b/sapi/cli/php_cli_server.c
1616
@@ -15,6 +15,8 @@

patches/8.5/cmake.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ index e691bd3964b..191fcd70eb5 100644
154154
+CMakeLists.txt.user
155155
+CMakeScripts/
156156
diff --git a/run-tests.php b/run-tests.php
157-
index 171f6e2e5b6..ab664630f07 100755
157+
index ac5fc91118e..dc56eba1d15 100755
158158
--- a/run-tests.php
159159
+++ b/run-tests.php
160-
@@ -851,10 +851,12 @@ function write_information(array $user_tests, $phpdbg): void
160+
@@ -857,10 +857,12 @@ function write_information(array $user_tests, $phpdbg): void
161161
<?php
162162
$exts = get_loaded_extensions();
163163
$ext_dir = ini_get('extension_dir');
@@ -174,7 +174,7 @@ index 171f6e2e5b6..ab664630f07 100755
174174
}
175175
}
176176
}
177-
@@ -943,7 +945,7 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
177+
@@ -949,7 +951,7 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
178178

179179
$failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep;
180180
$failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n";
@@ -183,7 +183,7 @@ index 171f6e2e5b6..ab664630f07 100755
183183

184184
if (!IS_WINDOWS) {
185185
/* If PHP_AUTOCONF is set, use it; otherwise, use 'autoconf'. */
186-
@@ -954,7 +956,9 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
186+
@@ -960,7 +962,9 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
187187
}
188188

189189
/* Always use the generated libtool - Mac OSX uses 'glibtool' */
@@ -194,7 +194,7 @@ index 171f6e2e5b6..ab664630f07 100755
194194

195195
/* Use shtool to find out if there is glibtool present (MacOSX) */
196196
$sys_libtool_path = shell_exec(__DIR__ . '/build/shtool path glibtool libtool');
197-
@@ -976,9 +980,17 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
197+
@@ -982,9 +986,17 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
198198
}
199199

200200
$ldd = shell_exec("ldd $php 2>/dev/null");

patches/8.5/dmalloc.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See: https://github.com/php/php-src/pull/8465
1010
1 file changed, 2 insertions(+), 1 deletion(-)
1111

1212
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
13-
index 911cfd2bb59..754880d558d 100644
13+
index da6732f06e7..b4f701f74e6 100644
1414
--- a/sapi/cli/php_cli_server.c
1515
+++ b/sapi/cli/php_cli_server.c
1616
@@ -15,6 +15,8 @@

0 commit comments

Comments
 (0)