configure.ac 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # libmodbus package version number, (as distinct from shared library version)
  2. # An odd micro number indicates in-progress development from Git
  3. # An even micro number indicates a released version
  4. #
  5. # Making a point release:
  6. # - increase mb_version_micro to the next even number
  7. #
  8. # After the release:
  9. # - increase mb_version_minor to the next odd number
  10. #
  11. # Take care to update the libtool versioning when required (MB_LD_*).
  12. # http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
  13. #
  14. m4_define([mb_version_major], [2])
  15. m4_define([mb_version_minor], [1])
  16. m4_define([mb_version_micro], [1])
  17. m4_define([mb_release_status],
  18. [m4_if(m4_eval(mb_version_minor % 2), [1], [snapshot],
  19. [release])])
  20. m4_define([mb_version], [mb_version_major.mb_version_minor.mb_version_micro])
  21. AC_PREREQ(2.63)
  22. AC_INIT([libmodbus],[mb_version],[stephane.raimbault@gmail.com])
  23. AC_CONFIG_SRCDIR([src/modbus.c])
  24. AC_CONFIG_HEADERS([config.h])
  25. AM_INIT_AUTOMAKE([foreign])
  26. # enable nice build output on automake1.11
  27. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  28. MB_VERSION_MAJOR=mb_version_major
  29. MB_VERSION_MINOR=mb_version_minor
  30. MB_VERSION_MICRO=mb_version_micro
  31. MB_VERSION=mb_version
  32. AC_SUBST(MB_VERSION_MAJOR)
  33. AC_SUBST(MB_VERSION_MINOR)
  34. AC_SUBST(MB_VERSION_MICRO)
  35. AC_SUBST(MB_VERSION)
  36. # ABI version
  37. MB_LD_CURRENT=3
  38. MB_LD_REVISION=0
  39. MB_LD_AGE=0
  40. MB_LT_LDFLAGS="-version-info $MB_LD_CURRENT:$MB_LD_REVISION:$MB_LD_AGE"
  41. AC_SUBST(MB_LT_LDFLAGS)
  42. # Checks for programs.
  43. AC_PROG_CC
  44. AC_PROG_CXX
  45. AC_PROG_MAKE_SET
  46. LT_INIT([disable-static])
  47. # Checks for header files.
  48. AC_HEADER_STDC
  49. AC_CHECK_HEADERS([termios.h sys/time.h unistd.h errno.h limits.h fcntl.h sys/types.h sys/socket.h sys/ioctl.h netinet/in.h netinet/ip.h netinet/tcp.h arpa/inet.h])
  50. # Checks for typedefs, structures, and compiler characteristics.
  51. AC_C_CONST
  52. AC_TYPE_SIZE_T
  53. AC_HEADER_TIME
  54. # AC_TYPE_UINT*_T: not supported by autoconf-2.59 of CentOS 5.3
  55. # AC_TYPE_UINT16_T
  56. # AC_TYPE_UINT32_T
  57. # AC_TYPE_UINT8_T
  58. # Cygwin defines IPTOS_LOWDELAY but can't handle that flag so it's necessary to
  59. # workaround that problem and Cygwin doesn't define MSG_DONTWAIT.
  60. AC_CHECK_DECLS([__CYGWIN__])
  61. # Checks for library functions.
  62. AC_FUNC_FORK
  63. AC_CHECK_FUNCS([gettimeofday inet_ntoa memset select socket strerror])
  64. AC_CONFIG_FILES([
  65. Makefile
  66. src/Makefile
  67. src/version.h
  68. tests/Makefile
  69. libmodbus.pc
  70. ])
  71. AC_OUTPUT