[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Makefile.am issue (and patch)
From: |
Jim Meyering |
Subject: |
Re: Makefile.am issue (and patch) |
Date: |
Fri, 04 Jul 2008 09:52:43 +0200 |
Brian Silverman <address@hidden> wrote:
> I'm having a small issue with make install of coreutils. I've
> included below a patch that solves my problem.
>
> I am using coreutils-6.12, and building it under cygwin, and I'm
> cross-compiling it to a PPC-440.
>
> Here's my build steps:
> ./configure --host=powerpc-440-linux-gnu --prefix="`pwd`/__images"
> make
> make install
>
> configure and make work fine. But make install fails with:
> ./ginstall: ./ginstall: cannot execute binary file
>
> To fix this, I'm using the patch below. Note that the change in my
> patch applies to code from a very recent checkin:
>
> http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=9d595099372e2eabbecce2f303058743e93f0748
>
> Perhaps my issue is only related to cross-compiling? Or is there a
> better fix I should use?
Thank you for the report and patch.
The bug is indeed specific to cross-compiling environments.
There is some benefit in using the just-built binary when possible,
so I've fixed it to permit that.
Would you please confirm that this works for you, too?
>From 9a4e22d03600c836673033089e396e141c7d1f08 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 4 Jul 2008 09:41:57 +0200
Subject: [PATCH] install with just-built ./ginstall only when not
cross-compiling
* src/Makefile.am (install-exec-am): ...otherwise, use the default
value, $(INSTALL_PROGRAM). Reported by Brian Silverman.
---
THANKS | 1 +
src/Makefile.am | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/THANKS b/THANKS
index 40b33ba..bff0917 100644
--- a/THANKS
+++ b/THANKS
@@ -79,6 +79,7 @@ Bob Proulx address@hidden
Branden Robinson address@hidden
Brendan O'Dea address@hidden
Brian Kimball address@hidden
+Brian Silverman address@hidden
Brian Youmans address@hidden
Bruce Korb address@hidden
Bruce Robertson address@hidden
diff --git a/src/Makefile.am b/src/Makefile.am
index 342fc09..65b20a2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -437,11 +437,15 @@ sc_tight_scope: $(all_programs)
{ echo 'the above variables should have static scope' 1>&2; \
exit 1; } || :
-.PHONY: cu-install-binPROGRAMS
+# Use the just-built ./ginstall, when not cross-compiling.
+# Override automake's install-one-at-a-time rule, when possible.
install-exec-am:
- @case '$(program_transform_name):$(EXEEXT)' in \
+ @(./ginstall --version) > /dev/null 2>&1 \
+ && install=./ginstall \
+ || install='$(INSTALL_PROGRAM)'; \
+ case '$(program_transform_name):$(EXEEXT)' in \
's,x,x,:') cu=cu-;; *) cu= ;; esac; \
- $(MAKE) $(AM_MAKEFLAGS) binPROGRAMS_INSTALL=./ginstall \
+ $(MAKE) $(AM_MAKEFLAGS) binPROGRAMS_INSTALL="$$install" \
$${cu}install-binPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
@@ -458,6 +462,7 @@ install-exec-am:
filtered_PROGS = \
`echo "$(bin_PROGRAMS)" | sed 's/ *\<ginstall\> */ /;s/ *\[ */ /'`
d_bindir = $(DESTDIR)$(bindir)
+.PHONY: cu-install-binPROGRAMS
cu-install-binPROGRAMS: $(bin_PROGRAMS)
$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(d_bindir)"
--
1.5.6.1.206.g8dcaf96