From 33d835b8fc0f8ef9e0019938a87d2906383c3865 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 23 May 2016 19:50:24 -0400 Subject: [PATCH] niti: filter the -lrt flag on OS X MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- .../dynamic_loading_ffi/on_demand_compiler.nit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit b/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit index 4207a01..4e4a5b3 100644 --- a/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit +++ b/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit @@ -128,7 +128,12 @@ redef class AModule srcs.add_all mmodule.ffi_files # Compiler options specific to this module - var ldflags = mmodule.ldflags[""].join(" ") + var ldflags_array = mmodule.ldflags[""] + if ldflags_array.has("-lrt") and system("sh -c 'uname -s 2>/dev/null || echo not' | grep Darwin >/dev/null") == 0 then + # Remove -lrt on OS X + ldflags_array.remove "-lrt" + end + var ldflags = ldflags_array.join(" ") # Protect pkg-config var pkgconfigs = mmodule.pkgconfigs -- 1.7.9.5