replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / tool / SConscript
index 871e7a9..6aee4b5 100644 (file)
@@ -1,27 +1,29 @@
-# //******************************************************************
-# //
-# // 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.
-# //
-# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+# ******************************************************************
+#
+# 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.
+#
+# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 #
 Import('env')
+import os
 
 tools_env = env.Clone()
 src_dir = tools_env.get('SRC_DIR')
+target_os = tools_env.get('TARGET_OS')
 
 ######################################################################
 # Build flags
@@ -29,29 +31,47 @@ src_dir = tools_env.get('SRC_DIR')
 with_upstream_libcoap = tools_env.get('WITH_UPSTREAM_LIBCOAP')
 if with_upstream_libcoap == '1':
     # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded.
-    tools_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
+    tools_env.AppendUnique(CPPPATH = ['#/extlibs/libcoap/libcoap/include'])
 else:
     # For bring up purposes only, the forked version will live here.
-    tools_env.AppendUnique(CPPPATH = ['../../connectivity/lib/libcoap-4.1.1/include'])
+    tools_env.AppendUnique(CPPPATH = ['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
 
-tools_env.PrependUnique(CPPPATH = ['../../../../extlibs/cjson',
-                                  '../../stack/include',
-                                  '../../stack/include/internal',
-                                  '../../logger/include',
-                                  '../../../oc_logger/include',
-                                  '../../connectivity/api',
-                                  '../../connectivity/inc/pkix',
-                                  '../include',
-                                  '../include/internal'
-                                  ])
+tools_env.PrependUnique(CPPPATH = [
+    '#/extlibs/cjson',
+    '#/resource/csdk/stack/include',
+    '#/resource/csdk/stack/include/internal',
+    '#/resource/csdk/logger/include',
+    '#/resource/oc_logger/include',
+    '#/resource/csdk/connectivity/api',
+    '#/resource/csdk/connectivity/inc/pkix',
+    '#/resource/csdk/security/include',
+    '#/resource/csdk/security/include/internal',
+    '#/resource/csdk/security/provisioning/include',
+    '#/resource/csdk/security/provisioning/include/internal'
+])
 tools_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
-tools_env.AppendUnique(LIBPATH = [tools_env.get('BUILD_DIR')])
 tools_env.AppendUnique(RPATH = [tools_env.get('BUILD_DIR')])
-tools_env.PrependUnique(LIBS = ['oc', 'octbstack'])
+tools_env.AppendUnique(LIBPATH = [tools_env.get('BUILD_DIR')])
+tools_env.PrependUnique(LIBS = ['oc', 'octbstack', 'mbedtls', 'mbedx509', 'mbedcrypto'])
+
+if tools_env.get('MULTIPLE_OWNER') == '1':
+       tools_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
 
 ######################################################################
 # Source files and Targets
 ######################################################################
 json2cbor = tools_env.Program('json2cbor', ['json2cbor.c'])
-Alias("json2cbor", [json2cbor])
-env.AppendTarget('json2cbor')
+
+SVRDBEDITOR_DIR = 'svrdbeditor_src/'
+svrdbeditor_src = [
+    SVRDBEDITOR_DIR + 'svrdbeditorcommon.c',
+    SVRDBEDITOR_DIR + 'svrdbeditoracl.c',
+    SVRDBEDITOR_DIR + 'svrdbeditorcred.c',
+    SVRDBEDITOR_DIR + 'svrdbeditordoxm.c',
+    SVRDBEDITOR_DIR + 'svrdbeditorpstat.c',
+    SVRDBEDITOR_DIR + 'svrdbeditor.c'
+]
+
+svrdbeditor = tools_env.Program("svrdbeditor", svrdbeditor_src)
+Alias("securitytool", [json2cbor, svrdbeditor])
+tools_env.AppendTarget('securitytool')