mirror of
https://xff.cz/git/u-boot/
synced 2025-09-26 13:01:17 +02:00
dm: Add a more efficient libfdt library
Add a Python version of the libfdt library which contains enough features to support the dtoc tool. This is only a very bare-bones implementation. It requires the 'swig' to build. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
38
lib/libfdt/setup.py
Normal file
38
lib/libfdt/setup.py
Normal file
@@ -0,0 +1,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',
|
||||
sources = files,
|
||||
extra_compile_args = cflags
|
||||
)
|
||||
|
||||
sys.argv = [progname, '--quiet', 'build_ext', '--inplace']
|
||||
|
||||
setup (name = 'libfdt',
|
||||
version = '0.1',
|
||||
author = "SWIG Docs",
|
||||
description = """Simple swig libfdt from docs""",
|
||||
ext_modules = [libfdt_module],
|
||||
py_modules = ["libfdt"],
|
||||
)
|
Reference in New Issue
Block a user