Add unit test code coverage (gcov) make target
[ric-plt/sdl.git] / configure.ac
1 # SDL version
2 #
3 # 1. If no interface changes has been made, increment SDL_MICRO.
4 # 2. Else, if new interfaces have been added but existing interfaces have not
5 #    been changed, increment SDL_MINOR and zero SDL_MICRO. (Backward compatible
6 #    interface change.)
7 # 3. Else, increment SDL_MAJOR and zero both SDL_MINOR and SDL_MICRO. (Backward
8 #    incompatible interface change.)
9 #
10 # Change the numbers just before release.
11
12 m4_define([SDL_MAJOR], [1])
13 m4_define([SDL_MINOR], [1])
14 m4_define([SDL_MICRO], [0])
15
16 # SDL ABI version with libtool
17 #
18 # 1. Always increase the revision value.
19 # 2. Increase the current value whenever an interface has been added, removed
20 #    or changed.
21 # 3. Increase the age value only if the changes made to the ABI are backward
22 #    compatible.
23 #
24 # Never zero or decrease any of the ABI version number values.
25 #
26 # See https://autotools.io/libtool/version.html
27 #
28 # Change the numbers just before release.
29
30 m4_define([SDL_CURRENT], [2])
31 m4_define([SDL_REVISION], [5])
32 m4_define([SDL_AGE], [1])
33
34 AC_INIT([shareddatalayer], [SDL_MAJOR.SDL_MINOR.SDL_MICRO], [], [], [https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/sdl])
35 AC_CONFIG_HEADERS([include/config.h])
36 AC_CONFIG_AUX_DIR([build-aux])
37 AC_CONFIG_FILES([Makefile])
38 AC_CONFIG_FILES([Doxyfile])
39 AC_CONFIG_FILES([rpm/sdl.spec])
40 AC_CONFIG_FILES([debian/changelog])
41 AC_CONFIG_FILES([run-tests.sh], [chmod +x run-tests.sh])
42 AC_CONFIG_MACRO_DIR([m4])
43 AM_INIT_AUTOMAKE([subdir-objects foreign 1.13 tar-pax -Wall -Werror])
44 AM_PROG_AR
45 LT_INIT
46 AM_SILENT_RULES([yes])
47 AC_PROG_CXX
48 AC_LANG([C++])
49 AC_PROG_MKDIR_P
50 AM_PROG_LIBTOOL
51 AC_CONFIG_MACRO_DIR([m4])
52 AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
53 AX_BOOST_BASE([1.53], [], [AC_MSG_ERROR(Unable to detect suitable boost library)])
54 AX_BOOST_PROGRAM_OPTIONS
55 AX_BOOST_SYSTEM
56 AX_BOOST_FILESYSTEM
57 PKG_PROG_PKG_CONFIG
58
59 AC_DEFINE([HAVE_SYSTEMLOGGER], [0], [Have systemlogger])
60 AM_CONDITIONAL([SYSTEMLOGGER], [test "xyes" = "xno"])
61
62 SDL_CONF_DIR=$sysconfdir/$PACKAGE_NAME.d
63 AC_SUBST(SDL_CONF_DIR)
64
65 AC_DEFINE(HAVE_REDIS, [1], [Have redis])
66 AM_CONDITIONAL([REDIS], [test xtrue])
67
68 PKG_CHECK_MODULES([HIREDIS], [hiredis])
69 AC_DEFINE(HAVE_HIREDIS, [1], [Have hiredis])
70 AM_CONDITIONAL([HIREDIS], [test xtrue])
71 # Redis cluster configuration is not supported in RIC currently (implementation is not compatible with current hiredis-vip version)
72 AC_DEFINE(HAVE_HIREDIS_VIP, [0], [Have hiredis-vip])
73 AM_CONDITIONAL([HIREDIS_VIP], [test "xyes" = "xno"])
74
75 AC_ARG_WITH([gcov-report-dir],
76     AS_HELP_STRING([--with-gcov-report-dir=DIR],
77         [Directory for GCOV report files]),
78     [],
79     [with_gcov_report_dir=no])
80 AC_MSG_CHECKING([gcov])
81 if test "x$with_gcov_report_dir" = "xno"; then
82     AC_MSG_RESULT([no])
83     GCOV_REPORT_DIR="gcov_report"
84 else
85     AC_MSG_RESULT([yes])
86     AC_MSG_NOTICE([gcov report directory: $with_gcov_report_dir])
87     GCOV_REPORT_DIR="$with_gcov_report_dir"
88 fi
89 AC_SUBST(GCOV_REPORT_DIR)
90 AM_CONDITIONAL([ENABLE_GCOV],[test "x$with_gcov_report_dir" != "xno"])
91
92 DX_DOT_FEATURE(ON)
93 DX_INIT_DOXYGEN([shareddatalayer], [Doxyfile], [doxygen-doc])
94 SDL_LT_VERSION=m4_format("%d:%d:%d", SDL_CURRENT, SDL_REVISION, SDL_AGE)
95 AC_SUBST(SDL_LT_VERSION)
96 AC_OUTPUT