@@ -26,6 +26,7 @@ include(CheckIncludeFiles)
2626include (CheckSourceCompiles)
2727include (CheckSymbolExists)
2828include (CMakeDependentOption)
29+ include (CMakePushCheckState)
2930include (FeatureSummary)
3031
3132option (PHP_SAPI_CLI "Enable the CLI SAPI module" ON )
@@ -59,24 +60,30 @@ endif()
5960check_symbol_exists(setproctitle "unistd.h;stdlib.h" HAVE_SETPROCTITLE)
6061check_include_files(sys/pstat.h HAVE_SYS_PSTAT_H)
6162
63+ # For some BSD-based systems.
6264message (CHECK_START "Checking for PS_STRINGS" )
63- check_source_compiles(C [[
64- #include <machine/vmparam.h>
65- #include <sys/exec.h>
66-
67- int main(void)
68- {
69- PS_STRINGS->ps_nargvstr = 1;
70- PS_STRINGS->ps_argvstr = "foo";
71-
72- return 0;
73- }
74- ]] HAVE_PS_STRINGS)
75- if (HAVE_PS_STRINGS)
65+ cmake_push_check_state(RESET)
66+ set (CMAKE_REQUIRED_QUIET TRUE )
67+
68+ check_source_compiles(C [[
69+ #include <machine/vmparam.h> // For old BSD.
70+ #include <sys/exec.h>
71+
72+ int main(void)
73+ {
74+ PS_STRINGS->ps_nargvstr = 1;
75+ PS_STRINGS->ps_argvstr = "foo";
76+
77+ return 0;
78+ }
79+ ]] PHP_SAPI_CLI_HAVE_PS_STRINGS)
80+ cmake_pop_check_state()
81+ if (PHP_SAPI_CLI_HAVE_PS_STRINGS)
7682 message (CHECK_PASS "yes" )
7783else ()
7884 message (CHECK_FAIL "no" )
7985endif ()
86+ set (HAVE_PS_STRINGS ${PHP_SAPI_CLI_HAVE_PS_STRINGS} )
8087
8188################################################################################
8289# The cli SAPI.
0 commit comments