SConscript revision 12027:1eb7dc7aa10b
1# Copyright (c) 2017, TU Dresden
2# Copyright (c) 2017, University of Kaiserslautern
3# All rights reserved.
4
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to deal
7# in the Software without restriction, including without limitation the rights
8# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9# copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in
13# all copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE.
22#
23# Authors: Christian Menard
24#          Matthias Jung
25
26import os
27
28Import('main')
29
30main.Prepend(CPPPATH=Dir('./src'))
31main.Prepend(CPATH=Dir('./src'))
32
33main.Prepend(CXXFLAGS=['-DSC_INCLUDE_FX', '-pthread'])
34main.Prepend(CFLAGS=['-DSC_INCLUDE_FX', '-pthread'])
35
36conf = Configure(main)
37
38if main['PLATFORM'] == 'darwin':
39    main.Append(LINKFLAGS=['-undefined', 'dynamic_lookup'])
40
41s_file = None
42if conf.CheckDeclaration("__i386__"):
43    s_file = 'i386.s'
44if conf.CheckDeclaration("__x86_64__"):
45    s_file = 'iX86_64.s'
46conf.Finish()
47
48if s_file is None:
49    print 'Unsupported CPU architecture!'
50    Exit(1)
51
52systemc_files = Glob('src/sysc/kernel/*.cpp')
53systemc_files += ['src/sysc/qt/qt.c', 'src/sysc/qt/md/' + s_file]
54systemc_files += Glob('src/sysc/communication/*.cpp')
55systemc_files += Glob('src/sysc/tracing/*.cpp')
56systemc_files += Glob('src/sysc/utils/*.cpp')
57systemc_files += Glob('src/sysc/datatypes/bit/*.cpp')
58systemc_files += Glob('src/sysc/datatypes/fx/*.cpp')
59systemc_files += Glob('src/sysc/datatypes/int/*.cpp')
60systemc_files += Glob('src/sysc/datatypes/misc/*.cpp')
61
62main.Library('libsystemc', systemc_files)
63main.SharedLibrary('libsystemc', systemc_files)
64
65