1 |
# |
---|
2 |
# library |
---|
3 |
# |
---|
4 |
|
---|
5 |
import os |
---|
6 |
import sys |
---|
7 |
|
---|
8 |
#Import( 'env' ) |
---|
9 |
Import( 'externalenv' ) |
---|
10 |
#dbus_env = env.Copy() |
---|
11 |
#buildenv={} |
---|
12 |
#if os.environ.has_key('PATH'): |
---|
13 |
# buildenv['PATH']=os.environ['PATH'] |
---|
14 |
#else: |
---|
15 |
# buildenv['PATH']='' |
---|
16 |
|
---|
17 |
#if os.environ.has_key('PKG_CONFIG_PATH'): |
---|
18 |
# buildenv['PKG_CONFIG_PATH']=os.environ['PKG_CONFIG_PATH'] |
---|
19 |
#else: |
---|
20 |
# buildenv['PKG_CONFIG_PATH']='' |
---|
21 |
|
---|
22 |
dbus_env = externalenv.Copy() #Environment( ENV = buildenv ) |
---|
23 |
|
---|
24 |
#CacheDir( 'cache/objects' ) |
---|
25 |
|
---|
26 |
if dbus_env.has_key('DBUS1_FLAGS'): |
---|
27 |
dbus_env.MergeFlags( dbus_env['DBUS1_FLAGS'] ) |
---|
28 |
|
---|
29 |
# add the local version of libdbus++ |
---|
30 |
dbus_env.AppendUnique( CPPPATH=["#/external/dbus/include"] ) |
---|
31 |
dbus_env.AppendUnique( LIBPATH=[dbus_env['build_base']+"external/dbus"]) |
---|
32 |
dbus_env.AppendUnique( LIBS=["dbus-c++"] ) |
---|
33 |
dbus_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE"] ) |
---|
34 |
|
---|
35 |
# this is required to indicate that the DBUS version we use has support |
---|
36 |
# for platform dependent threading init functions |
---|
37 |
# this is true for DBUS >= 0.96 or so. Since we require >= 1.0 it is |
---|
38 |
# always true |
---|
39 |
dbus_env.AppendUnique( CCFLAGS=["-DDBUS_HAS_THREADS_INIT_DEFAULT"] ) |
---|
40 |
|
---|
41 |
sources = [ |
---|
42 |
'src/connection.cpp', |
---|
43 |
'src/debug.cpp', |
---|
44 |
'src/dispatcher.cpp', |
---|
45 |
'src/error.cpp', |
---|
46 |
'src/eventloop.cpp', |
---|
47 |
'src/interface.cpp', |
---|
48 |
'src/introspection.cpp', |
---|
49 |
'src/property.cpp', |
---|
50 |
'src/message.cpp', |
---|
51 |
'src/object.cpp', |
---|
52 |
'src/pendingcall.cpp', |
---|
53 |
'src/server.cpp', |
---|
54 |
'src/types.cpp' |
---|
55 |
] |
---|
56 |
|
---|
57 |
if dbus_env.has_key('DEBUG') and dbus_env['DEBUG']: |
---|
58 |
dbus_env.AppendUnique( CCFLAGS=["-DDEBUG","-g"] ) |
---|
59 |
|
---|
60 |
dbus_env.PrependUnique( LIBS=["expat"] ) |
---|
61 |
libdbuspp=dbus_env.StaticLibrary('dbus-c++', sources) |
---|
62 |
|
---|
63 |
# |
---|
64 |
# tools |
---|
65 |
# |
---|
66 |
|
---|
67 |
tools_env = dbus_env.Copy() |
---|
68 |
|
---|
69 |
introspect_sources = [ |
---|
70 |
'tools/introspect.cpp', |
---|
71 |
] |
---|
72 |
|
---|
73 |
xml2cpp_sources = [ |
---|
74 |
'tools/xml.cpp','tools/xml2cpp.cpp' |
---|
75 |
] |
---|
76 |
|
---|
77 |
tools_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE"] ) |
---|
78 |
tools_env.AppendUnique( CPPPATH=["#/external/dbus/include"] ) |
---|
79 |
tools_env.PrependUnique( LIBPATH=dbus_env['build_base']+"external/dbus" ) |
---|
80 |
tools_env.PrependUnique( LIBS="dbus-c++" ) |
---|
81 |
|
---|
82 |
dbusxx_introspect = tools_env.Program('dbusxx-introspect', introspect_sources) |
---|
83 |
dbusxx_xml2cpp = tools_env.Program('dbusxx-xml2cpp', xml2cpp_sources) |
---|
84 |
|
---|
85 |
# |
---|
86 |
# xml translator |
---|
87 |
# |
---|
88 |
|
---|
89 |
def dbusxx_xml2cpp_emitter(target, source, env): |
---|
90 |
dbus_env.Depends(target, dbusxx_xml2cpp) |
---|
91 |
return (target, source) |
---|
92 |
|
---|
93 |
dbusxx_xml2cpp_adaptor_builder = Builder(action = dbusxx_xml2cpp[0].abspath + ' $SOURCE --adaptor=$TARGET', |
---|
94 |
emitter = dbusxx_xml2cpp_emitter, |
---|
95 |
suffix = '.h', src_suffix = '.xml') |
---|
96 |
|
---|
97 |
dbusxx_xml2cpp_proxy_builder = Builder(action = dbusxx_xml2cpp[0].abspath + ' $SOURCE --proxy=$TARGET', |
---|
98 |
emitter = dbusxx_xml2cpp_emitter, |
---|
99 |
suffix = '.h', src_suffix = '.xml') |
---|
100 |
|
---|
101 |
Export('dbusxx_xml2cpp_adaptor_builder') |
---|
102 |
Export('dbusxx_xml2cpp_proxy_builder') |
---|