1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Autotools: Replace uname with host_alias for finding Solaris (#15770)

This wraps checks in AC_CACHE_CHECK and replaces the "uname -sr" command
with simpler $host_alias as it is already set by the config.guess script
properly.
This commit is contained in:
Peter Kokot
2024-09-06 08:44:10 +02:00
committed by GitHub
parent 824f55ae84
commit bcbf7bea92
2 changed files with 16 additions and 19 deletions

View File

@@ -1301,17 +1301,14 @@ dnl
dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a
dnl component of the path has execute but not read permissions.
dnl
AC_DEFUN([PHP_BROKEN_GETCWD],[
AC_MSG_CHECKING([for broken getcwd])
os=$(uname -sr 2>/dev/null)
case $os in
SunOS*[)]
AC_DEFINE([HAVE_BROKEN_GETCWD], [1],
[Define to 1 if system has a broken 'getcwd'.])
AC_MSG_RESULT([yes]);;
*[)]
AC_MSG_RESULT([no]);;
esac
AC_DEFUN([PHP_BROKEN_GETCWD], [
AC_CACHE_CHECK([for broken getcwd], [php_cv_func_getcwd_broken],
[AS_CASE([$host_alias],
[*solaris*], [php_cv_func_getcwd_broken=yes],
[php_cv_func_getcwd_broken=no])])
AS_VAR_IF([php_cv_func_getcwd_broken], [yes],
[AC_DEFINE([HAVE_BROKEN_GETCWD], [1],
[Define to 1 if system has a broken 'getcwd'.])])
])
dnl

View File

@@ -9,14 +9,14 @@ if test "$PHP_CGI" != "no"; then
dnl BSD systems.
AC_CHECK_MEMBERS([struct sockaddr_un.sun_len],,,[#include <sys/un.h>])
AC_MSG_CHECKING([whether cross-process locking is required by accept()])
AS_CASE([$(uname -sr)],
[SunOS\ 5.*], [
AC_MSG_RESULT([yes])
AC_DEFINE([USE_LOCKING], [1],
[Define to 1 if cross-process locking is required by 'accept()'.])
],
[AC_MSG_RESULT([no])])
AC_CACHE_CHECK([whether cross-process locking is required by accept()],
[php_cv_have_cross_process_locking],
[AS_CASE([$host_alias],
[*solaris*], [php_cv_have_cross_process_locking=yes],
[php_cv_have_cross_process_locking=no])])
AS_VAR_IF([php_cv_have_cross_process_locking], [yes],
[AC_DEFINE([USE_LOCKING], [1],
[Define to 1 if cross-process locking is required by 'accept()'.])])
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/cgi/Makefile.frag])