* Don't fiddle with NDEBUG in C code
It is way to late to do this in php.h, since assert.h has already been
included. Even pushing that down to zend_portability.h may not have
the desired effect. Instead we define or undefine NDEBUG as CFLAG, so
that it works in all circumstances.
As a last resort we fail at build time, if `NDEBUG` is defined when
`ZEND_DEBUG` is enabled.
We also remove the useless workaround in zend_test to include assert.h
again, since that usually won't have any effect anyway.
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
This marks the following environment variables as precious:
- PHP_BUILD_ARCH
- PHP_BUILD_COMPILER
- PHP_BUILD_PROVIDER
- PHP_BUILD_SYSTEM
- PHP_UNAME
Meaning, they are now also shown in the `./configure --help` output, and
they can be used like this when configuring the PHP build:
./configure PHP_BUILD_ARCH="..." PHP_BUILD_COMPILER="..." ...
This is a follow-up of previous backticks replacement commits. This
replaces backticks command substitutions in remaining ext config M4
files, phpize, and configure.ac with the recommended $(...).
Note that $(...) still does not work on some obsolete shells that ship
with Solaris 10, for example. Elsewhere they should work. However, for
these obsolete shells Autoconf also re-executes the shell script under
the supported shell so it can make them work regardless.
Additionally, few comments CS are also adjusted to not cause confusion
when searching for backticks usages and one indentation sync done.
As of Autoconf 2.72 the backticks in macro help texts are also replaced
with single quotes.
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.
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>
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.
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.
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.
* 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.
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.
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.
- 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
- 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)
- 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.
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
```
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.
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.
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).
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.