diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-02-06 16:33:39 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-02-06 16:33:39 -0800 |
commit | df2e79ce976ff922c46d56183a6a904f9d5b8cf6 (patch) | |
tree | 192c20e0cde3f250d40515b303e1944e30fc1c74 /Makefile | |
parent | 9b7224f6a3419bba497b2a47a0c27f8f4893a3cc (diff) | |
download | syslinux-df2e79ce976ff922c46d56183a6a904f9d5b8cf6.tar.gz |
Deal with various distributions breaking gcc in weird ways
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 |