[gobject-introspection] scanner: Fix non-libtool linker flags on Darwin



commit 4a724ac699f0c34fba2fb452cfadea11540325e8
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Oct 19 23:10:27 2015 -0700

    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 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 224c3e5..515b422 100644
--- a/giscanner/ccompiler.py
+++ b/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
                 # out their names later
-                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)
 
         else:
             # libtool case: assemble linker command arguments, like we did before


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]