diff src/build-binutils.mk @ 3509:3350681f52f2

Don't install cross tools in host directory tree. Don't install cross tools separately in cross-tools directory tree. Specify cross AS, LD, and NM programs explicitly when configuring GCC.
author John W. Eaton <jwe@octave.org>
date Fri, 07 Feb 2014 12:49:14 -0500
parents d621dce7de41
children 1b350761007f
line wrap: on
line diff
--- a/src/build-binutils.mk	Fri Feb 07 12:45:35 2014 -0500
+++ b/src/build-binutils.mk	Fri Feb 07 12:49:14 2014 -0500
@@ -15,6 +15,13 @@
   $(PKG)_DEPS     := build-gcc
 endif
 
+ifneq ($(MXE_NATIVE_BUILD),yes)
+  define $(PKG)_POST_BUILD
+    $(INSTALL) -d '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)'
+    mv $(addprefix $(HOST_PREFIX)/bin/, ar as dlltool ld ld.bfd nm objcopy objdump ranlib strip) '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)'
+  endef
+endif
+
 define $(PKG)_UPDATE
     $(WGET) -q -O- 'http://ftp.gnu.org/gnu/binutils/?C=M;O=D' | \
     $(SED) -n 's,.*<a href="binutils-\([0-9][^"]*\)\.tar.*,\1,p' | \
@@ -45,5 +52,6 @@
         --disable-werror
     $(MAKE) -C '$(1)' -j '$(JOBS)'
     $(MAKE) -C '$(1)' -j 1 install
-    $(MAKE) -C '$(1)' -j 1 DESTDIR=$(TOP_DIR)/cross-tools install
+
+    $($(PKG)_POST_BUILD)
 endef