configure.ac 1.4 KB

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