--- /dev/null
+# *****************************************************************
+#
+# 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');
+