title: How to pass flag to gcc in Python setup.py script?
body: <p>I'm writing a Python extension in C that requires the CoreFoundation framework (among other things). This compiles fine with:</p>
  
  <pre><code>gcc -o foo foo.c -framework CoreFoundation -framework Python
  </code></pre>
  
  <p>("-framework" is an Apple-only gcc extension, but that's okay because I'm using their specific framework anyway)</p>
  
  <p>How do I tell setup.py to pass this flag to gcc?</p>
  
  <p>I tried this, but it doesn't seem to work (it compiles, but then complains of undefined symbols when I try to run it):</p>
  
  <pre><code>from distutils.core import setup, Extension
  setup(name='foo',
        version='1.0',
        author='Me',
        ext_modules=[Extension('foo',
                               ['foo.c'],
                               extra_compile_args=['-framework CoreFoundation'])])
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <p>This appears to work:</p>
  
  <pre><code>from distutils.core import setup, Extension
  setup(name='foo',
        version='1.0',
        author='Me',
        ext_modules=[Extension('foo',
                               ['foo.c'],
                               extra_link_args=['-framework', 'CoreFoundation'])])
  </code></pre>