Skip to content

Commit 870aff5

Browse files
committed
Sync cache variable names and enable gdImageGetInterpolationMethod()
When using bundled libgd, gdImageGetInterpolationMethod() seems to be always available. When using external libgd, it is available as of libgd 2.1.1.
1 parent ea8abcc commit 870aff5

File tree

9 files changed

+52
-25
lines changed

9 files changed

+52
-25
lines changed

cmake/cmake/ConfigureChecks.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ else()
7777
check_include_files(resolv.h HAVE_RESOLV_H)
7878
endif()
7979

80-
check_include_files(strings.h HAVE_STRINGS_H)
80+
check_include_files(strings.h PHP_HAVE_STRINGS_H)
81+
set(HAVE_STRINGS_H ${PHP_HAVE_STRINGS_H})
82+
8183
check_include_files(sys/file.h HAVE_SYS_FILE_H)
8284
check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H)
8385
check_include_files(sys/ipc.h HAVE_SYS_IPC_H)
@@ -364,7 +366,10 @@ endblock()
364366

365367
check_symbol_exists(statvfs sys/statvfs.h HAVE_STATVFS)
366368
check_symbol_exists(std_syslog sys/syslog.h HAVE_STD_SYSLOG)
367-
check_symbol_exists(strcasecmp strings.h HAVE_STRCASECMP)
369+
370+
check_symbol_exists(strcasecmp strings.h PHP_HAVE_STRCASECMP)
371+
set(HAVE_STRCASECMP ${PHP_HAVE_STRCASECMP})
372+
368373
check_symbol_exists(symlink unistd.h HAVE_SYMLINK)
369374
check_symbol_exists(tzset time.h HAVE_TZSET)
370375
check_symbol_exists(unsetenv stdlib.h HAVE_UNSETENV)

cmake/cmake/platforms/Windows.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
3030
# PHP has nice() emulation implemented on Windows.
3131
set(HAVE_NICE TRUE)
3232

33-
# PHP defines strcasecmp in Zend/zend_config.w32.h.
34-
set(HAVE_STRCASECMP TRUE)
35-
3633
# PHP has syslog.h emulation implemented on Windows.
3734
set(HAVE_SYSLOG_H TRUE)
3835

@@ -48,6 +45,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
4845
# PHP has socketpair() emulation implemented on Windows.
4946
set(PHP_HAS_SOCKETPAIR TRUE)
5047

48+
# PHP defines strcasecmp in Zend/zend_config.w32.h.
49+
set(PHP_HAVE_STRCASECMP TRUE)
50+
5151
##############################################################################
5252
# To speed up the Windows build experience where configuration phase takes
5353
# much longer compared to POSIX-based environments, the following are always
@@ -139,7 +139,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
139139
set(HAVE_STD_SYSLOG FALSE)
140140
set(HAVE_STDDEF_H TRUE) # Defined by check_type_size().
141141
set(HAVE_STDINT_H TRUE) # Defined by check_type_size().
142-
set(HAVE_STRINGS_H FALSE)
143142
set(HAVE_STRLCAT FALSE)
144143
set(HAVE_STRLCPY FALSE)
145144
set(HAVE_STRNLEN TRUE)
@@ -265,6 +264,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
265264
set(PHP_HAVE_CREATEPROCESS TRUE)
266265
set(PHP_HAVE_FORK FALSE)
267266
set(PHP_HAVE_GRP_H FALSE)
267+
set(PHP_HAVE_STRINGS_H FALSE)
268268
set(PHP_HAVE_UNISTD_H FALSE)
269269
set(PHP_SAPI_CLI_HAVE_PS_STRINGS FALSE)
270270
set(PHP_SAPI_PHPDBG_HAS_UFFDIO_WRITEPROTECT_MODE_WP FALSE)

cmake/ext/curl/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ if(
152152
/* No SSL support */
153153
return 1;
154154
}
155-
]] PHP_EXT_CURL_HAS_CURL_OLD_OPENSSL)
155+
]] PHP_EXT_CURL_HAVE_CURL_OLD_OPENSSL)
156156
cmake_pop_check_state()
157+
set(HAVE_CURL_OLD_OPENSSL ${PHP_EXT_CURL_HAVE_CURL_OLD_OPENSSL})
157158

158-
if(NOT PHP_EXT_CURL_HAS_CURL_OLD_OPENSSL)
159+
if(NOT PHP_EXT_CURL_HAVE_CURL_OLD_OPENSSL)
159160
message(CHECK_FAIL "no")
160161
else()
161-
set(HAVE_CURL_OLD_OPENSSL TRUE)
162162
message(CHECK_PASS "yes")
163163
find_package(OpenSSL ${PHP_OPENSSL_MIN_VERSION})
164164
set_package_properties(
@@ -173,7 +173,8 @@ if(
173173
if(TARGET OpenSSL::Crypto)
174174
cmake_push_check_state(RESET)
175175
set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto)
176-
check_include_files(openssl/crypto.h HAVE_OPENSSL_CRYPTO_H)
176+
check_include_files(openssl/crypto.h PHP_EXT_CURL_HAVE_OPENSSL_CRYPTO_H)
177+
set(HAVE_OPENSSL_CRYPTO_H ${PHP_EXT_CURL_HAVE_OPENSSL_CRYPTO_H})
177178
cmake_pop_check_state()
178179
endif()
179180
endif()

cmake/ext/fileinfo/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ cmake_push_check_state(RESET)
9494
check_symbol_exists(strcasestr string.h PHP_EXT_FILEINFO_HAVE_STRCASESTR)
9595
set(HAVE_STRCASESTR ${PHP_EXT_FILEINFO_HAVE_STRCASESTR})
9696
cmake_pop_check_state()
97-
if(NOT HAVE_STRCASESTR)
97+
if(NOT PHP_EXT_FILEINFO_HAVE_STRCASESTR)
9898
message(STATUS "Using libmagic strcasestr implementation")
9999
target_sources(php_ext_fileinfo PRIVATE libmagic/strcasestr.c)
100100
endif()

cmake/ext/gd/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ if(NOT PHP_EXT_GD_EXTERNAL)
338338

339339
set(HAVE_LIBPNG TRUE)
340340
set(HAVE_GD_PNG TRUE)
341+
set(HAVE_GD_GET_INTERPOLATION TRUE)
341342

342343
if(PHP_EXT_GD_AVIF)
343344
find_package(libavif 0.8.2)
@@ -496,13 +497,18 @@ else()
496497
cmake_push_check_state(RESET)
497498
set(CMAKE_REQUIRED_LIBRARIES GD::GD)
498499

499-
check_symbol_exists(gdFontCacheShutdown gd.h HAVE_GD_FREETYPE)
500-
check_symbol_exists(gdVersionString gd.h HAVE_GD_LIBVERSION)
500+
check_symbol_exists(gdFontCacheShutdown gd.h PHP_EXT_GD_HAVE_GD_FREETYPE)
501+
set(HAVE_GD_FREETYPE ${PHP_EXT_GD_HAVE_GD_FREETYPE})
502+
503+
check_symbol_exists(gdVersionString gd.h PHP_EXT_GD_HAVE_GD_LIBVERSION)
504+
set(HAVE_GD_LIBVERSION ${PHP_EXT_GD_HAVE_GD_LIBVERSION})
505+
501506
check_symbol_exists(
502507
gdImageGetInterpolationMethod
503508
gd.h
504-
HAVE_GD_GET_INTERPOLATION
509+
PHP_EXT_GD_HAVE_GD_GET_INTERPOLATION
505510
)
511+
set(HAVE_GD_GET_INTERPOLATION ${PHP_EXT_GD_HAVE_GD_GET_INTERPOLATION})
506512
cmake_pop_check_state()
507513
endif()
508514
endif()

cmake/ext/gd/cmake/config.h.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
/* Define to 1 if gd extension has FreeType support. */
1212
#cmakedefine HAVE_GD_FREETYPE 1
1313

14-
/* Define to 1 if GD library has the 'gdImageGetInterpolationMethod' function.
15-
*/
14+
/* Define to 1 if GD library has the 'gdImageGetInterpolationMethod' function
15+
(available as of libgd 2.1.1). */
1616
#cmakedefine HAVE_GD_GET_INTERPOLATION 1
1717

1818
/* Define to 1 if gd extension has JPEG support. */
1919
#cmakedefine HAVE_GD_JPG 1
2020

21-
/* Define to 1 if GD library has the 'gdVersionString' function. */
21+
/* Define to 1 if GD library has the 'gdVersionString' function (available as
22+
of libgd 2.1.1). */
2223
#cmakedefine HAVE_GD_LIBVERSION 1
2324

2425
/* Define to 1 if gd extension has PNG support. */

cmake/ext/ldap/CMakeLists.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,23 @@ if(TARGET LDAP::LDAP)
9999
set(CMAKE_REQUIRED_LIBRARIES LDAP::LDAP)
100100

101101
# Sanity check.
102-
check_symbol_exists(ldap_sasl_bind_s ldap.h PHP_EXT_LDAP_HAS_LDAP_SASL_BIND_S)
103-
if(NOT PHP_EXT_LDAP_HAS_LDAP_SASL_BIND_S)
102+
check_symbol_exists(
103+
ldap_sasl_bind_s
104+
ldap.h
105+
PHP_EXT_LDAP_HAVE_LDAP_SASL_BIND_S
106+
)
107+
if(NOT PHP_EXT_LDAP_HAVE_LDAP_SASL_BIND_S)
104108
# Fallback to deprecated ldap_simple_bind_s().
105-
check_symbol_exists(ldap_simple_bind_s ldap.h PHP_HAS_LDAP_SIMPLE_BIND_S)
109+
check_symbol_exists(
110+
ldap_simple_bind_s
111+
ldap.h
112+
PHP_EXT_LDAP_HAVE_LDAP_SIMPLE_BIND_S
113+
)
106114
endif()
107-
if(NOT PHP_EXT_LDAP_HAS_LDAP_SASL_BIND_S AND NOT PHP_HAS_LDAP_SIMPLE_BIND_S)
115+
if(
116+
NOT PHP_EXT_LDAP_HAVE_LDAP_SASL_BIND_S
117+
AND NOT PHP_EXT_LDAP_HAVE_LDAP_SIMPLE_BIND_S
118+
)
108119
message(
109120
FATAL_ERROR
110121
"LDAP sanity check failed: neither 'ldap_sasl_bind_s()' nor "

cmake/ext/mbstring/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ if(PHP_EXT_MBSTRING_MBREGEX)
154154
{
155155
return (intptr_t)(ONIG_ENCODING_KOI8 + 1);
156156
}
157-
]] PHP_ONIG_KOI8)
157+
]] PHP_EXT_MBSTRING_ONIG_KOI8)
158158
cmake_pop_check_state()
159-
if(PHP_ONIG_KOI8)
159+
if(PHP_EXT_MBSTRING_ONIG_KOI8)
160160
message(CHECK_PASS "no")
161161
else()
162162
message(CHECK_FAIL "yes")

cmake/ext/mbstring/libmbfl/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ target_compile_definitions(
102102
)
103103

104104
# The libmbfl configuration header.
105-
check_include_files(strings.h HAVE_STRINGS_H)
106-
check_symbol_exists(strcasecmp strings.h HAVE_STRCASECMP)
105+
check_include_files(strings.h PHP_HAVE_STRINGS_H)
106+
set(HAVE_STRINGS ${PHP_HAVE_STRINGS_H})
107+
108+
check_symbol_exists(strcasecmp strings.h PHP_HAVE_STRCASECMP)
109+
set(HAVE_STRCASECMP ${PHP_HAVE_STRCASECMP})
107110

108111
cmake_path(
109112
RELATIVE_PATH

0 commit comments

Comments
 (0)