Skip to content

Commit db6cca2

Browse files
orlitzkypetk
authored andcommitted
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
1 parent 6a1bde5 commit db6cca2

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ PHP NEWS
1111
. Fixed OSS-Fuzz #478009707 (Borked assign-op/inc/dec on untyped hooked
1212
property backing value). (ilutov)
1313
. Fixed bug GH-21215 (Build fails with -std=). (Arnaud)
14+
. Fixed bug GH-13674 (Build system installs libtool wrappers when using
15+
slibtool). (Michael Orlitzky)
1416

1517
- Curl:
1618
. Fixed bug GH-21023 (CURLOPT_XFERINFOFUNCTION crash with a null callback).

sapi/cgi/Makefile.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_FASTCGI_OBJS) $(PH
66
install-cgi: $(SAPI_CGI_PATH)
77
@echo "Installing PHP CGI binary: $(INSTALL_ROOT)$(bindir)/"
88
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
9-
@$(INSTALL) -m 0755 $(SAPI_CGI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php-cgi$(program_suffix)$(EXEEXT)
9+
@$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_CGI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php-cgi$(program_suffix)$(EXEEXT)
1010
@echo "Installing PHP CGI man page: $(INSTALL_ROOT)$(mandir)/man1/"
1111
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
1212
@$(INSTALL_DATA) sapi/cgi/php-cgi.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php-cgi$(program_suffix).1

sapi/cli/Makefile.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $(SAPI_CLI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CLI_OBJS)
66
install-cli: $(SAPI_CLI_PATH)
77
@echo "Installing PHP CLI binary: $(INSTALL_ROOT)$(bindir)/"
88
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
9-
@$(INSTALL) -m 0755 $(SAPI_CLI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)
9+
@$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_CLI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)
1010
@echo "Installing PHP CLI man page: $(INSTALL_ROOT)$(mandir)/man1/"
1111
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
1212
@$(INSTALL_DATA) sapi/cli/php.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php$(program_suffix).1

sapi/fpm/Makefile.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ install-fpm: $(SAPI_FPM_PATH)
88
@$(mkinstalldirs) $(INSTALL_ROOT)$(sbindir)
99
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log
1010
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run
11-
@$(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROOT)$(sbindir)/$(program_prefix)php-fpm$(program_suffix)$(EXEEXT)
11+
@$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROOT)$(sbindir)/$(program_prefix)php-fpm$(program_suffix)$(EXEEXT)
1212

1313
@if test -f "$(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf"; then \
1414
echo "Installing PHP FPM defconfig: skipping"; \

sapi/litespeed/Makefile.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ $(SAPI_LITESPEED_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_LITESPEED_OB
66
install-litespeed: $(SAPI_LITESPEED_PATH)
77
@echo "Installing PHP LiteSpeed binary: $(INSTALL_ROOT)$(bindir)/"
88
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
9-
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)lsphp$(program_suffix)
9+
@$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)lsphp$(program_suffix)

sapi/phpdbg/Makefile.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ install-phpdbg: $(BUILD_BINARY)
2525
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
2626
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log
2727
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run
28-
@$(INSTALL) -m 0755 $(BUILD_BINARY) $(INSTALL_ROOT)$(bindir)/$(program_prefix)phpdbg$(program_suffix)$(EXEEXT)
28+
@$(LIBTOOL) --mode=install $(INSTALL) -m 0755 $(BUILD_BINARY) $(INSTALL_ROOT)$(bindir)/$(program_prefix)phpdbg$(program_suffix)$(EXEEXT)
2929
@echo "Installing phpdbg man page: $(INSTALL_ROOT)$(mandir)/man1/"
3030
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
3131
@$(INSTALL_DATA) sapi/phpdbg/phpdbg.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)phpdbg$(program_suffix).1

0 commit comments

Comments
 (0)