Commit Graph

302 Commits

Author SHA1 Message Date
Nikita Popov
451314111b Revert "Remove configure checks for supported instruction sets"
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.
2019-11-04 11:32:46 +01:00
Nikita Popov
edccf32f7f Remove configure checks for supported instruction sets
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.
2019-10-31 11:27:53 +01:00
Nikita Popov
c518932c03 Add "-pthread" to EXTRA_LDFLAGS_PROGRAM as well 2019-10-14 11:33:39 +02:00
Gerard Roche
db54b0fa18 Azure: Publish code coverage results
* Add an Azure Publish Code Coverage Results task
* Add `make gcovr-html` to generate a gcovr test coverage report in HTML
* Add `make gcovr-xml` to generate a gcovr test coverage report in XML
* Remove `test` target dependency from `make lcov-html`;
  Run the two targets together instead: `make test lcov-html`.

Re: https://github.com/php/php-src/pull/4739#issuecomment-534911441

See: https://externals.io/message/107113,
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops,
and https://github.com/php/php-src/pull/4759.
2019-10-11 17:44:36 +02:00
Nikita Popov
3718a95526 Remove configure checks for ltp when using --enable-gcov
gcov builds can also be used with other tools like gcovr, so remove
the hard dependency on LTP.
2019-10-11 16:51:03 +02:00
Dmitry Stogov
1bb1a1ee28 Revert "Don't buid static libaraies when only DSO required"
This reverts commit f633c34757.
2019-10-10 16:28:59 +03:00
Dmitry Stogov
3ded328bea Fixed bug #78614 (Does not compile with DTRACE anymore) 2019-10-04 10:10:22 +03:00
Gerard Roche
9cc1bf5628 Fix GCOV not working for PHP-7.4 and master branches
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.
2019-09-25 10:19:19 +02:00
Dmitry Stogov
f633c34757 Don't buid static libaraies when only DSO required 2019-09-19 23:44:53 +03:00
Peter Kokot
ef165b4422 Remove build.mk usage
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
2019-07-21 11:40:23 +02:00
Peter Kokot
bbdbc2658c Remove duplicate socklen_t check
- Use Autoconf's default AC_CHECK_TYPES

Closes GH-4418
2019-07-18 12:11:19 +02:00
Peter Kokot
a6daded1a4 Refactor undefining PACKAGE_* symbols
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
2019-07-11 02:00:51 +02:00
Peter Kokot
900de30b0f Refactor genif.sh
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
2019-07-08 14:58:26 +02:00
Peter Kokot
a39ea91753 Simplify PHP_CHECK_PDO_INCLUDES calls
Conditional checks were once used for backwards compatibility with
phpize from PHP versions that didn't have this macro call yet.

Closes GH-4376
2019-07-08 10:24:41 +02:00
Peter Kokot
5ba69ab3ad Remove some unused variables
- 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
2019-07-08 10:18:17 +02:00
Peter Kokot
3bde4838f4 Remove PHP_DEBUG_MACRO
The macro is no longer used. The warning at the end of the configure
script therefore is also no longer used.
2019-07-07 12:15:36 +02:00
Peter Kokot
49cc2a63b3 Remove some more Apache 1 left overs
- warning in configure.ac is relevant for the sapi/apache
- errors output redirected to /dev/null when checking Apache version
2019-07-07 12:09:19 +02:00
Peter Kokot
16df718251 Remove PHP_CHECK_CONFIGURE_OPTIONS
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
2019-07-02 22:15:24 +02:00
Peter Kokot
798fed3b0d Remove warnings for bison and re2c checks
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
2019-06-27 00:59:59 +02:00
Hugh McMaster
32114b57f3 Use a common setup macro to detect the Expat library
Closes GH-4221.
2019-06-04 10:10:50 +02:00
Peter Kokot
29bff939c7 Enhance makedist script
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
2019-05-18 02:05:59 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
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
2019-05-12 18:43:03 +02:00
Peter Kokot
e586d3f447 Bump config.guess and config.sub
```
wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
```
2019-05-11 00:24:26 +02:00
Peter Kokot
4eb67310a0 Remove vcsclean script
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`
2019-05-08 21:51:01 +02:00
Peter Kokot
ce65d2354c Remove TSRM configuration header
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.
2019-04-29 22:34:43 +02:00
Peter Kokot
c79eb107a0 Simplify checking of *nix build tools
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.
2019-04-29 01:30:27 +02:00
Peter Kokot
f9db357623 Automatically remove aclocal.m4 if present
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.
2019-04-28 21:05:34 +02:00
Peter Kokot
beb58ca128 Move Autoconf Archive macros to a common m4 dir
In PHP the build dir is used as a directory for external macros
including Autoconf Archive macros.
2019-04-23 20:37:31 +02:00
Peter Kokot
4e7064d173 Move acinclude.m4 to build/php.m4
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
2019-04-23 20:28:45 +02:00
Peter Kokot
02c1f3293e Join build makefiles together
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.
2019-04-17 21:52:58 +02:00
Peter Kokot
b09fa9ed53 Simplify generated_lists generation
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.
2019-04-16 17:25:08 +02:00
Peter Kokot
69b20f51e1 Disable PACKAGE_* preprocessor symbols
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.
2019-04-13 07:00:17 +02:00
Peter Kokot
5e16f5b8d8 Remove php7.spec.in file
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.
2019-03-28 17:42:11 +01:00
Peter Kokot
8b94042c47 Enhance Autoconf version checking
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
2019-03-24 02:12:46 +01:00
Remi Collet
ed808c59e4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  NEWS
  Revert "Fix #77609: Tests from mailparse extension fails"
2019-03-20 11:55:44 +01:00
Peter Kokot
2957651c5c Move Makefile.global and Makefile.gcov to build directory
These files can be stored in the build directory instead of bloating the
project root directory.
2019-03-04 12:30:42 +01:00
Peter Kokot
1c32d751c7 Remove mkinstalldirs, install-sh and missing
These scripts are part of Automake [1] and are in current *nix build
system not used anymore nor empty files need to be created.

[1] https://www.gnu.org/software/automake/manual/html_node/Auxiliary-Programs.html
2019-03-04 12:10:50 +01:00
Peter Kokot
e763cc7425 Fix file permissions
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.
2019-02-28 22:07:16 +01:00
Peter Kokot
3aeb7b0e77 Remove deprecated PHP_EXTENSION m4 macro
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.
2019-02-27 20:12:53 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Peter Kokot
7e445ef3b1 Set AC_CONFIG_AUX_DIR to build directory
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.
2018-12-10 08:11:44 +01:00
Eli Schwartz
2d03197749 ext/gd: Use pkg-config to detect the availability of freetype2
The latest version of freetype2 does not install freetype-config by
default, but pkg-config support has been there for approximately 15
years. In order to reliably detect freetype2, pkg-config *must* be used.

See:
https://savannah.nongnu.org/bugs/?53093
https://bugs.php.net/bug.php?id=76324
2018-11-07 13:05:47 +01:00
Peter Kokot
addcf2402d Remove mkdep.awk
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.
2018-10-20 10:08:54 +02:00
Peter Kokot
82f59a9682 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Fix #77041: buildconf should output error messages to stderr
2018-10-20 09:55:33 +02:00
Peter Kokot
b7cef2b008 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Fix #77041: buildconf should output error messages to stderr
2018-10-20 09:54:00 +02:00
Peter Kokot
0dc15e1885 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
  Fix #77041: buildconf should output error messages to stderr
2018-10-20 09:51:22 +02:00
Mizunashi Mana
9f5cb626ed Fix #77041: buildconf should output error messages to stderr 2018-10-20 09:42:56 +02:00
Peter Kokot
3412345ffe Remove unused variable makefile_am_files
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.
2018-10-16 22:33:04 +02:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
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
2018-10-14 12:56:38 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
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
2018-10-14 12:55:24 +02:00