configure.ac 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.59)
  3. AC_INIT(Open62541, 1.0)
  4. AC_CANONICAL_SYSTEM
  5. AM_INIT_AUTOMAKE([subdir-objects])
  6. AC_PROG_MAKE_SET
  7. #default CFLAGS is -g -02
  8. #reset it just to -g and make optimization dependend on --enable-debug
  9. if test -z $CFLAGS; then
  10. CFLAGS=''
  11. fi
  12. AM_PATH_PYTHON
  13. AC_PROG_CC
  14. AC_PROG_LN_S
  15. AM_PROG_CC_C_O
  16. AC_CHECK_LIB([m],[exp],,AC_MSG_ERROR([Libm missing]))
  17. AC_CHECK_LIB([expat],[XML_Parse],,AC_MSG_ERROR([Libexpat missing]))
  18. PKG_CHECK_MODULES([CHECK], [check >= 0.9.12],[have_check="yes"],AC_MSG_WARN([Check not found or check version lower than 0.9.12; cannot run unit tests!])
  19. [have_check="no"])
  20. AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = "xyes"])
  21. AM_CONDITIONAL([TARGET_WIN],[test "${host_os}" = "mingw32"])
  22. AM_CONDITIONAL([TARGET_LINUX],[test "${host_os}" = "linux-gnu" || test "${host_os}" = "linux"])
  23. #adding platform-dependent information to compile flags
  24. AM_COND_IF([TARGET_WIN],
  25. AC_DEFINE([WINDOWS])) #define WINDOWS is accessible from pre-processor
  26. AM_COND_IF([TARGET_LINUX],
  27. AC_DEFINE([LINUX]))
  28. #debugging
  29. AC_ARG_ENABLE(debug,
  30. AS_HELP_STRING([--enable-debug],
  31. [enable debugging, default: no]),
  32. [case "${enableval}" in
  33. yes) debug=true; verbose=false ;;
  34. no) debug=false; verbose=false ;;
  35. verbose) debug=true; verbose=true ;;
  36. *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  37. esac],[debug=false])
  38. AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
  39. AM_COND_IF([DEBUG],
  40. AC_DEFINE([DEBUG])) #define DEBUG is accessible from pre-processor
  41. AM_CONDITIONAL(VERBOSE, test x"$verbose" = x"true")
  42. AM_COND_IF([VERBOSE],
  43. AC_DEFINE([VERBOSE])) #define VERBOSE is accessible from pre-processor
  44. #multithreading
  45. AC_ARG_ENABLE(multithreading,
  46. AS_HELP_STRING([--enable-multithreading],
  47. [enable multithreading, default: yes]),
  48. [case "${enableval}" in
  49. yes) multithreading=true ;;
  50. no) multithreading=false ;;
  51. *) AC_MSG_ERROR([bad value ${enableval} for --enable-multithreading]) ;;
  52. esac],[multithreading=false])
  53. AM_CONDITIONAL(MULTITHREADING, test x"$multithreading" = x"true")
  54. AM_COND_IF([MULTITHREADING],
  55. AC_DEFINE([MULTITHREADING])) #define MULTITHREADING is accessible from pre-processor
  56. #coverage
  57. AC_ARG_ENABLE(coverage,
  58. AS_HELP_STRING([--enable-coverage],
  59. [enable coverage, default: no]),
  60. [case "${enableval}" in
  61. yes) coverage=true ;;
  62. no) coverag=false ;;
  63. *) AC_MSG_ERROR([bad value ${enableval} for --enable-coverage]) ;;
  64. esac],[coverage=false])
  65. AM_CONDITIONAL(COVERAGE, test x"$coverage" = x"true")
  66. AM_COND_IF([COVERAGE],
  67. AC_DEFINE([COVERAGE])) #define MULTITHREADING is accessible from pre-processor
  68. #raspberry pi
  69. AC_ARG_ENABLE(raspi,
  70. AS_HELP_STRING([--enable-raspi],
  71. [enable raspi, default: no]),
  72. [case "${enableval}" in
  73. yes) raspi=true ;;
  74. no) raspi=false ;;
  75. *) AC_MSG_ERROR([bad value ${enableval} for --enable-raspi]) ;;
  76. esac],[raspi=false])
  77. AM_CONDITIONAL(RASPI, test x"$raspi" = x"true")
  78. AM_COND_IF([RASPI],
  79. AC_DEFINE([RASPI]))
  80. #doxygen start
  81. AC_ARG_ENABLE(doxygen,
  82. AS_HELP_STRING([--enable-doxygen],
  83. [enable doxygen, default: no]),
  84. [case "${enableval}" in
  85. yes) enabledoxygen=true ;;
  86. no) enabledoxygen=false ;;
  87. *) AC_MSG_ERROR([bad value ${enableval} for --enable-doxygen]) ;;
  88. esac],[enabledoxygen=false])
  89. AM_CONDITIONAL(ENABLE_DOXYGEN, test x"$enabledoxygen" = x"true")
  90. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  91. AC_CHECK_PROGS([DOT], [dot])
  92. #break if doxygen enabled but not present
  93. if test x"$enabledoxygen" = x"true"; then
  94. if test -z "$DOXYGEN"; then
  95. AC_MSG_ERROR([Doxygen not found])
  96. fi
  97. if test -z "$DOT"; then
  98. AC_MSG_ERROR([Graphviz not found])
  99. fi
  100. fi
  101. AM_COND_IF([ENABLE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
  102. #doxygen end
  103. #language wrappers
  104. AC_ARG_ENABLE(python_wrapper,
  105. AS_HELP_STRING([--enable-python-wrapper],
  106. [build python-wrapper, default: no]),
  107. [case "${enableval}" in
  108. yes) python_wrapper=true ;;
  109. no) python_wrapper=false ;;
  110. *) AC_MSG_ERROR([bad value ${enableval} for --enable-python-wrapper]) ;;
  111. esac],[python_wrapper=false])
  112. AM_CONDITIONAL(PYTHON_WRAPPER, test x"$python_wrapper" = x"true")
  113. AM_COND_IF([PYTHON_WRAPPER],
  114. AC_DEFINE([PYTHON_WRAPPER]))
  115. AC_ARG_ENABLE(lua_wrapper,
  116. AS_HELP_STRING([--enable-lua-wrapper],
  117. [build lua-wrapper, default: no]),
  118. [case "${enableval}" in
  119. yes) lua_wrapper=true ;;
  120. no) lua_wrapper=false ;;
  121. *) AC_MSG_ERROR([bad value ${enableval} for --enable-lua-wrapper]) ;;
  122. esac],[lua_wrapper=false])
  123. AM_CONDITIONAL(LUA_WRAPPER, test x"$lua_wrapper" = x"true")
  124. AM_COND_IF([LUA_WRAPPER],
  125. AC_DEFINE([LUA_WRAPPER]))
  126. AC_LIBTOOL_WIN32_DLL
  127. AC_PROG_LIBTOOL
  128. AC_CONFIG_MACRO_DIR([m4])
  129. AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile examples/src/Makefile doc/Makefile wrappers/Makefile wrappers/python/Makefile wrappers/lua/Makefile)
  130. AC_OUTPUT