Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/python/setup.py
Parent Directory
|
Revision Log
Revision 2191 -
(show annotations)
(download)
(as text)
Wed Sep 18 15:41:51 2024 UTC (5 months, 3 weeks ago) by amb
File MIME type: text/x-python
File size: 2372 byte(s)
Wed Sep 18 15:41:51 2024 UTC (5 months, 3 weeks ago) by amb
File MIME type: text/x-python
File size: 2372 byte(s)
Add header files as dependencies for the Python module.
1 | # Python interface setup script |
2 | # |
3 | # Part of the Routino routing software. |
4 | # |
5 | # This file Copyright 2018, 2022, 2024 Andrew M. Bishop |
6 | # |
7 | # This program is free software: you can redistribute it and/or modify |
8 | # it under the terms of the GNU Affero General Public License as published by |
9 | # the Free Software Foundation, either version 3 of the License, or |
10 | # (at your option) any later version. |
11 | # |
12 | # This program is distributed in the hope that it will be useful, |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | # GNU Affero General Public License for more details. |
16 | # |
17 | # You should have received a copy of the GNU Affero General Public License |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | # |
20 | |
21 | import os |
22 | import re |
23 | from setuptools import setup, Extension |
24 | |
25 | routino_router = Extension('routino._router', |
26 | sources = ['src/_router.c'], |
27 | depends = ['../src/routino.h'], |
28 | include_dirs = ['../src'], |
29 | library_dirs = ['../src'], |
30 | libraries = ['routino']) |
31 | |
32 | # Note: the database needs access to all symbols, not just those |
33 | # exported by the libroutino library so it must link with the object |
34 | # files and not just the library. |
35 | |
36 | lib_files = [] |
37 | |
38 | for file in os.listdir('../src'): |
39 | if re.search("-lib.o", file) and not re.search("-slim-lib.o", file): |
40 | lib_files.append("../src/" + file) |
41 | |
42 | routino_database = Extension('routino._database', |
43 | sources = ['src/_database.cc', 'src/database.cc'], |
44 | depends = ['../src/types.h', '../src/nodes.h', '../src/segments.h', '../src/ways.h', '../src/relations.h', '../src/routino.h'], |
45 | include_dirs = ['../src'], |
46 | extra_objects = lib_files, |
47 | library_dirs = ['../src']) |
48 | |
49 | setup (name = 'Routino', |
50 | version = '1.0', |
51 | author="Andrew M. Bishop", author_email='amb@routino.org', |
52 | url='http://routino.org/', |
53 | description = 'Interfaces to Routino in Python', |
54 | packages = ['routino'], |
55 | package_dir = {'routino': 'src'}, |
56 | py_modules = ['routino', 'routino.router', 'routino.database'], |
57 | ext_modules = [routino_router, routino_database]) |