Commit 610ff3b76562e9f6e7ca7e21a4fe3b094d205901

Authored by Stéphane Raimbault
1 parent e93f2d88

unit-test.h is now generated to avoid config.h dependency

.gitignore
@@ -36,6 +36,7 @@ tests/bandwidth-server-one @@ -36,6 +36,7 @@ tests/bandwidth-server-one
36 tests/random-test-client 36 tests/random-test-client
37 tests/random-test-server 37 tests/random-test-server
38 tests/unit-test-client 38 tests/unit-test-client
  39 +tests/unit-test.h
39 tests/unit-test-server 40 tests/unit-test-server
40 tests/version 41 tests/version
41 doc/*.html 42 doc/*.html
configure.ac
@@ -16,17 +16,15 @@ m4_define([libmodbus_version_minor], [0]) @@ -16,17 +16,15 @@ m4_define([libmodbus_version_minor], [0])
16 m4_define([libmodbus_version_micro], [1]) 16 m4_define([libmodbus_version_micro], [1])
17 17
18 m4_define([libmodbus_release_status], 18 m4_define([libmodbus_release_status],
19 - [m4_if(m4_eval(libmodbus_version_minor % 2), [1], [snapshot],  
20 - [release])]) 19 + [m4_if(m4_eval(libmodbus_version_minor % 2), [1], [snapshot], [release])])
21 20
22 m4_define([libmodbus_version], 21 m4_define([libmodbus_version],
23 - [libmodbus_version_major.libmodbus_version_minor.libmodbus_version_micro]) 22 + [libmodbus_version_major.libmodbus_version_minor.libmodbus_version_micro])
24 23
25 AC_PREREQ([2.63]) 24 AC_PREREQ([2.63])
26 AC_INIT([libmodbus],[libmodbus_version], 25 AC_INIT([libmodbus],[libmodbus_version],
27 [https://github.com/stephane/libmodbus/issues]) 26 [https://github.com/stephane/libmodbus/issues])
28 -AC_CONFIG_SRCDIR([src/modbus.c])  
29 -AC_CONFIG_HEADERS([config.h]) 27 +AC_CONFIG_HEADERS([config.h tests/unit-test.h])
30 AM_INIT_AUTOMAKE([foreign]) 28 AM_INIT_AUTOMAKE([foreign])
31 # enable nice build output on automake1.11 29 # enable nice build output on automake1.11
32 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) 30 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
tests/unit-test.h renamed to tests/unit-test.h.in
1 /* 1 /*
2 - * Copyright © 2008-2010 Stéphane Raimbault <stephane.raimbault@gmail.com> 2 + * Copyright © 2008-2011 Stéphane Raimbault <stephane.raimbault@gmail.com>
3 * 3 *
4 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,9 @@ @@ -18,7 +18,9 @@
18 #ifndef _UNIT_TEST_H_ 18 #ifndef _UNIT_TEST_H_
19 #define _UNIT_TEST_H_ 19 #define _UNIT_TEST_H_
20 20
21 -#include <config.h> 21 +/* Constants defined by configure.ac */
  22 +#define HAVE_INTTYPES_H @HAVE_INTTYPES_H@
  23 +#define HAVE_STDINT_H @HAVE_STDINT_H@
22 24
23 #ifdef HAVE_INTTYPES_H 25 #ifdef HAVE_INTTYPES_H
24 #include <inttypes.h> 26 #include <inttypes.h>