This reverts commit edccf32f7f.
This was reported to cause issues for as yet unknown reasons in
bug #78769. As this was intended as code cleanup, revert this from
7.4 at least. May reapply it to master later.
These were checking whether the instruction set is supported by
the host CPU, however they were only used to condition on whether
this instruction set is targeted at all. It would still use dynamic
dispatch (e.g. based on ifunc resolvers) to select the actual
implementation. Whether the target is guaranteed to support the
instruction set without dispatch is determined based on pre-defined
macros like __SSE2__.
This removes the configure-time builtin cpu checks to remove
confusion. Additionally this allows targeting an architecture that
is newer than the host architecture.
Code coverage reports (`make lcov`), since commit eef8522 (7.4 branch),
generates incorrect coverage and emits warnings. Simplifying the
Makefile.gcov file has the side-effect of resolving the issue.
Processing sapi/cli/php_http_parser.gcda
php-src/lcov_data/sapi/cli/php_http_parser.gcda:stamp mismatch with notes file
geninfo: WARNING: gcov did not create any files for php-src/lcov_data/sapi/cli/php_http_parser.gcda!
...
Processing ext/mbstring/mb_gpc.gcda
php-src/lcov_data/ext/mbstring/mb_gpc.gcda:stamp mismatch with notes file
geninfo: WARNING: gcov did not create any files for php-src/lcov_data/ext/mbstring/mb_gpc.gcda!
Closes: https://bugs.php.net/bug.php?id=52718.
See also: https://bugs.php.net/bug.php?id=78288.
First step when creating the `configure` script is currently using
make. This is helpful when developing buildsystem to only rebuild
`configure` and `main/php_config.h.in` files when one of the *.m4
or configure.ac file changes and saves the developer time a little.
Realistically however, it is not needed that much considering the
times of several seconds to fully rebuild the configure script and
configuration header. The next step when running the `configure`
script is much more time consuming so performance on buildconf
level is a bit questionable and won't be noticed on today's
systems.
Additionally:
- buildconf now removes cache and all targets and uses -f option on
the first step i.e. autoconf. The autoheader does not need the -f
option in this case.
Closes GH-4437
Instead of patching configuration headers template generated by
the given tools - autoheader, this moves patching these symbols to
the configure step before creating and invoking the config.status
and before the configuration header file is generated from the
patched template.
Closes GH-4374
Changes:
- Coding style fixes
- ${1+"$@"} replaced with "$@" [1]
- EXTRA_MODULE_PTRS variable is not used anymore
- awk tool defined via environment variable
- srcdir determined automatically from the genif.sh location
[1] https://www.in-ulm.de/~mascheck/various/bourne_args/
Closes GH-4372
- Variables php_abs_top_srcdir php_abs_top_builddir are no longer used.
- ZEND_EXT_TYPE is always zend_extension and variable is no longer used.
Closes GH-4378
Instead of building a custom macro for checking configure options,
Autoconf 2.62+ already outputs a warning at the beginning and the end
of the output of configure script. It automatically detects correct
and wrong options better.
This is related also to bug #55634.
So now instead a better way is the default Autoconf approach:
This outputs a warning at the beginning and end of the configure output:
./configure --with-non-existing
This results in fatal error:
./configure --non-existing
configure: error: unrecognized option: `--non-existing'
Try `./configure --help' for more information
The `--enable-option-checking=fatal` results in fatal error for all non
existing options:
./configure --with-non-existing --enable-option-checking=fatal
configure: error: unrecognized options: --with-non-existing
Closes GH-4348
This patch removes warnings when lexer and parser files are already
generated. For example, when downloading a PHP release. Realistically,
it is not so trivial to rebuild lexer and parser files without removing
them first. And considering that tarballs don't have cleaning tools
such as Git, this would require manual removali.
Related also to https://bugs.gentoo.org/593278
This enhances the makidst script:
- integrate both snapshot and makedist scripts together
- add help and options
- generated files are created in the php-src repository directly
- other minor enhancemenets such as CS fixes
- functionality moved from the Makefile to only shell script
- Add missed patching of the Zend Parsers to the main build step
- Add all *.tmp files to gitignore
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
The vcsclean script is really only a wrapper for a git clean command.
Developers should use the more proper and clear native Git command
directly instead:
`git clean -Xfd`
TSRM configuration header file was once created by separate autoconf
build system for TSRM and is with the current code not directly needed
like this anymore.
The buildmk.stamp file has been created by the *nix build checking step
to run the check step only once. Instead of poluting the project root
directory, the stamp file can be also omitted. Performance difference is
very minimal to not justify having the stamp check at all today anymore.
This patch integrates the buildcheck.sh to buildconf script directly.
Commit 4e7064d173 removed the usage of
`aclocal.m4`. When using Git repositories, many times cleaning of the
generated files is not done prior to running phpize or buildconf. For
example:
git clone git://github.com/php/php-src
cd php-src
git checkout PHP-7.3
./buildconf
./configure
git checkout PHP-7.4
./buildconf # -> warnings
./configure # -> errors
To not accidentally include `aclocal.m4` file in the generated configure
this enhances build system experience a bit more by removing aclocal.m4
file prior to start building configure file using phpize or buildconf.
The acinclude.m4 file is in a usual Autotools build processed with
Automake's aclocal tool. Since PHP currently doesn't use Automake and
aclocal this file can be moved into the build directory. PHP build
system currently generates a combined aclocal.m4 file that Autoconf
can processes automatically.
However, a newer practice is writing all local macros in separate
dedicated files prefixed with package name, in PHP's case PHP_MACRO_NAME
and putting them in a common `m4` directory. PHP uses currently `build`
directory for this purpose.
Name `php.m4` probably most resembles such file for PHP's case.
PHP manually created the aclocal.m4 file from acinclude.m4 and
build/libtool.m4. Which is also not a particularly good practice [1], so
this patch also removes the generated alocal.m4 usage and uses
m4_include() calls manually in the configure.ac and phpize.m4 files
manually.
- sort order is not important but can be alphabetical
- list of *.m4 files prerequisites for configure script generation
updated
- Moving m4_include() before AC_INIT also removes all comments starting
with hash character (`#`) in the included files.
[1] https://autotools.io/autoconf/macros.html
Changes:
- Joins build/build.mk and build/build2.mk files together since there
isn't any practical reason for having two different files with the
current build system.
- Makefile is now more portable. All special syntaxes are omitted, for
example, a conditional assignment operators `?=`. This makes buildconf
more useful on Solaris make derivative, so there is no longer need to
override make with gmake: `MAKE=gmake ./buildconf`.
- Suppressing autoconf and autoheader warnings is not needed anymore
with current build system. Instead, the option `-Wall` has been used
when running `./buildconf --debug` to get more useful debug info
about current M4.
The `generated_lists` file is generated as a helper for build related
Makefile to include a list of *.m4 files prerequisites. When some of
these *.m4 files change, the configure script is regenerated when
buildconf is run. This can be simplified using dynamic environment
variable passed to the Makefile directly so it avoids another file from
being generated in the project root directory and shipping it with the
PHP release or creating a dedicated gitignore rule.
This is portable across all POSIX compatible makes So this patch
includes GNU Make, and everybody elses' make derivative support.
Autoconf defines PACKAGE_* symbols:
- PACKAGE_NAME
- PACKAGE_VERSION
- PACKAGE_TARNAME
- PACKAGE_STRING
- PACKAGE_BUGREPORT
- PACKAGE_URL
and appends them to the generated config.h.in files. With AC_INIT change
via afd52f9d99 where package version, URL,
bug report location and similar meta data are defined, these
preprocessor macros are then non empty strings in the generated
configuration header file. When using phpize, PHP shares the config
files in extensions, warnings of redefined macros appear, such as:
- `warning: 'PACKAGE_NAME' macro redefined`
This patch now disables these non utilized symbols in the generated
config header files.
Better practice would be to include only API specific headers where
needed but this would require even more refactorings. Some extensions
such as pcre, pgsql, and pdo_pgsql solve this issue by undefining some
of these symbols before including the library configuration headers in
the code also. Because these symbols can be defined by any library which
uses Autotools.
Additionally, the unused PACKAGE_* symbols were cleaned for the bundled
libmbfl library and with this patch not needed undef code removed.
RPM specification file was introduced via
7c2f1384d4 for PHP to include official
RPM packages long time agon. With removal of the makerpm script via
3d51d4c90c and Linux repositories to
manage such updated and customized info in their repositories this file
is most likely not needed anymore.
With this required Autoconf version is now defined only on two places:
- configure.ac
- scripts/phpize.m4
and additionally:
- Script can be run from other locations
- Synced CS and portability a bit
Git can track executable (0755) and non-executable (0644) file modes.
This patch fixes file permissions in the php-src repository according to
the predefined executable files with 0755 permissions (shell scripts)
and all others with 0644 permissions.
The PHP_EXTENSION macro was used before the introduction of the updated
build system in the 9d9d39a0de. The
extensions at that time possibly still used the Makefile.in and Automake
and the PHP_EXTENSION macro has been replaced with the PHP_NEW_EXTENSION
macro.
Today, the once deprecated macro can be removed in favor of only
PHP_NEW_EXTENSION macro.
The Autoconf macro AC_CONFIG_AUX_DIR can set the location of the
auxiliary build tools such as config.guess, config.sub, and bundled
libtool scripts and moves these bundled files from the root directory
to the build subdirectory.
Additionally some changes in this context or as a part of obsoletion:
- The LT_TARGETS variable in build/build2.mk file was once used as a part
of the Automake step. It's not used anymore and has been refactored to
separate makedist script directly.
- ltconfig is not used anymore since libtool 1.4+
cf8d1563c2
- phpize file locations for the config.guess, config.sub, and ltmain.sh
has been refactored accordingly.
The `mkdep.awk` file was part of the previous *nix build system and was
used to create a .deps file with a list of dependencies that could be
processed by Automake further on.
Newer build system was done via 9d9d39a0de
and outdated files removed via 22815419f8
so the current file in the PHP source code is not used anymore.
Additionally, the *.slo files were processed by this file. The *.slo
files also used to be generated by older libtool so today, these don't
get generated anymore.
The `makefile_am_files` was part of the previous build system where
automake was used to build Makefiles. Since 9d9d39a0de
this is not used anymore and can be removed.
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.
According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.
According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2