Commit Graph

6330 Commits

Author SHA1 Message Date
Peter Kokot
575efc0617
Autotools: Quote PHP_ADD_SOURCES* macros arguments (#15146)
- A redundant shell quoted flags argument replaced with Autoconf quotes
  (the PHP_ADD_SOURCES macro already adds the necessary shell quotes
  characters where needed)
- CS synced
2024-07-29 10:08:48 +02:00
Peter Kokot
003e238436
Autotools: Quote and fix PHP_SELECT_SAPI arguments (#15118)
This macro once had also the 5th argument (the build target), which was
removed via 2a6da0f24c. This quotes all
PHP_SELECT_SAPI arguments and removes the redundant ones. The basic
macro usage help text is moved to the macros section from the obsolete
docs file.
2024-07-27 22:46:36 +02:00
Peter Kokot
a7f0fe1f33
Autotools: Quote macro arguments
- PHP_EXPAND_PATH
- PHP_LIBGCC_LIBPATH
- PHP_OUTPUT
- PHP_REMOVE_USR_LIB
2024-07-27 05:26:32 +02:00
Peter Kokot
2f0bb9293c
Autotools: Append rt library to FPM_EXTRA_LIBS (#15059)
This appends the possible rt library as needed on Solaris <= 10 to
FPM_EXTRA_LIBS instead of the global LIBS variable for all SAPIs to have
cleaner build. The possible required rt library for other SAPIs is also
checked in the configure.ac.
2024-07-22 17:19:55 +02:00
lwlinux
15470bd16c
sapi/cli/php_cli.c: fix typos (#15057) 2024-07-22 06:41:02 +01:00
Peter Kokot
90e63d8a94
[skip ci] Remove GH-14685 artefact 2024-07-22 00:57:34 +02:00
David Carlier
3713c02803
sapi/fpm: retiring solaris /dev/poll support proposal.
Since Solaris 10, the port API is supported, is more modern, less bug
prone and offers, on average, better performances.

Close GH-14685
2024-07-21 17:03:41 +01:00
Peter Kokot
97afc86437
Autotools: Quote M4 arguments (#15045)
- AC_MSG_CHECKING
- AC_MSG_RESULT
- AC_MSG_WARN
- AC_MSG_ERROR
- AC_MSG_NOTICE
2024-07-21 01:52:17 +02:00
Peter Kokot
6857c7c8d6
Autotools: Expand m4_normalize sooner (#15018)
Quoted m4_normalize will expand and change its argument later in the
macro call when M4 is processing the *.m4 sources. Without quotes the
already normalized string is passed to the macro directly. In these
specific cases generated configure script is the same. This is more for
consistency to have this synced and not repeat the pattern too much
in the future when copy/pasting. Note, that many AC_* macros require
similar behavior already (for example, AC_CHECK_FUNCS.)
2024-07-19 15:20:04 +02:00
Peter Kokot
ccd2787947
[skip ci] Update PHP version in phpdbg help (#14965) 2024-07-16 07:02:05 +02:00
Jorg Adam Sowa
85b7181d7d
Added property hooks words in fuzzer parser dict (#14958) 2024-07-14 22:52:25 +02:00
Ilija Tovilo
20d8151b35
Add cachegrind support for php-cgi warmups (#14952)
Cachegrind supports cg_annotate --diff, which makes it much easier to compare
the performance of two patches.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-07-14 19:53:16 +02:00
Peter Kokot
0051b73a3e
Autotools: Refactor PHP-FPM /proc/pid filename check (#14949)
- Check wrapped in AC_CACHE_CHECK using php_cv_file_proc_mem variable
- CS synced
2024-07-14 17:20:41 +02:00
Peter Kokot
0e2e8e0f13
Autotools: Quote all PHP_ADD_BUILD_DIR arguments (#14947)
- All arguments quoted for consistency
- m4_normalize used where list of directories becomes a bit simpler to
  read and see the diff
2024-07-14 16:58:43 +02:00
Peter Kokot
fb5d64c300
Autotools: Use FPM_EXTRA_LIBS for SELinux library (#14885)
Instead of appending -lselinux to global LIBS variable, this adds it as
needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
invocation.

Follow-up of GH-14881
2024-07-13 01:20:44 +02:00
Peter Kokot
2ea79c024c
Autotools: Use FPM_EXTRA_LIBS for apparmor library (#14884)
Instead of appending -lapparmor to global LIBS variable, this adds it as
needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
invocation.

Follow-up of GH-14881
2024-07-13 01:20:05 +02:00
Peter Kokot
3dd0c11cc3
Autotools: Use FPM_EXTRA_LIBS for systemd library (#14883)
Instead of appending -lsystemd to global LIBS variable, this adds it as
needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
invocation. Move php_fpm_systemd substitution after its check.

Follow-up of GH-14881
2024-07-13 01:19:16 +02:00
David CARLIER
0f398a437e
sapi/apache: AP_MPMQ_MAX_THREADS is always available. (#14934)
since we upgraded the minimum with 2.4, AP_MPMQ_MAX_THREADS is always
available (since 2.3) and all MPM return a value, including prefork.
2024-07-12 13:22:24 +01:00
Peter Kokot
58a3ab92c3
Autotools: Fix config.status script syntax (#14929)
The init-cmds argument is appended to the config.status script with cat
command and variables $var are replaced during the cat step to their
values, so quoting these values fixes the syntax errors.

* Simplify threaded Apache build detection

Instead of checking for entire "grepped" string, this only checks for
yes|no values instead.

* Redirect the standard output and standard error

The "grep -q" is not portable according to docs so this redirects the
output and checks the exit status.

Fixes report in GH-14872
2024-07-12 02:16:49 +02:00
David CARLIER
246357607c
sapi/apache2handler: function using char * to const char *. (#14925) 2024-07-12 00:34:00 +01:00
Peter Kokot
5586d0c7de
Autotools: Refactor ptrace check for PHP-FPM (#14907)
- This syncs CS and wraps ptrace function check in a single
  AC_CACHE_CHECK for optional edge case cross-compiling adjustments
- Overquoted arguments are reduced (first the compilation check if
  ptrace in proper form is available on the system and then the run
  check if ptrace works as expected)
- The cache variable php_cv_have_mach_vm_read is renamed to
  php_cv_func_mach_vm_read.
2024-07-11 00:09:08 +02:00
Peter Kokot
9185f613e0
Autotools: Use FPM_EXTRA_LIBS for ACL library (#14881)
- ACL user/group check wrapped in AC_CACHE_CHECK
- instead of appending -lacl to global LIBS variable, this adds it as
  needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
  invocation
2024-07-09 18:42:31 +02:00
Peter Kokot
7fda12218a
Autotools: Move Apache warning to SAPI's config.m4 (#14872)
This uses AC_CONFIG_COMMANDS macro to conditionally output the warning
message at the end of configure phase if non-threaded Apache
installation has been found and PHP is built without --enable-zts.

Variables set in the 2nd argument (init-cmds) are for the command
invocation scope as the first argument doesn't have any knowledge of
configure variables as described in the Autoconf docs.

This is moved as it is related only to apache2handler SAPI and also
now warning is displayed a bit nicer at the end of the configure phase
after files are generated. This also enables outputting warning when
using config.status script.
2024-07-08 17:17:33 +02:00
Peter Kokot
1f847a0bdf
Check Apache HTTP Server command-line utility (#14173)
The Apache HTTP server command-line tool (/usr/sbin/apache2) might be
part of a separate package, such as apache2-bin or similar. If not
installed, the configure script can still find the apxs tool, but
previously didn't check for the HTTP server tool separately. Otherwise,
configure syntax errors (integer expression expected) are thrown when
checking for the Apache version.
2024-07-08 17:15:09 +02:00
Peter Kokot
2f97ad9c10
[skip ci] Add link to FPM docs in FPM man page (#14853)
This removes obsolete link to php-fpm.org and redundant manual link in
favor of a dedicated FPM chapters.

Can be tested with:

    man sapi/fpm/php-fpm.8.in
2024-07-08 14:59:45 +02:00
Peter Kokot
083493be57
Fix AS_VAR_* checks (#14868)
AS_VAR_SET_IF doesn't behave the same as "test -n" and/or "test -z",
which becomes an issue for Apache's ZTS automatic enabling and CFLAGS
edge case where it would be explicitly set to empty value. It is safer
to use AS_VAR_IF instead of AS_VAR_SET_IF in these cases.
2024-07-08 14:20:58 +02:00
Peter Kokot
300d092449
Autotools: Refactor phpdbg POSIX Threads checks (#14865)
- AS_VAR_IF, AS_VAR_APPEND used and CS synced
- Added one missing AC_MSG_RESULT to properly put the configure output
  log on each line
- AH_TEMPLATE used for HAVE_USERFAULTFD_WRITEFAULT to have help text on
  lesser places
- Redundant terminating semicolons removed
- Redundant PTHREADS_CHECK call removed as it is already done in
  configure.ac and before including SAPI M4 stubs
- Redundant CFLAGS and LIBS storing and restoring removed
2024-07-08 13:26:53 +02:00
Peter Kokot
3d8bd8fe4f
Remove unused HAVE_PHPDBG (#14864)
This is not defined on Windows and isn't used. Also phpdbg doesn't
install any headers to the public usage.
2024-07-08 00:42:05 +02:00
Peter Kokot
1bdf9aa38d
Remove support for EOL Apache 2.0 and 2.2 in favor of 2.4+ (#14664)
Apache 2.2 has been marked as EOL in December 2017 and doesn't receive
security patches any longer. Also, most *nix distributions and packages
mostly support 2.4 as minimum by now.

On Windows, this removes the configure option --enable-apache2-2handler
and merges the --enable-apache2handler and --enable-apache2-4handler
into a single option with favoring the --enable-apache2handler.

- The upstream MODULE_MAGIC_NUMBER is deprecated in favor of
  MODULE_MAGIC_NUMBER_MAJOR in apache2/ap_mmn.h
- The initial upstream MODULE_MAGIC_NUMBER_MAJOR was 20111025 in Apache
  2.4.0
- The upstream APLOG_USE_MODULE is always available since Apache 2.3.6
- The upstream CORE_PRIVATE is unnecessary and ignored since Apache
  2.4.0

See:
https://forum.apachehaus.com/news-general-discussion/apache-2-2-users-your-time-is-running-out/

Discussion: https://news-web.php.net/php.internals/124067
2024-07-08 00:07:55 +02:00
Peter Kokot
2ebef11e83
Update http links to https and sync www.php.net URLs (#14854) 2024-07-07 04:23:08 +02:00
Peter Kokot
83cd1c241e
Autotools: Refactor mach_vm_read check in FPM (#14830)
- Check wrapped in AC_CACHE_CHECK
- Synced CS
2024-07-05 15:19:14 +02:00
Peter Kokot
cc7cfcef08
Autotools: Refactor PHP_FPM_BUILTIN_ATOMIC (#14825)
- Check wrapped in AC_CACHE_CHECK
- Synced CS
- Since this can be also compiler agnostic check, "gcc" text replaced
  with "compiler"
2024-07-05 09:42:44 +02:00
Peter Kokot
17a53470d7
Autotools: Refactor PHP_FPM_LQ checks (#14828)
- CS synced
- checks wrapped in AC_CACHE_CHECH
- HAVE_LQ_SO_LISTENQ defined unconditionally for simplifications
2024-07-05 09:41:50 +02:00
Niels Dossche
c69dedabb2
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14553: Bug in phpdbg8.3 (also 8.1 and 8.2) echo output - trimmed at NULL byte (?)
2024-07-04 18:44:29 +02:00
Niels Dossche
751c267850
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14553: Bug in phpdbg8.3 (also 8.1 and 8.2) echo output - trimmed at NULL byte (?)
2024-07-04 18:44:17 +02:00
Niels Dossche
95889979f2
Fix GH-14553: Bug in phpdbg8.3 (also 8.1 and 8.2) echo output - trimmed at NULL byte (?)
This broke in 6318040df2 when phpdbg
stopped using its custom printing routines. By relying on standard
printing routines, the embedded NUL bytes are causing the strings to be
cut off, even when using %.*s. Solve this by going straight to the
output routine, which is what the printf routine would've done anyway.

Closes GH-14822.
2024-07-04 18:43:42 +02:00
Peter Kokot
dc7b67ebc3
Autotools: Sync PHP_ADD_MAKEFILE_FRAGMENT (#14766)
- Macro help text updated for extensions and general usage
- Arguments quoted
- dnl removes redundant newlines in the generated configure script
2024-07-03 13:15:13 +02:00
David CARLIER
6b037200a4
sapi/cli: setting process name little optimisation. (#14767) 2024-07-02 12:12:34 +01:00
Peter Kokot
a071d1c9cf
Autotools: Refactor PS_STRINGS check in cli (#14763)
- over-quoted arguments reduced
- AS_VAR_IF used
- php_cv_var_PS_STRINGS cache variable name used instead of cli_cv_*
- Macro help text synced according to empty definition
2024-07-02 12:37:33 +02:00
Peter Kokot
5e27a2a994
Autotools: Simplify SAPI configure log check messages (#14764)
The PHP_ARG_ENABLE and PHP_ARG_WITH 2nd argument is the check message in
the configure log output.
2024-07-02 08:11:10 +02:00
Peter Kokot
2c20811942
Autotools: Remove unused PHPDBG_SHARED compile definition (#14762)
There was also redundant backslash escaping.
2024-07-02 07:13:01 +02:00
Peter Kokot
dc1cc503db
Autotools: Sync PHP_SUBST in sapi (#14753)
- Arguments quoted
- Redundant comments removed (some basic help info is in the
  build/php.m4)
- APXS variable as such isn't used in the generated Makefile, the path
  to the apxs tool is inserted during the configure step directly
2024-07-01 21:04:09 +02:00
Peter Kokot
bf139e9b1f
Remove unused defined CPP macros in fpm SAPI (#14740)
* Remove unused defined CPP macros in fpm SAPI

- PHP_FPM_SYSTEMD
- PHP_FPM_USER
- PHP_FPM_GROUP

* [skip ci] Update UPGRADING.INTERNALS
2024-07-01 14:06:45 +02:00
Peter Kokot
212b2834e9
Autotools: Sync indentation style in build system files (#14725) 2024-06-29 23:25:17 +02:00
Peter Kokot
c44834d8ad
Trim trailing whitespace (#14721) 2024-06-29 18:41:45 +02:00
Peter Kokot
2041c133ac
Normalize AC_CHECK_FUNC* first argument (#14700)
The m4_normalize is for Autoconf < 2.70 (on 2.70 and later versions a
blank-or-newline separated items can be expanded without using
backslash-newline).

This also syncs the 1st argument quotes.
2024-06-28 22:40:24 +02:00
Peter Kokot
c705dd8884
Wrap FPM checks in AC_CACHE_CHECK and fix CS (#14681)
- This simplifies over-quoted arguments to AC_COMPILE_IFELSE
- Indentation and other CS fixes
- php_cv_* cache variables
- AC_DEFINE help texts syncs to make it more clear
- Fix -Wunused-but-set-variable warnings
2024-06-27 21:30:35 +02:00
Peter Kokot
8946099b73
Rename AC_FPM_* M4 macros to PHP_FPM_* (#14670)
This syncs the FPM SAPI M4 macro names with the current naming
conventions prefixed with PHP_.
2024-06-26 15:39:52 +02:00
Arnaud Le Blanc
11accb5cdf
Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Peter Kokot
f3feef8b93
Define default RE2C_FLAGS (#14615)
The --no-generation-date flag is a common re2c flag used in all re2c
invocations. This adds the 2nd optional argument to PHP_PROG_RE2C M4
macro in BC manner to set the default re2c command-line options and sets
the default RE2C_FLAGS similarly on Windows.
2024-06-24 22:09:04 +02:00