From 91839bcb1a276ceae6295dde4ec919c22e82e1da Mon Sep 17 00:00:00 2001 From: WB2OSZ Date: Sun, 22 Jan 2017 10:01:16 -0500 Subject: [PATCH] Do not overwrite existing CFLAGS and LDFLAGS. https://github.com/wb2osz/direwolf/pull/38 --- Makefile.linux | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.linux b/Makefile.linux index 5af2792..271f367 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -26,14 +26,18 @@ CC := gcc # There are a few source files where it had been necessary to define __USE_XOPEN2KXSI, # __USE_XOPEN, or _POSIX_C_SOURCE. Doesn't seem to be needed after adding this. -CFLAGS := -O3 -pthread -Igeotranz -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 -Wall +# The first assignment to CFLAGS and LDFLAGS uses +=, rather than :=, so +# we will inherit options already set in build environment. +# Explanation - https://github.com/wb2osz/direwolf/pull/38 + +CFLAGS += -O3 -pthread -Igeotranz -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 -Wall # That was fine for a recent Ubuntu and Raspbian Jessie. # However, Raspbian wheezy was then missing declaration for strsep and definition of fd_set. CFLAGS += -D_BSD_SOURCE -LDFLAGS := -lm -lpthread -lrt +LDFLAGS += -lm -lpthread -lrt