Author: Michal Vyskocil <[email protected]>
Branch: 
Changeset: r3191:c195b130abef
Date: 2017-05-25 09:25 +0200
http://bitbucket.org/cffi/cffi/changeset/c195b130abef/

Log:    can't link with libraries expects -pthreads or similar flags

        read extra_compile_args and extra_link_args fom pkg-config too

diff --git a/cffi/pkgconfig.py b/cffi/pkgconfig.py
--- a/cffi/pkgconfig.py
+++ b/cffi/pkgconfig.py
@@ -48,6 +48,9 @@
             return tuple (string [2:].split ('=', 2))
         return [_macros (x) for x in string.split () if x.startswith ("-D")]
 
+    def drop_macros (string):
+        return [x for x in string.split () if not x.startswith ("-D")]
+
     # pkg-config call
     def pc (libname, *args):
         a = ["pkg-config", "--print-errors"]
@@ -61,7 +64,9 @@
                 "include_dirs" : dropILl (pc (libname, "--cflags-only-I")),
                 "library_dirs" : dropILl (pc (libname, "--libs-only-L")),
                 "libraries" : dropILl (pc (libname, "--libs-only-l")),
-                "define_macros" : macros (pc (libname, "--cflags")),
+                "define_macros" : macros (pc (libname, "--cflags-only-other")),
+                "extra_compile_args" : drop_macros (pc (libname, 
"--cflags-only-other")),
+                "extra_link_args" : pc (libname, "--libs-only-other").split ()
                 }
 
     # merge all arguments together
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to