Commit Graph

741 Commits

Author SHA1 Message Date
Peter Kokot
bf845d563e
Use AC_SUBST for CONFIGURE_COMMAND and CONFIGURE_OPTIONS (#14445)
Instead of the PHP_SUBST_OLD, which also adds redundant variables to the
generated Makefile, these two can be done with AC_SUBST to be
substituted in the generated main/build-defs.h header and
scripts/php-config script.
2024-06-03 08:19:26 +02:00
Peter Kokot
cba3891d53
Join SQLite library setup M4 macros to PHP_SETUP_SQLITE (#14372)
Macro can simplify managing minimum version of SQLite library on less
places.
2024-05-30 18:16:30 +02:00
Peter Kokot
471aa1141f
Refactor fopencookie check (#14346)
- This checks for a type cookie_io_functions_t and defines the
  HAVE_FOPENCOOKIE based on type check result and the fopencookie()
  function presence.
- Fixed -Wunused... warnings in config.log on stricter compiler
  configurations
- The run check for off64_t is wrapped into AC_CACHE_CHECK for having
  the php_cv_type_cookie_off64_t cache variable available to customize
  possible cross-compilation edge cases
- Comment about glibcs 2.1.2 removed because also some other earlier
  versions provided this type already
2024-05-30 14:56:47 +02:00
Peter Kokot
d8da8d88e0
Remove obsolete Makefile .NOEXPORT target (#13734)
This was once used on GNU Make from versions 3.59 to 3.63 (released in
1994) to not export all variables, otherwise a system limit may be
exceeded. This was the case for the obsolete UNIX System V (SysV) and is
on current systems not applicable anymore, with such target ignored.
2024-05-30 12:41:12 +02:00
Máté Kocsis
c08535c804
Fix regex for searching for constant lists
0242577b33 partly fixed the detection of external constant lists referenced on Predefined Constants pages, but changing the file search regex is needed too in order to fully fix the underlying issue in case of cURL constants.
2024-05-30 09:46:56 +02:00
Peter Kokot
de0415e705
Remove PROG_SENDMAIL from Makefile (#14355)
PROG_SENDMAIL is not used in the generated Makefile. For the
main/build-defs.h it is substituted automatically with AC_PATH_PROG.
2024-05-30 00:53:07 +02:00
Máté Kocsis
0242577b33
Also check constants in referenced constant lists
Some constants are extracted from Predefined Constants pages (e.g. https://github.com/php/doc-en/pull/3413), which should alsobe checked when verifying the manual.
2024-05-29 23:50:46 +02:00
Máté Kocsis
cf004ed47e
Fix implicitly nullable type detection in stubs 2024-05-28 21:06:00 +02:00
Valentin Udaltsov
be19e7954d
Fix gen_stub.php errors (#14335) 2024-05-27 22:11:23 +02:00
Peter Kokot
2ab114ebff
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix incompatible pointer type warnings
2024-05-24 21:01:06 +02:00
Peter Kokot
a893e40139
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix incompatible pointer type warnings
2024-05-24 21:00:54 +02:00
Peter Kokot
9e226b2881
Fix incompatible pointer type warnings
This fixes the incompatible pointer type warnings when checking for
reentrant functions declaractions (-Wincompatible-pointer-types) in
config.log. These were not declared on some obsolete systems if
_REENTRANT was not defined. The check is for now left in the code base
but can be transitioned to newer code without checking for missing
declarations or using these otherwise in the future.

Closes GH-14315.
2024-05-24 20:57:52 +02:00
Máté Kocsis
78f72cffa4
Add support for generating parameter attributes for the manual (#14270) 2024-05-20 21:03:19 +02:00
Peter Kokot
bc09cd2bc8
Fix the aligned variable attribute check (#14211)
By default compilers may not treat attribute warnings as errors when
encountering an unknown __attribute__, unless some error option is
provided (-Werror=attributes, -Werror=unknown-attributes, -Werror...).
This fixes the check and wraps it into a separate M4 macro to be
extendable in the future if needed. It checks if conftest.err file was
generated by the compilation check when warnings appear. Also, PHP check
is a bit customized by using __alignof__ keyword, so it is left in there
for now to not break existing checks.
2024-05-19 12:18:59 +02:00
Máté Kocsis
f093015a6c
Fix class constant and property ID generation for the manual (#14249)
Related to https://github.com/php/doc-en/pull/3367
2024-05-17 20:30:16 +02:00
Peter Kokot
173f51365d
Update AX_CHECK_COMPILE_FLAG to serial 7 (#14217)
This syncs the file with upstream:
https://github.com/autoconf-archive/autoconf-archive/blob/master/m4/ax_check_compile_flag.m4
2024-05-13 21:15:20 +02:00
Calvin Buckley
25b224d111 Merge branch 'PHP-8.3' 2024-05-10 15:09:26 -03:00
Calvin Buckley
d479ac4856 Merge remote-tracking branch 'origin/PHP-8.2' into PHP-8.3 2024-05-10 15:08:25 -03:00
Calvin Buckley
4e21a26db2
Fix check for newer versions of ICU (#14186)
* Fix check for newer versions of ICU

The previous test would always trigger, even if the version of ICU
installed didn't require C++17. This was because it incorrectly used
the `test` program, which broke the build on systems without a C++17
compiler.

Tested with macOS 14 and i 7.2.

* Fix broken ICU version check for definition

Same as the previous fix for C++17.

---------

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-05-10 14:20:17 -03:00
Peter Kokot
a27cdd65f3
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13727: Building with -Werror=strict-prototypes (#14029)
2024-04-22 21:23:15 +02:00
Peter Kokot
71aae5a17e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13727: Building with -Werror=strict-prototypes (#14029)
2024-04-22 21:22:28 +02:00
Peter Kokot
44775b7617
Fix GH-13727: Building with -Werror=strict-prototypes (#14029)
This is addon to the GH-13727 bug fix. When configuring the build with:

  ./configure CFLAGS=-Werror=strict-prototypes

libtool check for parsing nm command would fail:

  checking command to parse /usr/bin/nm -B output from cc object... failed

Upstream libtool has this specific check already fixed. Note that this
works only with Autoconf version 2.72 and later and is preparation for
future compilers that might have this error enabled by default.
2024-04-22 21:21:40 +02:00
Peter Kokot
f28ddec540
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix erroneous dnl appended in configure (#14013)
2024-04-21 17:23:58 +02:00
Peter Kokot
7d3d8de1f3
Fix erroneous dnl appended in configure (#14013)
This is a backport of commit 03f15534a1 to
PHP-8.2 due to GH-14002 and fixes the PHP_CXX_COMPILE_STDCXX check in
ext/intl whether the specified C++ standard is mandatory or optional.

The `dnl` (Discard to Next Line) M4 macro in this combination of `m4_if`
macros and arguments isn't properly replaced and a literal `dnl` string
is appended in the configure script. The `[]dnl` works ok.
2024-04-21 17:23:22 +02:00
Ørjan Malde
ff76cb738b
rudimentary midipix port (#13896) 2024-04-18 08:19:44 +02:00
Peter Kokot
413f2cd427
Refactor root build directories (#13785)
This adds all root build directories in one call. PEAR directory is
created only when enabled and duplicated Zend directory creation is
removed, because it was intended for the zend_config.h when building
out-of-source or using the config.status manually before the
PHP_ADD_BUILD_DIR was introduced in the build system.
2024-03-27 16:20:03 +01:00
Ayesh Karunaratne
3de3e137bf ext/openssl: Bump minimum required OpenSSL version to 1.1.1
Bumps the minimum required OpenSSL version from 1.0.2 to 1.1.1.

OpenSSL 1.1.1 is an LTS release, but has reached[^1] EOL from upstream. However, Linux distro/OS vendors
continue to ship OpenSSL 1.1.1, so 1.1.1 was picked as the minimum. The current minimum 1.0.2 reached
EOL in 2018.

Bumping the minimum required OpenSSL version makes it possible for ext-openssl to remove a bunch of
conditional code, and assume that TLS 1.3 (shipped with OpenSSL 1.1.1) will be supported everywhere.

 - Debian buster: 1.1.1[^2]
 - Ubuntu 20.04: 1.1.1[^3]
 - CentOS/RHEL 7: 1.0.2
 - RHEL 8/Rocky 8/EL 8: 1.1.1
 - Fedora 38: 3.0.9 (`openssl11` provides OpenSSL 1.1 as well)

RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum OpenSSL version.

[^1]: https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/index.html
[^2]: https://packages.debian.org/buster/libssl-dev
[^3]: https://packages.ubuntu.com/focal/libssl-dev
2024-03-23 15:12:06 +00:00
Remi Collet
ec2ace7f83
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix AX_GCC_FUNC_ATTRIBUTE failure
2024-03-22 11:30:24 +01:00
Remi Collet
2b7917391c
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix AX_GCC_FUNC_ATTRIBUTE failure
2024-03-22 11:30:07 +01:00
Remi Collet
09a36812c1
Fix AX_GCC_FUNC_ATTRIBUTE failure 2024-03-22 11:29:45 +01:00
Peter Kokot
530e0d68eb
Create modules directory in a centralized location (#13411)
Shared objects of extensions during the *nix build are copied to the
`modules` directory. It is a practice established since the early days
of the PHP build system. Other build systems may have similar concept of
"library destination directory". On Windows, they are put into the root
build directory. Such directory simplifies collection of the shared
extensions during testing, or when running the cli executable at the end
of the build process.

This change ensures that the directory is consistently created in a
single location, for both the primary PHP build process and when
utilizing `phpize` within community extensions.

The AC_CONFIG_COMMANDS_PRE is executed at the end of the configuration
phase, before creating the config.status script, where also build
directories and global Makefile are created.

The pwd is executed using the recommended $(...) instead of the obsolete
backticks. Autoconf automatically locates the proper shell and
re-executes the configure script if such case is found that $(...) is
not supported (the initial /bin/sh on Solaris 10, for example).
2024-03-21 17:43:49 +01:00
Máté Kocsis
5bb03158b6
Add the last few remaining constants to stubs (#13751)
Basically all constants are now declared via stubs. The rest of the constants are either deprecated (`SID` or `MHASH_*`) or out of interest (`__COMPILER_HALT_OFFSET__` and `PHP_CLI_PROCESS_TITLE`).
2024-03-19 08:20:33 +01:00
Máté Kocsis
5992a29724
Improve BC support of arginfo files fenerated by gen_stub.php (#13705)
- Declared compatibility expectations of stub files are now enforced by a ZEND_STATIC_ASSERT call at the top of arginfo files
- Property registration for PHP 7 is fixed: function zend_declare_property_ex() is used again instead of zend_declare_typed_property(). This has been a regression since I added support for exposing doc comments.
- As a defensive measure, deep cloning is performed before newer features (type declarations, attributes etc.) are discarded before generating legacy arginfo files. Until now, some of the objects were forgotten to be taken care of. These omissions may have resulted in some weird bugs in theory (but probably they didn't have much impact in practice).
- PHP version related conditions inside *non-legacy arginfo files* used to possibly check for the 70000 version iD until now if compatibility with PHP 7.0 was declared in a stub. This was not 100% correct, since non-legacy arginfo files are only for PHP 8.0+. Now, I made sure that at least PHP version ID 80000 is used in the preprocessor conditions. The solution was a bit tricky though...
2024-03-18 22:06:17 +01:00
David Carlier
952cc2a675 Merge branch 'PHP-8.3' 2024-03-18 06:59:29 +00:00
David Carlier
839153069f Merge branch 'PHP-8.2' into PHP-8.3 2024-03-18 06:58:14 +00:00
David Carlier
868257a3de Fix GH-13727: macro generating invalid call test prototypes fixes.
autoconf/libtool generating code to test features missed `void` for
C calls prototypes w/o arguments.
Note that specific changes related to libtool have to be upstreamed.

Co-authored-by: Peter Kokot <petk@php.net>

close GH-13732
2024-03-18 06:53:39 +00:00
Máté Kocsis
577db99462
Verify stub aliases in CI (#13682)
In the same time, let's not verify implementation aliases since they may now legitimately differ from their aliased function/method counterparts (think about the ext/dom refactoring where e.g. many return type declarations have changed). Additionally, unnecessary `@no-verify` tags are cleaned up.
2024-03-13 23:32:35 +01:00
Peter Kokot
8595bead87
Use default Autoconf's AC_LANG_PROGRAM (#13565)
This adds default test program prologue and body of
`int main(void) { return 0; }` where possible.
2024-03-11 00:24:57 +01:00
Máté Kocsis
ec285ff669
Support multiple file-level phpdoc blocks in gen_stub.php
This allows writing the following:
/** @generate-class-entries */
/** @generate-legacy-arginfo 80000 */
2024-03-05 21:24:21 +01:00
Peter Kokot
42a4e50513
Sync logical operators in shell scripting code (#13560)
This updates the obsolescent `-a` and `-o` binary primaries to `&&` and
`||`.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
2024-03-01 20:40:16 +01:00
Peter Kokot
2ca38d11bb
Remove PHP_CHECK_GCC_ARG (#13525)
The PHP_CHECK_GCC_ARG has been already removed in PHP 8.0 and this also
removes the error emitting wrapper.

Patches for the solr and vld extensions have been sent upstream.
2024-02-27 18:45:36 +01:00
Máté Kocsis
e84acc0e43
Escape function names in optimizer function info 2024-02-25 16:09:50 +01:00
Máté Kocsis
f2e199e878
Implement "support doc comments for internal classes and functions" (#13266)
Fixes #13130
2024-02-25 08:41:31 +01:00
Peter Kokot
db6a567607 Remove duplicate libtool --silent option
The libtool --silent option for PHP build invocation is already set in
the configure.ac.
2024-02-25 07:24:36 +01:00
Peter Kokot
e72f0c887b
Simplify prctl and procctl Autoconf checks (#13450)
The AC_CHECK_FUNCS checks whether the linker sees the function in the
usual libraries, in this case libc. This is a simple trick to also check
existence of belonging headers, since the code uses HAVE_PRCTL and
HAVE_PROCCTL to include headers and call functions.
2024-02-21 09:04:37 +01:00
Peter Kokot
056c43f848 [skip ci] Sync file permissions in Git repository
Git can track executable (0755) and non-executable (0644) file modes.
This is a minor file permissions sync across the php-src Git repository.

- build/config.guess (0755 as done upstream)
- build/config.sub (0755 as done upstream)
- ext/*/?*.stub.php (0644)
- ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk (0755 due to shebang usage)
2024-02-20 17:58:47 +01:00
Peter Kokot
03f15534a1 Fix Autoconf configure new lines
The `dnl` (delete to next line) directive in this combination of `m4_if`
macros and arguments isn't properly replaced and a literal dnl string is
appended in the configure script. The `[]dnl` works ok.
2024-02-19 21:30:29 +01:00
Máté Kocsis
10957e498c
Do not generate frameless info items when func info generation is disabled
While here, I fixed newlines around arginfo and function entry generation. Previously, newlines were repeated.
2024-02-18 11:39:00 +01:00
Peter Kokot
25923987b5
Refactor PHP_SOCKADDR_CHECKS (#13406)
Instead of the project macro, the sockaddr_storage and sockaddr.sa_len
can be checked with the AC_CHECK_TYPES and AC_CHECK_MEMBERS by including
the sys/socket.h. Some systems (~1988) didn't include the sys/types.h in
the socket.h (obsolete on current systems).

These macros by default define the HAVE_STRUCT_SOCKADDR_STORAGE and
HAVE_STRUCT_SOCKADDR_SA_LEN.
2024-02-16 13:29:20 +01:00
Peter Kokot
9588796294
Use AC_CHECK_TYPES for checking struct flock (#13397)
The struct flock is defined in fcntl.h, if system has it. This removes
redundant PHP_STRUCT_FLOCK M4 macro in favor of the AC_CHECK_TYPES,
which by default defines symbol HAVE_STRUCT_FLOCK.
2024-02-15 19:17:01 +01:00