aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py.in
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-03-21 18:33:54 +0100
committerTristan Gingold <tgingold@free.fr>2018-03-21 18:33:54 +0100
commitffca448651c5b7b0fc5fe6bdbbcf1e0dc13419e1 (patch)
treeaecf5e76a63c2906fa4ad2041505b740b0780209 /setup.py.in
parent047de40c7799e4186b16bd1ad2c6eb17a7cf0098 (diff)
downloadghdl-ffca448651c5b7b0fc5fe6bdbbcf1e0dc13419e1.tar.gz
ghdl-ffca448651c5b7b0fc5fe6bdbbcf1e0dc13419e1.tar.bz2
ghdl-ffca448651c5b7b0fc5fe6bdbbcf1e0dc13419e1.zip
Set a version to libghdl, put version in configure.
Diffstat (limited to 'setup.py.in')
-rw-r--r--setup.py.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/setup.py.in b/setup.py.in
index 57f997084..ef6e3daae 100644
--- a/setup.py.in
+++ b/setup.py.in
@@ -7,6 +7,9 @@ from distutils.command.build import build
import os
import os.path
+so_ext = "@SOEXT@"
+libghdl_version = "@libghdl_version@"
+
class GHDLBuild(build):
def my_copy_tree(self, src, dst):
"""Tuned version of copy_tree: exclude .o files"""
@@ -27,7 +30,10 @@ class GHDLBuild(build):
# Copy VHDL libraries & shared library
dstdir = os.path.join(self.build_lib, 'libghdl')
- distutils.file_util.copy_file("libghdl" + "@SOEXT@", dstdir)
+ libghdl_filename = "libghdl-" + libghdl_version + so_ext
+ distutils.file_util.copy_file(libghdl_filename, dstdir)
+ with open(os.path.join(dstdir, "config.py"), 'w') as f:
+ f.write('libghdl_filename="{}"\n'.format(libghdl_filename))
self.my_copy_tree(os.path.join("lib", "ghdl"),
os.path.join(dstdir, "ghdl"))