Browse Source

Stack: Correct include for architecture related headers

Fixes #2646
Stefan Profanter 5 years ago
parent
commit
f19a6a1839

+ 7 - 13
CMakeLists.txt

@@ -108,12 +108,12 @@ GET_PROPERTY(ua_architecture_headers_beginning GLOBAL PROPERTY UA_ARCHITECTURE_H
 GET_PROPERTY(ua_architecture_sources GLOBAL PROPERTY UA_ARCHITECTURE_SOURCES)
 
 set(ua_architecture_sources ${ua_architecture_sources}
-            ${PROJECT_SOURCE_DIR}/arch/ua_network_tcp.c
+    ${PROJECT_SOURCE_DIR}/arch/network_tcp.c
 )
 
 set(ua_architecture_headers ${ua_architecture_headers}
-            ${PROJECT_SOURCE_DIR}/arch/ua_network_tcp.h
-            ${PROJECT_SOURCE_DIR}/arch/ua_architecture_functions.h
+    ${PROJECT_SOURCE_DIR}/include/open62541/network_tcp.h
+    ${PROJECT_SOURCE_DIR}/include/open62541/architecture_functions.h
 )
 
 
@@ -527,7 +527,7 @@ endif()
 
 set(exported_headers ${exported_headers}
                      ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h
-                     ${PROJECT_SOURCE_DIR}/arch/ua_architecture_base.h
+                     ${PROJECT_SOURCE_DIR}/include/open62541/architecture_base.h
                      ${ua_architecture_headers_beginning}
                      )
 
@@ -548,7 +548,7 @@ endif()
 
 set(exported_headers ${exported_headers}
                      ${PROJECT_SOURCE_DIR}/deps/ms_stdint.h
-                     ${PROJECT_SOURCE_DIR}/arch/ua_architecture_definitions.h
+                     ${PROJECT_SOURCE_DIR}/include/open62541/architecture_definitions.h
                      ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.h
                      ${PROJECT_BINARY_DIR}/src_generated/open62541/nodeids.h
                      ${PROJECT_SOURCE_DIR}/include/open62541/constants.h
@@ -1142,20 +1142,14 @@ if(UA_ENABLE_DISCOVERY_MULTICAST)
 endif()
 
 # export library (either static or shared depending on BUILD_SHARED_LIBS)
-if(NOT UA_ENABLE_AMALGAMATION)
-install(TARGETS open62541
-        EXPORT open62541Targets
-        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
-        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-        RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
-        INCLUDES DESTINATION include/open62541 include)
-else()
 install(TARGETS open62541
         EXPORT open62541Targets
         LIBRARY DESTINATION ${LIB_INSTALL_DIR}
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
         RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
         INCLUDES DESTINATION include)
+
+if(UA_ENABLE_AMALGAMATION)
 # Our default way of installation is the non-amalgamated version.
 # See also https://github.com/open62541/open62541/pull/2292#discussion_r241106424
 install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")")

+ 1 - 1
arch/Readme.md

@@ -114,7 +114,7 @@ To port to a new architecture you should follow these steps:
     * Do the same for UA_LOG_SOCKET_ERRNO_GAI_WRAP(LOG) for errors related to getaddrinfo
     */
     
-    #include "ua_architecture_functions.h"
+    #include <open62541/architecture_functions.h>
     
     #endif /* PLUGINS_ARCH_NEW_ARCH_UA_ARCHITECTURE_H_ */
     

+ 1 - 1
arch/eCos/ua_architecture.h

@@ -82,7 +82,7 @@ int gethostname_ecos(char* name, size_t len);
     LOG; \
 }
 
-#include "ua_architecture_functions.h"
+#include <open62541/architecture_functions.h>
 
 #endif /* PLUGINS_ARCH_ECOS_UA_ARCHITECTURE_H_ */
 

+ 1 - 1
arch/freertosLWIP/ua_architecture.h

@@ -14,7 +14,7 @@
 #include "ua_lwip.h"
 #include "ua_freeRTOS.h"
 
-#include "ua_architecture_functions.h"
+#include <open62541/architecture_functions.h>
 
 #endif /* PLUGINS_ARCH_FREERTOSLWIP_UA_ARCHITECTURE_H_ */
 

+ 1 - 1
arch/ua_network_tcp.c

@@ -9,8 +9,8 @@
  */
 
 #define UA_INTERNAL
-#include "ua_network_tcp.h"
 
+#include <open62541/network_tcp.h>
 #include <open62541/plugin/log_stdout.h>
 #include <open62541/util.h>
 

+ 2 - 2
arch/posix/ua_architecture.h

@@ -10,7 +10,7 @@
 #ifndef PLUGINS_ARCH_POSIX_UA_ARCHITECTURE_H_
 #define PLUGINS_ARCH_POSIX_UA_ARCHITECTURE_H_
 
-#include "ua_architecture_base.h"
+#include <open62541/architecture_base.h>
 
 /* Enable POSIX features */
 #if !defined(_XOPEN_SOURCE)
@@ -146,7 +146,7 @@ extern void * (*UA_globalRealloc)(void *ptr, size_t size);
     LOG; \
 }
 
-#include "ua_architecture_functions.h"
+#include <open62541/architecture_functions.h>
 
 #if defined(__APPLE__)  && defined(_SYS_QUEUE_H_)
 //  in some compilers there's already a _SYS_QUEUE_H_ which is included first and doesn't have all functions

+ 2 - 2
arch/vxworks/ua_architecture.h

@@ -10,7 +10,7 @@
 #ifndef PLUGINS_ARCH_VXWORKS_UA_ARCHITECTURE_H_
 #define PLUGINS_ARCH_VXWORKS_UA_ARCHITECTURE_H_
 
-#include "ua_architecture_base.h"
+#include <open62541/architecture_base.h>
 
 #include <errno.h>
 #include <time.h>
@@ -108,7 +108,7 @@
     LOG; \
 }
 
-#include "ua_architecture_functions.h"
+#include <open62541/architecture_functions.h>
 
 #endif /* PLUGINS_ARCH_VXWORKS_UA_ARCHITECTURE_H_ */
 

+ 2 - 2
arch/wec7/ua_architecture.h

@@ -9,7 +9,7 @@
 #ifndef PLUGINS_ARCH_WEC7_UA_ARCHITECTURE_H_
 #define PLUGINS_ARCH_WEC7_UA_ARCHITECTURE_H_
 
-#include "ua_architecture_base.h"
+#include <open62541/architecture_base.h>
 
 #ifndef _BSD_SOURCE
 # define _BSD_SOURCE
@@ -136,7 +136,7 @@ char *strerror(int errnum);
 }
 #define UA_LOG_SOCKET_ERRNO_GAI_WRAP UA_LOG_SOCKET_ERRNO_WRAP
 
-#include "ua_architecture_functions.h"
+#include <open62541/architecture_functions.h>
 
 /* Fix redefinition of SLIST_ENTRY on mingw winnt.h */
 #if !defined(_SYS_QUEUE_H_) && defined(SLIST_ENTRY)

+ 2 - 2
arch/win32/ua_architecture.h

@@ -10,7 +10,7 @@
 #ifndef PLUGINS_ARCH_WIN32_UA_ARCHITECTURE_H_
 #define PLUGINS_ARCH_WIN32_UA_ARCHITECTURE_H_
 
-#include "ua_architecture_base.h"
+#include <open62541/architecture_base.h>
 
 #ifndef _BSD_SOURCE
 # define _BSD_SOURCE
@@ -142,7 +142,7 @@
 }
 #define UA_LOG_SOCKET_ERRNO_GAI_WRAP UA_LOG_SOCKET_ERRNO_WRAP
 
-#include "ua_architecture_functions.h"
+#include <open62541/architecture_functions.h>
 
 /* Fix redefinition of SLIST_ENTRY on mingw winnt.h */
 #if !defined(_SYS_QUEUE_H_) && defined(SLIST_ENTRY)

+ 1 - 1
deps/string_escape.h

@@ -12,7 +12,7 @@
 extern "C" {
 #endif
 
-#include "ua_architecture_definitions.h"
+#include <open62541/architecture_definitions.h>
 #include <string.h>
     
 /* Locale independent versions of isxxx() functions */

arch/ua_architecture_base.h → include/open62541/architecture_base.h


arch/ua_architecture_definitions.h → include/open62541/architecture_definitions.h


+ 1 - 1
arch/ua_architecture_functions.h

@@ -200,7 +200,7 @@ int UA_access(const char *pathname, int mode); //equivalent implementation of ht
 #define UA_fileExists(X) ( UA_access(X, 0) == 0)
 #endif
 
-#include "ua_architecture_definitions.h"
+#include <open62541/architecture_definitions.h>
 
 _UA_END_DECLS
 

arch/ua_network_tcp.h → include/open62541/network_tcp.h


+ 1 - 2
plugins/ua_config_default.c

@@ -11,6 +11,7 @@
  */
 
 #include <open62541/client_config_default.h>
+#include <open62541/network_tcp.h>
 #include <open62541/plugin/accesscontrol_default.h>
 #include <open62541/plugin/log_stdout.h>
 #include <open62541/plugin/nodestore_default.h>
@@ -18,8 +19,6 @@
 #include <open62541/plugin/securitypolicy_default.h>
 #include <open62541/server_config_default.h>
 
-#include "ua_network_tcp.h"
-
 /* Struct initialization works across ANSI C/C99/C++ if it is done when the
  * variable is first declared. Assigning values to existing structs is
  * heterogeneous across the three. */

+ 11 - 11
tests/CMakeLists.txt

@@ -49,17 +49,17 @@ endif()
 
 
 # Use different plugins for testing
-set(test_plugin_sources ${PROJECT_SOURCE_DIR}/arch/ua_network_tcp.c
-                        ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_clock.c
-                        ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c
-                        ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c
-                        ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c
-                        ${PROJECT_SOURCE_DIR}/plugins/ua_pki_default.c
-                        ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.c
-                        ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_none.c
-                        ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_policy.c
-                        ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c
-)
+set(test_plugin_sources ${PROJECT_SOURCE_DIR}/arch/network_tcp.c
+    ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_clock.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_pki_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_none.c
+    ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_policy.c
+    ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c
+    )
 
 if(UA_ENABLE_HISTORIZING)
     set(test_plugin_sources ${test_plugin_sources}

+ 0 - 1
tests/client/check_client.c

@@ -6,7 +6,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 #include "ua_server_internal.h"
 
 #include <check.h>

+ 0 - 1
tests/client/check_client_async.c

@@ -9,7 +9,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 
 #include <check.h>
 #include <stdio.h>

+ 0 - 1
tests/client/check_client_async_connect.c

@@ -9,7 +9,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 
 #include <check.h>
 #include <stdlib.h>

+ 0 - 2
tests/client/check_client_highlevel.c

@@ -8,8 +8,6 @@
 #include <open62541/server.h>
 #include <open62541/server_config_default.h>
 
-#include "ua_network_tcp.h"
-
 #include <check.h>
 
 #include "thread_wrapper.h"

+ 0 - 1
tests/client/check_client_historical_data.c

@@ -16,7 +16,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 
 #include <check.h>
 

+ 0 - 1
tests/client/check_client_securechannel.c

@@ -9,7 +9,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 
 #include "check.h"
 #include "testing_clock.h"

+ 0 - 1
tests/client/check_client_subscriptions.c

@@ -8,7 +8,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 
 #include <stdio.h>
 #include <stdlib.h>

+ 0 - 1
tests/encryption/check_encryption_basic128rsa15.c

@@ -7,7 +7,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 #include "ua_server_internal.h"
 
 #include <check.h>

+ 0 - 1
tests/encryption/check_encryption_basic256sha256.c

@@ -10,7 +10,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 #include "ua_server_internal.h"
 
 #include <stdio.h>

+ 9 - 9
tests/fuzz/CMakeLists.txt

@@ -51,15 +51,15 @@ endif()
 list(APPEND LIBS "${open62541_LIBRARIES}")
 
 # Use different plugins for testing
-set(fuzzing_plugin_sources ${PROJECT_SOURCE_DIR}/arch/ua_network_tcp.c
-        ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_clock.c
-        ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c
-        ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c
-        ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c
-        ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.c
-        ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c
-        ${PROJECT_SOURCE_DIR}/plugins/ua_pki_default.c
-        ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_none.c
+set(fuzzing_plugin_sources ${PROJECT_SOURCE_DIR}/arch/network_tcp.c
+    ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_clock.c
+    ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/ua_pki_default.c
+    ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_none.c
 )
 
 if(UA_ENABLE_ENCRYPTION)

+ 0 - 1
tests/server/check_discovery.c

@@ -7,7 +7,6 @@
 #include <open62541/server_config_default.h>
 
 #include "server/ua_server_internal.h"
-#include "ua_network_tcp.h"
 
 #include <fcntl.h>
 

+ 0 - 2
tests/server/check_local_monitored_item.c

@@ -10,8 +10,6 @@
 #include <open62541/server_config_default.h>
 #include <open62541/types.h>
 
-#include "ua_network_tcp.h"
-
 #include <stddef.h>
 
 #include "check.h"

+ 0 - 1
tests/server/check_monitoreditem_filter.c

@@ -12,7 +12,6 @@
 #include <open62541/server_config_default.h>
 
 #include "client/ua_client_internal.h"
-#include "ua_network_tcp.h"
 
 #include <check.h>
 

+ 0 - 1
tests/server/check_server_historical_data.c

@@ -18,7 +18,6 @@
 
 #include "client/ua_client_internal.h"
 #include "server/ua_server_internal.h"
-#include "ua_network_tcp.h"
 
 #include <check.h>
 

+ 1 - 1
tests/server/check_services_view.c

@@ -2,12 +2,12 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include <open62541/client.h>
 #include <open62541/client_config_default.h>
 #include <open62541/server.h>
 #include <open62541/server_config_default.h>
 
 #include "server/ua_server_internal.h"
-#include "ua_network_tcp.h"
 
 #include <check.h>
 #include <stdio.h>