configure.ac 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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()
  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='-g'
  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. 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!])
  18. [have_check="no"])
  19. AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = "xyes"])
  20. AM_CONDITIONAL([TARGET_WIN],[test "${host_os}" = "mingw32"])
  21. AM_CONDITIONAL([TARGET_LINUX],[test "${host_os}" = "linux-gnu" || test "${host_os}" = "linux"])
  22. #adding platform-dependent information to compile flags
  23. AM_COND_IF([TARGET_WIN],
  24. AC_DEFINE([WINDOWS])) #define WINDOWS is accessible from pre-processor
  25. AM_COND_IF([TARGET_LINUX],
  26. AC_DEFINE([LINUX]))
  27. AC_ARG_ENABLE(debug,
  28. AS_HELP_STRING([--enable-debug],
  29. [enable debugging, default: no]),
  30. [case "${enableval}" in
  31. yes) debug=true, verbose=false ;;
  32. no) debug=false, verbose=false ;;
  33. verbose) debug=true, verbose=true ;;
  34. *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  35. esac],[debug=false])
  36. AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
  37. AM_COND_IF([DEBUG],
  38. AC_DEFINE([DEBUG])) #define DEBUG is accessible from pre-processor
  39. AM_CONDITIONAL(VERBOSE, test x"$verbose" = x"true")
  40. AM_COND_IF([VERBOSE],
  41. AC_DEFINE([VERBOSE])) #define VERBOSE is accessible from pre-processor
  42. AC_ARG_ENABLE(multithreading,
  43. AS_HELP_STRING([--enable-multithreading],
  44. [enable multithreading, default: yes]),
  45. [case "${enableval}" in
  46. yes) multithreading=true ;;
  47. no) multithreading=false ;;
  48. *) AC_MSG_ERROR([bad value ${enableval} for --enable-multithreading]) ;;
  49. esac],[multithreading=false])
  50. AM_CONDITIONAL(MULTITHREADING, test x"$multithreading" = x"true")
  51. AM_COND_IF([MULTITHREADING],
  52. AC_DEFINE([MULTITHREADING])) #define MULTITHREADING is accessible from pre-processor
  53. AC_ARG_ENABLE(coverage,
  54. AS_HELP_STRING([--enable-coverage],
  55. [enable coverage, default: no]),
  56. [case "${enableval}" in
  57. yes) coverage=true ;;
  58. no) coverag=false ;;
  59. *) AC_MSG_ERROR([bad value ${enableval} for --enable-coverage]) ;;
  60. esac],[coverage=false])
  61. AM_CONDITIONAL(COVERAGE, test x"$coverage" = x"true")
  62. AM_COND_IF([COVERAGE],
  63. AC_DEFINE([COVERAGE])) #define MULTITHREADING is accessible from pre-processor
  64. #doxygen start
  65. AC_ARG_ENABLE(doxygen,
  66. AS_HELP_STRING([--enable-doxygen],
  67. [enable doxygen, default: no]),
  68. [case "${enableval}" in
  69. yes) enabledoxygen=true ;;
  70. no) enabledoxygen=false ;;
  71. *) AC_MSG_ERROR([bad value ${enableval} for --enable-doxygen]) ;;
  72. esac],[enabledoxygen=false])
  73. AM_CONDITIONAL(ENABLE_DOXYGEN, test x"$enabledoxygen" = x"true")
  74. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  75. #break if doxygen enabled but not present
  76. if test x"$enabledoxygen" = x"true"; then
  77. if test -z "$DOXYGEN"; then
  78. AC_MSG_ERROR([Doxygen not found])
  79. fi
  80. fi
  81. AM_COND_IF([ENABLE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
  82. #doxygen end
  83. AC_LIBTOOL_WIN32_DLL
  84. AC_PROG_LIBTOOL
  85. AC_CONFIG_MACRO_DIR([m4])
  86. AC_CONFIG_FILES(Makefile include/Makefile src/Makefile tool/Makefile tests/Makefile examples/src/Makefile doc/Makefile)
  87. AC_OUTPUT