| # SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) |
| # While Python 3 is the default, it's also possible to invoke |
| # this setup.py script with Python 2. |
| setup.py file for SWIG libfdt |
| Copyright (C) 2017 Google, Inc. |
| Written by Simon Glass <sjg@chromium.org> |
| from distutils.core import setup, Extension |
| VERSION_PATTERN = '^#define DTC_VERSION "DTC ([^"]*)"$' |
| version_file = "../version_gen.h" |
| f = open(version_file, 'rt') |
| m = re.match(VERSION_PATTERN, f.readline()) |
| setupdir = os.path.dirname(os.path.abspath(sys.argv[0])) |
| libfdt_module = Extension( |
| include_dirs=['../libfdt'], |
| library_dirs=['../libfdt'], |
| swig_opts=['-I../libfdt'], |
| author='Simon Glass <sjg@chromium.org>', |
| description='Python binding for libfdt', |
| ext_modules=[libfdt_module], |