title: How to link Mac OS framework in Cython
body: <p>How to link Mac OS framework in Cython?</p>
  
  <p>I failed with </p>
  
  <pre><code>from distutils.core import setup
  from distutils.extension import Extension
  from Cython.Build import cythonize
  ext_modules=[
      Extension("PyLexActivator",
            sources=["PyLexActivator.pyx"],
            language='c++',
            extra_objects=["libLexActivator.a"], 
            extra_link_args=['-framework CoreFoundation', 
                       '-framework SystemConfiguration'],
      )
  ]
  setup(
    name = "PyLexActivator",
    ext_modules = cythonize(ext_modules)
  )
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>python setup.py build_ext --inplace
  running build_ext
  building 'PyLexActivator' extension
  /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/o/anaconda/include -arch x86_64 -I. -I/Users/o/anaconda/include/python3.5m -c PyLexActivator.cpp -o build/temp.macosx-10.6-x86_64-3.5/PyLexActivator.o
  /usr/bin/clang++ -bundle -undefined dynamic_lookup -L/Users/o/anaconda/lib -arch x86_64 build/temp.macosx-10.6-x86_64-3.5/PyLexActivator.o libLexActivator.a -L/Users/o/anaconda/lib -o 
  /Users/suo/Documents/guanran/face_recommend/cryptlex/PyLexActivator.cpython-35m-darwin.so -framework Foundation -framework SystemConfiguration
  clang: error: unknown argument: '-framework CoreFoundation'
  clang: error: unknown argument: '-framework SystemConfiguration'
  clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
  error: command '/usr/bin/clang++' failed with exit status 1
  </code></pre>
  
  <p>Adding the full path to the framework does not work too. </p>