configure.ac 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 ;;
  32. no) debug=false ;;
  33. *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  34. 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. AC_LIBTOOL_WIN32_DLL
  40. AC_PROG_LIBTOOL
  41. AC_CONFIG_MACRO_DIR([m4])
  42. AC_CONFIG_FILES(Makefile include/Makefile src/Makefile tool/Makefile tests/Makefile examples/src/Makefile)
  43. AC_OUTPUT