configure.ac 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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]) ;; esac],
  35. [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]) ;; esac],
  49. [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(doxygen,
  54. AS_HELP_STRING([--enable-doxygen],
  55. [enable doxygen, default: no]),
  56. [case "${enableval}" in
  57. yes) enabledoxygen=true ;;
  58. no) enabledoxygen=false ;;
  59. *) AC_MSG_ERROR([bad value ${enableval} for --enable-doxygen]) ;; esac],
  60. [enabledoxygen=false])
  61. AM_CONDITIONAL(ENABLE_DOXYGEN, test x"$enabledoxygen" = x"true")
  62. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  63. AM_CONDITIONAL([HAVE_DOXYGEN],[test -n "$DOXYGEN"])
  64. AM_COND_IF([ENABLE_DOXYGEN],[AM_COND_IF([HAVE_DOXYGEN],[usedoxygen=true],[usedoxygen=false])],[usedoxygen=false])
  65. #if ENABLE_DOXYGEN;then
  66. # if HAVE_DOXYGEN;then
  67. # usedoxygen = true
  68. # else
  69. # usedoxygen = false
  70. # fi
  71. #else
  72. # usedoxygen = false
  73. #fi
  74. AM_CONDITIONAL([USE_DOXYGEN], test x"$usedoxygen" = x"true")
  75. AM_COND_IF([USE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
  76. if test -z "$DOXYGEN";then
  77. AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
  78. fi
  79. AC_LIBTOOL_WIN32_DLL
  80. AC_PROG_LIBTOOL
  81. AC_CONFIG_MACRO_DIR([m4])
  82. AC_CONFIG_FILES(Makefile include/Makefile src/Makefile tool/Makefile tests/Makefile examples/src/Makefile doc/Makefile)
  83. AC_OUTPUT