aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
Diffstat (limited to 'com32')
-rw-r--r--com32/lib/MCONFIG6
-rw-r--r--com32/libutil/Makefile6
-rw-r--r--com32/modules/Makefile6
-rw-r--r--com32/samples/Makefile6
4 files changed, 16 insertions, 8 deletions
diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG
index 461ada44..781292ba 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 1dac1f76..15393533 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 bef45a87..9be0b85a 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 b694a489..b2544e6d 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,)