Skip to content

Commit 7e2147b

Browse files
committed
Clean up some unused code (and fix some comments) in build scripts
- Fix typo in build/php.m4 - Nothing uses HAVE_INTTYPES_H; so remove check for header file - Nothing defines ZEND_ACCONFIG_H_NO_C_PROTOS; so remove #ifndef - `format_money` was removed in 2019, so <monetary.h> no longer needed - Nothing uses HAVE_NETDB_H; so remove check for header file - Nothing checks HAVE_TERMIOS_H; so remove check for header file (This was actually added when Wez Furlong was adding the original implementation of PTY support in `proc_open`, since replaced.) - Nothing checks HAVE_SYS_AUXV_H; so remove check for header file - PHP_BUILD_DATE variable is not used for anything, so remove it This variable was added to the Makefile, but from there, was not used for anything. The comments suggest it was intended to allow 'reproducible builds'. Presumably, this means that if a bug is found in a PHP binary somewhere, one could look at the Makefile which it was built from, see the date, and then could check the same code version out from source control. But... there can easily be multiple commits to the repo in the same day. Also, what makes us think that the Makefile which a binary was built from will be easily available? Besides, ext/standard/info.c already embeds the build date and time in each binary... but it does it using `__DATE__` and `__TIME__` (see `php_print_info`). - Nothing checks HAVE_FINITE; so don't check for function - Grammar fix to comment in build/php.m4 - Nothing sets $php_ldflags_add_usr_lib variable in configure, so remove conditional This was added in 2002, when Rasmus was having difficulty building PHP on some host and needed to have /usr/lib in the rpath. It was never documented and probably has never been used by anyone else.
1 parent aa2e68c commit 7e2147b

File tree

4 files changed

+6
-33
lines changed

4 files changed

+6
-33
lines changed

Zend/Zend.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ _LT_AC_TRY_DLOPEN_SELF([
146146
])
147147
148148
dnl Checks for library functions.
149-
AC_CHECK_FUNCS(getpid kill finite sigsetjmp)
149+
AC_CHECK_FUNCS(getpid kill sigsetjmp)
150150
151151
ZEND_CHECK_FLOAT_PRECISION
152152

build/php.m4

+3-3
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ AC_DEFUN([PHP_SELECT_SAPI],[
870870
+--------------------------------------------------------------------+
871871
| *** ATTENTION *** |
872872
| |
873-
| You've configured multiple SAPIs to be build. You can build only |
873+
| You've configured multiple SAPIs to be built. You can build only |
874874
| one SAPI module plus CGI, CLI and FPM binaries at the same time. |
875875
+--------------------------------------------------------------------+
876876
])
@@ -2218,8 +2218,8 @@ AC_DEFUN([PHP_DETECT_SUNCC],[
22182218
dnl
22192219
dnl PHP_CRYPT_R_STYLE
22202220
dnl
2221-
dnl Detect the style of crypt_r() is any is available see
2222-
dnl APR_CHECK_CRYPT_R_STYLE() for original version.
2221+
dnl Detect the style of crypt_r() if any is available.
2222+
dnl See APR_CHECK_CRYPT_R_STYLE() for original version.
22232223
dnl
22242224
AC_DEFUN([PHP_CRYPT_R_STYLE],
22252225
[

configure.ac

+2-26
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ AH_TOP([
4343
#define ZEND_DLIMPORT
4444
])
4545
AH_BOTTOM([
46-
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
47-
4846
#include <stdlib.h>
4947
5048
#ifdef HAVE_SYS_TYPES_H
@@ -61,8 +59,6 @@ AH_BOTTOM([
6159
6260
#include <string.h>
6361
64-
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
65-
6662
#endif /* PHP_CONFIG_H */
6763
])
6864

@@ -372,7 +368,6 @@ dnl ----------------------------------------------------------------------------
372368

373369
dnl QNX requires unix.h to allow functions in libunix to work properly.
374370
AC_CHECK_HEADERS([ \
375-
inttypes.h \
376371
stdint.h \
377372
dirent.h \
378373
sys/param.h \
@@ -389,16 +384,13 @@ grp.h \
389384
ieeefp.h \
390385
langinfo.h \
391386
malloc.h \
392-
monetary.h \
393-
netdb.h \
394387
poll.h \
395388
pty.h \
396389
pwd.h \
397390
resolv.h \
398391
strings.h \
399392
syslog.h \
400393
sysexits.h \
401-
sys/auxv.h \
402394
sys/ioctl.h \
403395
sys/file.h \
404396
sys/mman.h \
@@ -415,7 +407,6 @@ sys/sysexits.h \
415407
sys/uio.h \
416408
sys/wait.h \
417409
sys/loadavg.h \
418-
termios.h \
419410
unistd.h \
420411
unix.h \
421412
utime.h \
@@ -1272,28 +1263,14 @@ AC_SUBST(EXPANDED_LOCALSTATEDIR)
12721263
AC_SUBST(EXPANDED_PHP_CONFIG_FILE_PATH)
12731264
AC_SUBST(EXPANDED_PHP_CONFIG_FILE_SCAN_DIR)
12741265

1275-
if test -n "$php_ldflags_add_usr_lib"; then
1276-
PHP_RPATHS="$PHP_RPATHS /usr/lib"
1277-
fi
1278-
12791266
PHP_UTILIZE_RPATHS
12801267

1281-
if test -z "$php_ldflags_add_usr_lib"; then
1282-
PHP_REMOVE_USR_LIB(PHP_LDFLAGS)
1283-
PHP_REMOVE_USR_LIB(LDFLAGS)
1284-
fi
1268+
PHP_REMOVE_USR_LIB(PHP_LDFLAGS)
1269+
PHP_REMOVE_USR_LIB(LDFLAGS)
12851270

12861271
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
12871272
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
12881273

1289-
dnl SOURCE_DATE_EPOCH for reproducible builds
1290-
dnl https://reproducible-builds.org/specs/source-date-epoch/
1291-
PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d 2>/dev/null`
1292-
if test $? -ne 0 ; then
1293-
PHP_BUILD_DATE=`date -u +%Y-%m-%d`
1294-
fi
1295-
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
1296-
12971274
UNAME=`uname -a | xargs`
12981275
PHP_UNAME=${PHP_UNAME:-$UNAME}
12991276
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
@@ -1356,7 +1333,6 @@ PHP_SUBST(LIBTOOL)
13561333
PHP_SUBST(LN_S)
13571334
PHP_SUBST_OLD(NATIVE_RPATHS)
13581335
PHP_SUBST_OLD(PEAR_INSTALLDIR)
1359-
PHP_SUBST(PHP_BUILD_DATE)
13601336
PHP_SUBST_OLD(PHP_LDFLAGS)
13611337
PHP_SUBST_OLD(PHP_LIBS)
13621338
PHP_SUBST(OVERALL_TARGET)

ext/standard/string.c

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
#ifdef HAVE_LANGINFO_H
2626
# include <langinfo.h>
2727
#endif
28-
#ifdef HAVE_MONETARY_H
29-
# include <monetary.h>
30-
#endif
3128

3229
/*
3330
* This define is here because some versions of libintl redefine setlocale

0 commit comments

Comments
 (0)