Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / libcoap-4.1.1 / SConscript
index 167613c..ded6fd0 100644 (file)
@@ -7,6 +7,8 @@ Import('env')
 libcoap_env = env.Clone()
 
 target_os = env.get('TARGET_OS')
+ca_transport = env.get('TARGET_TRANSPORT')
+with_tcp = env.get('WITH_TCP')
 # As in the source code(C) includes arduino Time library head file(C++)
 # It requires compile the .c with g++
 if target_os == 'arduino':
@@ -28,13 +30,17 @@ if target_os == 'arduino':
                ])
 
 if target_os not in ['arduino', 'windows', 'winrt']:
-       libcoap_env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '_BSD_SOURCE'])
+       libcoap_env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '_DEFAULT_SOURCE'])
        libcoap_env.AppendUnique(CFLAGS = ['-std=gnu99','-fPIC'])
 
 if target_os not in ['windows', 'winrt']:
        libcoap_env.AppendUnique(CFLAGS = ['-Wall', '-ffunction-sections',
                        '-fdata-sections', '-fno-exceptions'])
 
+if target_os == 'linux':
+       if with_tcp == True:
+               libcoap_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+
 if target_os == 'android':
        libcoap_env.AppendUnique(LIBS = ['log'])
 
@@ -69,3 +75,4 @@ libcoap_src = [
 libcoap = libcoap_env.StaticLibrary('libcoap', libcoap_src, OBJPREFIX='libcoap_')
 
 libcoap_env.InstallTarget([libcoap], 'libcoap')
+libcoap_env.UserInstallTargetLib([libcoap], 'libcoap')
\ No newline at end of file