[syslinux] host cross-compile patch

Don Hiatt donhiatt at gmail.com
Mon Mar 15 13:45:03 PDT 2010


I tend to use the same tool-chain across various hosts so I made this
very simple patch that allows you to pass the cross-compiler name to
make ( e.g. make CROSS_COMPILE=i686-nptl-linux-gnu-).

I'm not sure if patches should be attached or just pasted inline so I
did both this time. BTW, it's relative to syslinux 4 but the same
changes work with syslinux 3 although the patch won't apply cleanly.

don

-------------
diff --git a/MCONFIG b/MCONFIG
index 87079a5..6c5a164 100644
--- a/MCONFIG
+++ b/MCONFIG
@@ -39,19 +39,23 @@ UPX	 = upx

 CHMOD	 = chmod

-CC	 = gcc
+# Pass cross-compiler tuple to make,
+#  e.g. make CROSS_COMPILE=i686-nptl-linux-gnu-
+CROSS_COMPILE	?=
+CC		= $(CROSS_COMPILE)gcc
+
 gcc_ok   = $(shell tmpf=gcc_ok.$$$$.tmp; \
 		   if $(CC) $(GCCOPT) $(1) -c $(topdir)/dummy.c \
 			-o $$tmpf 2>/dev/null ; \
 		   then echo '$(1)'; else echo '$(2)'; fi; \
 		   rm -f $$tmpf)

-LD	 = ld
-OBJDUMP	 = objdump
-OBJCOPY  = objcopy
-AR       = ar
-NM       = nm
-RANLIB   = ranlib
+LD	 = $(CROSS_COMPILE)ld
+OBJDUMP	 = $(CROSS_COMPILE)objdump
+OBJCOPY  = $(CROSS_COMPILE)objcopy
+AR       = $(CROSS_COMPILE)ar
+NM       = $(CROSS_COMPILE)nm
+RANLIB   = $(CROSS_COMPILE)ranlib
 GZIPPROG = gzip
 PNGTOPNM = pngtopnm
 MCOPY    = mcopy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mconfig.diff
Type: application/octet-stream
Size: 833 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20100315/7f6872fe/attachment.obj>


More information about the Syslinux mailing list