spielwiese
Last change
on this file since 17228e was
17228e,
checked in by Hans Schoenemann <hannes@…>, 11 years ago
|
fix: make check (for non-dbug version)
removed: static.h
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | // -*- c++ -*- |
---|
2 | //***************************************************************************** |
---|
3 | /** @file pyobject_setup.cc |
---|
4 | * |
---|
5 | * @author Alexander Dreyer |
---|
6 | * @date 2010-12-15 |
---|
7 | * |
---|
8 | * This header file defines the @c blackbox setup operations for the pyobject |
---|
9 | * |
---|
10 | * @par Copyright: |
---|
11 | * (c) 2010 by The Singular Team, see LICENSE file |
---|
12 | **/ |
---|
13 | //***************************************************************************** |
---|
14 | |
---|
15 | #include "config.h" |
---|
16 | #include <kernel/mod2.h> |
---|
17 | #include <kernel/febase.h> |
---|
18 | |
---|
19 | /* whether pyobject module is linked statically or dynamically */ |
---|
20 | #ifdef HAVE_PYTHON |
---|
21 | |
---|
22 | #if defined(HAVE_STATIC) |
---|
23 | #ifdef HAVE_STATIC_PYTHON |
---|
24 | #define HAVE_STATIC_PYOBJECT |
---|
25 | #endif |
---|
26 | #else |
---|
27 | #ifdef EMBED_PYTHON |
---|
28 | #define HAVE_STATIC_PYOBJECT |
---|
29 | #else |
---|
30 | #define HAVE_DYNAMIC_PYOBJECT |
---|
31 | #endif |
---|
32 | #endif |
---|
33 | #endif |
---|
34 | |
---|
35 | # ifdef HAVE_STATIC_PYOBJECT // Case: link pyobject interface statically |
---|
36 | #include "pyobject.cc" |
---|
37 | void pyobject_setup() { pyobject_init(); } |
---|
38 | |
---|
39 | |
---|
40 | # elif defined(HAVE_DYNAMIC_PYOBJECT) // Case: pyobject is dynamic module (prefered variant) |
---|
41 | |
---|
42 | // forward declaration for Singular/iplib.cc |
---|
43 | void* binary_module_function(const char* lib, const char* func); |
---|
44 | void pyobject_setup() |
---|
45 | { |
---|
46 | void* fktn = binary_module_function("pyobject", "mod_init"); |
---|
47 | if (fktn) (* reinterpret_cast<void (*)()>(fktn) )(); |
---|
48 | else Werror("python related functions are not available"); |
---|
49 | } |
---|
50 | |
---|
51 | #else // Case: no python |
---|
52 | void pyobject_setup() { } |
---|
53 | |
---|
54 | #endif // HAVE_PYTHON |
---|
55 | |
---|
Note: See
TracBrowser
for help on using the repository browser.