replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / c_common / SConscript
index 8facaa1..0a9ff8e 100644 (file)
@@ -89,6 +89,12 @@ if target_os == 'arduino':
        # Detection of headers on the Arduino platform is currently broken.
        cxx_headers = []
 
+if target_os in ['tizenrt']:
+       env.AppendUnique(CCFLAGS = ['-std=c99'])
+       env.AppendUnique(CCFLAGS = ['-w'])
+       cxx_headers.remove('sys/timeb.h')
+       config_h_body += "#include <tinyara/config.h>\n\n"
+
 if target_os == 'msys_nt':
        # WinPThread provides a pthread.h, but we want to use native threads.
        cxx_headers.remove('pthread.h')
@@ -98,8 +104,12 @@ def get_define_from_header_file(header_file):
        return "HAVE_" + header_file_converted
 
 for header_file_name in cxx_headers:
-       if conf.CheckCXXHeader(header_file_name):
-               config_h_body += "#define %s 1\n\n" % get_define_from_header_file(header_file_name)
+       if target_os == 'tizenrt':
+               if conf.CheckCHeader(header_file_name):
+                       config_h_body += "#define %s 1\n\n" % get_define_from_header_file(header_file_name)
+       else:
+               if conf.CheckCXXHeader(header_file_name):
+                       config_h_body += "#define %s 1\n\n" % get_define_from_header_file(header_file_name)
 conf.Finish()
 
 # Autoconf feature doesn't work with Jenkins' arduino toolchain, so hardcode it here.
@@ -138,7 +148,8 @@ env.AppendUnique(CPPPATH = [
             os.path.join(Dir('.').abspath, 'oic_malloc', 'include'),
             os.path.join(Dir('.').abspath, 'oic_string', 'include'),
             os.path.join(Dir('.').abspath, 'oic_time', 'include'),
-            os.path.join(Dir('.').abspath, 'ocrandom', 'include')
+            os.path.join(Dir('.').abspath, 'ocrandom', 'include'),
+            os.path.join(Dir('.').abspath, 'octhread', 'include')
         ])
 
 if target_os == 'tizen':
@@ -158,8 +169,16 @@ common_src = [
        'oic_string/src/oic_string.c',
        'oic_malloc/src/oic_malloc.c',
        'oic_time/src/oic_time.c',
-       'ocrandom/src/ocrandom.c',
+       'ocrandom/src/ocrandom.c'
        ]
+
+if env['POSIX_SUPPORTED']:
+       common_src.append('octhread/src/posix/octhread.c')
+elif target_os  in ['windows']:
+       common_src.append('octhread/src/windows/octhread.c')
+else:
+       common_src.append('octhread/src/noop/octhread.c')
+
 commonlib = common_env.StaticLibrary('c_common', common_src)
 common_env.InstallTarget(commonlib, 'c_common')
 common_env.UserInstallTargetLib(commonlib, 'c_common')