diff options
author | Bernhard Nortmann <bernhard.nortmann@web.de> | 2016-04-13 14:29:41 +0300 |
---|---|---|
committer | Bernhard Nortmann <bernhard.nortmann@web.de> | 2016-05-03 09:02:09 +0300 |
commit | 73c20eea7bf0f12795ab94685fbb98eda0cf2cce (patch) | |
tree | 57b719b1df2f6925f7a57b51991326f6bdaf9b71 /Makefile | |
parent | d47c3a36494f266d61996d2882c1b15a80a1a1da (diff) |
Makefile: Have portable_endian.h properly expose all functions
For Linux, this requires additional #defines, see
https://gist.github.com/panzi/6856583#gistcomment-1656524
Placing those #defines into portable_endian.h would mean we
depend on the specific order of #includes (whatever pulls
in endian.h first, including other system includes). Avoid
this by using symbols provided "globally" via the Makefile.
Also nuke the _NETBSD_SOURCE definition in fel.c
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -18,9 +18,16 @@ CC = gcc CFLAGS = -g -O0 -Wall -Wextra -CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L +CFLAGS += -std=c99 $(DEFINES) CFLAGS += -Iinclude/ +DEFINES = -D_POSIX_C_SOURCE=200112L +# Define _BSD_SOURCE, necessary to expose all endian conversions properly. +# See http://linux.die.net/man/3/endian +DEFINES += -D_BSD_SOURCE +# glibc 2.20+ also requires _DEFAULT_SOURCE +DEFINES += -D_DEFAULT_SOURCE + # Tools useful on host and target TOOLS = sunxi-fexc sunxi-bootinfo sunxi-fel sunxi-nand-part |