summaryrefslogtreecommitdiff
path: root/mtools
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 /mtools
parent9b7224f6a3419bba497b2a47a0c27f8f4893a3cc (diff)
downloadsyslinux-df2e79ce976ff922c46d56183a6a904f9d5b8cf6.tar.gz
Deal with various distributions breaking gcc in weird ways
Diffstat (limited to 'mtools')
-rw-r--r--mtools/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/mtools/Makefile b/mtools/Makefile
index 26909a30..546e3d14 100644
--- a/mtools/Makefile
+++ b/mtools/Makefile
@@ -1,8 +1,14 @@
+gcc_ok = $(shell if gcc $(1) ../dummy.c -o /dev/null 2>/dev/null; \
+ then echo '$(1)'; else echo '$(2)'; fi)
+
+comma := ,
+LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
+
CC = gcc
OPTFLAGS = -g -Os
INCLUDES = -I. -I.. -I../libfat
CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
-LDFLAGS = -s
+LDFLAGS = $(LDHASH) -s
SRCS = syslinux.c ../syslxmod.c ../bootsect_bin.c ../ldlinux_bin.c $(wildcard ../libfat/*.c)
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))