Skip to content

Commit c047551

Browse files
committed
Add simplifications and adjustments
- Separate M4 macro removed (EXTRA_LIBS and ZEND_EXTRA_LIBS directly used in template) - Generated files added to 'make distclean' command for removal - Installation log texts adjusted according to current context - In templates PHP_THREAD_SAFETY used instead of ZEND_ZTS
1 parent 214d9c8 commit c047551

File tree

8 files changed

+13
-26
lines changed

8 files changed

+13
-26
lines changed

build/Makefile.global

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ distclean: clean
131131
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1
132132
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
133133
rm -f ext/phar/phar.phar ext/phar/phar.php
134+
rm -f scripts/php.pc sapi/embed/php-embed.pc
134135
if test "$(srcdir)" != "$(builddir)"; then \
135136
rm -f ext/phar/phar/phar.inc; \
136137
fi

build/php.m4

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,19 +2536,3 @@ AS_VAR_IF([php_var], [yes],
25362536
[Define to 1 if the compiler supports the '$1' variable attribute.])])
25372537
AS_VAR_POPDEF([php_var])
25382538
])
2539-
2540-
dnl
2541-
dnl PHP_PKG_CONFIG
2542-
dnl
2543-
dnl Prepare and substitute variables needed in pkg-config .pc files, such as
2544-
dnl php.pc.in. For example, a list of all external libraries that were linked to
2545-
dnl PHP.
2546-
dnl
2547-
AC_DEFUN([PHP_PKG_CONFIG],
2548-
[PHP_LIBS_PRIVATE=$EXTRA_LIBS
2549-
AS_VAR_SET_IF([ZEND_EXTRA_LIBS],
2550-
[AS_VAR_APPEND([PHP_LIBS_PRIVATE], [" $ZEND_EXTRA_LIBS"])])
2551-
AC_SUBST([PHP_LIBS_PRIVATE])
2552-
AC_SUBST([ZEND_DEBUG])
2553-
AC_SUBST([ZEND_ZTS])
2554-
])

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,8 +1328,6 @@ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
13281328
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
13291329
unset LDFLAGS
13301330

1331-
PHP_PKG_CONFIG
1332-
13331331
AC_ARG_PROGRAM
13341332

13351333
AS_VAR_IF([prefix], [NONE], [prefix=/usr/local])
@@ -1433,6 +1431,8 @@ AC_SUBST([SAPI_LIBNAME_STATIC])
14331431
AC_SUBST([PHP_VERSION])
14341432
AC_SUBST([PHP_VERSION_ID])
14351433
AC_SUBST([PHP_LDFLAGS])
1434+
AC_SUBST([PHP_THREAD_SAFETY])
1435+
AC_SUBST([ZEND_DEBUG])
14361436

14371437
PHP_UTILIZE_RPATHS
14381438

@@ -1495,7 +1495,7 @@ PHP_SUBST_OLD([EXTENSION_DIR])
14951495
PHP_SUBST([EXTRA_LDFLAGS])
14961496
PHP_SUBST([EXTRA_LDFLAGS_PROGRAM])
14971497
PHP_SUBST_OLD([EXTRA_LIBS])
1498-
PHP_SUBST([ZEND_EXTRA_LIBS])
1498+
PHP_SUBST_OLD([ZEND_EXTRA_LIBS])
14991499
PHP_SUBST([INCLUDES])
15001500
PHP_SUBST([EXTRA_INCLUDES])
15011501
PHP_SUBST([INSTALL_IT])

sapi/embed/Makefile.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
install-embed:
2-
@echo "Installing PHP Embed SAPI: $(INSTALL_ROOT)$(libdir)"
2+
@echo "Installing PHP Embed .pc file: $(INSTALL_ROOT)$(orig_libdir)/pkgconfig/"
33
@$(mkinstalldirs) $(INSTALL_ROOT)$(orig_libdir)/pkgconfig
44
@$(INSTALL_DATA) sapi/embed/php-embed.pc $(INSTALL_ROOT)$(orig_libdir)/pkgconfig/$(program_prefix)php-embed$(program_suffix).pc

sapi/embed/config.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ if test "$PHP_EMBED" != "no"; then
3131
AC_MSG_RESULT([$PHP_EMBED_TYPE])
3232
AC_SUBST([PHP_EMBED_TYPE])
3333

34-
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/embed/Makefile.frag], [$abs_srcdir/sapi/embed], [$abs_builddir/sapi/embed])
34+
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/embed/Makefile.frag],
35+
[$abs_srcdir/sapi/embed],
36+
[$abs_builddir/sapi/embed])
3537
PHP_OUTPUT([sapi/embed/php-embed.pc])
3638

3739
install_embed=install-embed

sapi/embed/php-embed.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ php_inipath=@EXPANDED_PHP_CONFIG_FILE_PATH@
2424
# Whether PHP is built in debug mode (yes) or not (no).
2525
php_debug=@ZEND_DEBUG@
2626
# Whether PHP is built with thread safety (yes) or not (no).
27-
php_zts=@ZEND_ZTS@
27+
php_zts=@PHP_THREAD_SAFETY@
2828

2929
Name: PHP Embed SAPI
3030
Description: A lightweight SAPI to embed PHP into application using C bindings
3131
URL: https://www.php.net
3232
License: PHP
3333
Version: @PHP_VERSION@
3434
Cflags: -I${includedir} -I${includedir}/main -I${includedir}/TSRM -I${includedir}/Zend -I${includedir}/ext -I${includedir}/ext/date/lib
35-
Libs.private: @PHP_LIBS_PRIVATE@
35+
Libs.private: @EXTRA_LIBS@ @ZEND_EXTRA_LIBS@
3636
Libs: -L${libdir} -lphp

scripts/Makefile.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ install-programs: $(builddir)/phpize $(builddir)/php-config
4646
echo " page: $(program_prefix)$${page}$(program_suffix).1"; \
4747
$(INSTALL_DATA) $(builddir)/man1/$${page}.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)$${page}$(program_suffix).1; \
4848
done
49-
@echo "Installing pkgconf .pc file: $(INSTALL_ROOT)$(orig_libdir)/pkgconfig/php.pc"
49+
@echo "Installing PHP .pc file: $(INSTALL_ROOT)$(orig_libdir)/pkgconfig/"
5050
@$(mkinstalldirs) $(INSTALL_ROOT)$(orig_libdir)/pkgconfig
5151
@$(INSTALL_DATA) $(builddir)/php.pc $(INSTALL_ROOT)$(orig_libdir)/pkgconfig/$(program_prefix)php$(program_suffix).pc
5252

scripts/php.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ php_inipath=@EXPANDED_PHP_CONFIG_FILE_PATH@
2424
# Whether PHP is built in debug mode (yes) or not (no).
2525
php_debug=@ZEND_DEBUG@
2626
# Whether PHP is built with thread safety (yes) or not (no).
27-
php_zts=@ZEND_ZTS@
27+
php_zts=@PHP_THREAD_SAFETY@
2828

2929
Name: PHP
3030
Description: Build extension for a PHP general-purpose scripting language
3131
URL: https://www.php.net
3232
License: PHP
3333
Version: @PHP_VERSION@
3434
CFlags: -I${includedir} -I${includedir}/main -I${includedir}/TSRM -I${includedir}/Zend -I${includedir}/ext -I${includedir}/ext/date/lib
35-
Libs.private: @PHP_LIBS_PRIVATE@
35+
Libs.private: @EXTRA_LIBS@ @ZEND_EXTRA_LIBS@
3636
Libs:

0 commit comments

Comments
 (0)