replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / stack / samples / tizen / SimpleClientServer / scons / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 Import('env')
22
23 target_os = env.get('TARGET_OS')
24 transport = env.get('TARGET_TRANSPORT')
25 secured = env.get('SECURED')
26 routing = env.get('ROUTING')
27 with_mq = env.get('WITH_MQ')
28 OIC_LIB = 'oic'
29 root_dir = env.get('ROOT_DIR')
30 build_dir = env.get('BUILD_DIR')
31 sample_dir = build_dir
32
33 print "MQ flag is %s" % with_mq
34
35 env.AppendUnique(CPPFLAGS = ['-std=c++0x', '-fPIC', '-D__TIZEN__','-DWITH_POSIX', '-Wall', '-DSLP_SDK_LOG', '-g','-D_GNU_SOURCE','-DTIZEN_DEBUG_ENABLE', '-DTB_LOG','`pkg-config', '--cflags', '--libs','dlog', 'com.oic.ri', 'capi-network-connection',
36                                 'gobject-2.0','glib-2.0`'])
37
38 if routing == 'GW':
39         env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
40 elif routing == 'EP':
41         env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
42
43 if env.get('WITH_PROXY'):
44         env.AppendUnique(CPPDEFINES = ['WITH_CHPROXY'])
45         
46 env.Append(LIBS=[
47   'm', 'pthread', 'rt', 'dl', 'stdc++', 'gobject-2.0', 'gio-2.0', 'glib-2.0', 'capi-network-connection', 'dlog', 'capi-network-bluetooth', 'connectivity_abstraction', 'coap', 'octbstack', 'ocsrm', 'c_common'
48 ])
49
50 if secured == '1':
51         env.PrependUnique(CPPPATH = [root_dir + '/external/inc/'])
52         env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
53         env.Append(LIBS=['mbedtls', 'mbedx509','mbedcrypto'])
54
55 if 'ALL' in transport:
56         env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER','BT_ADAPTER_TEST','BLE_ADAPTER_TEST'])
57         print "CA Transport is ALL"
58         if env.get('WITH_TCP'):
59                 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
60 else:
61         if 'BT' in transport:
62                 env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER','BT_ADAPTER_TEST'])
63                 print "CA Transport is BT"
64         else:
65                 env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
66
67         if 'BLE' in transport:
68                 env.AppendUnique(CPPDEFINES = ['LE_ADAPTER','BLE_ADAPTER_TEST'])
69                 print "CA Transport is BLE"
70         else:
71                 env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
72
73         if 'IP' in transport:
74                 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
75                 print "CA Transport is IP"
76         else:
77                 env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
78
79         if env.get('WITH_TCP'):
80                 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
81         else:
82                 env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
83
84 if 'SUB' in with_mq:
85         env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
86         print "MQ SUB support"
87
88 if 'PUB' in with_mq:
89         env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
90         print "MQ PUB support"
91
92 if 'BROKER' in with_mq:
93         env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
94         print "MQ Broker support"
95
96 #ri_sample_src = [sample_dir + '/occlient.cpp']
97
98 #print " ri sample src %s" % ri_sample_src
99
100 #env.Program('ri_sample', [ri_sample_src,])
101
102 env.Program('occlient', [sample_dir + 'occlient.cpp', sample_dir + 'common.cpp'])
103 env.Program('ocserver', [sample_dir + 'ocserver.cpp', sample_dir + 'common.cpp'])
104 env.Program('ocrouting', [sample_dir + 'ocrouting.cpp', sample_dir + 'common.cpp'])