From 4a724ac699f0c34fba2fb452cfadea11540325e8 Mon Sep 17 00:00:00 2001
From: Philip Chimento <philip.chimento@gmail.com>
Date: Mon, 19 Oct 2015 23:10:27 -0700
Subject: scanner: Fix non-libtool linker flags on Darwin
Darwin's linker doesn't like "-rpath=path"; instead pass "-rpath path",
which works on more linkers than the version with the = sign does.
Additionally, Darwin's linker has no equivalent for "--no-as-needed" (it
seems to do the right thing by default?)
https://bugzilla.gnome.org/show_bug.cgi?id=625195
giscanner/ccompiler.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git giscanner/ccompiler.py giscanner/ccompiler.py
index 224c3e5..515b422 100644
--- giscanner/ccompiler.py
+++ giscanner/ccompiler.py
@@ -128,11 +128,12 @@ class CCompiler(object):
self.compiler.add_runtime_library_dir('.')
# https://bugzilla.gnome.org/show_bug.cgi?id=625195
- args.append('-Wl,-rpath=.')
+ args.append('-Wl,-rpath,.')
# Ensure libraries are always linked as we are going to use ldd to work
- args.append('-Wl,--no-as-needed')
+ if sys.platform != 'darwin':
+ args.append('-Wl,--no-as-needed')
for library in libraries:
self.compiler.add_library(library)
@@ -140,7 +141,7 @@ class CCompiler(object):
for library_path in libpaths:
args.append('-L' + library_path)
if os.path.isabs(library_path):
- args.append('-Wl,-rpath=' + library_path)
+ args.append('-Wl,-rpath,' + library_path)
# libtool case: assemble linker command arguments, like we did before