Skip to content

Commit 214d9c8

Browse files
committed
Fix pkg-config .pc files installation path and substitute missing variables
- Fixes missing extensiondir, php_inidir, php_inipath pkg-config variables - The PHP_CFLAGS_PRIVATE has been for now removed but might be reintroduced when possible or when global CFLAGS and CFLAGS_CLEAN will be refactored. - Installation now works and adds it to pkgconfig directory in libdir - PHP_SET_LIBS_PRIVATE M4 macro renamed to PHP_PKG_CONFIG
1 parent 29e9497 commit 214d9c8

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

build/php.m4

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,12 +2538,13 @@ AS_VAR_POPDEF([php_var])
25382538
])
25392539

25402540
dnl
2541-
dnl PHP_SET_LIBS_PRIVATE
2541+
dnl PHP_PKG_CONFIG
25422542
dnl
2543-
dnl Get a list of all external libraries that were linked to PHP. For using in
2544-
dnl templates, such as php.pc.in.
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.
25452546
dnl
2546-
AC_DEFUN([PHP_SET_LIBS_PRIVATE],
2547+
AC_DEFUN([PHP_PKG_CONFIG],
25472548
[PHP_LIBS_PRIVATE=$EXTRA_LIBS
25482549
AS_VAR_SET_IF([ZEND_EXTRA_LIBS],
25492550
[AS_VAR_APPEND([PHP_LIBS_PRIVATE], [" $ZEND_EXTRA_LIBS"])])

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
13281328
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
13291329
unset LDFLAGS
13301330

1331-
PHP_SET_LIBS_PRIVATE
1331+
PHP_PKG_CONFIG
13321332

13331333
AC_ARG_PROGRAM
13341334

sapi/embed/Makefile.frag

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

sapi/embed/php-embed.pc.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ exec_prefix=@exec_prefix@
1414
includedir=@includedir@/php
1515
libdir=@exec_prefix@/lib
1616
# The extension_dir PHP INI directive absolute path.
17-
extensiondir=@PHP_EXTENSION_DIR@
17+
extensiondir=@EXPANDED_EXTENSION_DIR@
1818
# PHP version as integer.
1919
php_vernum=@PHP_VERSION_ID@
2020
# The path where to scan for additional INI configuration files.
21-
php_inidir=@PHP_CONFIG_FILE_SCAN_DIR@
21+
php_inidir=@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@
2222
# The path in which to look for php.ini.
23-
php_inipath=@PHP_CONFIG_FILE_PATH@
23+
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).
@@ -31,7 +31,6 @@ 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@
34-
Cflags.private: @PHP_CFLAGS_PRIVATE@
3534
Cflags: -I${includedir} -I${includedir}/main -I${includedir}/TSRM -I${includedir}/Zend -I${includedir}/ext -I${includedir}/ext/date/lib
3635
Libs.private: @PHP_LIBS_PRIVATE@
3736
Libs: -L${libdir} -lphp

scripts/Makefile.frag

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ 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)$(libdir)/pkgconfig/php.pc"
50-
@$(mkinstalldirs) $(INSTALL_ROOT)$(libdir)/pkgconfig
51-
@$(INSTALL_DATA) $(builddir)/php.pc $(INSTALL_ROOT)$(libdir)/pkgconfig/$(program_prefix)php$(program_suffix).pc
49+
@echo "Installing pkgconf .pc file: $(INSTALL_ROOT)$(orig_libdir)/pkgconfig/php.pc"
50+
@$(mkinstalldirs) $(INSTALL_ROOT)$(orig_libdir)/pkgconfig
51+
@$(INSTALL_DATA) $(builddir)/php.pc $(INSTALL_ROOT)$(orig_libdir)/pkgconfig/$(program_prefix)php$(program_suffix).pc
5252

5353
$(builddir)/phpize: $(srcdir)/phpize.in $(top_builddir)/config.status
5454
(CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)

scripts/php.pc.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ exec_prefix=@exec_prefix@
1414
includedir=@includedir@/php
1515
libdir=@exec_prefix@/lib
1616
# The extension_dir PHP INI directive absolute path.
17-
extensiondir=@PHP_EXTENSION_DIR@
17+
extensiondir=@EXPANDED_EXTENSION_DIR@
1818
# PHP version as integer.
1919
php_vernum=@PHP_VERSION_ID@
2020
# The path where to scan for additional INI configuration files.
21-
php_inidir=@PHP_CONFIG_FILE_SCAN_DIR@
21+
php_inidir=@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@
2222
# The path in which to look for php.ini.
23-
php_inipath=@PHP_CONFIG_FILE_PATH@
23+
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).
@@ -31,7 +31,6 @@ Description: Build extension for a PHP general-purpose scripting language
3131
URL: https://www.php.net
3232
License: PHP
3333
Version: @PHP_VERSION@
34-
Cflags.private: @PHP_CFLAGS_PRIVATE@
3534
CFlags: -I${includedir} -I${includedir}/main -I${includedir}/TSRM -I${includedir}/Zend -I${includedir}/ext -I${includedir}/ext/date/lib
3635
Libs.private: @PHP_LIBS_PRIVATE@
3736
Libs:

0 commit comments

Comments
 (0)