Commit Graph

68 Commits

Author SHA1 Message Date
Peter Kokot
1f2948a966
Sync PHP_SUBST in phpize.m4 (#14756)
- Arguments quoted
- Duplicate redundant prefix variable substitution removed
2024-07-01 23:15:44 +01:00
Peter Kokot
cf3b9fca8f
Sync #if/ifdef/defined (-Wundef) (#14623)
These are either define (to value 1) or undefined:
- __GNUC__
- DBA_CDB_BUILTIN
- DBA_GDBM
- HAVE_FORK
- HAVE_PUTENV
- HAVE_SETENV
- HAVE_SYS_SELECT_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_WAIT_H
- HAVE_UNSETENV
- RFC3678_API
- ZEND_ENABLE_ZVAL_LONG64
- ZTS

Follow-up of GH-5526
2024-06-24 19:37:07 +02:00
Arnaud Le Blanc
182fee1447
Fix removal of optimization cflags in debug builds (#9647)
Discard known '-O' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
2024-05-22 13:22:34 +02:00
Peter Kokot
530e0d68eb
Create modules directory in a centralized location (#13411)
Shared objects of extensions during the *nix build are copied to the
`modules` directory. It is a practice established since the early days
of the PHP build system. Other build systems may have similar concept of
"library destination directory". On Windows, they are put into the root
build directory. Such directory simplifies collection of the shared
extensions during testing, or when running the cli executable at the end
of the build process.

This change ensures that the directory is consistently created in a
single location, for both the primary PHP build process and when
utilizing `phpize` within community extensions.

The AC_CONFIG_COMMANDS_PRE is executed at the end of the configuration
phase, before creating the config.status script, where also build
directories and global Makefile are created.

The pwd is executed using the recommended $(...) instead of the obsolete
backticks. Autoconf automatically locates the proper shell and
re-executes the configure script if such case is found that $(...) is
not supported (the initial /bin/sh on Solaris 10, for example).
2024-03-21 17:43:49 +01:00
Peter Kokot
5140889c92
Remove unused build variables (#12746)
- LFLAGS
- PHP_LIBS
- SHARED_LIBTOOL
- EXT_LIBS

These were part of the build system in the past and are no longer used
in current code.
2023-11-22 19:15:30 +01:00
Derick Rethans
2c166647f1 Fix phpize to include _GNU_SOURCE by default
This is to address the issue at
067df26344 (commitcomment-61578732)
2022-06-16 20:49:03 +01:00
Joe Watkins
c29226581e
Set BUILD_CC for phpize 2021-06-13 16:25:41 +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
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
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
Hugh McMaster
c9ee822bb6 Always use pkg-config from the host architecture 2019-04-29 14:16:16 +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
afd52f9d99 Refactor AC_INIT in configure.ac and PHP versions
Since Autoconf 2.53 the AC_INIT call with only a single argument has
been made obsolete and now includes several other optional arguments to
make installation experience a bit better by providing program version
and links to the project in the `./configure -h` output. This patch also
updates win build version. The phpize.m4 AC_INIT has been updated with
the call without arguments.
2019-04-07 05:52:14 +02:00
Peter Kokot
3207741df0 Refactor PHP_PROG_BISON and PHP_PROG_RE2C
This patch refactors these macros to also checks for the required given
versions of bison and re2c.

- PHP_PROG_RE2C and PHP_PROG_BISON take optional args - minmimum version
  required, and bison also excluded versions.
- Instead of caching values this uses manual checking and messaging
  outputs.
- It looks like the minimum version of RE2C 0.13.4 is working ok so far.

The genfiles script improvements:
- Add make override in genfiles
- Move checkings from makedist to genfiles
- Refactored output messages
- Various minor enhancements
2019-03-30 02:01:02 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Peter Kokot
6bb657fc34 Remove AC_PROG_CC_C_O
The AC_PROG_CC_C_O macro checks if compiler can use both -c and -o
options together and if not it defines the NO_MINUS_C_MINUS_O symbol.
It is not used in current codebase and therefore removed.
2019-03-03 14:47:49 +01: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
Peter Kokot
1257664ca2 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Fix #77035: The phpize and ./configure create redundant .deps file
2018-10-19 00:12:48 +02:00
Peter Kokot
74131ca342 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Fix #77035: The phpize and ./configure create redundant .deps file
2018-10-19 00:10:22 +02:00
Peter Kokot
5531dde5e9 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
  Fix #77035: The phpize and ./configure create redundant .deps file
2018-10-19 00:07:42 +02:00
Peter Kokot
447b41f6bb Fix #77035: The phpize and ./configure create redundant .deps file
The `.deps` file(s) was once used by Automake and created to write
dependencies to it. The file creation has been removed via the commit
779c11af21.

The phpize and ./configure script create a redundant .deps file in a
PECL extension directory which might cause confusions why is it used.
Today it is no longer relevant so this redundant artefact can be
removed in the phpize configure script.
2018-10-19 00:02:09 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Peter Kokot
9bbf9967bd Modernize the AC_PRESERVE_HELP_ORDER macro call
The Autoconf AC_PRESERVE_HELP_ORDER macro has been available since
Autoconf 2.59c [1] and in PHP it has been called conditionally on two places
to support older Autoconf versions. With recent updates and the macro
can be called unconditionally.

[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
2018-10-11 12:58:41 +02:00
Peter Kokot
0b0d4b5f0d Bump minimum Autoconf requirement to 2.68
This patch syncs and bumps the minimum required version of Autoconf for
the `phpize.m4` script and the main `configure.ac` from previously mixed
2.64 and 2.59 to 2.68.

At the time of this writing Autoconf 2.63 is still the version on
Centos 6, however by the PHP 7.3 release current systems out there
should all have pretty much updated Autoconf versions to 2.64+ at
least. Centos 7 already has Autoconf 2.69, for example.

This provides more options to update and get current with the *nix
build system and also avoids broken builds in certain cases as pointed
out in the relevant discussion [1].

Additionally, phpize also already provides the `AX_CHECK_COMPILE_FLAG`
Autoconf Archive m4 file that has Autoconf 2.64 minimum requirement.

Autoconf 2.68 was released in 2010, 8 years ago, relative to this patch.

[1] https://github.com/php/php-src/pull/3562
2018-10-09 21:06:10 +02:00
Peter Kokot
daaf706df0 Upgrade deprecated AC_OUTPUT macro calls
Autoconf 2.50 made several changes to macro calls. These include also
arguments passed to AC_OUTPUT macro. The upgrading chapter in Autoconf
documentation include an example of using AC_OUTPUT with
AC_CONFIG_FILES and AC_CONFIG_COMMANDS:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

PHP 5.4 to 7.1 require Autoconf 2.59+, PHP 7.2+ require Autoconf 2.64+,
and PHP 7.2 phpize script requires Autoconf 2.59+ which are all greater
than above mentioned 2.50 version. Systems out there should well support
this by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

More info on where exactly this got deprecated:
- ftp://ftp.gnu.org/old-gnu/Manuals/autoconf-2.13/html_mono/autoconf.html
- ftp://ftp.auckland.ac.nz/pub/gnu/Manuals/autoconf-2.52/html_chapter/autoconf_15.html
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
2018-07-29 16:04:39 +02:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +02:00
Peter Kokot
491f1477be Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS
Autoconf doesn't mention the AC_CONFIG_HEADER macro since the v2.13
released in 1999 anywhere in the documentation. Future of this macro is
unclear and commented as possible candidate for obsoletion in the
autoconf source code. Since it is just a wrapper around the main
AC_CONFIG_HEADERS macro, the functionality is the same, and also more
clear to find it in the autoconf documentation and avoid possible future
obsoletion.
2018-07-07 12:10:53 +02:00
Brian Evans
2fe9208ee3
Use modern autotools name of configure.ac instead of configure.in
configure.ac was introduced in 2001 with automake-1.15 and autoconf-2.50
to replace the file named configure.in.
Autotools is preparing to remove configure.in in Automake 2.0.
All new software should be using configure.ac.
This also fixes Bug #69770 where extensions are creating configure.in

Signed-off-by: Brian Evans <grknight@gentoo.org>
2017-01-27 06:07:40 +00:00
Yuchen Wang
2bd097c9f6 Fix wrong display in ZTS checking 2015-05-12 17:32:01 +08:00
Christopher Jones
2e235022e9 Relax autoconf support from 2.60 to 2.59. This is the version available on Centos/RHEL/Oracle Linux 5.6 2011-06-08 01:25:35 +00:00
Rasmus Lerdorf
438cc7f201 Drop support for autoconf < 2.60 in trunk and the
new PHP_5_4 branch. autoconf >= 2.60 should finally
be working now.
2011-05-15 06:09:21 +00:00
Jani Taskinen
309a56f3f7 - Fixed -g adding for gcc and g++ (former got it twice, latter not at all) 2010-11-02 09:58:08 +00:00
Gwynne Raskind
ea03ad31b7 One change in trying to update Autoconf was missed. This makes phpize work again. 2009-12-02 17:42:58 +00:00
Rasmus Lerdorf
58ae9eeb11 Missed a few - now it really works with autoconf-2.64+ 2009-11-25 01:36:41 +00:00
Jani Taskinen
d0ef930190 MFH:- Fixed bug #48456 (CPPFLAGS not restored properly in phpize.m4) 2009-06-02 19:54:03 +00:00
Derick Rethans
d29d24427f - MFH: Get rid of the four different versions of zend_extension* and only use
zend_extension. Because of the API identifier change in PHP 5.3 you also get
  a proper warning message now.
#- [DOC]
2009-05-18 21:33:38 +00:00
David Soria Parra
2b830291bb Fix cc detection in phpize according to changes in configure.in 2008-12-03 19:52:59 +00:00
Jani Taskinen
708cb0ec0e MFH:- Applied the missing parts to phpize.m4 for zend extension builds 2008-07-31 00:45:17 +00:00
Jani Taskinen
87acbd2639 MFH:- Detect whether debugging was enabled in PHP and drop optimizing flags if so (merge from configure.in) 2008-07-30 23:56:05 +00:00
Jani Taskinen
2af5002d5b ws 2008-07-30 22:55:08 +00:00
David Soria Parra
e4ad2672b8 MFB: - Fixed the fix for not requiring C++ always 2008-07-27 20:43:40 +00:00
Jani Taskinen
395e75bc5d MFH: Fixed a minor problem in not enabling c++/g++ when not needed. 2008-07-25 12:36:34 +00:00
Jani Taskinen
e602885e54 MFH:- Fixed bug #42292 ($PHP_CONFIG not set for phpized builds) 2007-08-14 08:43:41 +00:00
Jani Taskinen
67940a9c29 MFH:- Fixed bug #42195 (C++ compiler required always) 2007-08-06 14:33:51 +00:00
Antony Dovgal
934b97d611 MFH 2007-07-25 09:41:06 +00:00
Jani Taskinen
6b4b1e7431 MFH: cleanup & sync 2007-07-18 15:04:22 +00:00
foobar
c1c44ddcf3 MFH: - Add missing CXXFLAGS_CLEAN variable. 2007-06-01 15:12:29 +00:00
foobar
276171f871 MFH: - Determine the shared/link lib suffixes in one macro. 2006-04-10 12:16:17 +00:00
Andrei Zmievski
9e5655387a MFH 2006-04-08 17:53:11 +00:00