Skip to content

Commit bcbf7be

Browse files
authored
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.
1 parent 824f55a commit bcbf7be

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

build/php.m4

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,17 +1301,14 @@ dnl
13011301
dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a
13021302
dnl component of the path has execute but not read permissions.
13031303
dnl
1304-
AC_DEFUN([PHP_BROKEN_GETCWD],[
1305-
AC_MSG_CHECKING([for broken getcwd])
1306-
os=$(uname -sr 2>/dev/null)
1307-
case $os in
1308-
SunOS*[)]
1309-
AC_DEFINE([HAVE_BROKEN_GETCWD], [1],
1310-
[Define to 1 if system has a broken 'getcwd'.])
1311-
AC_MSG_RESULT([yes]);;
1312-
*[)]
1313-
AC_MSG_RESULT([no]);;
1314-
esac
1304+
AC_DEFUN([PHP_BROKEN_GETCWD], [
1305+
AC_CACHE_CHECK([for broken getcwd], [php_cv_func_getcwd_broken],
1306+
[AS_CASE([$host_alias],
1307+
[*solaris*], [php_cv_func_getcwd_broken=yes],
1308+
[php_cv_func_getcwd_broken=no])])
1309+
AS_VAR_IF([php_cv_func_getcwd_broken], [yes],
1310+
[AC_DEFINE([HAVE_BROKEN_GETCWD], [1],
1311+
[Define to 1 if system has a broken 'getcwd'.])])
13151312
])
13161313

13171314
dnl

sapi/cgi/config9.m4

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ if test "$PHP_CGI" != "no"; then
99
dnl BSD systems.
1010
AC_CHECK_MEMBERS([struct sockaddr_un.sun_len],,,[#include <sys/un.h>])
1111

12-
AC_MSG_CHECKING([whether cross-process locking is required by accept()])
13-
AS_CASE([$(uname -sr)],
14-
[SunOS\ 5.*], [
15-
AC_MSG_RESULT([yes])
16-
AC_DEFINE([USE_LOCKING], [1],
17-
[Define to 1 if cross-process locking is required by 'accept()'.])
18-
],
19-
[AC_MSG_RESULT([no])])
12+
AC_CACHE_CHECK([whether cross-process locking is required by accept()],
13+
[php_cv_have_cross_process_locking],
14+
[AS_CASE([$host_alias],
15+
[*solaris*], [php_cv_have_cross_process_locking=yes],
16+
[php_cv_have_cross_process_locking=no])])
17+
AS_VAR_IF([php_cv_have_cross_process_locking], [yes],
18+
[AC_DEFINE([USE_LOCKING], [1],
19+
[Define to 1 if cross-process locking is required by 'accept()'.])])
2020

2121
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/cgi/Makefile.frag])
2222

0 commit comments

Comments
 (0)