Commit Graph

69 Commits

Author SHA1 Message Date
Peter Kokot
7dd62811ce Remove HAVE_STDLIB_H
The C89 and later standard defines the `<stdlib.h>` header as part of
the standard headers [1] and on current systems it is always present
and the `HAVE_STDLIB_H` symbol can be removed.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-16 20:53:53 +02:00
Peter Kokot
dcc529aff4 Remove HAVE_SYS_VARARGS_H
Outdated systems used to provide the `<varargs.h>` and in case of PHP
`<sys/varargs.h>`. [1]

Current systems have `<stdarg.h>` which is also a C89 standard header
and systems have it always present. [2]

[1] https://en.wikipedia.org/wiki/Stdarg.h#varargs.h
[2] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
2018-09-16 20:50:20 +02:00
Richard Fussenegger
a25171b96d Silence ar warning 2018-09-15 20:42:25 +02:00
Christoph M. Becker
aaae9c66db Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76510: file_exists() stopped working for phar://
2018-09-11 12:23:50 +02:00
Christoph M. Becker
b117feeb2b Fix #76510: file_exists() stopped working for phar://
We work around a strlen() optimization bug in GCC 8[1] by checking
whether the used GCC exhibits the broken behavior, and if so by
disabling `optimize-strlen`.

[1] <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914>
2018-09-11 12:23:20 +02:00
Peter Kokot
77118fc925 Remove HAVE_ASSERT_H
The `<assert.h>` header file is part of the standard C89 headers [1] and
on older systems there needed to be also a manual check if header is
present.

Since PHP requires at least C89 manual check and the `HAVE_ASSERT_H`
symbol defined by Autoconf in configure.ac can be both removed [2].

This patch also removes unused <assert.h> includes where c files don't
use the `assert()` macro.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-09 09:43:03 +02:00
Peter Kokot
29dc0470c8
Remove AC_FUNC_UTIME_NULL
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems, including the AC_FUNC_UTIME_NULL.

This macro checks if `utime(file, NULL)` sets file's timestamp to the
current time and defines the `HAVE_UTIME_NULL` symbol. This check was
relevant on very old systems (for example, 4.3BSD released in 1986) and
today can be omitted for systems with utime since it should be well
supported by now. [2]

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-04 12:03:34 +02:00
Peter Kokot
eff22dc511
Remove AC_HEADER_DIRENT
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_DIRENT`.

This macro checks which header defines the `DIR` type. If `<dirent.h>`
is available it defines the `HAVE_DIRENT_H` symbol. Since the `<dirent.h>`
header is already checked in the `configure.ac`, this check is not needed
anymore. This macro also additionally checks for SCO Xenix (discontinued,
latest release 1989) dir and x libraries. [2]

Commit 6ed790685f introduced also
`<sys/dir.h>`. This header exists from times of UNIX System V and
provided definition of DIR type on these systems such as 4.3BSD.
Today `<sys/dir.h>` is kept for backwards compatibility and includes
the `<dirent.h>` on current systems. With `dirent.h>` present this
include is no longer required.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html

Remove unused dirent.h includes
2018-09-04 12:01:24 +02:00
Peter Kokot
ef12e96215 Remove AC_FUNC_VPRINTF
Autoconf 2.59d (released in 2006) 1 started promoting several macros
as not relevant for newer systems anymore, including the AC_FUNC_VPRINTF.

This macro checks for presence of the vprint function otherwise checks
for presence of the _doprnt function. This check was relevant on very
old systems and today can be omitted since it should be well supported
by now. [2]

Also PHP doesn't use the HAVE_VPRINTF or HAVE_DOPRNT symbols.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-08-29 21:31:55 +02:00
Peter Kokot
cbc785dc8c Remove AC_STRUCT_TM macro
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_STRUCT_TM`.

This macro checks if `struct tm` is defined in either `<sys/time.h>` or
`<time.h>` and defines the `TM_IN_SYS_TIME` symbol accordingly. This
check was relevant in times before the C89 for some embedded systems,
microcontrollers or very old systems. For newer systems it can be
avoided and the `<time.h>` should be included instead since current
systems should be well supported by now. [2]

Since PHP requires at least C89, this patch removes the obsolescent call
and time.h checks.

Refs:

- [1]: http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
- [2]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Structures.html
2018-08-29 21:22:47 +02:00
Peter Kokot
3748d8070f Implement #64517: Add AC_ARG_PROGRAM macro
The AC_ARG_PROGRAM Autoconf macro provides program name transformations
when installing. This patch implements #64517 and prepares the
implementation for the request #60518.

In ./configure --help it additionally outputs --program-prefix=PREFIX,
--program-suffix=SUFFIX and the upcoming --program-transform-name=PROGRAM
option.

Macro AC_ARG_PROGRAM is available since Autoconf 2.0 and needs to be
called after the AC_CANONICAL_TARGET macro.

Refs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Transforming-Names.html
2018-08-29 02:04:48 +02:00
Peter Kokot
a0970bbbab Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove outdated comment with PEAR xmlrpc dependency
2018-08-04 18:23:25 +02:00
Peter Kokot
99020cc085 Remove outdated comment with PEAR xmlrpc dependency
The xmlrpc extension is not required to install PEAR anymore.
2018-08-04 18:22:08 +02:00
Christoph M. Becker
a63c99ba62 Prepare for PHP 7.4 2018-07-31 13:56:24 +02:00
Peter Kokot
6399fa1eea [ci skip] Fix typo 2018-07-30 06:28:40 +02:00
Peter Kokot
4371945b8b Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf 2.50 released in 2001 made several macros obsolete including
the AC_TRY_RUN, AC_TRY_COMPILE and AC_TRY_LINK:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2

These macros should be replaced with the current AC_FOO_IFELSE instead:
- AC_TRY_RUN with AC_RUN_IFELSE and AC_LANG_SOURCE
- AC_TRY_LINK with AC_LINK_IFELSE and AC_LANG_PROGRAM
- AC_TRY_COMPILE with AC_COMPILE_IFELSE and AC_LANG_PROGRAM

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version therefore systems
should be well supported by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

Reference docs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf
2018-07-30 02:36:38 +02:00
Gabriel Caruso
f2b5ac7963
[ci skip] Fix typo 2018-07-29 13:48:35 -03:00
Peter Kokot
daaf706df0 Upgrade deprecated AC_OUTPUT macro calls
Autoconf 2.50 made several changes to macro calls. These include also
arguments passed to AC_OUTPUT macro. The upgrading chapter in Autoconf
documentation include an example of using AC_OUTPUT with
AC_CONFIG_FILES and AC_CONFIG_COMMANDS:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

PHP 5.4 to 7.1 require Autoconf 2.59+, PHP 7.2+ require Autoconf 2.64+,
and PHP 7.2 phpize script requires Autoconf 2.59+ which are all greater
than above mentioned 2.50 version. Systems out there should well support
this by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

More info on where exactly this got deprecated:
- ftp://ftp.gnu.org/old-gnu/Manuals/autoconf-2.13/html_mono/autoconf.html
- ftp://ftp.auckland.ac.nz/pub/gnu/Manuals/autoconf-2.52/html_chapter/autoconf_15.html
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
2018-07-29 16:04:39 +02:00
Peter Kokot
d2184efb7b Replace obsolete AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV
Autoconf 2.50 released in 2001 has made several macros obsolete. Instead
of the AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV the new
AC_CHECK_MEMBERS should be used.

When checking for the presence of stat struct members st_blkzize and
st_rdev the new AC_CHECK_MEMBERS macro defines new constants
HAVE_STRUCT_STAT_ST_BLKSIZE and HAVE_STRUCT_STAT_ST_RDEV.

Old constants HAVE_ST_BLKSIZE and HAVE_ST_RDEV need to be replaced
respectively in PHP code (this patch) and in PHP extenstions if they use
them.

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version.
2018-07-29 13:59:40 +02:00
Peter Kokot
b12cece8d5 Replace obsolete AC_AIX with AC_USE_SYSTEM_EXTENSIONS
Since Autoconf 2.62 the AC_AIX macro has been made obsolete and should
be replaced with the AC_USE_SYSTEM_EXTENSIONS instead.

Both macro behaviors are the same since the old one is just a wrapper
around the new AC_USE_SYSTEM_EXTENSIONS:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/specific.m4

PHP 7.2+ and the main configure.ac script require minimum Autoconf 2.64+.

Refs:
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
2018-07-29 08:00:15 +02:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +02:00
Peter Kokot
a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Anatol Belski
d664d1e959 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix C++11 and up compatibility for zend_finite and more
2018-07-08 20:34:58 +02:00
Anatol Belski
545a29d0cb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix C++11 and up compatibility for zend_finite and more
2018-07-08 20:32:52 +02:00
Peter Kokot
956446bdfa Bump Autoconf version in configure.ac to 2.64
Since PHP 7.2 the minimum autoconf version is 2.64. The configure.ac
script file includes also AX_CHECK_COMPILE_FLAG macro call so besides
only checking it in buildconf script this bumps the autoconf here too.

The phpize.m4 script is for now still relaxed to 2.59 version since some
still supported systems such as CentOS 6 still include autoconf 2.63
version and might require calling phpize on some old extensions.
2018-07-07 12:11:14 +02:00
Peter Kokot
491f1477be Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS
Autoconf doesn't mention the AC_CONFIG_HEADER macro since the v2.13
released in 1999 anywhere in the documentation. Future of this macro is
unclear and commented as possible candidate for obsoletion in the
autoconf source code. Since it is just a wrapper around the main
AC_CONFIG_HEADERS macro, the functionality is the same, and also more
clear to find it in the autoconf documentation and avoid possible future
obsoletion.
2018-07-07 12:10:53 +02:00
Peter Kokot
67352cb2c0 Fix bug #76392
On systems without glibc, such as Alpine with Musl libc, the function attributes
are not supported. GCC 6 doesn't properly omit some systems. This is
already fixed in GCC 7 but for systems with GCC 6 and ones without
glibc, this additional check fixes this bug.
2018-07-07 11:31:44 +02:00
Peter Kokot
b7368fe0d0 Add missing autoconf m4 quotes
Two macro calls were missing quotes and in order to be able to run the
autoupdate script, this patch adds them.
2018-07-03 19:12:44 +02:00
Remi Collet
8bf21adb8c bump to 7.2.9-dev 2018-07-03 13:52:04 +02:00
Peter Kokot
bbd7b2d0ee Remove old and unused warnings when building apache
The configure script already warns users at the beginning with
unrecognized options warning so additional check is not required. These
sapis were also removed from the PHP core.
2018-06-14 04:45:28 +02:00
Anatol Belski
c79af09bc6 Add check for variable size array feature
Usage of VLA is not portable, wile supported by some compilers. For
instance, GCC supports it even if -std=c89 is passed. Even if we would
switch to C99, it would be still not portable at least with VC++. Thus,
adding a centralized check so such code can be guarded and moved to
alloca() if needed.
2018-06-09 20:27:16 +02:00
Anatol Belski
a8a1dc038c Fix versions, as 7.2.6RC is already out 2018-05-19 15:44:23 +02:00
Remi Collet
0d87a0ba57 next is 7.2.6 2018-04-11 07:53:53 +02:00
Nikita Popov
c069adb4ba Merge branch 'PHP-7.2' 2018-03-23 22:04:18 +01:00
Michael Heimpold
25ba60b147 Fixed bug #75722: Rework valgrind detection
As described in bug report #75722, the configure script (acinclude.m4)
currently searches for the valgrind header file and enables valgrind
support if found.

When cross-compiling the searched paths are invalid for the target
platform because they belong to the host system. At the moment, there is
no way to tell the build system a dedicated path where to look for the
header file.

This leads to the issue, that when cross-compiling eg. for ARMv5 platform,
that valgrind header file is detected - e.g. because host system is amd64 -
and support is enabled - but target platform will never support valgrind
(valgrind requires e.g. at least ARMv7).

This change reworks the detection so that user could manually opt-in
valgrind support and optionally specify a directory where the build system
should look for the header file using the --with-valgrind option.
2018-03-23 22:02:17 +01:00
Remi Collet
d660d6d31b next is 7.2.5 2018-03-13 12:49:25 +01:00
Anatol Belski
5c41de2e1d Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76044 'date: illegal option -- -' in ./configure on FreeBSD
2018-03-05 22:39:06 +01:00
Anatol Belski
b53f326f67 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76044 'date: illegal option -- -' in ./configure on FreeBSD
2018-03-05 22:38:03 +01:00
Sara Golemon
2cc8cf2994
Now working on 7.2.4-dev 2018-02-13 14:37:00 -05:00
Xinchen Hui
cf0fae5e97 Optimized base64_encode/decode with SIMD instructions 2018-02-12 20:53:14 +08:00
Xinchen Hui
08428cf6a7 Fixed cpuinfo in LLVM GCC & Added AVX2 detection
Seems it only defines __builtin_cpu_supports but no __builtin_cpu_init
(Apple LLVM version 9.0.0 (clang-900.0.38))
2018-02-10 17:38:30 +08:00
Xinchen Hui
7ce72f0cf5 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src: (37 commits)
  Avoid conditions inside loop
  Improve loop vectorization
  Improve loop vectorization
  Remove unused function
  Fixed bug #75938
  Remove unused files
  Fixed bug #75940 Unnecessary compile wrapper with PHP_THREAD_SAFETY=yes
  typo
  Update README.GIT-RULES
  Fix SKIPIF section
  Fixes bug #75871 Use pkg-config for libxml2 if available
  Fixed bug #49876 lib path on 64bit distros
  Refactor testing READMEs
  Fixed bug #65414
  Fixed bug #65414
  Fixed bug #74519 strange behavior of AppendIterator
  fix #74519 strange behavior of AppendIterator
  Use bool instead of boolean
  Remove space between function name and open parentheses
  Fix some misspellings
  ...
2018-02-10 17:01:55 +08:00
Xinchen Hui
87b7180480 Fixed cpu feature check in reslover functions 2018-02-10 16:58:27 +08:00
Jaromír Doleček
a5b55416f4 Fixed bug #75940 Unnecessary compile wrapper with PHP_THREAD_SAFETY=yes 2018-02-09 14:30:06 +01:00
Nikita Popov
eafb092d9f Merge branch 'PHP-7.2' 2018-02-02 22:39:32 +01:00
Nikita Popov
3e15465f31 Merge branch 'PHP-7.1' into PHP-7.2 2018-02-02 22:31:40 +01:00
David Carlier
7f51257c08 NetBSD has its own unoptimizable memset version since 2013
checking presence of the function if older versions of NetBSD
2018-01-19 18:24:36 +01:00
Remi Collet
5a54107879 next is 7.2.3 2018-01-16 09:54:57 +01:00
Xinchen Hui
3a3e0493d0 Added ZEND_API zend_cpu_supports 2018-01-16 14:53:00 +08:00