Commit db6cca26dd2 for php.net
commit db6cca26dd2413852d4237b04da769d70569c405
Author: Michael Orlitzky <michael@orlitzky.com>
Date: Thu Jan 30 02:37:31 2025 +0000
sapi/*/Makefile.frag: install programs built with libtool, with libtool
When installing executables that were built using libtool, we are
supposed to use
$ libtool --mode-install <install-command>
rather than the bare <install-command>. This is discussed ever so
briefly in the "Installing executables" section of the GNU libtool
documentation:
https://www.gnu.org/software/libtool/manual/libtool.html
So far this has not caused a problem with GNU libtool on the platforms
that PHP supports, but there is an alternate libtool implementation
called slibtool that stores wrappers at the locations where PHP is
expecting the true executables to live. As a result, the wrappers (and
not the executables) are installed when slibtool is used to build PHP.
This is fixed by replacing,
$(INSTALL)
with
$(LIBTOOL) --mode=install $(INSTALL)
in the install-foo rules for the executables that are built with
libtool.
Closes GH-13674
diff --git a/NEWS b/NEWS
index 1affbb7f8a3..6a1388a961c 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP NEWS
. Fixed OSS-Fuzz #478009707 (Borked assign-op/inc/dec on untyped hooked
property backing value). (ilutov)
. Fixed bug GH-21215 (Build fails with -std=). (Arnaud)
+ . Fixed bug GH-13674 (Build system installs libtool wrappers when using
+ slibtool). (Michael Orlitzky)
- Curl:
. Fixed bug GH-21023 (CURLOPT_XFERINFOFUNCTION crash with a null callback).
diff --git a/sapi/cgi/Makefile.frag b/sapi/cgi/Makefile.frag
index 79e2afec254..eeadc7d3864 100644
--- a/sapi/cgi/Makefile.frag
+++ b/sapi/cgi/Makefile.frag
@@ -6,7 +6,7 @@ $(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_FASTCGI_OBJS) $(PH
install-cgi: $(SAPI_CGI_PATH)
@echo "Installing PHP CGI binary: $(INSTALL_ROOT)$(bindir)/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
- @$(INSTALL) -m 0755 $(SAPI_CGI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php-cgi$(program_suffix)$(EXEEXT)
+ @$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_CGI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php-cgi$(program_suffix)$(EXEEXT)
@echo "Installing PHP CGI man page: $(INSTALL_ROOT)$(mandir)/man1/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) sapi/cgi/php-cgi.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php-cgi$(program_suffix).1
diff --git a/sapi/cli/Makefile.frag b/sapi/cli/Makefile.frag
index aa1d642b9cd..52150d92d52 100644
--- a/sapi/cli/Makefile.frag
+++ b/sapi/cli/Makefile.frag
@@ -6,7 +6,7 @@ $(SAPI_CLI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CLI_OBJS)
install-cli: $(SAPI_CLI_PATH)
@echo "Installing PHP CLI binary: $(INSTALL_ROOT)$(bindir)/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
- @$(INSTALL) -m 0755 $(SAPI_CLI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)
+ @$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_CLI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)
@echo "Installing PHP CLI man page: $(INSTALL_ROOT)$(mandir)/man1/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) sapi/cli/php.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php$(program_suffix).1
diff --git a/sapi/fpm/Makefile.frag b/sapi/fpm/Makefile.frag
index c6a290f9d59..8c90e8c00da 100644
--- a/sapi/fpm/Makefile.frag
+++ b/sapi/fpm/Makefile.frag
@@ -8,7 +8,7 @@ install-fpm: $(SAPI_FPM_PATH)
@$(mkinstalldirs) $(INSTALL_ROOT)$(sbindir)
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run
- @$(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROOT)$(sbindir)/$(program_prefix)php-fpm$(program_suffix)$(EXEEXT)
+ @$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROOT)$(sbindir)/$(program_prefix)php-fpm$(program_suffix)$(EXEEXT)
@if test -f "$(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf"; then \
echo "Installing PHP FPM defconfig: skipping"; \
diff --git a/sapi/litespeed/Makefile.frag b/sapi/litespeed/Makefile.frag
index 2010d8d6235..d33d467c7de 100644
--- a/sapi/litespeed/Makefile.frag
+++ b/sapi/litespeed/Makefile.frag
@@ -6,4 +6,4 @@ $(SAPI_LITESPEED_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_LITESPEED_OB
install-litespeed: $(SAPI_LITESPEED_PATH)
@echo "Installing PHP LiteSpeed binary: $(INSTALL_ROOT)$(bindir)/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
- @$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)lsphp$(program_suffix)
+ @$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)lsphp$(program_suffix)
diff --git a/sapi/phpdbg/Makefile.frag b/sapi/phpdbg/Makefile.frag
index a069a23685d..aa1a1cd7942 100644
--- a/sapi/phpdbg/Makefile.frag
+++ b/sapi/phpdbg/Makefile.frag
@@ -25,7 +25,7 @@ install-phpdbg: $(BUILD_BINARY)
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run
- @$(INSTALL) -m 0755 $(BUILD_BINARY) $(INSTALL_ROOT)$(bindir)/$(program_prefix)phpdbg$(program_suffix)$(EXEEXT)
+ @$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(BUILD_BINARY) $(INSTALL_ROOT)$(bindir)/$(program_prefix)phpdbg$(program_suffix)$(EXEEXT)
@echo "Installing phpdbg man page: $(INSTALL_ROOT)$(mandir)/man1/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) sapi/phpdbg/phpdbg.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)phpdbg$(program_suffix).1