소스 검색

Stack: Use non-amalgamated headers in all the examples

For consistency we recommend using non-amalgamation install, thus the
examples should also use the non-amalgamated headers.
Stefan Profanter 5 년 전
부모
커밋
d715db1057
46개의 변경된 파일219개의 추가작업 그리고 94개의 파일을 삭제
  1. 39 32
      CMakeLists.txt
  2. 1 0
      arch/posix/ua_architecture.h
  3. 1 1
      examples/CMakeLists.txt
  4. 3 1
      examples/access_control/client_access_control.c
  5. 5 1
      examples/access_control/server_access_control.c
  6. 4 1
      examples/client.c
  7. 4 13
      examples/client_async.c
  8. 5 1
      examples/client_connect_loop.c
  9. 4 1
      examples/client_connectivitycheck_loop.c
  10. 4 1
      examples/client_subscription_loop.c
  11. 2 1
      examples/common.h
  12. 2 1
      examples/custom_datatype/client_types_custom.c
  13. 4 1
      examples/custom_datatype/server_types_custom.c
  14. 3 1
      examples/discovery/client_find_servers.c
  15. 3 1
      examples/discovery/server_lds.c
  16. 6 1
      examples/discovery/server_multicast.c
  17. 3 1
      examples/discovery/server_register.c
  18. 7 1
      examples/encryption/client_basic128rsa15.c
  19. 7 1
      examples/encryption/client_basic256sha256.c
  20. 6 1
      examples/encryption/server_basic128rsa15.c
  21. 6 1
      examples/encryption/server_basic256sha256.c
  22. 4 1
      examples/nodeset/server_nodeset.c
  23. 1 0
      examples/nodeset/server_nodeset_plcopen.c
  24. 4 1
      examples/pubsub/tutorial_pubsub_connection.c
  25. 4 2
      examples/pubsub/tutorial_pubsub_publish.c
  26. 4 1
      examples/server_certificate.c
  27. 4 1
      examples/server_ctt.c
  28. 4 1
      examples/server_inheritance.c
  29. 4 1
      examples/server_instantiation.c
  30. 4 1
      examples/server_mainloop.c
  31. 4 1
      examples/server_repeated_job.c
  32. 5 1
      examples/tutorial_client_events.c
  33. 3 1
      examples/tutorial_client_firststeps.c
  34. 4 1
      examples/tutorial_datatypes.c
  35. 4 1
      examples/tutorial_server_datasource.c
  36. 4 1
      examples/tutorial_server_events.c
  37. 4 1
      examples/tutorial_server_firststeps.c
  38. 4 1
      examples/tutorial_server_method.c
  39. 5 1
      examples/tutorial_server_monitoreditems.c
  40. 4 1
      examples/tutorial_server_object.c
  41. 5 1
      examples/tutorial_server_variable.c
  42. 4 1
      examples/tutorial_server_variabletype.c
  43. 1 1
      plugins/ua_config_default.c
  44. 0 1
      tests/fuzz/CMakeLists.txt
  45. 1 1
      tools/nodeset_compiler/backend_open62541.py
  46. 15 7
      tools/travis/travis_linux_script.sh

+ 39 - 32
CMakeLists.txt

@@ -742,29 +742,31 @@ add_custom_target(open62541-generator-statuscode DEPENDS
         ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.h
         ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.c)
 
-# single-file release
-add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.h
-                   PRE_BUILD
-                   COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
-                           ${OPEN62541_VER_COMMIT} ${CMAKE_CURRENT_BINARY_DIR}/open62541.h
-                           ${exported_headers} ${default_plugin_headers} ${ua_architecture_headers}
-                   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
-                           ${exported_headers} ${default_plugin_headers} ${ua_architecture_headers})
-
-add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
-                   PRE_BUILD
-                   COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
-                           ${OPEN62541_VER_COMMIT} ${CMAKE_CURRENT_BINARY_DIR}/open62541.c
-                           ${internal_headers} ${lib_sources} ${default_plugin_sources} ${ua_architecture_sources}
-                   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${internal_headers}
-                           ${lib_sources} ${default_plugin_sources} ${ua_architecture_sources} )
-
-add_custom_target(open62541-amalgamation-source DEPENDS ${PROJECT_BINARY_DIR}/open62541.c)
-add_custom_target(open62541-amalgamation-header DEPENDS ${PROJECT_BINARY_DIR}/open62541.h)
-
-add_dependencies(open62541-amalgamation-header open62541-generator-types)
-add_dependencies(open62541-amalgamation-source open62541-generator-types
-                 open62541-generator-transport open62541-generator-statuscode)
+if (UA_ENABLE_AMALGAMATION)
+    # single-file release
+    add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.h
+                       PRE_BUILD
+                       COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
+                               ${OPEN62541_VER_COMMIT} ${CMAKE_CURRENT_BINARY_DIR}/open62541.h
+                               ${exported_headers} ${default_plugin_headers} ${ua_architecture_headers}
+                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
+                               ${exported_headers} ${default_plugin_headers} ${ua_architecture_headers})
+
+    add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
+                       PRE_BUILD
+                       COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
+                               ${OPEN62541_VER_COMMIT} ${CMAKE_CURRENT_BINARY_DIR}/open62541.c
+                               ${internal_headers} ${lib_sources} ${default_plugin_sources} ${ua_architecture_sources}
+                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${internal_headers}
+                               ${lib_sources} ${default_plugin_sources} ${ua_architecture_sources} )
+
+    add_custom_target(open62541-amalgamation-source DEPENDS ${PROJECT_BINARY_DIR}/open62541.c)
+    add_custom_target(open62541-amalgamation-header DEPENDS ${PROJECT_BINARY_DIR}/open62541.h)
+
+    add_dependencies(open62541-amalgamation-header open62541-generator-types)
+    add_dependencies(open62541-amalgamation-source open62541-generator-types
+                     open62541-generator-transport open62541-generator-statuscode)
+endif()
 
 if(NOT UA_NODESET_ENCODE_BINARY_SIZE)
     set(UA_NODESET_ENCODE_BINARY_SIZE 32000)
@@ -813,14 +815,18 @@ if(UA_ENABLE_AMALGAMATION)
     if(UA_COMPILE_AS_CXX)
         set_source_files_properties(${PROJECT_BINARY_DIR}/open62541.c PROPERTIES LANGUAGE CXX)
     endif()
+
+    add_dependencies(open62541-amalgamation-source open62541-generator-namespace)
+    add_dependencies(open62541-amalgamation-header open62541-generator-namespace)
 else()
     add_definitions(-DUA_NO_AMALGAMATION)
     add_library(open62541-object OBJECT ${lib_sources} ${internal_headers} ${exported_headers})
     add_dependencies(open62541-object
-                     open62541-amalgamation-header
                      open62541-generator-types
                      open62541-generator-transport
-                     open62541-generator-statuscode)
+                     open62541-generator-statuscode
+                     open62541-generator-namespace
+                     )
     target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src)
 
     add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers})
@@ -836,12 +842,7 @@ else()
         set_source_files_properties(${lib_sources} PROPERTIES LANGUAGE CXX)
         set_source_files_properties(${default_plugin_sources} ${ua_architecture_sources} PROPERTIES LANGUAGE CXX)
     endif()
-endif()
 
-add_dependencies(open62541-amalgamation-source open62541-generator-namespace)
-add_dependencies(open62541-amalgamation-header open62541-generator-namespace)
-if(NOT UA_ENABLE_AMALGAMATION)
-    add_dependencies(open62541-object open62541-generator-namespace)
 endif()
 
 # Export Symbols
@@ -883,6 +884,10 @@ target_link_libraries(open62541 ${open62541_LIBRARIES})
 add_subdirectory(doc)
 
 if(UA_BUILD_EXAMPLES)
+    if(UA_ENABLE_AMALGAMATION)
+        # Cannot compile tests with amalgamation. Not prepared for single header include
+        message(FATAL_ERROR "Examples cannot be built with source amalgamation enabled")
+    endif()
     add_subdirectory(examples)
 endif()
 
@@ -1084,8 +1089,10 @@ set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_CmakePredifinedTargets"
 set_target_properties(open62541 PROPERTIES FOLDER "open62541/lib")
 set_target_properties(open62541-object PROPERTIES FOLDER "open62541/lib")
 set_target_properties(lint PROPERTIES FOLDER "CodeAnalysis")
-set_target_properties(open62541-amalgamation-header PROPERTIES FOLDER "open62541/lib")
-set_target_properties(open62541-amalgamation-source PROPERTIES FOLDER "open62541/lib")
+if (UA_ENABLE_AMALGAMATION)
+    set_target_properties(open62541-amalgamation-header PROPERTIES FOLDER "open62541/lib")
+    set_target_properties(open62541-amalgamation-source PROPERTIES FOLDER "open62541/lib")
+endif()
 
 set_target_properties(open62541-generator-namespace PROPERTIES FOLDER "open62541/generators")
 set_target_properties(open62541-generator-statuscode PROPERTIES FOLDER "open62541/generators")

+ 1 - 0
arch/posix/ua_architecture.h

@@ -34,6 +34,7 @@
 #include <sys/types.h>
 #include <net/if.h>
 #ifndef UA_sleep_ms
+# include <unistd.h>
 # define UA_sleep_ms(X) usleep(X * 1000)
 #endif
 

+ 1 - 1
examples/CMakeLists.txt

@@ -19,7 +19,7 @@ macro(add_example EXAMPLE_NAME EXAMPLE_SOURCE)
   add_executable(${EXAMPLE_NAME} ${STATIC_OBJECTS} ${EXAMPLE_SOURCE} ${ARGN} ${examples_headers})
   target_link_libraries(${EXAMPLE_NAME} open62541 ${open62541_LIBRARIES})
   assign_source_group(${EXAMPLE_SOURCE})
-  add_dependencies(${EXAMPLE_NAME} open62541-amalgamation-header open62541-amalgamation-source)
+  add_dependencies(${EXAMPLE_NAME} open62541-object)
   set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "open62541/examples")
   set_target_properties(${EXAMPLE_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
   if(UA_COMPILE_AS_CXX)

+ 3 - 1
examples/access_control/client_access_control.c

@@ -5,7 +5,9 @@
  * Using access_control_server
  */
 
-#include "open62541.h"
+#include <ua_client.h>
+#include <ua_config_default.h>
+#include <ua_client_highlevel.h>
 
 int main(void) {
     UA_Client *client = UA_Client_new(UA_ClientConfig_default);

+ 5 - 1
examples/access_control/server_access_control.c

@@ -1,7 +1,11 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_plugin_access_control.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 static UA_Boolean

+ 4 - 1
examples/client.c

@@ -1,7 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_client_subscriptions.h>
+#include <ua_client_highlevel.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
 
 #ifdef UA_ENABLE_SUBSCRIPTIONS
 static void

+ 4 - 13
examples/client_async.c

@@ -1,19 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 600
-#endif
-#ifndef _DEFAULT_SOURCE
-# define _DEFAULT_SOURCE
-#endif
-/* On older systems we need to define _BSD_SOURCE.
- * _DEFAULT_SOURCE is an alias for that. */
-#ifndef _BSD_SOURCE
-# define _BSD_SOURCE
-#endif
-
-#include "open62541.h"
+#include <ua_config_default.h>
+#include <ua_client_subscriptions.h>
+#include <ua_log_stdout.h>
+#include <ua_client_highlevel_async.h>
 
 #define NODES_EXIST
 /* async connection callback, it only gets called after the completion of the whole

+ 5 - 1
examples/client_connect_loop.c

@@ -10,7 +10,11 @@
  *
  * This example is very similar to the tutorial_client_firststeps.c. */
 
-#include "open62541.h"
+
+#include <ua_client_highlevel.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 1
examples/client_connectivitycheck_loop.c

@@ -1,7 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_client.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 1
examples/client_subscription_loop.c

@@ -10,7 +10,10 @@
  *
  * This example is very similar to the tutorial_client_firststeps.c. */
 
-#include "open62541.h"
+#include <ua_config_default.h>
+#include <ua_client_subscriptions.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 2 - 1
examples/common.h

@@ -1,7 +1,8 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include "ua_types.h"
+#include "ua_types_generated_handling.h"
 
 /* loadFile parses the certificate file.
  *

+ 2 - 1
examples/custom_datatype/client_types_custom.c

@@ -1,7 +1,8 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_client_highlevel.h>
+#include <ua_config_default.h>
 #include "custom_datatype.h"
 
 int main(void) {

+ 4 - 1
examples/custom_datatype/server_types_custom.c

@@ -1,8 +1,11 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_log_stdout.h>
+#include <ua_config_default.h>
 #include "custom_datatype.h"
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 3 - 1
examples/discovery/client_find_servers.c

@@ -5,7 +5,9 @@
  * and then calls GetEndpoints on the returned list of servers.
  */
 
-#include "open62541.h"
+#include <ua_client.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
 
 #define DISCOVERY_SERVER_ENDPOINT "opc.tcp://localhost:4840"
 

+ 3 - 1
examples/discovery/server_lds.c

@@ -6,7 +6,9 @@
  * find servers service to get all registered servers (see client_find_servers.c).
  */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 6 - 1
examples/discovery/server_multicast.c

@@ -7,7 +7,12 @@
  * (i.e., LDS-ME).
  */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_types.h>
+#include <ua_log_stdout.h>
+#include <ua_securitypolicies.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 3 - 1
examples/discovery/server_register.c

@@ -5,8 +5,10 @@
  * Before shutdown it has to unregister itself.
  */
 
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
 
-#include "open62541.h"
 #include <signal.h>
 
 #define DISCOVERY_SERVER_ENDPOINT "opc.tcp://localhost:4840"

+ 7 - 1
examples/encryption/client_basic128rsa15.c

@@ -1,9 +1,15 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+#include <ua_securitypolicies.h>
+#include <ua_client_highlevel.h>
 #include "common.h"
 
+#include <signal.h>
+
 #define MIN_ARGS           3
 #define FAILURE            1
 #define CONNECTION_STRING  "opc.tcp://localhost:4840"

+ 7 - 1
examples/encryption/client_basic256sha256.c

@@ -1,9 +1,15 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+#include <ua_securitypolicies.h>
+#include <ua_client_highlevel.h>
 #include "common.h"
 
+#include <signal.h>
+
 #define MIN_ARGS           3
 #define FAILURE            1
 #define CONNECTION_STRING  "opc.tcp://localhost:4840"

+ 6 - 1
examples/encryption/server_basic128rsa15.c

@@ -1,8 +1,13 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+#include <ua_securitypolicies.h>
+#include <ua_client_highlevel.h>
 #include "common.h"
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 6 - 1
examples/encryption/server_basic256sha256.c

@@ -1,8 +1,13 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+#include <ua_securitypolicies.h>
+#include <ua_client_highlevel.h>
 #include "common.h"
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 1
examples/nodeset/server_nodeset.c

@@ -1,7 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 /* Files example_namespace.h and example_namespace.c are created from server_nodeset.xml in the

+ 1 - 0
examples/nodeset/server_nodeset_plcopen.c

@@ -8,6 +8,7 @@
 #else
 #include "open62541.h"
 #endif
+
 #include <signal.h>
 
 /* Files example_namespace.h and example_namespace.c are created from server_nodeset.xml in the

+ 4 - 1
examples/pubsub/tutorial_pubsub_connection.c

@@ -2,7 +2,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 2
examples/pubsub/tutorial_pubsub_publish.c

@@ -24,9 +24,11 @@
  * ``tutorial_pubsub_connection.c``.
  */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
-#include <stdio.h>
 
 UA_NodeId connectionIdent, publishedDataSetIdent, writerGroupIdent;
 

+ 4 - 1
examples/server_certificate.c

@@ -5,7 +5,10 @@
 #define _CRT_SECURE_NO_WARNINGS //disable fopen deprication warning in msvs
 #endif
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include "common.h"
 #include <signal.h>
 

+ 4 - 1
examples/server_ctt.c

@@ -5,8 +5,11 @@
 #define _CRT_SECURE_NO_WARNINGS /* disable fopen deprication warning in msvs */
 #endif
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
 #include "common.h"
+
 #include <signal.h>
 
 /* This server is configured to the Compliance Testing Tools (CTT) against. The

+ 4 - 1
examples/server_inheritance.c

@@ -1,7 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 1
examples/server_instantiation.c

@@ -1,7 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 1
examples/server_mainloop.c

@@ -3,7 +3,10 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 1
examples/server_repeated_job.c

@@ -1,7 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 static void

+ 5 - 1
examples/tutorial_client_events.c

@@ -1,7 +1,11 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_client_highlevel.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+#include <ua_client_subscriptions.h>
+
 #include <signal.h>
 
 #ifdef _MSC_VER

+ 3 - 1
examples/tutorial_client_firststeps.c

@@ -8,7 +8,9 @@
  * provides both a server- and clientside API, so creating a client is as easy as
  * creating a server. Copy the following into a file `myClient.c`: */
 
-#include "open62541.h"
+#include <ua_client_highlevel.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
 
 int main(void) {
     UA_Client *client = UA_Client_new(UA_ClientConfig_default);

+ 4 - 1
examples/tutorial_datatypes.c

@@ -16,7 +16,10 @@
  * This section shows the basic interaction patterns for data types. Make
  * sure to compare with the type definitions in ``ua_types.h``. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 
 static void
 variables_basic(void) {

+ 4 - 1
examples/tutorial_server_datasource.c

@@ -25,7 +25,10 @@
  * new value arrives from the underlying process, we can just write into the
  * variable. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 static void

+ 4 - 1
examples/tutorial_server_events.c

@@ -1,7 +1,10 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 /**

+ 4 - 1
examples/tutorial_server_firststeps.c

@@ -20,7 +20,10 @@
  * you have the ``open62541.c/.h`` files in the current folder. Now create a new
  * C source-file called ``myServer.c`` with the following content: */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 UA_Boolean running = true;

+ 4 - 1
examples/tutorial_server_method.c

@@ -30,7 +30,10 @@
  * prepended. The type and length of the input arguments is checked internally
  * by the SDK, so that we don't have to verify the arguments in the callback. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 static UA_StatusCode

+ 5 - 1
examples/tutorial_server_monitoreditems.c

@@ -19,7 +19,11 @@
  * context pointer.
  */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+#include <ua_client_subscriptions.h>
+
 #include <signal.h>
 
 static void

+ 4 - 1
examples/tutorial_server_object.c

@@ -55,7 +55,10 @@
  * setting constraints on the variable values as this is not the focus of this
  * tutorial and was already covered. */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 static void

+ 5 - 1
examples/tutorial_server_variable.c

@@ -14,9 +14,13 @@
  * read only. See below for making the variable writable.
  */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
+
 static void
 addVariable(UA_Server *server) {
     /* Define the attribute of the myInteger variable node */

+ 4 - 1
examples/tutorial_server_variabletype.c

@@ -18,7 +18,10 @@
  * VariableTypeNode to the hierarchy of variable types.
  */
 
-#include "open62541.h"
+#include <ua_server.h>
+#include <ua_config_default.h>
+#include <ua_log_stdout.h>
+
 #include <signal.h>
 
 static UA_NodeId pointTypeId;

+ 1 - 1
plugins/ua_config_default.c

@@ -10,7 +10,6 @@
  *    Copyright 2018 (c) Fabian Arndt, Root-Core
  */
 
-#include "ua_plugin_securitypolicy.h"
 #include "ua_config_default.h"
 #include "ua_client_config.h"
 #include "ua_log_stdout.h"
@@ -19,6 +18,7 @@
 #include "ua_pki_certificate.h"
 #include "ua_nodestore_default.h"
 #include "ua_securitypolicies.h"
+#include "ua_plugin_securitypolicy.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

+ 0 - 1
tests/fuzz/CMakeLists.txt

@@ -19,7 +19,6 @@ if (UA_BUILD_FUZZING_CORPUS)
     add_executable(corpus_generator ua_debug_dump_pkgs_file.c corpus_generator.c)
     target_link_libraries(corpus_generator open62541 ${open62541_LIBRARIES})
     assign_source_group(corpus_generator)
-    add_dependencies(corpus_generator open62541-amalgamation-header)
     set_target_properties(corpus_generator PROPERTIES FOLDER "open62541/corpus_generator")
     set_target_properties(corpus_generator PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
     return()

+ 1 - 1
tools/nodeset_compiler/backend_open62541.py

@@ -196,7 +196,7 @@ UA_findDataTypeByBinary(const UA_NodeId *typeId);
 """ % (additionalHeaders))
     else:
         writeh("""
-#include "open62541.h"
+#include "ua_server.h"
 """)
     writeh("""
 _UA_BEGIN_DECLS

+ 15 - 7
tools/travis/travis_linux_script.sh

@@ -77,7 +77,7 @@ if [ $ANALYZE = "true" ]; then
 
         mkdir -p build
         cd build
-        scan-build-6.0 cmake -DUA_ENABLE_AMALGAMATION=ON ..
+        scan-build-6.0 cmake -DUA_ENABLE_AMALGAMATION=OFF ..
         scan-build-6.0 -enable-checker security.FloatLoopCounter \
           -enable-checker security.insecureAPI.UncheckedReturn \
           --status-bugs -v \
@@ -130,7 +130,7 @@ else
     if ! [ -z ${MINGW+x} ]; then
         echo -e "\r\n== Cross compile release build for MinGW 32 bit =="  && echo -en 'travis_fold:start:script.build.cross_mingw32\\r'
         mkdir -p build && cd build
-        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw32.cmake -DUA_ENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
+        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw32.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
         make -j
         if [ $? -ne 0 ] ; then exit 1 ; fi
         cp ../LICENSE ../AUTHORS ../README.md .
@@ -141,7 +141,7 @@ else
 
         echo -e "\r\n== Cross compile release build for MinGW 64 bit =="  && echo -en 'travis_fold:start:script.build.cross_mingw64\\r'
         mkdir -p build && cd build
-        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw64.cmake -DUA_ENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
+        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw64.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
         make -j
         if [ $? -ne 0 ] ; then exit 1 ; fi
         cp ../LICENSE ../AUTHORS ../README.md .
@@ -152,7 +152,7 @@ else
 
         echo -e "\r\n== Cross compile release build for 32-bit linux =="  && echo -en 'travis_fold:start:script.build.cross_linux\\r'
         mkdir -p build && cd build
-        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-gcc-m32.cmake -DUA_ENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
+        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-gcc-m32.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
         make -j
         if [ $? -ne 0 ] ; then exit 1 ; fi
         tar -pczf open62541-linux32.tar.gz ../../doc_latex/open62541.pdf ../LICENSE ../AUTHORS ../README.md bin/examples/server_ctt bin/examples/client bin/libopen62541.* open62541.h open62541.c
@@ -164,7 +164,7 @@ else
         mkdir -p build && cd build
         git clone https://github.com/raspberrypi/tools
         export PATH=$PATH:./tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/
-        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-rpi64.cmake -DUA_ENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
+        cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-rpi64.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
         make -j
         if [ $? -ne 0 ] ; then exit 1 ; fi
         tar -pczf open62541-raspberrypi.tar.gz ../../doc_latex/open62541.pdf ../LICENSE ../AUTHORS ../README.md bin/examples/server_ctt bin/examples/client bin/libopen62541.* open62541.h open62541.c
@@ -175,7 +175,7 @@ else
 
     echo -e "\r\n== Compile release build for 64-bit linux =="  && echo -en 'travis_fold:start:script.build.linux_64\\r'
     mkdir -p build && cd build
-    cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
+    cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=OFF -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
     make -j
     if [ $? -ne 0 ] ; then exit 1 ; fi
     tar -pczf open62541-linux64.tar.gz ../../doc_latex/open62541.pdf ../LICENSE ../AUTHORS ../README.md bin/examples/server_ctt bin/examples/client bin/libopen62541.* open62541.h open62541.c
@@ -196,12 +196,20 @@ else
 
     echo "Compile as shared lib version" && echo -en 'travis_fold:start:script.build.shared_libs\\r'
     mkdir -p build && cd build
-    cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DBUILD_SHARED_LIBS=ON -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=ON ..
+    cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DBUILD_SHARED_LIBS=ON -DUA_ENABLE_AMALGAMATION=OFF -DUA_BUILD_EXAMPLES=ON ..
     make -j
     if [ $? -ne 0 ] ; then exit 1 ; fi
     cd .. && rm build -rf
     echo -en 'travis_fold:end:script.build.shared_libs\\r'
 
+    echo "Compile as shared lib version with amalgamation" && echo -en 'travis_fold:start:script.build.shared_libs_amalgamate\\r'
+    mkdir -p build && cd build
+    cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DBUILD_SHARED_LIBS=ON -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=OFF ..
+    make -j
+    if [ $? -ne 0 ] ; then exit 1 ; fi
+    cd .. && rm build -rf
+    echo -en 'travis_fold:end:script.build.shared_libs_amalgamate\\r'
+
     if [ "$CC" != "tcc" ]; then
         echo -e "\r\n==Compile multithreaded version==" && echo -en 'travis_fold:start:script.build.multithread\\r'
         mkdir -p build && cd build