Fix broken build-system when libffi uses install-sh
authorHerbert Valerio Riedel <hvr@gnu.org>
Thu, 19 Nov 2015 11:21:04 +0000 (12:21 +0100)
committerBen Gamari <ben@smart-cactus.org>
Thu, 19 Nov 2015 12:24:32 +0000 (13:24 +0100)
Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1494

GHC Trac Issues: #11109

libffi/ghc.mk

index a37e3be..19b6f43 100644 (file)
@@ -79,6 +79,11 @@ $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP)
        mv libffi/build/Makefile.in libffi/build/Makefile.in.orig
        sed 's:@toolexeclibdir@:$$(libdir):g' < libffi/build/Makefile.in.orig > libffi/build/Makefile.in
 
+       # install-sh is used when /usr/bin/install is missing; ensure its
+       # path in libffi's Makefile is correct. See GHC #11109.
+       mv libffi/build/Makefile.in libffi/build/Makefile.in.orig
+       sed 's:@INSTALL@:$$(subst ../install-sh,$(TOP)/install-sh,@INSTALL@):g' < libffi/build/Makefile.in.orig > libffi/build/Makefile.in
+
 # * Because -Werror may be in SRC_CC_OPTS/SRC_LD_OPTS, we need to turn
 #   warnings off or the compilation of libffi might fail due to warnings;
 #   hence the -w flags.