From: Alexis Laferrière Date: Mon, 23 May 2016 23:50:24 +0000 (-0400) Subject: niti: filter the -lrt flag on OS X X-Git-Url: http://nitlanguage.org niti: filter the -lrt flag on OS X Signed-off-by: Alexis Laferrière --- 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