aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-03-07 05:10:02 +0100
committerTristan Gingold <tgingold@free.fr>2018-03-07 05:10:02 +0100
commitf94f726d515bcf48c50752a3487441fad629ee13 (patch)
tree8f8ddfcdc4f1aa5e825a51a26d6b63bbfcd3f2fb /setup.py
parent0e9e1f63cdf19dc45804d7b8728698f879489ee9 (diff)
downloadghdl-f94f726d515bcf48c50752a3487441fad629ee13.tar.gz
ghdl-f94f726d515bcf48c50752a3487441fad629ee13.tar.bz2
ghdl-f94f726d515bcf48c50752a3487441fad629ee13.zip
configure: add --enable-python
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py67
1 files changed, 0 insertions, 67 deletions
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 65d130ea5..000000000
--- a/setup.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-
-from distutils.core import setup, Extension
-from distutils.command.build import build
-from distutils.errors import CompileError
-import distutils.dep_util
-import distutils.ccompiler
-import subprocess
-import os
-import os.path
-
-class GHDLBuild(build):
- def copy_if_changed(self, source, destname):
- dest = os.path.join(self.build_temp, destname)
- if distutils.dep_util.newer(source, dest):
- print('copying ' + source)
- self.copy_file(source, dest, preserve_times=0)
-
- def run(self):
- # Run original build code
- build.run(self)
-
- self.mkpath(self.build_temp)
-
- srcdir = os.path.dirname(os.path.abspath(__file__))
- relpath = os.path.relpath(srcdir, self.build_temp)
- self.copy_if_changed(os.path.join(srcdir, 'src', 'version.in'),
- 'version.ads')
- self.copy_if_changed(os.path.join(srcdir, 'src', 'ghdldrv',
- 'default_paths.ads.in'),
- 'default_paths.ads')
-
- comp = distutils.ccompiler.new_compiler()
- so_file = comp.shared_object_filename('libghdl')
-
- cmd = ['gnatmake',
- '-aI' + os.path.join(srcdir, 'src', 'vhdl', 'python'),
- '-aI' + os.path.join(srcdir, 'src', 'vhdl'),
- '-aI' + os.path.join(srcdir, 'src', 'psl'),
- '-aI' + os.path.join(srcdir, 'src'),
- '-aI' + os.path.join(srcdir, 'src', 'ghdldrv'),
- '-aI' + os.path.join(srcdir, 'src', 'grt'),
- '-z', 'libghdl',
- '-o', so_file, '-fPIC', '-gnat05', '-gnata', '-g',
- '-bargs', '-shared', '-Llibghdl_',
- '-largs', '-shared', '-v' ]
-
- def compile():
- print cmd
- if subprocess.call(cmd, cwd=self.build_temp) != 0:
- raise CompileError('compilation failure')
-
- self.execute(compile, [], 'Compiling ghdl')
- dstdir = os.path.join(self.build_lib, 'libghdl')
- self.copy_file(os.path.join(self.build_temp, so_file), dstdir)
- self.copy_tree(os.path.join(srcdir, "lib",), dstdir)
-
-setup (name='libghdl',
- version='1.0',
- description = 'Interface to ghdl, a VHDL analyzer',
- author = 'Tristan Gingold',
- author_email = 'tgingold@free.fr',
- url = 'github.com/tgingold/ghdl',
- package_dir = {'libghdl' : 'src/vhdl/python/libghdl'},
- packages = ['libghdl'],
- cmdclass = {
- 'build': GHDLBuild})