Commit Graph

156 Commits

Author SHA1 Message Date
Florian Weimer
aeaab8ee3e Port various autoconf bits to C99 compilers
C99 no longer has implicit function declarations and implicit ints.
Current GCC versions enable them as an extension, but this will
change in a future GCC version.
2019-09-10 12:32:14 +02:00
Peter Kokot
cf197962e1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix typo
  Simplify functions checks in m4
2019-07-17 03:55:04 +02:00
Peter Kokot
476339646c Simplify functions checks in m4
- AC_CHECK_FUNCS already automatically defines belonging HAVE_function
  symbols and executes given shell code.
2019-07-17 03:50:47 +02:00
Peter Kokot
98d0892dd8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Sync functions checks
2019-06-30 23:59:47 +02:00
Peter Kokot
9a3c8e51e3 Sync functions checks
Removed unused checks:
- mbsinit check removed, HAVE_MBSINIT removed (not used in php-src)
- mempcpy check removed, HAVE_MEMPCPY removed (not used in php-src anymore since
  560ed89bfb which uses PHP's own implementation)
- strpncpy check removed, added via a8c9e893b6 and
  not used.
- setpgid check removed since HAVE_SETPGID is not used

Moved to a central configure.ac:
- fpclass
- mbrlen moved to configure.ac (since the HAVE_MBRLEN is used accross the php-src)
- sigprocmask
- getcwd
- getwd
- glob
- strfmon
- nice

Duplicated checks removed:
- gethostname
- getlogin
- getpwuid_r
- socketpair

- mprotect check simplified
2019-06-30 23:57:54 +02:00
Peter Kokot
c48c6a021f Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_DEV_ARANDOM
2019-06-30 23:40:32 +02:00
Peter Kokot
1925102fe4 Remove HAVE_DEV_ARANDOM
The arandom check is not needed anymore since the implementations of:
3467526a65
and
6554f721f7
2019-06-30 23:39:44 +02:00
Peter Kokot
6bfa6bff0b Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean headers checks
2019-06-27 02:45:31 +02:00
Peter Kokot
2079b09854 Clean headers checks
Some headers were checked multiple times in the main configure.ac file
and in the bundled extensions or SAPIs themselves. Also many of these
checks are then used accross other extensions or SAPIs so a central
configure.ac makes most sense for these checks.
2019-06-27 02:45:09 +02:00
Peter Kokot
8d8333b498 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_STRTOD and strtod check
2019-06-26 23:13:01 +02:00
Peter Kokot
cc4134c04e Remove HAVE_STRTOD and strtod check
There is no need to check for the strtod function. It is part of C89
standard which PHP-7.4+ supports.

http://port70.net/~nsz/c/c89/c89-draft.html#4.10.1.4
2019-06-26 23:10:55 +02:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
64b98c0e33 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove dead DEBUG_CFLAGS setting
2019-05-11 19:53:20 +02:00
Peter Kokot
836bbb4e2c Remove dead DEBUG_CFLAGS setting
The USE_MAINTAINER_MODE has been removed via
a4c484a4d8 and
43ed903949
2019-05-11 19:53:14 +02:00
Dmitry Stogov
4d7df449d0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add gcc global register for aarch64
2019-04-22 14:29:58 +03:00
CrazyMiaoo
9df15fc26b Add gcc global register for aarch64 2019-04-22 14:29:30 +03:00
Peter Kokot
7eb8913e04 Merge branch 'PHP-7.4'
* PHP-7.4:
  Refactor Zend/acinclude.m4 local macro
2019-04-21 15:53:44 +02:00
Peter Kokot
b1d3509e8c Refactor Zend/acinclude.m4 local macro
There is now only a single M4 macro in the legacy acinclude.m4 file. A
separate acinclude file was once used with a standalone Zend engine
building but with current build system this can be simplified a bit.
2019-04-21 15:53:19 +02:00
Nikita Popov
a3dc083c81 Merge branch 'PHP-7.4' 2019-04-15 10:54:46 +02:00
Nikita Popov
3f19592f92 Disable strict aliasing warnings
It seems like GCC 5 likes to warn about exactly those trivial strict
aliasing violations that it's not going to miscompile anyway and the
warnings are gone in newer versions. Just disable the noise.
2019-04-15 10:43:49 +02:00
Nikita Popov
5caa52476c Merge branch 'PHP-7.4' 2019-04-12 12:51:42 +02:00
Nikita Popov
3744533468 Enable -Wall on release builds for GCC
-Wall was already enabled for debug builds, enable it for release
builds as well.
2019-04-12 12:51:17 +02:00
Peter Kokot
e4a563b0c0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_SIGNAL_H
2019-04-07 15:57:21 +02:00
Peter Kokot
5f8915786f Remove HAVE_SIGNAL_H
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:55:34 +02:00
Peter Kokot
309edb070d Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_LIMITS_H
2019-04-07 15:21:48 +02:00
Peter Kokot
fd1ad1e25a Remove HAVE_LIMITS_H
The `<limits.h>` header file is part of the standard C89 headers [1]
and on current systems can be included unconditionally.

Since PHP requires at least C89 or greater, the `HAVE_LIMITS_H` symbol
defined by Autoconf in configure.ac [2] can be ommitted and simplifed
however due to bundled file library (libmagic) and timelib still using
it, the removal there was omitted and done only in Zend.m4 file.

Current bundled libraries libtime, oniguruma, and libmagic still include
partial `HAVE_LIMITS_H` usage and will be more refactored when this is
possible.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:20:02 +02:00
Peter Kokot
b49022b3dc Merge branch 'PHP-7.4'
* PHP-7.4:
  Refactor PHP_PROG_BISON and PHP_PROG_RE2C
2019-03-30 02:02:14 +01:00
Peter Kokot
3207741df0 Refactor PHP_PROG_BISON and PHP_PROG_RE2C
This patch refactors these macros to also checks for the required given
versions of bison and re2c.

- PHP_PROG_RE2C and PHP_PROG_BISON take optional args - minmimum version
  required, and bison also excluded versions.
- Instead of caching values this uses manual checking and messaging
  outputs.
- It looks like the minimum version of RE2C 0.13.4 is working ok so far.

The genfiles script improvements:
- Add make override in genfiles
- Move checkings from makedist to genfiles
- Refactored output messages
- Various minor enhancements
2019-03-30 02:01:02 +01:00
Joe Watkins
161adfff3f
For consistency with Windows, and because ZTS is not experimental or a "maintainer" feature, this commits renames --enable-maintainer-zts to --enable-zts in the autotools build, and related documentation 2019-03-23 07:34:54 +01:00
Nuno Lopes
33d4282526 remove unneeded AC_REQUIRE([AC_PROG_YACC])
thanks Peter Kokot for noticing
2019-03-17 08:10:41 -04:00
Peter Kokot
97d25c87d2 Clean build system
Changes:
- AC_TYPE_SIZE_T called on only one place (configure.ac)
- AC_FUNC_ALLOCA called on only one place (configure.ac)
- AC_TYPE_UID_T called on only one place (configure.ac)
- HAVE_STRSTR removed since strstr is part of C89 standard [1]
- Remove checks for strtol and strpbrk
- Checking for the presence of perror function is not needed anymore
  since it is part of C89 standard and PHP calls it unconditionally.
- Checking for functions strdup, setenv, strerror, and memmove done only
  on one place (configure.ac)
- outdated check for snprintf removed

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 20:20:12 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Peter Kokot
bebcdcc745 Remove legacy AC_CHECK_TYPE calls for uint and ulong
The AC_CHECK_TYPE was refactored in more recent versions of Autoconf
and the call with two arguments is obsolete and not recommended anymore.

This patch also refactors some leftovers of using ulong and uint which
are not standard nor common usages of types in C.

The ulong can be used as zend_ulong and uint usage is actually
`unsigned int`.

The usage of HAVE_ULONG removed since it is not used in current code
base.

Legacy edgecase for some legacy HPUX systems removed:
- sys/stream.h header is not checked and the HAVE_SYS_STREAM_H is
  not defined with current build system.

- flags are unsigned int
- max_allowed_packet changed to unsigned int
2019-03-06 22:49:16 +01:00
Peter Kokot
d6dac94ab1 Remove outdated hack for AIX 4
AIX 4 is not supported anymore for a while. This hack was added very
long time ago into PHP and is not needed anymore.
2019-03-03 14:51:36 +01:00
Peter Kokot
6bb657fc34 Remove AC_PROG_CC_C_O
The AC_PROG_CC_C_O macro checks if compiler can use both -c and -o
options together and if not it defines the NO_MINUS_C_MINUS_O symbol.
It is not used in current codebase and therefore removed.
2019-03-03 14:47:49 +01:00
Peter Kokot
7431eb72fe Remove LIBZEND_CHECK_INT_TYPE and PHP_CHECK_TYPES
Checking for int32_t and uint32_t types is already done by the
PHP_CHECK_STDINT_TYPES m4 macro.

The PHP_CHECK_TYPES m4 macro has been once used by the mysqlnd and has
been removed via 14caf174ff and
additionally, the internal unused macro _PHP_DEF_HAVE_FILE has been
removed.

Additionally, the unused PHP_HAVE_STDINT_TYPES symbol has been removed.
2019-03-02 12:23:21 +01:00
Peter Kokot
a700451706 Remove obsolescent AC_HEADER_STDC and memcpy check
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_STDC`.

This macro checks if given system has C89 compliant header files such
as `<string.h>`, `<stdlib.h>`, `<stdarg.h>`, `<float.h>`,... and defines
the `STDC_HEADERS` symbol [2]. Case is that current systems should be
well supported with at least C89 standard headers [3].

Given headers are still additionally checked with the `AC_PROG_CC`
macro, yet not needed anyway.

Additionally, the HAVE_MEMCPY check has been removed. The memcpy
function is standardized by C89 and later.

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
[3] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
2019-03-01 19:22:44 +01:00
Peter Kokot
00e050e7c7 Remove ZEND_FP_EXCEPT macro and HAVE_FP_EXCEPT
Usage of the HAVE_FP_EXCEPT symbol has been removed via
c334058412 and isn't used in current code
anymore.
2019-02-27 22:53:55 +01:00
Peter Kokot
b33fa18eab Remove unused PHP_AC_BROKEN_SPRINTF and AC_ZEND_BROKEN_SPRINTF
The sprintf function has been normalized to php_sprintf via
61364b5bb1.

This patch removes the checks to make a custom sprintf function

The ZEND_BROKEN_SPRINTF has been removed and the
hardcoded #define zend_sprintf sprintf is used.

The php_sprintf and zend_sprintf are now symbols to sprintf.

This patch now removes the custom PHP definitions of the php_sprintf and
zend_sprintf functions in favor of the C99 sprintf which is also
standardized in C89 already. Once, on some systems sprintf didn't behave
in same way.
2019-02-23 22:26:47 +01:00
Peter Kokot
e1f101d798 Remove separate *nix system build for Zend engine
Removed files used to provide building Zend engine separately using
Autoconf and Automake:
  cd Zend && ./buildconf && ./configure

Since Zend engine is tightly integrated in the PHP code itself and
current root configure.ac and acinclude provide this patch removes
these. Removed files also included several obsolete macros and
Automake dependency which is not used in main *nix PHP build system.
2019-01-04 22:04:05 +01:00
Peter Kokot
bde96f293a Remove support for Rhapsody code name
The Rhapsody code name was once used for computers with operating system
by Apple and was mostly replaced with a newer code name Darwin:
- https://en.wikipedia.org/wiki/Rhapsody_(operating_system)
- https://en.wikipedia.org/wiki/Darwin_(operating_system)

This patch removes obsolete checks from the *nix build script files.
2018-12-02 11:41:57 +01:00
Christoph M. Becker
34e65f73bc Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76825: Undefined symbols ___cpuid_count
2018-11-05 18:25:22 +01:00
Christoph M. Becker
7625f972db Fix #76825: Undefined symbols ___cpuid_count
Apparently, the presence of `cpuid.h` is not necessarily sufficient to
guarantee the availability of `__cpuid_count()`.  We therefore test for
the latter explicitly.
2018-11-05 18:24:39 +01:00
Peter Kokot
b189c2432a Remove HAVE_STDARG_H
The C89 standard and later defines the `<stdarg.h>` header as part of
the standard headers [1]. On current systems it is always present and
can be included unconditionally.

Checking for presence and functionality of the `<stdarg.h>` header and
variadic function is not relevant anymore on current systems since this
is always available.

Also Autoconf suggests relying on at least C89 or above [2] and [3].

The following files were regenerated with re2c 1.0.3:
- Zend/zend_language_scanner.c
- Zend/zend_language_scanner_defs.h

Refs:
[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-18 05:44:56 +02:00
Peter Kokot
d3ca28f569 Remove HAVE_STRING_H
The C89 standard and later defines the `<string.h>` header as part of
the standard headers [1] and on current systems it is always present.

Code included also `<strings.h>` header as an alterinative in some
files. This kind of check was relevant on some older systems where the
`<strings.h>` file included definitions for the C89 compliant
`<string.h>`. Today such alternative check is not required anymore. The
`<strings.h>` file is part of the POSIX definition these days.

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

This patch also cleans few unused `<strings.h>` inclusions in the libmbfl.

[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-18 05:32:08 +02:00
Nikita Popov
b3f8a6341d Remove unused HAVE_MEM_MMAP_ANON and HAVE_MEM_MMAP_ZERO checks
These haven't been used since the MM rewrite in PHP 7.0. Nowadays
we assume that either MAP_ANON or MAP_ANONYMOUS is available.
2018-09-17 12:08:11 +02:00
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
6db3c105f2
Remove AC_FUNC_MEMCMP
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_FUNC_MEMCMP`.

On some old systems such as SunOS 4.1.3 (EOL in 2003) and NeXT x86
OpenStep (discontinued) the `memcmp` function wasn't present or it
didn't work properly. [2]

On current systems including at least Solaris 10+ this check is not
relevant anymore.

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:02:47 +02:00
Xinchen Hui
6078491720 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76825 (Undefined symbols ___cpuid_count)
2018-09-04 17:26:56 +08:00