configure.ac 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. AC_PROG_CC
  13. AC_PROG_LN_S
  14. AM_PROG_CC_C_O
  15. AC_CHECK_LIB([m],[exp],,AC_MSG_ERROR([Libm missing]))
  16. 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!])
  17. [have_check="no"])
  18. AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = "xyes"])
  19. AM_CONDITIONAL([TARGET_WIN],[test "${host_os}" = "mingw32"])
  20. AM_CONDITIONAL([TARGET_LINUX],[test "${host_os}" = "linux-gnu" || test "${host_os}" = "linux"])
  21. #adding platform-dependent information to compile flags
  22. AM_COND_IF([TARGET_WIN],
  23. AC_DEFINE([WINDOWS])) #define WINDOWS is accessible from pre-processor
  24. AM_COND_IF([TARGET_LINUX],
  25. AC_DEFINE([LINUX]))
  26. AC_ARG_ENABLE(debug,
  27. AS_HELP_STRING([--enable-debug],
  28. [enable debugging, default: no]),
  29. [case "${enableval}" in
  30. yes) debug=true ;;
  31. no) debug=false ;;
  32. *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  33. esac],
  34. [debug=false])
  35. AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
  36. AM_COND_IF([DEBUG],
  37. AC_DEFINE([DEBUG])) #define DEBUG is accessible from pre-processor
  38. AC_LIBTOOL_WIN32_DLL
  39. AC_PROG_LIBTOOL
  40. AC_CONFIG_MACRO_DIR([m4])
  41. AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile examples/src/Makefile)
  42. AC_OUTPUT