Import('env')
lib_env = env.Clone()
-SConscript(env.get('SRC_DIR') + '/resource/third_party_libs.scons', 'lib_env')
+SConscript('#resource/third_party_libs.scons', 'lib_env')
liboctbstack_env = lib_env.Clone()
target_os = env.get('TARGET_OS')
+rd_mode = env.get('RD_MODE')
with_ra = env.get('WITH_RA')
with_ra_ibb = env.get('WITH_RA_IBB')
with_tcp = env.get('WITH_TCP')
+with_mq = env.get('WITH_MQ')
# As in the source code, it includes arduino Time library (C++)
# It requires compile the .c with g++
if target_os == 'arduino':
'security/provisioning/include',
])
-if target_os not in ['arduino', 'windows', 'winrt']:
+if 'SUB' in with_mq:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
+if 'PUB' in with_mq:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
+if 'BROKER' in with_mq:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
+
+if target_os not in ['arduino', 'windows']:
liboctbstack_env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
liboctbstack_env.AppendUnique(CFLAGS = ['-std=c99'])
elif liboctbstack_env.get('ROUTING') == 'EP':
liboctbstack_env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
-if target_os not in ['windows', 'winrt']:
+if target_os not in ['windows']:
liboctbstack_env.AppendUnique(CFLAGS = ['-Wall'])
liboctbstack_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
if target_os in ['tizen', 'linux']:
liboctbstack_env.ParseConfig("pkg-config --cflags --libs uuid")
-if target_os not in ['android', 'arduino', 'windows', 'winrt', 'msys_nt']:
- liboctbstack_env.AppendUnique(LIBS = ['pthread'])
-
if target_os == 'arduino':
liboctbstack_env.AppendUnique(CPPDEFINES = ['NDEBUG', 'WITH_ARDUINO'])
elif target_os not in ['darwin','ios', 'msys_nt', 'windows']:
if env.get('DTLS_WITH_X509') == '1':
liboctbstack_env.AppendUnique(CPPDEFINES = ['__WITH_X509__'])
-if env.get('WITH_RD') == '1':
- liboctbstack_env.PrependUnique(CPPPATH = ['../../service/resource-directory/include'])
- liboctbstack_env.PrependUnique(LIBPATH = [env.get('BUILD_DIR') + 'service/resource-directory/include'])
- liboctbstack_env.AppendUnique(CPPDEFINES = ['-DWITH_RD'])
- liboctbstack_env.AppendUnique(LIBS = ['resource_directory'])
-
liboctbstack_env.Append(LIBS = ['c_common'])
if liboctbstack_env.get('ROUTING') in ['GW', 'EP']:
OCTBSTACK_SRC + 'ocobserve.c',
OCTBSTACK_SRC + 'ocserverrequest.c',
OCTBSTACK_SRC + 'occollection.c',
- OCTBSTACK_SRC + 'oicgroup.c',
- OCTBSTACK_SRC + "rdpayload.c"
+ OCTBSTACK_SRC + 'oicgroup.c'
]
+if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
+ liboctbstack_src.append(OCTBSTACK_SRC + 'rdpayload.c')
+ liboctbstack_src.append(OCTBSTACK_SRC + 'oicresourcedirectory.c')
+ if 'CLIENT' in rd_mode:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
+ if 'SERVER' in rd_mode:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
+
if with_tcp == True:
liboctbstack_src.append(OCTBSTACK_SRC + 'oickeepalive.c')