From: Jaewook Jung Date: Mon, 5 Sep 2016 05:50:30 +0000 (+0900) Subject: Revert "Generate iotivity_config.h at build time" X-Git-Tag: 1.2.0+RC3~198 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8754a91b157e957b0c0ade9f07804cde2b3cd225;p=platform%2Fupstream%2Fiotivity.git Revert "Generate iotivity_config.h at build time" This reverts commit dbcc3f47fe5abd2102750cdd3ace7f92619e8dd0. Change-Id: I1fe54489a0d73940ca74f4abd293608c255fe645 Signed-off-by: Jaewook Jung Reviewed-on: https://gerrit.iotivity.org/gerrit/11393 Reviewed-by: Uze Choi Tested-by: Uze Choi --- diff --git a/.gitignore b/.gitignore index 4f34ee360..62afd32e0 100644 --- a/.gitignore +++ b/.gitignore @@ -37,9 +37,6 @@ resource/csdk/stack/samples/linux/SimpleClientServer/release/ resource/csdk/connectivity/build/out/ -# Ignore autogenerated files -resource/c_common/iotivity_config.h - resource/oc_logger/bin/ resource/oc_logger/lib/ resource/oc_logger/samples/linux/release/ diff --git a/build_common/SConscript b/build_common/SConscript index 0264e6ace..f71d250bc 100644 --- a/build_common/SConscript +++ b/build_common/SConscript @@ -433,6 +433,52 @@ conf = Configure(env, # POSIX_SUPPORTED, 1 if it is supported, 0 otherwise conf.CheckPThreadsSupport() +###################################################################### +# Generate macros for presence of headers +###################################################################### +cxx_headers = ['arpa/inet.h', + 'fcntl.h', + 'grp.h', + 'in6addr.h', + 'linux/limits.h', + 'memory.h', + 'netdb.h', + 'netinet/in.h', + 'pthread.h', + 'pwd.h', + 'stdlib.h', + 'string.h', + 'strings.h', + 'sys/socket.h', + 'sys/stat.h', + 'sys/time.h', + 'sys/timeb.h', + 'sys/types.h', + 'sys/unistd.h', + 'syslog.h', + 'time.h', + 'unistd.h', + 'uuid/uuid.h', + 'windows.h', + 'winsock2.h', + 'ws2tcpip.h'] + +if target_os == 'arduino': + # Detection of headers on the Arduino platform is currently broken. + cxx_headers = [] + +if target_os == 'msys_nt': + # WinPThread provides a pthread.h, but we want to use native threads. + cxx_headers.remove('pthread.h') + +def get_define_from_header_file(header_file): + header_file_converted = header_file.replace("/","_").replace(".","_").upper() + return "HAVE_" + header_file_converted + +for header_file_name in cxx_headers: + if conf.CheckCXXHeader(header_file_name): + conf.env.AppendUnique(CPPDEFINES = [get_define_from_header_file(header_file_name)]) + env = conf.Finish() ###################################################################### diff --git a/extlibs/timer/timer.c b/extlibs/timer/timer.c index 08b9a6efb..3dda84baf 100755 --- a/extlibs/timer/timer.c +++ b/extlibs/timer/timer.c @@ -22,7 +22,6 @@ #define _BSD_SOURCE -#include "iotivity_config.h" #ifdef HAVE_WINDOWS_H #include #endif @@ -41,6 +40,7 @@ #ifdef HAVE_STRING_H #include #endif +#include "platform_features.h" #include diff --git a/extlibs/timer/timer.h b/extlibs/timer/timer.h index ffa304ca0..3ad432ac8 100644 --- a/extlibs/timer/timer.h +++ b/extlibs/timer/timer.h @@ -21,7 +21,6 @@ #ifndef TIMER_H_ #define TIMER_H_ -#include "iotivity_config.h" #ifdef HAVE_SYS_TIME_H #include #endif diff --git a/extlibs/tinydtls/tests/dtls-server.c b/extlibs/tinydtls/tests/dtls-server.c index 07acd18eb..9a8918a7e 100644 --- a/extlibs/tinydtls/tests/dtls-server.c +++ b/extlibs/tinydtls/tests/dtls-server.c @@ -2,7 +2,6 @@ /* This is needed for apple */ #define __APPLE_USE_RFC_3542 -#include "iotivity_config.h" #include #include #include diff --git a/iotivity.pc.in b/iotivity.pc.in index f5c06c931..7bf7c455e 100644 --- a/iotivity.pc.in +++ b/iotivity.pc.in @@ -13,7 +13,6 @@ URL: https://www.iotivity.org Requires: Libs: -L${libdir} -loc -loc_logger -loc_logger_core -loctbstack -lconnectivity_abstraction Cflags: -I${includedir}/resource \ - -I${includedir}/c_common \ -I${svcincludedir}/resource-encapsulation \ -I${svcincludedir}/resource-container \ -I${svcincludedir}/resource-hosting \ diff --git a/resource/c_common/SConscript b/resource/c_common/SConscript index 31f7ecaa7..f412655cf 100644 --- a/resource/c_common/SConscript +++ b/resource/c_common/SConscript @@ -21,120 +21,15 @@ Import('env') import os -import datetime target_os = env.get('TARGET_OS') -target_arch = env.get('TARGET_ARCH') -###################################################################### -# Generate iotivity_config.h using presence of headers -###################################################################### - -config_h_env = env.Clone() -conf = Configure(config_h_env) - -config_h_header = ''' -/* **************************************************************************** - * iotivity_config.h - IoTivity platform-specific configuration header. - * - * Auto-generated code for the %s %s platform. - * - * Generated at %s - * - *************************************************************************** */ - -#ifndef IOTIVITY_CONFIG_H__ -#define IOTIVITY_CONFIG_H__ - -#include "platform_features.h" - -''' % (str(target_os), str(target_arch), str(datetime.datetime.utcnow())) - -config_h_body = '' - -config_h_footer = ''' - -#endif // IOTIVITY_CONFIG_H__ - -''' - -cxx_headers = ['arpa/inet.h', - 'fcntl.h', - 'grp.h', - 'in6addr.h', - 'linux/limits.h', - 'memory.h', - 'netdb.h', - 'netinet/in.h', - 'pthread.h', - 'pwd.h', - 'stdlib.h', - 'string.h', - 'strings.h', - 'sys/socket.h', - 'sys/stat.h', - 'sys/time.h', - 'sys/timeb.h', - 'sys/types.h', - 'sys/unistd.h', - 'syslog.h', - 'time.h', - 'unistd.h', - 'uuid/uuid.h', - 'windows.h', - 'winsock2.h', - 'ws2tcpip.h'] - -if target_os == 'arduino': - # Detection of headers on the Arduino platform is currently broken. - cxx_headers = [] - -if target_os == 'msys_nt': - # WinPThread provides a pthread.h, but we want to use native threads. - cxx_headers.remove('pthread.h') - -def get_define_from_header_file(header_file): - header_file_converted = header_file.replace("/","_").replace(".","_").upper() - return "HAVE_" + header_file_converted - -for header_file_name in cxx_headers: - if conf.CheckCXXHeader(header_file_name): - config_h_body += "#define %s\n\n" % get_define_from_header_file(header_file_name) -conf.Finish() - -# Autoconf feature doesn't work with Jenkins' arduino toolchain, so hardcode it here. -if target_os == 'arduino': - config_h_body += "#define HAVE_ARDUINO_TIME_H\n\n" - -# Generate the file -src_dir = env.get('SRC_DIR') -config_h_file_path = os.path.join(src_dir, 'resource', 'c_common', 'iotivity_config.h') -if os.path.exists(config_h_file_path): - os.remove(config_h_file_path) -config_h_file = open(config_h_file_path, "w") -config_h_file.write(config_h_header + config_h_body + config_h_footer) -config_h_file.close() - -# Sanity check to ensure that the above block created the file. -if not os.path.exists(config_h_file_path): - print "Error: iotivity_config.h file not created!" - -# iotivity_config.h should be copied to the build dir -env.UserInstallTargetHeader(config_h_file_path, 'c_common', 'iotivity_config.h') - -# Use the generated file internally -env.AppendUnique(CPPPATH = [os.path.join(src_dir, 'resource', 'c_common')]) - -###################################################################### - -###################################################################### # Add platform-specific helper library -###################################################################### - if target_os in ['windows', 'msys_nt']: SConscript('windows/SConscript') env.AppendUnique(CPPPATH = [ + os.path.join(Dir('.').abspath), os.path.join(Dir('.').abspath, 'oic_malloc', 'include'), os.path.join(Dir('.').abspath, 'oic_string', 'include'), os.path.join(Dir('.').abspath, 'oic_time', 'include'), @@ -150,6 +45,7 @@ if target_os in ['tizen', 'linux']: env.ParseConfig("pkg-config --cflags --libs uuid") common_env = env.Clone() +common_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource')]) ###################################################################### # Build flags @@ -168,9 +64,10 @@ common_src = [ 'oic_time/src/oic_time.c', 'ocrandom/src/ocrandom.c', ] + commonlib = common_env.StaticLibrary('c_common', common_src) common_env.InstallTarget(commonlib, 'c_common') common_env.UserInstallTargetLib(commonlib, 'c_common') -common_env.UserInstallTargetHeader('platform_features.h', 'c_common', 'platform_features.h') +common_env.UserInstallTargetHeader('platform_features.h', 'resource', 'platform_features.h') env.PrependUnique(LIBS = ['c_common']) diff --git a/resource/c_common/ocrandom/src/ocrandom.c b/resource/c_common/ocrandom/src/ocrandom.c index 32c4b4b03..118aeeeb3 100644 --- a/resource/c_common/ocrandom/src/ocrandom.c +++ b/resource/c_common/ocrandom/src/ocrandom.c @@ -30,8 +30,7 @@ #define _POSIX_C_SOURCE 200809L #endif -#include "iotivity_config.h" - +#include "platform_features.h" #ifdef HAVE_FCNTL_H #include #endif diff --git a/resource/c_common/oic_time/src/oic_time.c b/resource/c_common/oic_time/src/oic_time.c index e01e6fb8d..0b094f5d2 100644 --- a/resource/c_common/oic_time/src/oic_time.c +++ b/resource/c_common/oic_time/src/oic_time.c @@ -30,7 +30,6 @@ #define _POSIX_C_SOURCE 200809L #endif -#include "iotivity_config.h" #include "oic_time.h" #include // For NULL diff --git a/resource/c_common/windows/SConscript b/resource/c_common/windows/SConscript index 63ccb4589..a2e0e51c0 100644 --- a/resource/c_common/windows/SConscript +++ b/resource/c_common/windows/SConscript @@ -21,9 +21,6 @@ helper_src = [ static_libwinhelper = env.StaticLibrary('win_helper', helper_src) env.InstallTarget(static_libwinhelper, 'win_helper') env.UserInstallTargetLib(static_libwinhelper, 'win_helper') -env.UserInstallTargetHeader('include/win_sleep.h', 'c_common/windows/include', 'win_sleep.h') -env.UserInstallTargetHeader('include/pthread_create.h', 'c_common/windows/include', 'pthread_create.h') -env.UserInstallTargetHeader('include/vs12_snprintf.h', 'c_common/windows/include', 'vs12_snprintf.h') env.AppendUnique(LIBS = ['win_helper']) diff --git a/resource/csdk/connectivity/api/cacommon.h b/resource/csdk/connectivity/api/cacommon.h index cedc763e1..87d117447 100644 --- a/resource/csdk/connectivity/api/cacommon.h +++ b/resource/csdk/connectivity/api/cacommon.h @@ -26,8 +26,6 @@ #ifndef CA_COMMON_H_ #define CA_COMMON_H_ -#include "iotivity_config.h" - #ifndef WITH_ARDUINO #ifdef TCP_ADAPTER #define HAVE_SYS_POLL_H diff --git a/resource/csdk/connectivity/common/src/camutex_pthreads.c b/resource/csdk/connectivity/common/src/camutex_pthreads.c index 55f85365e..db790ec7e 100644 --- a/resource/csdk/connectivity/common/src/camutex_pthreads.c +++ b/resource/csdk/connectivity/common/src/camutex_pthreads.c @@ -36,7 +36,6 @@ #define _POSIX_C_SOURCE 200809L #endif -#include "iotivity_config.h" #ifdef HAVE_STRING_H #include #endif @@ -59,6 +58,7 @@ #include #include #include +#include "platform_features.h" #include "camutex.h" #include "logger.h" diff --git a/resource/csdk/connectivity/common/src/cathreadpool_pthreads.c b/resource/csdk/connectivity/common/src/cathreadpool_pthreads.c index 3865df6dc..d17af9c3e 100644 --- a/resource/csdk/connectivity/common/src/cathreadpool_pthreads.c +++ b/resource/csdk/connectivity/common/src/cathreadpool_pthreads.c @@ -27,7 +27,6 @@ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif -#include "iotivity_config.h" #include #if defined HAVE_PTHREAD_H #include diff --git a/resource/csdk/connectivity/inc/caadapternetdtls.h b/resource/csdk/connectivity/inc/caadapternetdtls.h index dcc23662e..6d03c7e8c 100644 --- a/resource/csdk/connectivity/inc/caadapternetdtls.h +++ b/resource/csdk/connectivity/inc/caadapternetdtls.h @@ -20,6 +20,7 @@ #ifndef CA_ADAPTER_NET_DTLS_H_ #define CA_ADAPTER_NET_DTLS_H_ +#include "platform_features.h" #include "dtls.h" #include "uarraylist.h" #include "camutex.h" diff --git a/resource/csdk/connectivity/inc/caadapterutils.h b/resource/csdk/connectivity/inc/caadapterutils.h index 5c2dcc77c..5f8c24878 100644 --- a/resource/csdk/connectivity/inc/caadapterutils.h +++ b/resource/csdk/connectivity/inc/caadapterutils.h @@ -27,8 +27,6 @@ #ifndef CA_ADAPTER_UTILS_H_ #define CA_ADAPTER_UTILS_H_ -#include "iotivity_config.h" - #include #ifdef __ANDROID__ #include diff --git a/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c b/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c index 571878e60..f960fab1c 100644 --- a/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c +++ b/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c @@ -17,7 +17,7 @@ * limitations under the License. * ******************************************************************/ -#include "iotivity_config.h" +#include "platform_features.h" #include "caadapternetdtls.h" #include "cacommon.h" #include "caipinterface.h" diff --git a/resource/csdk/connectivity/src/adapter_util/caadapterutils.c b/resource/csdk/connectivity/src/adapter_util/caadapterutils.c index 83558865f..888885bee 100644 --- a/resource/csdk/connectivity/src/adapter_util/caadapterutils.c +++ b/resource/csdk/connectivity/src/adapter_util/caadapterutils.c @@ -18,7 +18,6 @@ * ******************************************************************/ -#include "iotivity_config.h" #include "caadapterutils.h" #include diff --git a/resource/csdk/connectivity/src/caprotocolmessage.c b/resource/csdk/connectivity/src/caprotocolmessage.c index 94810ca88..03eca3bfb 100644 --- a/resource/csdk/connectivity/src/caprotocolmessage.c +++ b/resource/csdk/connectivity/src/caprotocolmessage.c @@ -28,7 +28,6 @@ // Refer http://www.gnu.org/software/libc/manual/html_node/BSD-Random.html #define _DEFAULT_SOURCE -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/connectivity/src/caqueueingthread.c b/resource/csdk/connectivity/src/caqueueingthread.c index e03416109..3e10065c6 100644 --- a/resource/csdk/connectivity/src/caqueueingthread.c +++ b/resource/csdk/connectivity/src/caqueueingthread.c @@ -18,7 +18,6 @@ * ******************************************************************/ -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/connectivity/src/caretransmission.c b/resource/csdk/connectivity/src/caretransmission.c index 7101b4c22..a3cb02f21 100644 --- a/resource/csdk/connectivity/src/caretransmission.c +++ b/resource/csdk/connectivity/src/caretransmission.c @@ -41,7 +41,6 @@ #define _POSIX_C_SOURCE 200809L #endif -#include "iotivity_config.h" #include #include #include @@ -56,7 +55,7 @@ #ifdef HAVE_SYS_TIME_H #include #endif -#ifdef HAVE_SYS_TIMEB_H +#if HAVE_SYS_TIMEB_H #include #endif #ifdef HAVE_TIME_H diff --git a/resource/csdk/connectivity/src/ip_adapter/caipserver.c b/resource/csdk/connectivity/src/ip_adapter/caipserver.c index f953689fe..313d2f6a5 100644 --- a/resource/csdk/connectivity/src/ip_adapter/caipserver.c +++ b/resource/csdk/connectivity/src/ip_adapter/caipserver.c @@ -25,7 +25,6 @@ #define _GNU_SOURCE // for in6_pktinfo #endif -#include "iotivity_config.h" #include #if !defined(_WIN32) #include @@ -66,6 +65,7 @@ #include "camutex.h" #include "oic_malloc.h" #include "oic_string.h" +#include "platform_features.h" #define USE_IP_MREQN #if defined(_WIN32) diff --git a/resource/csdk/connectivity/test/camutex_tests.cpp b/resource/csdk/connectivity/test/camutex_tests.cpp index 9a8e6f69d..54d9fb83d 100644 --- a/resource/csdk/connectivity/test/camutex_tests.cpp +++ b/resource/csdk/connectivity/test/camutex_tests.cpp @@ -33,7 +33,6 @@ #define _POSIX_C_SOURCE 200809L #endif // _POSIX_C_SOURCE -#include "iotivity_config.h" #include "gtest/gtest.h" #include @@ -48,6 +47,7 @@ #ifdef HAVE_UNISTD_H #include #endif +#include "platform_features.h" #ifdef HAVE_WINDOWS_H #include #endif diff --git a/resource/csdk/connectivity/test/catests.cpp b/resource/csdk/connectivity/test/catests.cpp index 69eaa14b2..c701a2e4c 100644 --- a/resource/csdk/connectivity/test/catests.cpp +++ b/resource/csdk/connectivity/test/catests.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include "gtest/gtest.h" #ifdef HAVE_PTHREAD_H diff --git a/resource/csdk/logger/src/logger.c b/resource/csdk/logger/src/logger.c index edeb16749..cc7f303e6 100644 --- a/resource/csdk/logger/src/logger.c +++ b/resource/csdk/logger/src/logger.c @@ -30,8 +30,6 @@ #define _POSIX_C_SOURCE 200809L #endif -#include "iotivity_config.h" - // Pull in _POSIX_TIMERS feature test macro to check for // clock_gettime() support. #ifdef HAVE_UNISTD_H @@ -54,6 +52,7 @@ #include "logger.h" #include "string.h" #include "logger_types.h" +#include "platform_features.h" #ifndef __TIZEN__ static oc_log_ctx_t *logCtx = 0; diff --git a/resource/csdk/security/include/securevirtualresourcetypes.h b/resource/csdk/security/include/securevirtualresourcetypes.h index 77af258da..bc0efb46f 100644 --- a/resource/csdk/security/include/securevirtualresourcetypes.h +++ b/resource/csdk/security/include/securevirtualresourcetypes.h @@ -41,14 +41,14 @@ #ifndef OC_SECURITY_RESOURCE_TYPES_H #define OC_SECURITY_RESOURCE_TYPES_H -#include "iotivity_config.h" - #include // for uint8_t typedef #include #if defined(__WITH_X509__) || defined(__WITH_TLS__) #include "byte_array.h" #endif /* __WITH_X509__ or __WITH_TLS__*/ +#include "platform_features.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/resource/csdk/security/provisioning/sample/provisioningclient.c b/resource/csdk/security/provisioning/sample/provisioningclient.c index c742e1be0..b0454ee41 100644 --- a/resource/csdk/security/provisioning/sample/provisioningclient.c +++ b/resource/csdk/security/provisioning/sample/provisioningclient.c @@ -18,14 +18,13 @@ * *****************************************************************/ -#include "iotivity_config.h" - #include #include #ifdef HAVE_UNISTD_H #include #endif +#include "platform_features.h" #include "utlist.h" #include "logger.h" #include "oic_malloc.h" diff --git a/resource/csdk/security/provisioning/sample/sampleserver_justworks.cpp b/resource/csdk/security/provisioning/sample/sampleserver_justworks.cpp index fcf752dda..adec06f14 100644 --- a/resource/csdk/security/provisioning/sample/sampleserver_justworks.cpp +++ b/resource/csdk/security/provisioning/sample/sampleserver_justworks.cpp @@ -20,7 +20,6 @@ /////////////////////////////////////////////////////////////////////// //NOTE : This sample server is generated based on ocserverbasicops.cpp /////////////////////////////////////////////////////////////////////// -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/security/provisioning/sample/sampleserver_randompin.cpp b/resource/csdk/security/provisioning/sample/sampleserver_randompin.cpp index 56156bad7..06a551279 100644 --- a/resource/csdk/security/provisioning/sample/sampleserver_randompin.cpp +++ b/resource/csdk/security/provisioning/sample/sampleserver_randompin.cpp @@ -20,7 +20,6 @@ /////////////////////////////////////////////////////////////////////// //NOTE : This sample server is generated based on ocserverbasicops.cpp /////////////////////////////////////////////////////////////////////// -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/security/provisioning/src/ownershiptransfermanager.c b/resource/csdk/security/provisioning/src/ownershiptransfermanager.c index eec02f3ef..6499e0394 100644 --- a/resource/csdk/security/provisioning/src/ownershiptransfermanager.c +++ b/resource/csdk/security/provisioning/src/ownershiptransfermanager.c @@ -30,7 +30,6 @@ #define _POSIX_C_SOURCE 200809L #endif -#include "iotivity_config.h" #ifdef HAVE_TIME_H #include #endif diff --git a/resource/csdk/security/provisioning/src/pmutility.c b/resource/csdk/security/provisioning/src/pmutility.c index ee4c60783..f67938899 100755 --- a/resource/csdk/security/provisioning/src/pmutility.c +++ b/resource/csdk/security/provisioning/src/pmutility.c @@ -21,8 +21,7 @@ #define _POSIX_C_SOURCE 200112L #endif -#include "iotivity_config.h" -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H #include #endif #ifdef HAVE_STRING_H diff --git a/resource/csdk/security/provisioning/src/secureresourceprovider.c b/resource/csdk/security/provisioning/src/secureresourceprovider.c index fcf6536ed..0b1433441 100644 --- a/resource/csdk/security/provisioning/src/secureresourceprovider.c +++ b/resource/csdk/security/provisioning/src/secureresourceprovider.c @@ -17,7 +17,6 @@ * limitations under the License. * * *****************************************************************/ -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/security/provisioning/unittest/provisioningdatabasemanager.cpp b/resource/csdk/security/provisioning/unittest/provisioningdatabasemanager.cpp index 14338f227..92c67b739 100644 --- a/resource/csdk/security/provisioning/unittest/provisioningdatabasemanager.cpp +++ b/resource/csdk/security/provisioning/unittest/provisioningdatabasemanager.cpp @@ -17,7 +17,6 @@ * limitations under the License. * * *****************************************************************/ -#include "iotivity_config.h" #include "gtest/gtest.h" #include "provisioningdatabasemanager.h" diff --git a/resource/csdk/security/src/aclresource.c b/resource/csdk/security/src/aclresource.c index 450123fc4..3aaefeb3d 100644 --- a/resource/csdk/security/src/aclresource.c +++ b/resource/csdk/security/src/aclresource.c @@ -18,10 +18,9 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #ifdef HAVE_STRING_H #include -#elif defined(HAVE_STRINGS_H) +#elif HAVE_STRINGS_H #include #endif #include diff --git a/resource/csdk/security/src/credresource.c b/resource/csdk/security/src/credresource.c index 24371b882..2e2bba54f 100644 --- a/resource/csdk/security/src/credresource.c +++ b/resource/csdk/security/src/credresource.c @@ -20,7 +20,6 @@ #define __STDC_LIMIT_MACROS -#include "iotivity_config.h" #include #ifdef HAVE_STRING_H #include diff --git a/resource/csdk/security/src/directpairing.c b/resource/csdk/security/src/directpairing.c index af7cbad59..e7ef882da 100644 --- a/resource/csdk/security/src/directpairing.c +++ b/resource/csdk/security/src/directpairing.c @@ -20,7 +20,6 @@ #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200112L #endif -#include "iotivity_config.h" #ifdef HAVE_UNISTD_H #include #endif diff --git a/resource/csdk/security/src/doxmresource.c b/resource/csdk/security/src/doxmresource.c index 44b22becb..9aac58518 100644 --- a/resource/csdk/security/src/doxmresource.c +++ b/resource/csdk/security/src/doxmresource.c @@ -17,11 +17,10 @@ // limitations under the License. // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif diff --git a/resource/csdk/security/src/dpairingresource.c b/resource/csdk/security/src/dpairingresource.c index 534dcea1d..820021a8e 100644 --- a/resource/csdk/security/src/dpairingresource.c +++ b/resource/csdk/security/src/dpairingresource.c @@ -18,7 +18,6 @@ * * *****************************************************************/ -#include "iotivity_config.h" #include #include #include "ocstack.h" diff --git a/resource/csdk/security/src/iotvticalendar.c b/resource/csdk/security/src/iotvticalendar.c index acb44f1df..dc16f4b21 100644 --- a/resource/csdk/security/src/iotvticalendar.c +++ b/resource/csdk/security/src/iotvticalendar.c @@ -22,7 +22,6 @@ #if !defined(WITH_ARDUINO) #define _XOPEN_SOURCE //Needed by strptime -#include "iotivity_config.h" #include #include "iotvticalendar.h" #include "oic_string.h" diff --git a/resource/csdk/security/src/pconfresource.c b/resource/csdk/security/src/pconfresource.c index b216e6204..84bbf480d 100644 --- a/resource/csdk/security/src/pconfresource.c +++ b/resource/csdk/security/src/pconfresource.c @@ -18,7 +18,6 @@ * * *****************************************************************/ -#include "iotivity_config.h" #include #include #include "ocstack.h" diff --git a/resource/csdk/security/src/verresource.c b/resource/csdk/security/src/verresource.c index 78725a7c3..96afaccf9 100644 --- a/resource/csdk/security/src/verresource.c +++ b/resource/csdk/security/src/verresource.c @@ -18,11 +18,10 @@ * * *****************************************************************/ -#include "iotivity_config.h" #include #include -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif diff --git a/resource/csdk/security/unittest/pstatresource.cpp b/resource/csdk/security/unittest/pstatresource.cpp index df46f2752..90f189db4 100644 --- a/resource/csdk/security/unittest/pstatresource.cpp +++ b/resource/csdk/security/unittest/pstatresource.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #ifdef HAVE_UNISTD_H #include #endif diff --git a/resource/csdk/security/unittest/securityresourcemanager.cpp b/resource/csdk/security/unittest/securityresourcemanager.cpp index 9a38f4841..29177095e 100644 --- a/resource/csdk/security/unittest/securityresourcemanager.cpp +++ b/resource/csdk/security/unittest/securityresourcemanager.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include "gtest/gtest.h" #ifdef HAVE_PWD_H #include diff --git a/resource/csdk/stack/include/octypes.h b/resource/csdk/stack/include/octypes.h index 5fafce278..2ae83e412 100644 --- a/resource/csdk/stack/include/octypes.h +++ b/resource/csdk/stack/include/octypes.h @@ -28,7 +28,7 @@ #ifndef OCTYPES_H_ #define OCTYPES_H_ -#include "iotivity_config.h" +#include "platform_features.h" #include "ocstackconfig.h" #include #include diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp index 061c94f3b..fe7c8ae49 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include @@ -38,6 +37,7 @@ #include "ocpayload.h" #include "payload_logging.h" #include "common.h" +#include "platform_features.h" #ifdef ROUTING_GATEWAY /** diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp index a37f64acb..988ce3525 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp @@ -17,7 +17,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientcoll.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientcoll.cpp index 5e576b400..375b169ce 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientcoll.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientcoll.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientslow.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientslow.cpp index aa45b6c34..d15fdd41f 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientslow.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientslow.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp index 68c592f0c..970565a7f 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp @@ -19,7 +19,6 @@ //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include @@ -42,6 +41,7 @@ #include "ocpayload.h" #include "ocserver.h" #include "common.h" +#include "platform_features.h" //string length of "/a/light/" + std::numeric_limits::digits10 + '\0'" // 9 + 9 + 1 = 19 diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp index e5726c4c9..84d902ce2 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/ocservercoll.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/ocservercoll.cpp index ed1897581..b5408d0ad 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/ocservercoll.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/ocservercoll.cpp @@ -19,7 +19,6 @@ //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include @@ -39,6 +38,7 @@ #include #include "ocpayload.h" #include "common.h" +#include "platform_features.h" #define TAG PCF("ocservercontainer") diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverslow.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverslow.cpp index 997b78920..5f0ba4b6c 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverslow.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverslow.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include diff --git a/resource/csdk/stack/samples/linux/secure/ocamsservice.cpp b/resource/csdk/stack/samples/linux/secure/ocamsservice.cpp index e7262a8de..4d0fdf0aa 100644 --- a/resource/csdk/stack/samples/linux/secure/ocamsservice.cpp +++ b/resource/csdk/stack/samples/linux/secure/ocamsservice.cpp @@ -1,5 +1,5 @@ -#include "iotivity_config.h" + #include #include #include @@ -13,6 +13,7 @@ #ifdef HAVE_PTHREAD_H #include #endif +#include "platform_features.h" #include "ocstack.h" #include "logger.h" #include "common.h" diff --git a/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp b/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp index 5e8ca9963..714d075ba 100644 --- a/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp +++ b/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include @@ -36,6 +35,7 @@ #include #include #include +#include "platform_features.h" #include "ocstack.h" #include "logger.h" #include "occlientbasicops.h" diff --git a/resource/csdk/stack/samples/linux/secure/occlientdirectpairing.cpp b/resource/csdk/stack/samples/linux/secure/occlientdirectpairing.cpp index 5ae096b5f..af344d372 100644 --- a/resource/csdk/stack/samples/linux/secure/occlientdirectpairing.cpp +++ b/resource/csdk/stack/samples/linux/secure/occlientdirectpairing.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include @@ -38,6 +37,7 @@ #undef ERROR #endif #endif // defined(HAVE_WINDOWS_H) +#include "platform_features.h" #include "ocstack.h" #include "logger.h" #include "ocpayload.h" diff --git a/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp b/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp index 61db06ac9..9d836693c 100644 --- a/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp +++ b/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include #include #include @@ -32,6 +31,7 @@ #ifdef HAVE_PTHREAD_H #include #endif +#include "platform_features.h" #include "ocstack.h" #include "logger.h" #include "ocpayload.h" diff --git a/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec b/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec index 09a9ca441..f86c4c617 100644 --- a/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec +++ b/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec @@ -67,7 +67,6 @@ cp resource/oc_logger/include/targets/oc_ostream_logger.h %{DEST_INC_DIR} cp resource/csdk/stack/include/ocpresence.h %{DEST_INC_DIR} cp resource/csdk/stack/include/ocpayload.h %{DEST_INC_DIR} cp resource/c_common/platform_features.h %{DEST_INC_DIR} -cp resource/c_common/iotivity_config.h %{DEST_INC_DIR} cp resource/c_common/*/include/*.h %{DEST_INC_DIR} cp resource/csdk/stack/include/payload_logging.h %{DEST_INC_DIR} cp resource/csdk/stack/include/rdpayload.h %{DEST_INC_DIR} diff --git a/resource/csdk/stack/src/occlientcb.c b/resource/csdk/stack/src/occlientcb.c index 42100d6b4..cc2bfb40a 100644 --- a/resource/csdk/stack/src/occlientcb.c +++ b/resource/csdk/stack/src/occlientcb.c @@ -18,7 +18,7 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" + #include "occlientcb.h" #include "utlist.h" #include "logger.h" diff --git a/resource/csdk/stack/src/ocpayload.c b/resource/csdk/stack/src/ocpayload.c index 80e9e064d..3af571ea5 100644 --- a/resource/csdk/stack/src/ocpayload.c +++ b/resource/csdk/stack/src/ocpayload.c @@ -21,7 +21,6 @@ // Required for strok_r #define _POSIX_C_SOURCE 200112L -#include "iotivity_config.h" #include #include "ocpayload.h" #include "octypes.h" diff --git a/resource/csdk/stack/src/ocresource.c b/resource/csdk/stack/src/ocresource.c index 860b27aca..e5323e630 100755 --- a/resource/csdk/stack/src/ocresource.c +++ b/resource/csdk/stack/src/ocresource.c @@ -29,7 +29,6 @@ #define _GNU_SOURCE #endif -#include "iotivity_config.h" #ifdef HAVE_STRING_H #include #endif diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index f11501c72..13d595be3 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -36,7 +36,6 @@ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS #endif -#include "iotivity_config.h" #include #include #include @@ -58,6 +57,7 @@ #include "cainterface.h" #include "ocpayload.h" #include "ocpayloadcbor.h" +#include "platform_features.h" #if defined (ROUTING_GATEWAY) || defined (ROUTING_EP) #include "routingutility.h" diff --git a/resource/csdk/stack/src/oicgroup.c b/resource/csdk/stack/src/oicgroup.c index a2968cd10..558f683e1 100755 --- a/resource/csdk/stack/src/oicgroup.c +++ b/resource/csdk/stack/src/oicgroup.c @@ -20,8 +20,6 @@ #define _POSIX_C_SOURCE 200112L -#include "iotivity_config.h" - #include #include "oicgroup.h" @@ -34,6 +32,8 @@ #include "logger.h" #include "timer.h" +#include "platform_features.h" + #define TAG "OIC_RI_GROUP" #define DESC_DELIMITER "\"" diff --git a/resource/csdk/stack/src/oicresourcedirectory.c b/resource/csdk/stack/src/oicresourcedirectory.c index 8920bdea5..4a60a772b 100644 --- a/resource/csdk/stack/src/oicresourcedirectory.c +++ b/resource/csdk/stack/src/oicresourcedirectory.c @@ -17,7 +17,6 @@ // limitations under the License. // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include "oicresourcedirectory.h" #include "rdpayload.h" diff --git a/resource/examples/lightserver.cpp b/resource/examples/lightserver.cpp index 1ce1e6b8c..6368e93dc 100644 --- a/resource/examples/lightserver.cpp +++ b/resource/examples/lightserver.cpp @@ -23,7 +23,6 @@ /// This sample provides steps to define an interface for a resource /// (properties and methods) and host this resource on the server. /// -#include "iotivity_config.h" #ifdef HAVE_UNISTD_H #include diff --git a/resource/examples/presenceserver.cpp b/resource/examples/presenceserver.cpp index 228e6af33..5bb8b06e3 100644 --- a/resource/examples/presenceserver.cpp +++ b/resource/examples/presenceserver.cpp @@ -23,12 +23,9 @@ /// (properties and methods) and host this resource on the server. /// -#include "iotivity_config.h" #include -#ifdef HAVE_PTHREAD_H #include -#endif #include #include #include @@ -39,6 +36,7 @@ #ifdef HAVE_WINDOWS_H #include #endif +#include "platform_features.h" using namespace OC; using namespace std; diff --git a/resource/examples/simpleclient.cpp b/resource/examples/simpleclient.cpp index a2997bcd0..f9452af89 100644 --- a/resource/examples/simpleclient.cpp +++ b/resource/examples/simpleclient.cpp @@ -20,7 +20,6 @@ // OCClient.cpp : Defines the entry point for the console application. // -#include "iotivity_config.h" #ifdef HAVE_UNISTD_H #include #endif diff --git a/resource/examples/simpleclientHQ.cpp b/resource/examples/simpleclientHQ.cpp index 6d631d3d6..be585fca7 100644 --- a/resource/examples/simpleclientHQ.cpp +++ b/resource/examples/simpleclientHQ.cpp @@ -20,22 +20,21 @@ // OCClient.cpp : Defines the entry point for the console application. // -#include "iotivity_config.h" - #include #include #include +#ifdef HAVE_PTHREAD_H +#include +#endif #include #include #include "OCPlatform.h" #include "OCApi.h" -#if defined(HAVE_PTHREAD_H) -#include -#endif #if defined(HAVE_WINDOWS_H) #include #endif +#include "platform_features.h" using namespace OC; diff --git a/resource/examples/simpleserver.cpp b/resource/examples/simpleserver.cpp index b005900ba..13981cb32 100644 --- a/resource/examples/simpleserver.cpp +++ b/resource/examples/simpleserver.cpp @@ -22,9 +22,8 @@ /// This sample provides steps to define an interface for a resource /// (properties and methods) and host this resource on the server. /// -#include "iotivity_config.h" - #include + #ifdef HAVE_UNISTD_H #include #endif @@ -39,6 +38,7 @@ #ifdef HAVE_WINDOWS_H #include #endif +#include "platform_features.h" using namespace OC; using namespace std; diff --git a/resource/examples/simpleserverHQ.cpp b/resource/examples/simpleserverHQ.cpp index 6d641e739..3adef4e6f 100644 --- a/resource/examples/simpleserverHQ.cpp +++ b/resource/examples/simpleserverHQ.cpp @@ -23,7 +23,6 @@ /// (properties and methods) and host this resource on the server. /// -#include "iotivity_config.h" #include #ifdef HAVE_PTHREAD_H @@ -38,6 +37,7 @@ #ifdef HAVE_WINDOWS_H #include #endif +#include "platform_features.h" using namespace OC; using namespace std; diff --git a/resource/examples/threadingsample.cpp b/resource/examples/threadingsample.cpp index 46cfbec03..1eaaebae8 100644 --- a/resource/examples/threadingsample.cpp +++ b/resource/examples/threadingsample.cpp @@ -23,7 +23,6 @@ /// server in a separate thread, and running 2 clients in each thread. /// -#include "iotivity_config.h" #include #include @@ -38,6 +37,7 @@ #ifdef HAVE_WINDOWS_H #include #endif +#include "platform_features.h" using namespace OC; diff --git a/resource/src/OCResource.cpp b/resource/src/OCResource.cpp index 9fd3d5b70..b83061f52 100644 --- a/resource/src/OCResource.cpp +++ b/resource/src/OCResource.cpp @@ -18,7 +18,6 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#include "iotivity_config.h" #include "OCResource.h" #include "OCUtilities.h"