mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-14 00:37:41 -04:00
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>
34 lines
683 B
Python
34 lines
683 B
Python
#!/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"],
|
|
)
|