blob: 62e7bcc1acebabd7a8f40265f8e4edd082ec563d [file] [log] [blame]
Simon Glassa2a6f042016-07-04 11:58:11 -06001#!/usr/bin/env python
2
3"""
4setup.py file for SWIG libfdt
5"""
6
7from distutils.core import setup, Extension
8import os
9import sys
10
11# Don't cross-compile - always use the host compiler.
12del os.environ['CROSS_COMPILE']
13del os.environ['CC']
14
15progname = sys.argv[0]
16cflags = sys.argv[1]
17files = sys.argv[2:]
18
19if cflags:
20 cflags = [flag for flag in cflags.split(' ') if flag]
21else:
22 cflags = None
23
24libfdt_module = Extension(
25 '_libfdt',
26 sources = files,
27 extra_compile_args = cflags
28)
29
30sys.argv = [progname, '--quiet', 'build_ext', '--inplace']
31
32setup (name = 'libfdt',
33 version = '0.1',
34 author = "SWIG Docs",
35 description = """Simple swig libfdt from docs""",
36 ext_modules = [libfdt_module],
37 py_modules = ["libfdt"],
38 )