cython-devel

annotate Cython/Distutils/extension.py @ 4256:b816b03ff502

Make __new__ -> __cinit__ into an error, fix compiler crash.
author Robert Bradshaw <robertwb@math.washington.edu>
date Tue Dec 21 02:09:22 2010 -0800 (17 months ago)
parents 9183be31b2cd
children

rev   line source
robertwb@391 1 """Pyrex.Distutils.extension
robertwb@391 2
robertwb@391 3 Provides a modified Extension class, that understands hou to describe
robertwb@391 4 Pyrex extension modules in setup scripts."""
robertwb@391 5
robertwb@391 6 __revision__ = "$Id:$"
robertwb@391 7
scoder@1849 8 import os, sys
robertwb@391 9 from types import *
robertwb@391 10 import distutils.extension as _Extension
robertwb@391 11
robertwb@391 12 try:
robertwb@391 13 import warnings
robertwb@391 14 except ImportError:
robertwb@391 15 warnings = None
robertwb@391 16
robertwb@391 17 class Extension(_Extension.Extension):
robertwb@391 18 _Extension.Extension.__doc__ + \
robertwb@391 19 """pyrex_include_dirs : [string]
robertwb@391 20 list of directories to search for Pyrex header files (.pxd) (in
robertwb@391 21 Unix form for portability)
cb@3435 22 pyrex_directives : {string:value}
cb@3435 23 dict of compiler directives
robertwb@391 24 pyrex_create_listing_file : boolean
robertwb@391 25 write pyrex error messages to a listing (.lis) file.
cb@3391 26 pyrex_line_directivess : boolean
cb@3391 27 emit pyx line numbers for debugging/profiling
robertwb@391 28 pyrex_cplus : boolean
robertwb@391 29 use the C++ compiler for compiling and linking.
robertwb@391 30 pyrex_c_in_temp : boolean
robertwb@391 31 put generated C files in temp directory.
robertwb@391 32 pyrex_gen_pxi : boolean
robertwb@391 33 generate .pxi file for public declarations
markflorisson88@4175 34 pyrex_gdb : boolean
markflorisson88@4123 35 generate Cython debug information for this extension for cygdb
robertwb@391 36 """
robertwb@391 37
robertwb@391 38 # When adding arguments to this constructor, be sure to update
robertwb@391 39 # user_options.extend in build_ext.py.
robertwb@391 40 def __init__ (self, name, sources,
robertwb@391 41 include_dirs = None,
robertwb@391 42 define_macros = None,
robertwb@391 43 undef_macros = None,
robertwb@391 44 library_dirs = None,
robertwb@391 45 libraries = None,
robertwb@391 46 runtime_library_dirs = None,
robertwb@391 47 extra_objects = None,
robertwb@391 48 extra_compile_args = None,
robertwb@391 49 extra_link_args = None,
robertwb@391 50 export_symbols = None,
robertwb@391 51 #swig_opts = None,
robertwb@391 52 depends = None,
robertwb@391 53 language = None,
robertwb@391 54 pyrex_include_dirs = None,
cb@3435 55 pyrex_directives = None,
robertwb@391 56 pyrex_create_listing = 0,
cb@3391 57 pyrex_line_directives = 0,
robertwb@391 58 pyrex_cplus = 0,
robertwb@391 59 pyrex_c_in_temp = 0,
robertwb@391 60 pyrex_gen_pxi = 0,
markflorisson88@4175 61 pyrex_gdb = False,
robertwb@391 62 **kw):
robertwb@391 63
robertwb@391 64 _Extension.Extension.__init__(self, name, sources,
robertwb@391 65 include_dirs = include_dirs,
robertwb@391 66 define_macros = define_macros,
robertwb@391 67 undef_macros = undef_macros,
robertwb@391 68 library_dirs = library_dirs,
robertwb@391 69 libraries = libraries,
robertwb@391 70 runtime_library_dirs = runtime_library_dirs,
robertwb@391 71 extra_objects = extra_objects,
robertwb@391 72 extra_compile_args = extra_compile_args,
robertwb@391 73 extra_link_args = extra_link_args,
robertwb@391 74 export_symbols = export_symbols,
robertwb@391 75 #swig_opts = swig_opts,
robertwb@391 76 depends = depends,
robertwb@391 77 language = language,
robertwb@391 78 **kw)
robertwb@391 79
robertwb@391 80 self.pyrex_include_dirs = pyrex_include_dirs or []
cb@3435 81 self.pyrex_directives = pyrex_directives or {}
robertwb@391 82 self.pyrex_create_listing = pyrex_create_listing
cb@3391 83 self.pyrex_line_directives = pyrex_line_directives
robertwb@391 84 self.pyrex_cplus = pyrex_cplus
robertwb@391 85 self.pyrex_c_in_temp = pyrex_c_in_temp
robertwb@391 86 self.pyrex_gen_pxi = pyrex_gen_pxi
markflorisson88@4175 87 self.pyrex_gdb = pyrex_gdb
robertwb@391 88
robertwb@391 89 # class Extension
robertwb@391 90
robertwb@391 91 read_setup_file = _Extension.read_setup_file