Debian Codegraph @

protolib/setup.py

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 # This Python script can be used to build and install a Python "protokit" module that
2 # provides a wrapper to select portions of the "Protlib" code base.
3 # This currently includes just the "protopipe" interprocess communication class.
4 # Example scripts are provided in the "examples" subdirectory.
5
6 import platform
•7 from setuptools import setup, Extension
8
9 # This setup.py script assumes that Protolib (libprotokit.a) has already
10 # been built and located in "protolib/lib with respect to this script
11 # You can 'cd makefiles' or 'cd protolib/makefiles' to build Protolib for
12 # your system before attempting to install this Python module.
13
14 PYTHON = "src/python/"
15
16 srcFiles = [PYTHON + 'protokit.cpp']
17
18 # Determine system-specific macro definitions, etc
19 # (For now we support only "linux", "darwin" (MacOS), "freebsd", and "win32")
20
21 system = platform.system().lower()
22
23 sys_macros = [('HAVE_ASSERT',None), ('HAVE_IPV6',None), ('PROTO_DEBUG', None)]
24 sys_libs = ['protokit']
25 extra_link_args = []
26
27 if system in ('linux', 'darwin', 'freebsd'):
28 sys_macros.append(('UNIX',None))
29 if(system in 'darwin'):
30 extra_link_args.append("-mmacosx-version-min=10.9")
31 extra_link_args.append("-stdlib=libc++")
32 elif system in ('windows'):
33 sys_macros.append(('WIN32',None))
34 else:
35 raise Exception("setup.py: unsupported operating system \"%s\"" % system)
36
37 if system == 'darwin':
38 sys_libs.append('resolv')
39
40 setup(name='protokit',
41 version = '1.0',
42 ext_modules = [Extension('protokit',
43 srcFiles,
44 include_dirs = ['./include'],
45 define_macros = sys_macros,
46 library_dirs = ['./lib', './build'],
47 libraries = sys_libs,
48 extra_link_args = extra_link_args)])