[syslinux] SYSLINUX 3.50-pre14 pushed out; adds INCLUDE support

Luciano Rocha strange at nsk.no-ip.org
Wed May 23 13:50:16 PDT 2007


On Wed, May 23, 2007 at 10:57:16AM -0700, H. Peter Anvin wrote:
> Luciano Rocha wrote:
> > 
> > perl -pi -e 's!-o /dev/null!-o /dev/stderr!g' `find . -name Makefile -o
> > -name MCONFIG` did it for me.
> > 
> > But the previous version only changed the permissions of /dev/null, not
> > the file type as  Genaldo reported. So the safest version, but specific
> > to linux, would be to change to /proc/self/fd/2 instead.
> > 
> 
> There are better ways to fix this, writing and deleting a temp file is
> the right thing to do, but for some unfanthomable reason it just doesn't
> work when I try to implement it.

The attached patch works for me.

-- 
lfr
0/0
-------------- next part --------------
diff --git a/Makefile b/Makefile
index 5a27526..2445035 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,10 @@
 # No builtin rules
 MAKEFLAGS = -r
 
-gcc_ok   = $(shell if gcc $(1) dummy.c -o /dev/null 2>/dev/null; \
-	           then echo '$(1)'; else echo '$(2)'; fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) dummy.c -o $$tmpf 2>/dev/null; \
+	           then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
 
 comma   := ,
 LDHASH  := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG
index 461ada4..781292b 100644
--- a/com32/lib/MCONFIG
+++ b/com32/lib/MCONFIG
@@ -1,7 +1,9 @@
 # -*- makefile -*-
 
-gcc_ok  = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	  then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok  = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	  then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 GCCOPT := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
 
diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile
index 1dac1f7..1539353 100644
--- a/com32/libutil/Makefile
+++ b/com32/libutil/Makefile
@@ -29,8 +29,10 @@
 ## Utility companion library for the COM32 library
 ##
 
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32     := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
 
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index bef45a8..9be0b85 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -14,8 +14,10 @@
 ## samples for syslinux users
 ##
 
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32     := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
 
diff --git a/com32/samples/Makefile b/com32/samples/Makefile
index b694a48..b2544e6 100644
--- a/com32/samples/Makefile
+++ b/com32/samples/Makefile
@@ -14,8 +14,10 @@
 ## samples for syslinux users
 ##
 
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32     := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
 
diff --git a/dos/Makefile b/dos/Makefile
index 5fd52d1..53406b1 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -1,5 +1,7 @@
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32       := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector,)
 
diff --git a/extlinux/Makefile b/extlinux/Makefile
index 8d347a9..d2ea6f9 100644
--- a/extlinux/Makefile
+++ b/extlinux/Makefile
@@ -1,5 +1,7 @@
-gcc_ok   = $(shell if gcc $(1) ../dummy.c -o /dev/null 2>/dev/null; \
-	           then echo '$(1)'; else echo '$(2)'; fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) ../dummy.c -o $$tmpf 2>/dev/null; \
+	           then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
 
 comma   := ,
 LDHASH  := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
diff --git a/mbr/Makefile b/mbr/Makefile
index 7662a0a..8774413 100644
--- a/mbr/Makefile
+++ b/mbr/Makefile
@@ -14,8 +14,10 @@
 # Makefile for MBR
 #
 
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32       := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector)
 
diff --git a/memdisk/Makefile b/memdisk/Makefile
index 72234ca..161a163 100644
--- a/memdisk/Makefile
+++ b/memdisk/Makefile
@@ -12,8 +12,10 @@
 
 VERSION := $(shell cat ../version)
 
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32     := $(call gcc_ok,-m32,)
 ALIGN   := $(call gcc_ok,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0)
diff --git a/menu/Makefile b/menu/Makefile
index cee1c3a..702f456 100644
--- a/menu/Makefile
+++ b/menu/Makefile
@@ -14,8 +14,10 @@
 ## samples for syslinux users
 ##
 
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32     := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
 
diff --git a/mtools/Makefile b/mtools/Makefile
index 546e3d1..16d63a6 100644
--- a/mtools/Makefile
+++ b/mtools/Makefile
@@ -1,5 +1,7 @@
-gcc_ok   = $(shell if gcc $(1) ../dummy.c -o /dev/null 2>/dev/null; \
-	           then echo '$(1)'; else echo '$(2)'; fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) ../dummy.c -o $$tmpf 2>/dev/null; \
+	           then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
 
 comma   := ,
 LDHASH  := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
diff --git a/sample/Makefile b/sample/Makefile
index f301b9f..cc22a98 100644
--- a/sample/Makefile
+++ b/sample/Makefile
@@ -14,8 +14,10 @@
 ## samples for syslinux users
 ##
 
-gcc_ok   = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
-	           then echo $(1); else echo $(2); fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+	           then echo $(1); else echo $(2); fi; rm -f $$tmpf)
 
 M32       := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector,)
 
diff --git a/unix/Makefile b/unix/Makefile
index f0ab279..b046529 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -1,5 +1,7 @@
-gcc_ok   = $(shell if gcc $(1) ../dummy.c -o /dev/null 2>/dev/null; \
-	           then echo '$(1)'; else echo '$(2)'; fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok   = $(shell tmpf=$(TMPFILE); if gcc $(1) ../dummy.c -o $$tmpf 2>/dev/null; \
+	           then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
 
 comma   := ,
 LDHASH  := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070523/a49c6ade/attachment.sig>


More information about the Syslinux mailing list