Fixed [IOT-396] "Sconscript not available in Iotivity repo"
authorErich Keane <erich.keane@intel.com>
Fri, 3 Apr 2015 17:55:08 +0000 (10:55 -0700)
committerErich Keane <erich.keane@intel.com>
Fri, 3 Apr 2015 18:03:10 +0000 (18:03 +0000)
Currently Sconscript alone has been added for tinydtls compilation.
Before compiling the code, Please add tinydtls source code in this folder.

Change-Id: Idd5f19f54dba5cc5cfb855658b08498ff5fda0d7
Signed-off-by: k.karthick <k.karthick@samsung.com>
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/595
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/connectivity/lib/tinydtls/ReadMe.txt [new file with mode: 0644]
resource/csdk/connectivity/lib/tinydtls/SConscript [new file with mode: 0644]

diff --git a/resource/csdk/connectivity/lib/tinydtls/ReadMe.txt b/resource/csdk/connectivity/lib/tinydtls/ReadMe.txt
new file mode 100644 (file)
index 0000000..b3dce09
--- /dev/null
@@ -0,0 +1,5 @@
+Currently Sconscript alone has been added for tinydtls compilation.
+Before compiling the code, Please add tinydtls source code in this folder.
+
+Source Code will be available in following link:
+http://sourceforge.net/projects/tinydtls/files/latest/download?source=files
\ No newline at end of file
diff --git a/resource/csdk/connectivity/lib/tinydtls/SConscript b/resource/csdk/connectivity/lib/tinydtls/SConscript
new file mode 100644 (file)
index 0000000..ee836eb
--- /dev/null
@@ -0,0 +1,72 @@
+# *****************************************************************
+#
+#  Copyright 2015 Samsung Electronics All Rights Reserved.
+#
+#
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+# *****************************************************************/
+##
+# Tinydtls build script
+##
+
+Import('env')
+
+print "Reading Tinydtls folder script"
+
+target_os = env.get('TARGET_OS')
+
+if(target_os) == 'arduino':
+       env.Replace(CFLAGS = env.get('CXXFLAGS'))
+
+root_dir = './'
+
+tinydtls_src_path = root_dir
+
+env.AppendUnique(CPPPATH = [root_dir])
+env.AppendUnique(CPPPATH = [root_dir+'aes/'])
+env.AppendUnique(CPPPATH = [root_dir+'ecc/'])
+env.AppendUnique(CPPPATH = [root_dir+'sha2/'])
+
+######################################################################
+# Source files and Target(s)
+######################################################################
+tinydtls_src = [
+                'dtls.c',
+                'crypto.c',
+                'ccm.c',
+                'hmac.c',
+                'netq.c',
+                'peer.c',
+                'dtls_time.c',
+                'session.c',
+                'aes/rijndael.c',
+                'ecc/ecc.c',
+                'sha2/sha2.c',
+        ]
+
+env.AppendUnique(TINYDTLS_SRC = tinydtls_src)
+
+if not env.get('RELEASE'):
+       if(target_os) not in ['android', 'arduino']:
+               env.AppendUnique(TINYDTLS_SRC = ['debug.c'])
+else:
+       env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+
+env.AppendUnique(CPPDEFINES = ['WITH_OICSTACK', 'DTLSV12',  'WITH_SHA256', 'DTLS_CHECK_CONTENTTYPE'])
+
+libtinydtls = env.StaticLibrary('libtinydtls', env.get('TINYDTLS_SRC'), OBJPREFIX='libtinydtls_')
+
+env.InstallTarget(libtinydtls, 'libtinydtls');
+