]> granicus.if.org Git - php/commitdiff
Clean up some unused code (and fix some comments) in build scripts
authorAlex Dowad <alexinbeijing@gmail.com>
Tue, 26 May 2020 17:56:52 +0000 (19:56 +0200)
committerAlex Dowad <alexinbeijing@gmail.com>
Fri, 19 Jun 2020 20:04:52 +0000 (22:04 +0200)
- 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.

Zend/Zend.m4
build/php.m4
configure.ac
ext/standard/string.c

index b0f913aac3e098b62adfef441ceb88efe6fd398d..76f9dd8810c74e7fbc64883f8d9c7dc0d7f023b3 100644 (file)
@@ -146,7 +146,7 @@ _LT_AC_TRY_DLOPEN_SELF([
 ])
 
 dnl Checks for library functions.
-AC_CHECK_FUNCS(getpid kill finite sigsetjmp)
+AC_CHECK_FUNCS(getpid kill sigsetjmp)
 
 ZEND_CHECK_FLOAT_PRECISION
 
index 6aaf739815de9a3334ceab64361dc16aa5622e96..d181bbeeba1d12beb7fb2a5ce042e3812a8301cf 100644 (file)
@@ -870,7 +870,7 @@ AC_DEFUN([PHP_SELECT_SAPI],[
 +--------------------------------------------------------------------+
 |                        *** ATTENTION ***                           |
 |                                                                    |
-| You've configured multiple SAPIs to be build. You can build only   |
+| You've configured multiple SAPIs to be built. You can build only   |
 | one SAPI module plus CGI, CLI and FPM binaries at the same time.   |
 +--------------------------------------------------------------------+
 ])
@@ -2218,8 +2218,8 @@ AC_DEFUN([PHP_DETECT_SUNCC],[
 dnl
 dnl PHP_CRYPT_R_STYLE
 dnl
-dnl Detect the style of crypt_r() is any is available see
-dnl APR_CHECK_CRYPT_R_STYLE() for original version.
+dnl Detect the style of crypt_r() if any is available.
+dnl See APR_CHECK_CRYPT_R_STYLE() for original version.
 dnl
 AC_DEFUN([PHP_CRYPT_R_STYLE],
 [
index e830acfb25582e9f6ad9854257feeaac12c4035b..99e04e6c1d0be4eeb182dda4db6acd67f94997c0 100644 (file)
@@ -43,8 +43,6 @@ AH_TOP([
 #define ZEND_DLIMPORT
 ])
 AH_BOTTOM([
-#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
-
 #include <stdlib.h>
 
 #ifdef HAVE_SYS_TYPES_H
@@ -61,8 +59,6 @@ AH_BOTTOM([
 
 #include <string.h>
 
-#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
-
 #endif /* PHP_CONFIG_H */
 ])
 
@@ -372,7 +368,6 @@ dnl ----------------------------------------------------------------------------
 
 dnl QNX requires unix.h to allow functions in libunix to work properly.
 AC_CHECK_HEADERS([ \
-inttypes.h \
 stdint.h \
 dirent.h \
 sys/param.h \
@@ -389,8 +384,6 @@ grp.h \
 ieeefp.h \
 langinfo.h \
 malloc.h \
-monetary.h \
-netdb.h \
 poll.h \
 pty.h \
 pwd.h \
@@ -398,7 +391,6 @@ resolv.h \
 strings.h \
 syslog.h \
 sysexits.h \
-sys/auxv.h \
 sys/ioctl.h \
 sys/file.h \
 sys/mman.h \
@@ -415,7 +407,6 @@ sys/sysexits.h \
 sys/uio.h \
 sys/wait.h \
 sys/loadavg.h \
-termios.h \
 unistd.h \
 unix.h \
 utime.h \
@@ -1272,28 +1263,14 @@ AC_SUBST(EXPANDED_LOCALSTATEDIR)
 AC_SUBST(EXPANDED_PHP_CONFIG_FILE_PATH)
 AC_SUBST(EXPANDED_PHP_CONFIG_FILE_SCAN_DIR)
 
-if test -n "$php_ldflags_add_usr_lib"; then
-  PHP_RPATHS="$PHP_RPATHS /usr/lib"
-fi
-
 PHP_UTILIZE_RPATHS
 
-if test -z "$php_ldflags_add_usr_lib"; then
-  PHP_REMOVE_USR_LIB(PHP_LDFLAGS)
-  PHP_REMOVE_USR_LIB(LDFLAGS)
-fi
+PHP_REMOVE_USR_LIB(PHP_LDFLAGS)
+PHP_REMOVE_USR_LIB(LDFLAGS)
 
 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
 EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
 
-dnl SOURCE_DATE_EPOCH for reproducible builds
-dnl https://reproducible-builds.org/specs/source-date-epoch/
-PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d 2>/dev/null`
-if test $? -ne 0 ; then
-PHP_BUILD_DATE=`date -u +%Y-%m-%d`
-fi
-AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
-
 UNAME=`uname -a | xargs`
 PHP_UNAME=${PHP_UNAME:-$UNAME}
 AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
@@ -1356,7 +1333,6 @@ PHP_SUBST(LIBTOOL)
 PHP_SUBST(LN_S)
 PHP_SUBST_OLD(NATIVE_RPATHS)
 PHP_SUBST_OLD(PEAR_INSTALLDIR)
-PHP_SUBST(PHP_BUILD_DATE)
 PHP_SUBST_OLD(PHP_LDFLAGS)
 PHP_SUBST_OLD(PHP_LIBS)
 PHP_SUBST(OVERALL_TARGET)
index 8a8c889f08209ecb78584398c8ead22a63ecbc62..1178b08730bcdf141343ba7c43b09168fa927f29 100644 (file)
@@ -25,9 +25,6 @@
 #ifdef HAVE_LANGINFO_H
 # include <langinfo.h>
 #endif
-#ifdef HAVE_MONETARY_H
-# include <monetary.h>
-#endif
 
 /*
  * This define is here because some versions of libintl redefine setlocale