summaryrefslogtreecommitdiff
path: root/lib/libfdt/setup.py
blob: fc881351c6d6884e645ba64ae0a58ac5f3031df7 (plain)
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
38
#!/usr/bin/env python

"""
setup.py file for SWIG libfdt
"""

from distutils.core import setup, Extension
import os
import sys

# Don't cross-compile - always use the host compiler.
del os.environ['CROSS_COMPILE']
del os.environ['CC']

progname = sys.argv[0]
cflags = sys.argv[1]
files = sys.argv[2:]

if cflags:
    cflags = [flag for flag in cflags.split(' ') if flag]
else:
    cflags = None

libfdt_module = Extension(
    '_libfdt_legacy',
    sources = files,
    extra_compile_args =  cflags
)

sys.argv = [progname, '--quiet', 'build_ext', '--inplace', '--force']

setup (name = 'libfdt_legaacy',
       version = '0.1',
       author      = "SWIG Docs",
       description = """Simple swig libfdt from docs""",
       ext_modules = [libfdt_module],
       py_modules = ["libfdt_legacy"],
       )