SConscript('protocol-plugin/SConscript')
# Build notification manager project
- SConscript('notification-manager/SConscript')
+ if target_os not in ['android', 'tizen']:
+ SConscript('notification-manager/SConscript')
+
+ # Build resource-encapsulation project
+ if target_os not in ['android', 'tizen']:
+ SConscript('resource-encapsulation/SConscript')
++
++ # Build simulator module
++ if target_os in ['linux']:
++ SConscript('simulator/SConscript')
#else:
# SConscript('notification-manager/SampleApp/arduino/SConscript')
- if target_os in ['linux']:
- # Build simulator module
- SConscript('simulator/SConscript')
+
--- /dev/null
- java_home = ARGUMENTS.get('JAVA_HOME', 0)
- if not java_home:
+#******************************************************************
+#
+# Copyright 2014 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.
+#
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+##
+# Simulator build script
+##
+
+import os
+Import('env')
+
+lib_env = env.Clone()
+SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
+simulator_env = lib_env.Clone()
+
+target_os = env.get('TARGET_OS')
+######################################################################
+# Build flags
+######################################################################
+simulator_env.AppendUnique(CPPPATH = ['inc', 'src'])
+simulator_env.AppendUnique(CPPPATH = [
+ '../../resource/include/',
+ '../../resource/csdk/stack/include',
+ '../../resource/csdk/ocrandom/include',
+ '../../resource/csdk/logger/include',
+ '../../resource/oc_logger/include',
+ ])
+
+# Including Java path for building JNI files
- *************************************** Error *********************************
- * JAVA_HOME variable not set in scons command *
- *******************************************************************************
++try:
++ os.environ['JAVA_HOME']
++except KeyError:
+ print '''
- else:
- java_headers = [os.path.join(java_home, 'include')]
- java_headers.append(os.path.join(java_headers[0], 'win32'))
- java_headers.append(os.path.join(java_headers[0], 'linux'))
- java_headers.append(os.path.join(java_headers[0], 'solaris'))
- simulator_env.AppendUnique(CPPPATH = java_headers)
++*************************************** Error *********************************
++* JAVA_HOME environment variable not set
++* Simulator has dependency on java, Please set environment variable JAVA_HOME
++*******************************************************************************
+ '''
++ sys.exit(1)
++
++java_headers = [os.path.join(os.environ['JAVA_HOME'], 'include')]
++java_headers.append(os.path.join(java_headers[0], 'win32'))
++java_headers.append(os.path.join(java_headers[0], 'linux'))
++java_headers.append(os.path.join(java_headers[0], 'solaris'))
++simulator_env.AppendUnique(CPPPATH = java_headers)
+
+simulator_env.AppendUnique(CPPPATH = ['../../extlibs/cjson'])
+simulator_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'libcoap'])
+simulator_env.AppendUnique(LIBS = ['pthread'])
+
+simulator_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+
+######################################################################
+# Source files and Targets
+######################################################################
+simulator_src = [env.Glob('src/*.cpp'), env.Glob('java/jni/*.cpp')]
+simulatorsdk = simulator_env.SharedLibrary('SimulatorManager', simulator_src)
+
+simulator_env.InstallTarget(simulatorsdk, 'libSimulator')
+
+#Build sample application
+SConscript('examples/server/SConscript')