configure.ac 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.59)
  3. AC_INIT(OPCUAServer, 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=true])
  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_LIBTOOL_WIN32_DLL
  54. AC_PROG_LIBTOOL
  55. AC_CONFIG_MACRO_DIR([m4])
  56. AC_CONFIG_FILES(Makefile include/Makefile src/Makefile tool/Makefile tests/Makefile examples/src/Makefile)
  57. AC_OUTPUT