blob: 4c0a12ff071213b0fbf1f460d1e1a0332c624b1b [file] [log] [blame]
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +02001dnl Process this file with autoconf to produce a configure script
2AC_INIT([osmo-pcap],
3 m4_esyscmd([./git-version-gen .tarball-version]),
4 [openbsc-devel@lists.openbsc.org])
5
6AM_INIT_AUTOMAKE([dist-bzip2])
Holger Hans Peter Freyther0b4b8242016-09-08 15:09:16 +02007AC_CONFIG_TESTDIR(tests)
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +02008
9dnl kernel style compile messages
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11
12dnl checks for programs
13AC_PROG_MAKE_SET
14AC_PROG_CC
15AC_PROG_INSTALL
16AC_PROG_RANLIB
17
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020018dnl checks for header files
19AC_HEADER_STDC
20
Holger Hans Peter Freyther0b4b8242016-09-08 15:09:16 +020021AC_ARG_ENABLE([external_tests],
22 AC_HELP_STRING([--enable-external-tests],
23 [Include the VTY tests in make check [default=no]]),
24 [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
25if test "x$enable_ext_tests" = "xyes" ; then
26 AM_PATH_PYTHON
27 AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
28 if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
29 AC_MSG_ERROR([Please install osmocom-python to run the VTY tests.])
30 fi
31fi
32AC_MSG_CHECKING([whether to enable VTY tests])
33AC_MSG_RESULT([$enable_ext_tests])
34AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020035
36dnl Checks for typedefs, structures and compiler characteristics
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020037AC_ARG_WITH([pcap-config],
38 AC_HELP_STRING([--with-pcap-config=FILE], [Use given pcap-config]),
39 [pcapcfg="$withval" ],
40 [AC_PATH_PROG([pcapcfg], [pcap-config], [])])
41if test x$pcapcfg = "x"; then
42 AC_MSG_ERROR([pcap-config can not be found])
43fi
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020044
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010045dnl CentOS 5 and Debian 6.0 do not ship with a pcap-config and we somehow
46dnl need to support these versions. Once we drop support for these two distros
47dnl the below can be simplified again.
48AC_ARG_VAR([PCAP_LIBS], [PCAP library files])
49AC_ARG_VAR([PCAP_CFLAGS], [PCAP C compiler flags])
50
51if test "x$ac_cv_env_PCAP_LIBS_set" != "xset"; then
52 PCAP_LIBS=`$pcapcfg --libs`
53fi
54
55if test "x$ac_cv_env_PCAP_CFLAGS_set" != "xset"; then
56 PCAP_CFLAGS=`$pcapcfg --cflags`
57fi
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020058AC_SUBST([PCAP_LIBS])
59AC_SUBST([PCAP_CFLAGS])
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020060
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010061dnl checks for libraries
62PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
Holger Hans Peter Freytherb7a834b2015-09-10 16:45:45 +020063PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.2)
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010064PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
Holger Hans Peter Freythere0248692016-08-05 15:47:08 +020065PKG_CHECK_MODULES(LIBZMQ, libzmq >= 3.2.2)
Holger Hans Peter Freytherc2667962016-08-25 23:07:44 +020066PKG_CHECK_MODULES(LIBGNUTLS, gnutls)
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010067
68
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020069# Coverage build taken from WebKit's configure.in
70AC_MSG_CHECKING([whether to enable code coverage support])
71AC_ARG_ENABLE(coverage,
72 AC_HELP_STRING([--enable-coverage],
73 [enable code coverage support [default=no]]),
74 [],[enable_coverage="no"])
75AC_MSG_RESULT([$enable_coverage])
76if test "$enable_coverage" = "yes"; then
77 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
78 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
79 AC_SUBST([COVERAGE_CFLAGS])
80 AC_SUBST([COVERAGE_LDFLAGS])
81fi
82
Holger Hans Peter Freyther530ecc02011-05-31 15:47:44 +020083AM_CONFIG_HEADER(osmopcapconfig.h)
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020084
85dnl Generate the output
86AC_OUTPUT(
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020087 include/Makefile
88 include/osmo-pcap/Makefile
89 src/Makefile
Daniel Willmann5d62ed02011-07-19 11:58:15 +020090 contrib/Makefile
Holger Hans Peter Freyther0b4b8242016-09-08 15:09:16 +020091 tests/Makefile
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020092 Makefile)