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
5 # Making a point release:
6 # - increase libmodbus_version_micro to the next even number
9 # - increase libmodbus_version_minor to the next odd number
11 # Take care to update the libtool versioning when required (LIBMODBUS_LD_*).
12 # http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
14 m4_define([libmodbus_version_major], [2])
15 m4_define([libmodbus_version_minor], [9])
16 m4_define([libmodbus_version_micro], [3])
18 m4_define([libmodbus_release_status],
19 [m4_if(m4_eval(libmodbus_version_minor % 2), [1], [snapshot],
22 m4_define([libmodbus_version],
23 [libmodbus_version_major.libmodbus_version_minor.libmodbus_version_micro])
26 AC_INIT([libmodbus],[libmodbus_version],
27 [https://github.com/stephane/libmodbus/issues])
28 AC_CONFIG_SRCDIR([src/modbus.c])
29 AC_CONFIG_HEADERS([config.h])
30 AM_INIT_AUTOMAKE([foreign])
31 # enable nice build output on automake1.11
32 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
34 LIBMODBUS_VERSION_MAJOR=libmodbus_version_major
35 LIBMODBUS_VERSION_MINOR=libmodbus_version_minor
36 LIBMODBUS_VERSION_MICRO=libmodbus_version_micro
37 LIBMODBUS_VERSION=libmodbus_version
38 AC_SUBST(LIBMODBUS_VERSION_MAJOR)
39 AC_SUBST(LIBMODBUS_VERSION_MINOR)
40 AC_SUBST(LIBMODBUS_VERSION_MICRO)
41 AC_SUBST(LIBMODBUS_VERSION)
44 LIBMODBUS_LD_CURRENT=4
45 LIBMODBUS_LD_REVISION=0
47 LIBMODBUS_LT_VERSION_INFO=$LIBMODBUS_LD_CURRENT:$LIBMODBUS_LD_REVISION:$LIBMODBUS_LD_AGE
48 AC_SUBST(LIBMODBUS_LT_VERSION_INFO)
52 # Check whether we are building for Win32
59 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "true")
61 # Checks for programs.
65 LT_INIT([disable-static win32-dll])
82 # Check whether to build docs / install man pages
83 AC_LIBMODBUS_CHECK_DOC_BUILD
85 # Checks for header files.
88 # Checks for typedefs, structures, and compiler characteristics.
92 # AC_TYPE_UINT*_T: not supported by autoconf-2.59 of CentOS 5.3
97 # Cygwin defines IPTOS_LOWDELAY but can't handle that flag so it's necessary to
98 # workaround that problem and Cygwin doesn't define MSG_DONTWAIT.
99 AC_CHECK_DECLS([__CYGWIN__])
101 # Checks for library functions.
103 AC_CHECK_FUNCS([gettimeofday inet_ntoa memset select socket strerror strlcpy getaddrinfo])
105 # Add -Wall -Werror for GCC if not already there
106 if test "x$GCC" = "xyes"; then
108 *[[\ \ ]]-Wall[[\ \ ]]*) ;;
109 *) CFLAGS="$CFLAGS -Wall" ;;
113 if test "x$GCC" = "xyes"; then
115 *[[\ \ ]]-Werror[[\ \ ]]*) ;;
116 *) CFLAGS="$CFLAGS -Werror" ;;
120 # Required for getaddrinfo (TCP PI - IPv6)
121 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
122 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
123 LIBS="$LIBS -lws2_32"