Commit Graph

655 Commits

Author SHA1 Message Date
Peter Kokot
fbacc0f936
Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +02:00
Peter Kokot
3f4028d3d9
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15587: Autotools: fix configure check for aarch64 CRC32 API
2024-08-25 18:02:25 +02:00
Peter Kokot
5c44610093
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15587: Autotools: fix configure check for aarch64 CRC32 API
2024-08-25 18:01:33 +02:00
Bernd Kuhls
5947db6bb8
Fix GH-15587: Autotools: fix configure check for aarch64 CRC32 API
On arm32 bit the check succeeds leading to a build error later on:

/home/autobuild/autobuild/instance-3/output-1/build/php-8.3.10/ext/standard/crc32.c:70:12:
 error: 'armv8-a' does not support feature 'nothing'
   70 | #   pragma GCC target ("+nothing+crc")

Co-authored-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[http://lists.busybox.net/pipermail/buildroot/2024-August/761151.html]
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
2024-08-25 18:00:29 +02:00
Peter Kokot
babf18c52e
Autotools: Remove obsolete compiler reset (#15549)
This was once added via 827ad656cb to
store the compiler variable when being modified due to using libtool
passing pthread_cflags to linker.
2024-08-23 16:54:21 +02:00
Peter Kokot
1b3c204033
Autotools: Add min-version argument to PHP_PROG_PHP macro (#15477)
This makes a bit simpler to use this macro by optionally passing the
required minimum PHP version. If version is not passed it falls back
to 7.4 as before. Minimum version also added to configure.ac.
2024-08-22 17:30:08 +02:00
Peter Kokot
4e193b4113
Autotools: Move abs_srcdir and abs_builddir to init macro (#15537)
This syncs the abs_srcdir and abs_builddir variables assignments between
the php-src build and phpize. The `&&` was picked over `;` as it is more
rigorous - the pwd command would fail if cd fails for some reason.
2024-08-22 16:26:48 +02:00
Peter Kokot
e7874f2089
Autotools: Move Zend/zend_config.h to AC_CONFIG_COMMANDS (#15538)
Instead of creating Zend/zend_config.h header file in an initialization
argument of "default" commands, this creates it in its own wrapper
when config.status is called.
2024-08-22 16:26:28 +02:00
Peter Kokot
602a4ac735
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix bug GH-15514 (Configure error: genif.sh: syntax error)

Autotools: Refactor main/internal_functions commands

This wraps generation of main/internal_functions* files into a separate
AC_CONFIG_COMMANDS and uses a SHELL variable instead of sh command.
Autoconf sets the SHELL variable to a suitable current shell the
configure is running in.

Instead of putting the commands into the 2nd argument the 3rd
initialization argument is used like before because it is easier to read
and work with variables (AWK, EXT_STATIC and EXT_CLI_STATIC), which
would need to be assigned again for the 2nd argument.

This simplifies the configure usage on Solaris 10 C shell and KornShell
without issuing errors when executing genif.sh script.
2024-08-21 18:20:42 +02:00
Peter Kokot
d5b5e61d80
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug GH-15514 (Configure error: genif.sh: syntax error)
2024-08-21 18:17:58 +02:00
Peter Kokot
48a18e5be7
Fix bug GH-15514 (Configure error: genif.sh: syntax error)
Autoconf assigns the current suitable shell to SHELL variable. This
notably fixes cases on Solaris 10 when using C shell or KornShell where
genif.sh: syntax error at line 35 occurs due to using the `sh` command.
2024-08-21 18:16:07 +02:00
Peter Kokot
c69d29ebc3
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15515: Configure error grep illegal option q (#15516)
2024-08-21 15:57:33 +02:00
Peter Kokot
9e63e20a2c
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15515: Configure error grep illegal option q (#15516)
2024-08-21 15:54:56 +02:00
Peter Kokot
63841ba7cf
Fix GH-15515: Configure error grep illegal option q (#15516)
On Solaris default grep doesn't support the -q option. In such cases
the grep output can be redirected to /dev/null and the exit status is
checked.
2024-08-21 15:51:27 +02:00
Peter Kokot
40217b2ea4
Autotools: Move auto_cflags marker to PHP_INIT_BUILD_SYSTEM (#15487)
The "hacky" auto_cflags variable is otherwise set only for the Oracle
Developer Studio compiler (which is at this point also non-usable) and
perhaps might be removed in the future but this is for now moved to the
PHP_INIT_BUILD_SYSTEM for consistent settings between the php-src build
and phpize.

The PHP_INIT_BUILD_SYSTEM is now also called sooner in phpize to match
the php-src build.
2024-08-19 22:29:20 +02:00
Peter Kokot
dffe25bd19
Autotools: Move AWK finder to PHP_INIT_BUILD_SYSTEM (#15478)
This calls the PHP_PROG_AWK from a single place for php-src build and
phpize.
2024-08-18 13:30:03 +02:00
Jakub Zelenka
0b61b8dc99
PHP-8.3 is now for PHP-8.3.12-dev 2024-08-13 20:16:40 +01:00
Sergey Panteleev
84d8fa9f53
PHP-8.2 is now for PHP 8.2.24-dev 2024-08-13 17:18:16 +03:00
Peter Kokot
540b9f5bc7
Autotools: Wrap long texts with m4_text_wrap (#15368)
The m4_text_wrap macro wraps the text into a single space separated
string which is wrapped to not exceed the line lenght of 79 characters
by default.
2024-08-13 10:33:17 +02:00
Peter Kokot
1108710892
Autotools: Sync CS across the configure.ac (#15332)
- AS_* macros used where it makes it easier to read
- Redundant double quotes removed (Autoconf and shell script don't need
  these on these places directly)
- Overquoted arguments reduced in AC_RUN_IFELSE
2024-08-10 22:13:50 +02:00
Peter Kokot
2b30b22d7d
Autotools: Quote PHP_CHECK_SIZEOF macro arguments
[skip ci]
2024-08-10 16:01:22 +02:00
Peter Kokot
a355c3572e
Update and sync PHP build preprocessor macros help texts (#15298)
[skip ci]
2024-08-08 21:31:57 +02:00
Peter Kokot
84e1920c12
Autotools: Add phpized configure log and help separators (#15251)
- This quotes all PHP_CONFIGURE_PART arguments
- When configuring and building extensions with phpize, this makes the
  './configure --help' and './configure' log output a bit more readable
  as it separates the extension configuration, Libtool configuration and
  the rest of the Autoconf and phpize configuration options.
- The ./configure output separators bold tags are moved to the
  PHP_INIT_BUILD_SYSTEM macro to be available also in phpized extensions
- The obsolete ticks `...` converted to the recommended $(...); Autoconf
  configure re-executes itself in shells where the $(...) still wouldn't
  work ok. For example, the default, initial, non-updated shell on
  Solaris 10.
- Empty new lines in help separators synced (Autoconf default separators
  don't include additional empty newline after the separator title);
  so the PHP_HELP_SEPARATOR additional empty line is also removed
  (see './configure --help' output)
2024-08-06 22:15:22 +02:00
Peter Kokot
62f75a7812
Autotools: Refactor thread safety checks (#15214)
- The ZTS is defined on only one place
- Added help text for ZTS preprocessor macro
- The 'enable_zts' variable replaced with PHP_THREAD_SAFETY in
  configure.ac.
- Nits fixed.
2024-08-05 22:30:10 +02:00
Peter Kokot
18a99a4d33
Autotools: Refactor debug checks (#15215)
- Added help text for ZEND_DEBUG preprocessor macro
- CS synced
2024-08-04 21:59:58 +02:00
Peter Kokot
dcdcb3cbfe
Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00
Peter Kokot
4f07cdc584
Replace PHP_OUTPUT with AC_CONFIG_FILES (#15186)
This is a follow-up of GH-15177
(c96f08aa70)
and GH-15185
(9467ffb43c)

The PHP_OUTPUT macro was introduced in the very early phase of the build
system due to AC_OUTPUT handling issues in the old Autoconf versions
before the AC_CONFIG_FILES, AC_CONFIG_COMMANDS etc were introduced with
the AC_OUTPUT signature without arguments. The PHP_OUTPUT was also
helping Makefile.in back then being properly generated based on whether
all files were generated or only some (when using the obsolete
CONFIG_FILES=... ./config.status invocation instead of the new
./config.status --file=...). Another issue is that PHP_OUTPUT can't be
used by extensions when using phpize.

This replaces the PHP_OUTPUT invocations with default AC_CONFIG_FILES.

The obsolete "REDO_ALL" feature at the config.status invocation is also
removed with a simpler unconditional generation.

In phar extension the "ext/phar" is replaced with $ext_dir variable to
be able to use phpize.
2024-08-03 21:52:14 +02:00
Peter Kokot
4993453933
Autotools: Update configure.ac CPP macros help texts (#15189)
- __MUSL__
- DEFAULT_SHORT_OPEN_TAG
- HAVE_BUILD_DEFS_H
- HAVE_GCOV
- HAVE_LIBDL
- PHP_RTLD_NOW
- PHP_SIGCHILD
- ZEND_FIBER_UCONTEXT
2024-08-02 01:14:48 +02:00
Peter Kokot
49a08d5ca3
Autotools: Move HAVE_DTRACE to configure.ac (#15160)
Following 32210ce967 and
9ea290b72b, this moves the HAVE_DTRACE
preprocessor macro definition back to configure.ac so that
PHP_INIT_DTRACE Autoconf macro can be used in extensions without
redefinition interference.
2024-07-30 07:47:11 +02:00
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
9cc63e1de9
Autotools: Normalize headers arguments (#15149)
Refactor all "long" arguments into blank-or-newline-separated list of
files with m4_normalize.
2024-07-29 10:08:17 +02:00
Peter Kokot
21e01f3e70
Autotools: Simplify PHP_ALWAYS_SHARED macro (#15129)
Instead of defining an empty M4 macro PHP_ALWAYS_SHARED when configuring
extensions in php-src using the main configure.ac, the m4_ifdef can be
used to conditionally call the macro when it is defined (when using
phpize).
2024-07-28 01:33:05 +02:00
Peter Kokot
0d36701b32
Autotools: Remove dead code (#15128)
This is a left over from 4dee0c4a14.

These definitions are now always done by the config-stubs file. For
phpize builds they are in the phpize.m4 as before.
2024-07-28 01:30:15 +02:00
Peter Kokot
ef8e792962
Autotools: Quote M4 macro arguments
- AC_CHECK_TYPES
- AC_REPLACE_FUNCS
- PHP_HELP_SEPARATOR needs here double quotes as content contains '['
  and ']' characters
2024-07-27 11:22:28 +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
6e57550f14
Autotools: Normalize DTrace sources argument (#15111)
Using the m4_normalize, the source files can be added more intuitively
using blank-or-newline delimited list of files. This adds also some
basic help text.
2024-07-26 23:30:20 +02:00
Peter Kokot
ff4b99e260
Autotools: Quote PHP_ADD_LIB* arguments (#15112)
Following previous CS syncs, this quotes arguments in PHP_ADD_LIB* M4
macros:
- PHP_ADD_LIBRARY
- PHP_ADD_LIBRARY_WITH_PATH
- PHP_ADD_LIBPATH
2024-07-26 23:26:55 +02:00
Peter Kokot
fa7ee84f0b
Autotools: Quote PHP_CONFIG_NICE arguments 2024-07-26 09:58:59 +02: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
Pierrick Charron
e07813ad46
PHP-8.2 is now for PHP 8.2.23-dev 2024-07-16 12:20:55 -04:00
Eric Mann
155e89e12f
PHP-8.3 is now for PHP 8.3.11-dev 2024-07-16 06:45:20 -07:00
Peter Kokot
694e04499a
Autotools: Sync LIBS and LDFLAGS handling (#14956)
- ZEND_EXTRA_LIBS holds all possible libraries appended during the
  checks related to Zend.m4, moved after the ZEND_INIT check to make it
  more clear, redundant double quotes removed;
- EXTRA_LIBS has already been populated above in the configure.ac
- redundant 'unset LIBS' removed
2024-07-15 12:16:53 +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
Ilija Tovilo
780a8280d2
[RFC] Property hooks (#13455)
RFC: https://wiki.php.net/rfc/property-hooks

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2024-07-14 11:55:03 +02:00
Peter Kokot
d59691c02f
Autotools: Move php_shtool variable initialization to PHP_INIT_BUILD_SYSTEM (#14904)
As this script is still needed across the PHP build system its path can
be also set on once place for both phpize usage and regular php-src's
configure.ac.
2024-07-10 21:15:02 +02:00
Peter Kokot
9e94d2b040
Autotools: Refactor builtin checks (#14835)
This creates a single M4 macro PHP_CHECK_BUILTIN and removes other
PHP_CHECK_BUILTIN_* macros. Checks are wrapped in AC_CACHE_CHECK and
PHP_HAVE_BUILTIN_* CPP macro definitions are defined to 1 if builtin
is found and undefined if not.

This also changes all PHP_HAVE_BUILTIN_ symbols to be either undefined
or defined (to value 1) and syncs all #if/ifdef/defined usages of them
in the php-src code. This way it is simpler to use them because they
don't need to be defined to value 0 on Windows, for example. This is
done as previous usages in php-src were mixed and on many places they
were only checked with ifdef.
2024-07-08 21:25:16 +02:00
Peter Kokot
745ae8ddd8
Autotools: Remove obsolete crypt link override due to OpenSSL (#14863)
OpenSSL versions before 0.9.7 provided its own crypt() function (and
des_* functions) in its Crypto library that interfered with the
implementation relying on crypt() from some other crypt library. This is
at this point obsolete as crypt and other functions that caused clashes
were removed in OpenSSL version 1.1.0.

In OpenSSL 0.9.7 des_old.c and des_old.h files were provided for BC.

In OpenSSL 0.9.8 crypt() function was renamed to _ossl_old_crypt and the
crypt macro definition was commented out in the des_old.h header.

In OpenSSL 1.1.0 the old DES API was removed, meaning OpenSSL's crypto
library no longer provides crypt() function as it used to.

References:
- Some further historic notes on this:
  https://www.openldap.org/faq/data/cache/1041.html
- OpenSSL Git commit history and changelogs
2024-07-08 20:24:28 +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
05b9345b08
Autotools: Remove unused DEBUG_CFLAGS variable (#12659)
This removes the unused DEBUG_CFLAGS variable from configure.ac. It has
been once set in the build files similarly to Zend.m4 but was then
removed and simplified.

CS synced and DEBUG_CFLAGS checked and appended with AS_VAR_* macros.
2024-07-08 17:05:57 +02:00