-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
37 lines (33 loc) · 1.3 KB
/
setup.py
File metadata and controls
37 lines (33 loc) · 1.3 KB
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
35
36
37
import os
import sys
import subprocess
from distutils.core import setup, Extension
INC_DIR = ['src']
LIB_DIR = []
LIBRARIES = ['m']
sources = ['src/erfa.c', 'src/_erfamodule.c']
extra_compile_args = []
if sys.platform == 'darwin':
#### is there some way to check this compatibility version on OSX ?
## extra_compile_args.extend(['-Wl','-compatibility_version,0.0.0','-current_version,0.0.0'])
sources.pop(0)
subprocess.Popen(('gcc', '-Wall', '-O', 'fPIC', '-shared', '-I./src',
'-Wl,-compatibility_version,2.0.0,-current_version,2.0.0',
'-o', 'liberfa.dylib', './src/erfa.c', '-lm'))
LIBRARIES.append('erfa')
LIB_DIR.append('.')
moduleerfa = Extension('_erfa',
include_dirs = INC_DIR,
libraries = LIBRARIES,
library_dirs = LIB_DIR,
extra_compile_args = extra_compile_args,
sources = sources)
setup (name = 'erfa_python',
version = '2018.02.01',
description = 'Python wrapper for ERFA library',
url = 'https://github.com/nirinA/erfa_python',
author = 'nirinA raseliarison',
author_email = 'nirina.raseliarison@gmail.com',
py_modules=['erfa'],
ext_modules = [moduleerfa, ],
license="Public Domain")