aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/MCONFIG
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-02-06 16:33:39 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-02-06 16:33:39 -0800
commitdf2e79ce976ff922c46d56183a6a904f9d5b8cf6 (patch)
tree192c20e0cde3f250d40515b303e1944e30fc1c74 /com32/lib/MCONFIG
parent9b7224f6a3419bba497b2a47a0c27f8f4893a3cc (diff)
downloadsyslinux-elf-df2e79ce976ff922c46d56183a6a904f9d5b8cf6.tar.gz
syslinux-elf-df2e79ce976ff922c46d56183a6a904f9d5b8cf6.tar.xz
syslinux-elf-df2e79ce976ff922c46d56183a6a904f9d5b8cf6.zip
Deal with various distributions breaking gcc in weird ways
Diffstat (limited to 'com32/lib/MCONFIG')
-rw-r--r--com32/lib/MCONFIG7
1 files changed, 6 insertions, 1 deletions
diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG
index 39b62db1..461ada44 100644
--- a/com32/lib/MCONFIG
+++ b/com32/lib/MCONFIG
@@ -1,5 +1,10 @@
# -*- 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)
+
+GCCOPT := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
+
CC = gcc
LD = ld
INCLUDE = -I.
@@ -21,7 +26,7 @@ LIBFLAGS = -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO \
# fallback anyway, just use that on old machines...
# LIBFLAGS += -DPNG_NO_FLOATING_POINT_SUPPORTED
-REQFLAGS = -g -m32 -mregparm=3 -DREGPARM=3 -D__COM32__ -I. -I./sys -I../include
+REQFLAGS = $(GCCOPT) -g -mregparm=3 -DREGPARM=3 -D__COM32__ -I. -I./sys -I../include
OPTFLAGS = -Os -march=i386 -falign-functions=0 -falign-jumps=0 \
-falign-labels=0 -ffast-math -fomit-frame-pointer
WARNFLAGS = -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline