File: numarrayext.py

package info (click to toggle)
python-numarray 1.1.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,428 kB
  • ctags: 8,469
  • sloc: ansic: 92,018; python: 20,861; makefile: 263; sh: 13
file content (34 lines) | stat: -rw-r--r-- 1,169 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from distutils.core import Extension
import numinclude
import sys

class NumarrayExtension(Extension):
    def __init__(self, module, sources=None, **keywords):
        
        if sources is None:
            sources = [module+"module.c"]
            
        if "include_dirs" not in keywords.keys():
            keywords["include_dirs"] = []
        keywords["include_dirs"].append(numinclude.include_dir)

        if "extra_compile_args" not in keywords.keys():
            keywords["extra_compile_args"] = []
        keywords["extra_compile_args"].extend(EXTRA_COMPILE_ARGS)
        
        if "extra_link_args" not in keywords.keys():
            keywords["extra_link_args"] = []
        keywords["extra_link_args"].extend(EXTRA_LINK_ARGS)
        
        Extension.__init__(self, module, sources, **keywords)


EXTRA_LINK_ARGS = []          # Link options for all platforms
EXTRA_COMPILE_ARGS = []       # Compile options for all platforms

if sys.platform == "osf1v5":
    EXTRA_COMPILE_ARGS.extend(["-ieee"])

if not hasattr(sys, 'version_info') or sys.version_info < (2,2,0,'final'):
    raise SystemExit, "Python 2.2 or later required to build numarray."