From a4528f3d8ccc07dec92c088daddfad2df54da15e Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> Date: Mon, 3 Jun 2013 12:08:08 +0200 Subject: [PATCH] Link with -lrt if glibc < 2.17 for native on linux --- Makefile.include | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.include b/Makefile.include index c195d5bc21..6f6b4171de 100644 --- a/Makefile.include +++ b/Makefile.include @@ -29,6 +29,15 @@ ifeq ($(shell uname -s),Darwin) endif endif +# backward compatability with glibc <= 2.17 for native +ifeq ($(CPU),native) +ifeq ($(shell uname -s),Linux) +ifeq ($(shell ldd --version | awk '/^ldd/{if ($$NF < 2.17) {print "yes"} else {print "no"} }'),yes) + LINKFLAGS += -lrt +endif +endif +endif + ## make script for your project. Build RIOT-base here! all: $(PROJBINDIR)/$(PROJECT).a @echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(MCU)." -- GitLab