X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fprovisioning%2Fexamples%2FSConscript;h=515f049db37abc4b01cea9fbdf64569ebf86ab1b;hb=3c093548382bb2542c87a67e6e5fa32552c29cb3;hp=184a73a3b4b7442c4ab72cedb802f98f5c01785d;hpb=66ea6de691f2f58652110c9c9cfc9f46e435f669;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/provisioning/examples/SConscript b/resource/provisioning/examples/SConscript index 184a73a..515f049 100644 --- a/resource/provisioning/examples/SConscript +++ b/resource/provisioning/examples/SConscript @@ -21,10 +21,15 @@ ## # Examples build script ## -Import('env') +thread_env = SConscript('#build_common/thread.scons') +lib_env = thread_env.Clone() +target_os = lib_env.get('TARGET_OS') + # Add third party libraries -lib_env = env.Clone() -SConscript(env.get('SRC_DIR') + '/resource/third_party_libs.scons', 'lib_env') +SConscript('#resource/third_party_libs.scons', 'lib_env') + +with_ra = lib_env.get('WITH_RA') +with_ra_ibb = lib_env.get('WITH_RA_IBB') examples_env = lib_env.Clone() @@ -34,53 +39,88 @@ examples_env = lib_env.Clone() examples_env.AppendUnique(CPPPATH = [ '../../include/', '../../csdk/stack/include', + '../../../extlibs/cjson', + '../../../extlibs/mbedtls/mbedtls/include', '../../csdk/logger/include', '../../oc_logger/include', + '../../csdk/connectivity/api', + '../../csdk/connectivity/inc/pkix', + '../../csdk/connectivity/common/inc', + '../../csdk/connectivity/lib/libcoap-4.1.1/include', '../../csdk/security/include', + '../../csdk/security/include/internal', + '../../csdk/security/provisioning/include/cloud', '../../csdk/security/provisioning/include', '../../csdk/security/provisioning/include/oxm', '../../csdk/security/provisioning/include/internal' ]) -target_os = env.get('TARGET_OS') -if target_os not in ['windows', 'winrt']: - examples_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - - # Note: 'pthread' is in libc for android. On other platform, if use - # new gcc(>4.9?) it isn't required, otherwise, it's required - if target_os != 'android': - examples_env.AppendUnique(LIBS = ['-lpthread', '-ldl']) - -examples_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -examples_env.AppendUnique(RPATH = [env.get('BUILD_DIR')]) +examples_env.AppendUnique(LIBPATH = [examples_env.get('BUILD_DIR')]) +examples_env.AppendUnique(RPATH = [examples_env.get('BUILD_DIR')]) examples_env.PrependUnique(LIBS = ['ocprovision', 'oc', 'ocpmapi', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap']) -if env.get('SECURED') == '1': - examples_env.AppendUnique(LIBS = ['tinydtls']) -if env.get('DTLS_WITH_X509') == '1': - examples_env.AppendUnique(LIBS = ['CKManager']) - examples_env.AppendUnique(LIBS = ['asn1']) +if with_ra_ibb: + examples_env.AppendUnique(LIBS = examples_env['RALIBS'], LIBPATH = examples_env['RALIBPATH'], RPATH = examples_env['RARPATH']) + print "RALIBS = %s" % examples_env['RALIBS'] + print "RALIBPATH = %s" % examples_env['RALIBPATH'] + print "RARPATH = %s" % examples_env['RARPATH'] + examples_env.AppendUnique(LIBS = 'wksxmppxep') +else : + if with_ra: + examples_env.AppendUnique(LIBS = ['ra_xmpp']) + +if examples_env.get('SECURED') == '1': + examples_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto']) + +if 'g++' in examples_env.get('CXX'): + examples_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) -if target_os == 'android': +if target_os in ['android']: examples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) examples_env.AppendUnique(LIBS = ['gnustl_shared']) - if not env.get('RELEASE'): + if not examples_env.get('RELEASE'): examples_env.AppendUnique(LIBS = ['log']) if target_os in ['darwin', 'ios']: examples_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE']) +if target_os == 'tizen': + examples_env.AppendUnique(CPPDEFINES = ['__TIZEN__']) +if examples_env.get('MULTIPLE_OWNER') == '1': + examples_env.AppendUnique(CPPDEFINES = ['MULTIPLE_OWNER']) + ###################################################################### # Source files and Targets ###################################################################### provisioningclient = examples_env.Program('provisioningclient', 'provisioningclient.cpp') +if examples_env.get('MULTIPLE_OWNER') == '1': + subownerclient = examples_env.Program('subownerclient', 'subownerclient.cpp') -Alias("examples", [provisioningclient]) -env.AppendTarget('examples') +if examples_env.get('WITH_TCP') == True: + cloudClient = examples_env.Program('cloudClient',['cloudClient.cpp', 'cloudAuth.cpp', 'cloudWrapper.cpp']) src_dir = examples_env.get('SRC_DIR') svr_db_src_dir = src_dir + '/resource/provisioning/examples/' -svr_db_build_dir = env.get('BUILD_DIR') +'/resource/provisioning/examples/' -examples_env.Alias("install", examples_env.Install( svr_db_build_dir, - svr_db_src_dir + 'oic_svr_db_client.json')) +svr_db_build_dir = examples_env.get('BUILD_DIR') +'/resource/provisioning/examples/' + +clientjson = examples_env.Install(svr_db_build_dir, svr_db_src_dir + 'oic_svr_db_client.json') +clientdat = examples_env.Install(svr_db_build_dir, svr_db_src_dir + 'oic_svr_db_client.dat') + +if examples_env.get('MULTIPLE_OWNER') == '1': + subownerclientdat = examples_env.Install(svr_db_build_dir, + svr_db_src_dir + 'oic_svr_db_subowner_client.dat') + Alias("subowner", [subownerclientdat, subownerclient]) + examples_env.AppendTarget("subowner") + +if examples_env.get('WITH_TCP') == True: + clouddat = examples_env.Install(svr_db_build_dir, + svr_db_src_dir + 'cloud.dat') + rootcert = examples_env.Install(svr_db_build_dir, + svr_db_src_dir + 'rootca.crt') + Alias("cloud", [clouddat, rootcert, cloudClient]) + examples_env.AppendTarget("cloud") + +Alias("examples", [provisioningclient, clientjson,clientdat]) +examples_env.AppendTarget('examples') +