Skip to content

Commit 5b1be8a

Browse files
committed
Use target host information; shorten output
1 parent f9df77a commit 5b1be8a

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

configure.ac

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,16 +1412,6 @@ AC_ARG_VAR([PHP_UNAME],
14121412
AS_VAR_IF([PHP_UNAME],, [PHP_UNAME=$(uname -a | xargs)])
14131413
AC_DEFINE_UNQUOTED([PHP_UNAME], ["$PHP_UNAME"], [The 'uname -a' output.])
14141414

1415-
AC_ARG_VAR([PHP_UNAME_S],
1416-
[Operating system name (defaults to the 'uname -s' output)])
1417-
AS_VAR_IF([PHP_UNAME_S],, [PHP_UNAME_S=$(uname -s | xargs)])
1418-
AC_DEFINE_UNQUOTED([PHP_UNAME_S], ["$PHP_UNAME_S"], [The 'uname -s' output.])
1419-
1420-
AC_ARG_VAR([PHP_UNAME_R],
1421-
[Operating system version (defaults to the 'uname -r' output)])
1422-
AS_VAR_IF([PHP_UNAME_R],, [PHP_UNAME_R=$(uname -r | xargs)])
1423-
AC_DEFINE_UNQUOTED([PHP_UNAME_R], ["$PHP_UNAME_R"], [The 'uname -r' output.])
1424-
14251415
PHP_OS=$(uname | xargs)
14261416
AC_DEFINE_UNQUOTED([PHP_OS], ["$PHP_OS"], [The 'uname' output.])
14271417

@@ -1447,6 +1437,11 @@ AS_VAR_IF([PHP_BUILD_ARCH],,,
14471437
[AC_DEFINE_UNQUOTED([PHP_BUILD_ARCH], ["$PHP_BUILD_ARCH"],
14481438
[The build architecture.])])
14491439

1440+
AC_ARG_VAR([PHP_BUILD_OS], [The build OS])
1441+
AS_VAR_IF([PHP_BUILD_OS],,,
1442+
[AC_DEFINE_UNQUOTED([PHP_BUILD_OS], ["$PHP_BUILD_OS"],
1443+
[The build OS.])])
1444+
14501445
PHP_SUBST([PHP_FASTCGI_OBJS])
14511446
PHP_SUBST([PHP_SAPI_OBJS])
14521447
PHP_SUBST([PHP_BINARY_OBJS])

main/main.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,18 @@ PHPAPI char *php_get_version(sapi_module_struct *sapi_module)
138138
#endif
139139
#ifdef PHP_BUILD_ARCH
140140
" " PHP_BUILD_ARCH
141-
#else
142-
" Unknown arch"
143141
#endif
144-
);
145-
smart_string_appends(&version_info, "Copyright (c) The PHP Group\n");
146-
smart_string_append_printf(&version_info, "Built %s\n",
147-
#ifdef PHP_BUILD_PROVIDER
148-
"by " PHP_BUILD_PROVIDER
149-
#else
150-
"on " PHP_UNAME_S " " PHP_UNAME_R
142+
#ifdef PHP_BUILD_OS
143+
" " PHP_BUILD_OS
151144
#endif
152145
#ifdef PHP_BUILD_COMPILER
153-
" (" PHP_BUILD_COMPILER ")"
154-
#else
155-
""
146+
" " PHP_BUILD_COMPILER
156147
#endif
157148
);
149+
smart_string_appends(&version_info, "Copyright (c) The PHP Group\n");
150+
if (php_build_provider()) {
151+
smart_string_append_printf(&version_info, "Built by %s\n", php_build_provider());
152+
}
158153
smart_string_appends(&version_info, get_zend_version());
159154
smart_string_0(&version_info);
160155

main/php_main.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,24 @@ PHPAPI bool php_tsrm_startup(void);
110110
# endif
111111
#endif
112112

113+
#ifndef PHP_BUILD_OS
114+
# if defined(PHP_WIN32)
115+
# define PHP_BUILD_OS "WINNT"
116+
# elif defined(__APPLE__)
117+
# define PHP_BUILD_OS "Darwin"
118+
# elif defined(__linux__)
119+
# define PHP_BUILD_OS "Linux"
120+
# elif defined(__FreeBSD__)
121+
# define PHP_BUILD_OS "FreeBSD"
122+
# elif defined(__NetBSD__)
123+
# define PHP_BUILD_OS "NetBSD"
124+
# elif defined(__OpenBSD__)
125+
# define PHP_BUILD_OS "OpenBSD"
126+
#elif defined(__sun__)
127+
# define PHP_BUILD_OS "Solaris"
128+
# endif
129+
#endif
130+
113131
END_EXTERN_C()
114132

115133
#endif

win32/build/confutils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ extension_module_ptrs = "";
133133
var oss = wmiservice.ExecQuery("Select * from Win32_OperatingSystem");
134134
var os = oss.ItemIndex(0);
135135
AC_DEFINE("PHP_BUILD_SYSTEM", os.Caption + " [" + os.Version + "]", "The system that PHP was built on.");
136-
AC_DEFINE("PHP_UNAME_S", os.Caption, "The system name that PHP was built on.");
137-
AC_DEFINE("PHP_UNAME_R", os.Version, "The system version that PHP was built on.");
138136
var build_provider = WshShell.Environment("Process").Item("PHP_BUILD_PROVIDER");
139137
if (build_provider) {
140138
AC_DEFINE("PHP_BUILD_PROVIDER", build_provider, "The PHP build provider information.");

0 commit comments

Comments
 (0)