Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.7KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_open62541_check_h.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_OPEN62541_CHECK_H([HEADERS = `...see_below...'], [ACTION-IF-FOUND],
  8. # [ACTION-IF-NOT-FOUND])
  9. #
  10. # DESCRIPTION
  11. #
  12. # Searches for the header file(s) of the open62541 library [1].
  13. #
  14. # The open62541 library is a cmake-based project, that provides its header
  15. # files in one of two layouts:
  16. #
  17. # 1) As individual files, e.g. ua_config.h, ua_server.h, ua_types.h, ...
  18. # 2) As a single amalgamation file open62541.h
  19. #
  20. # The second case is enabled when configuring open62541 with the options
  21. # "-D UA_ENABLE_AMALGAMATION=true to" cmake, which seems to be preferred.
  22. # Code using the library can distinguish which layout is used by checking
  23. # for the macro "UA_NO_AMALGAMATION": if it is defined, the first layout
  24. # is used.
  25. #
  26. # The AX_OPEN62541_CHECK_H macro checks first for the amalgamation and, if
  27. # that is not found, for the individual headers. It defines
  28. # "UA_NO_AMALGAMATION" if necessary.
  29. #
  30. # The individual headers to check for if no amalgamation is found can be
  31. # provided as a space-separated list in the first argument. If that is
  32. # empty, it defaults to all files known to be contained in the
  33. # amalgamation as of v0.2.0 of the library:
  34. #
  35. # * ms_stdint.h
  36. # * ua_client.h
  37. # * ua_client_highlevel.h
  38. # * ua_config.h
  39. # * ua_config_standard.h
  40. # * ua_connection.h
  41. # * ua_constants.h
  42. # * ua_job.h
  43. # * ua_log.h
  44. # * ua_log_stdout.h
  45. # * ua_network_tcp.h
  46. # * ua_nodeids.h
  47. # * ua_server.h
  48. # * ua_server_external_ns.h
  49. # * ua_types.h
  50. # * ua_types_generated.h
  51. # * ua_types_generated_handling.h
  52. #
  53. # If the with_open62541 shell variable is set to "no" (e.g. from running
  54. # the AX_OPEN62541_PATH macro and the user giving configure the option
  55. # "--without-open62541"), then expands ACTION-IF-NOT-FOUND without any
  56. # checks.
  57. #
  58. # [1]: <http://open62541.org/>
  59. #
  60. # LICENSE
  61. #
  62. # Copyright (c) 2016,2017 Olaf Mandel <olaf@mandel.name>
  63. #
  64. # Copying and distribution of this file, with or without modification, are
  65. # permitted in any medium without royalty provided the copyright notice
  66. # and this notice are preserved. This file is offered as-is, without any
  67. # warranty.
  68. #serial 3
  69. # AX_OPEN62541_CHECK_H([HEADERS], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  70. # -------------------------------------------------------------------------
  71. AC_DEFUN([AX_OPEN62541_CHECK_H],
  72. [m4_pushdef([headers], m4_normalize([$1]))dnl
  73. m4_ifblank(m4_defn([headers]), [m4_define([headers],
  74. [ms_stdint.h]dnl
  75. [ua_client.h]dnl
  76. [ua_client_highlevel.h]dnl
  77. [ua_config.h]dnl
  78. [ua_config_standard.h]dnl
  79. [ua_connection.h]dnl
  80. [ua_constants.h]dnl
  81. [ua_job.h]dnl
  82. [ua_log.h]dnl
  83. [ua_log_stdout.h]dnl
  84. [ua_network_tcp.h]dnl
  85. [ua_nodeids.h]dnl
  86. [ua_server.h]dnl
  87. [ua_server_external_ns.h]dnl
  88. [ua_types.h]dnl
  89. [ua_types_generated.h]dnl
  90. [ua_types_generated_handling.h])])dnl
  91. dnl ua_server_external_ns.h depends on ua_server.h but fails to include it:
  92. dnl so specify the includes:
  93. pushdef([includes],
  94. [#ifdef HAVE_UA_SERVER_H
  95. # include <ua_server.h>
  96. #endif])dnl
  97. dnl
  98. AS_IF([test x${with_open62541:+set} != xset -o "x$with_open62541" != xno],
  99. [AC_CHECK_HEADERS([open62541.h], [$2],
  100. [AC_CHECK_HEADERS(m4_defn([headers]), [$2]dnl
  101. [AC_DEFINE([UA_NO_AMALGAMATION], [1],
  102. [Use individual open62541 headers instead of the amalgamation.])],
  103. [$3],
  104. [m4_defn([includes])])],
  105. [AC_INCLUDES_DEFAULT])],
  106. [$3])
  107. m4_popdef([headers], [includes])dnl
  108. ])# AX_OPEN62541_CHECK_H