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], [3])
15 m4_define([libmodbus_version_minor], [1])
16 m4_define([libmodbus_version_micro], [11])
18 m4_define([libmodbus_release_status],
19 [m4_if(m4_eval(libmodbus_version_minor % 2), [1], [snapshot], [release])])
21 m4_define([libmodbus_version],
22 [libmodbus_version_major.libmodbus_version_minor.libmodbus_version_micro])
27 [https://github.com/stephane/libmodbus/issues],
29 [http://libmodbus.org/])
30 AC_CONFIG_SRCDIR([src/modbus.c])
31 AC_CONFIG_AUX_DIR([build-aux])
32 AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax subdir-objects])
34 AC_USE_SYSTEM_EXTENSIONS
36 AC_CONFIG_MACRO_DIR([m4])
37 AM_SILENT_RULES([yes])
39 LIBMODBUS_VERSION_MAJOR=libmodbus_version_major
40 LIBMODBUS_VERSION_MINOR=libmodbus_version_minor
41 LIBMODBUS_VERSION_MICRO=libmodbus_version_micro
42 LIBMODBUS_VERSION=libmodbus_version
43 AC_SUBST(LIBMODBUS_VERSION_MAJOR)
44 AC_SUBST(LIBMODBUS_VERSION_MINOR)
45 AC_SUBST(LIBMODBUS_VERSION_MICRO)
46 AC_SUBST(LIBMODBUS_VERSION)
49 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
50 LIBMODBUS_LD_CURRENT=6
51 LIBMODBUS_LD_REVISION=0
53 LIBMODBUS_LT_VERSION_INFO=$LIBMODBUS_LD_CURRENT:$LIBMODBUS_LD_REVISION:$LIBMODBUS_LD_AGE
54 AC_SUBST(LIBMODBUS_LT_VERSION_INFO)
77 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "true")
78 AM_CONDITIONAL(OS_QNX, test "$os_qnx" = "true")
80 m4_pattern_forbid([^LT_INIT])dnl
81 LT_INIT([disable-static win32-dll pic-only])
104 # Cygwin defines IPTOS_LOWDELAY but can't handle that flag so it's necessary to
105 # workaround that problem and Cygwin doesn't define MSG_DONTWAIT.
106 AC_CHECK_DECLS([__CYGWIN__])
108 # Check for network function in libnetwork for Haiku
109 AC_SEARCH_LIBS(accept, network socket)
111 # Checks for library functions.
112 AC_CHECK_FUNCS([accept4 gai_strerror getaddrinfo gettimeofday inet_pton inet_ntop select socket strerror strlcpy])
114 # Required for MinGW with GCC v4.8.1 on Win7
115 AC_DEFINE(WINVER, 0x0501, _)
131 if test "$os_cygwin" = "false"; then
132 # Required for getaddrinfo (TCP IP - IPv6)
133 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
134 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
135 LIBS="$LIBS -lws2_32"
140 if test "$os_sunos" = "true"; then
141 LIBS="$LIBS -lnsl -lsocket"
145 # Check for RS485 support (Linux kernel version 2.6.28+)
146 AC_CHECK_DECLS([TIOCSRS485], [], [], [[#include <sys/ioctl.h>]])
147 # Check for RTS flags
148 AC_CHECK_DECLS([TIOCM_RTS], [], [], [[#include <sys/ioctl.h>]])
150 WARNING_CFLAGS="-Wall \
151 -Wmissing-declarations -Wmissing-prototypes \
152 -Wnested-externs -Wpointer-arith \
153 -Wsign-compare -Wchar-subscripts \
154 -Wstrict-prototypes -Wshadow \
156 AC_SUBST([WARNING_CFLAGS])
160 AS_HELP_STRING([--disable-tests],
161 [Build tests (default: yes)]),,
163 AM_CONDITIONAL(BUILD_TESTS, [test $enable_tests != no])
165 AC_CONFIG_HEADERS([config.h tests/unit-test.h])
170 src/win32/modbus.dll.manifest
175 AC_ARG_ENABLE([debug],
176 [AS_HELP_STRING([--enable-debug],
177 [Enable debug symbols (default is no)])],
178 [enable_debug=$enableval],
181 AS_IF([test "x$enable_debug" = "xyes"], [
195 sysconfdir: ${sysconfdir}
197 includedir: ${includedir}
200 cflags: ${CFLAGS} ${WARNING_CFLAGS}
203 tests: ${enable_tests}