root/trunk/libffado/external/dbus/SConscript

Revision 566, 2.0 kB (checked in by ppalmers, 15 years ago)

fix scons problem with PKG_CONFIG_PATH being not set in the calling environment

Line 
1 #
2 # library
3 #
4
5 import os
6 import sys
7
8 Import( 'env' )
9 #dbus_env = env.Copy()
10 buildenv={}
11 if os.environ.has_key('PATH'):
12         buildenv['PATH']=os.environ['PATH']
13 else:
14         buildenv['PATH']=''
15
16 if os.environ.has_key('PKG_CONFIG_PATH'):
17         buildenv['PKG_CONFIG_PATH']=os.environ['PKG_CONFIG_PATH']
18 else:
19         buildenv['PKG_CONFIG_PATH']=''
20
21 dbus_env = Environment( ENV = buildenv )
22
23 CacheDir( 'cache/objects' )
24
25 dbus_env.MergeFlags( ["!pkg-config --cflags --libs dbus-1"] )
26
27 # add the local version of libdbus++
28 dbus_env.AppendUnique( CPPPATH=["#/external/dbus/include"] )
29 dbus_env.AppendUnique( LIBPATH=[env['build_base']+"external/dbus"])
30 dbus_env.AppendUnique( LIBS=["dbus-c++"] )
31 dbus_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE"] )
32
33 sources = [
34         'src/connection.cpp',
35         'src/debug.cpp',
36         'src/dispatcher.cpp',
37         'src/error.cpp',
38         'src/eventloop.cpp',
39         'src/interface.cpp',
40         'src/introspection.cpp',
41         'src/property.cpp',
42         'src/message.cpp',
43         'src/object.cpp',
44         'src/pendingcall.cpp',
45         'src/server.cpp',
46         'src/types.cpp'
47 ]
48
49 if env['DEBUG']:
50         dbus_env.AppendUnique( CCFLAGS=["-DDEBUG","-g"] )
51
52 dbus_env.PrependUnique( LIBS=["expat"] )
53 libdbuspp=dbus_env.StaticLibrary('dbus-c++', sources)
54
55 #
56 # tools
57 #
58
59 tools_env = dbus_env.Copy()
60
61 introspect_sources = [
62         'tools/introspect.cpp',
63 ]
64
65 xml2cpp_sources = [
66         'tools/xml.cpp','tools/xml2cpp.cpp'
67 ]
68
69 tools_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE"] )
70 tools_env.AppendUnique( CPPPATH=["#/external/dbus/include"] )
71 tools_env.PrependUnique( LIBPATH=env['build_base']+"external/dbus" )
72 tools_env.PrependUnique( LIBS="dbus-c++" )
73
74 dbusxx_introspect = tools_env.Program('dbusxx-introspect', introspect_sources)
75 dbusxx_xml2cpp = tools_env.Program('dbusxx-xml2cpp', xml2cpp_sources)
76
77 #
78 # xml translator
79 #
80
81 def dbusxx_xml2cpp_emitter(target, source, env):
82         dbus_env.Depends(target, dbusxx_xml2cpp)
83         return (target, source)
84
85 dbusxx_xml2cpp_builder = Builder(action = dbusxx_xml2cpp[0].abspath + ' $SOURCE --adaptor=$TARGET',
86         emitter = dbusxx_xml2cpp_emitter,
87         suffix = '.h', src_suffix = '.xml')
88
89 Export('dbusxx_xml2cpp_builder')
Note: See TracBrowser for help on using the browser.