summaryrefslogtreecommitdiff
path: root/Makefile
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 /Makefile
parent9b7224f6a3419bba497b2a47a0c27f8f4893a3cc (diff)
downloadsyslinux-df2e79ce976ff922c46d56183a6a904f9d5b8cf6.tar.gz
Deal with various distributions breaking gcc in weird ways
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ff810827..5a27526c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
## -----------------------------------------------------------------------
##
-## Copyright 1998-2006 H. Peter Anvin - All Rights Reserved
+## Copyright 1998-2007 H. Peter Anvin - All Rights Reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -17,12 +17,18 @@
# 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)
+
+comma := ,
+LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
+
OSTYPE = $(shell uname -msr)
CC = gcc
INCLUDE =
CFLAGS = -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
PIC = -fPIC
-LDFLAGS = -O2 -s
+LDFLAGS = -O2 -s $(LDHASH)
AR = ar
RANLIB = ranlib