summaryrefslogtreecommitdiff
path: root/dos/Makefile
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-02-10 13:22:40 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-02-10 13:22:40 -0800
commit14df2f8046001f2dc24e1f65bb17c6e31dfbbd09 (patch)
treee1aa9c709cd2e3ff208d2160157bac9f3acff61c /dos/Makefile
parent1970446f95df5ac0a0d3b2b0e90b72e0dd353699 (diff)
parentd48bb2b249d996587cfe6e39e810a9805d013abe (diff)
downloadsyslinux-3.40-pre5.tar.gz
Merge with git+ssh://master.kernel.org/pub/scm/boot/syslinux/syslinux.git#syslinux-3.3xsyslinux-3.40-pre5
Diffstat (limited to 'dos/Makefile')
-rw-r--r--dos/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/dos/Makefile b/dos/Makefile
index 61423cec..5fd52d1b 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -1,9 +1,14 @@
+gcc_ok = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
+ then echo $(1); else echo $(2); fi)
+
+M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector,)
+
CC = gcc
LD = ld -m elf_i386
OBJCOPY = objcopy
OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
INCLUDES = -include code16.h -I. -I.. -I../libfat
-CFLAGS = -m32 -mregparm=3 -DREGPARM=3 -W -Wall -ffreestanding -msoft-float $(OPTFLAGS) $(INCLUDES)
+CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -msoft-float $(OPTFLAGS) $(INCLUDES)
LDFLAGS = -T com16.ld
AR = ar
RANLIB = ranlib