Add an initial Python library for libfdt
Add Python bindings for a bare-bones set of libfdt functions. These allow navigating the tree and reading node names and properties. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
committed by
David Gibson
parent
cdbb2b6c7a
commit
50f2507016
34
pylibfdt/setup.py
Normal file
34
pylibfdt/setup.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
setup.py file for SWIG libfdt
|
||||
"""
|
||||
|
||||
from distutils.core import setup, Extension
|
||||
import os
|
||||
import sys
|
||||
|
||||
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',
|
||||
sources = files,
|
||||
extra_compile_args = cflags
|
||||
)
|
||||
|
||||
sys.argv = [progname, '--quiet', 'build_ext', '--inplace']
|
||||
|
||||
setup (name = 'libfdt',
|
||||
version = '0.1',
|
||||
author = "Simon Glass <sjg@chromium.org>",
|
||||
description = """Python binding for libfdt""",
|
||||
ext_modules = [libfdt_module],
|
||||
py_modules = ["libfdt"],
|
||||
)
|
||||
Reference in New Issue
Block a user