blob: 845a0c2b10dba25f03cd10320a72ed2b4ce50955 [file] [log] [blame]
Simon Glass76bce102016-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
Stefan Agner99638902017-03-29 12:41:23 -070030sys.argv = [progname, '--quiet', 'build_ext', '--inplace', '--force']
Simon Glass76bce102016-07-04 11:58:11 -060031
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 )