blob: 35b4ee0fedab30df2ae3575accd7b7680614a1e7 [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])
7
8dnl kernel style compile messages
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
11dnl checks for programs
12AC_PROG_MAKE_SET
13AC_PROG_CC
14AC_PROG_INSTALL
15AC_PROG_RANLIB
16
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020017dnl checks for header files
18AC_HEADER_STDC
19
20
21dnl Checks for typedefs, structures and compiler characteristics
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020022AC_ARG_WITH([pcap-config],
23 AC_HELP_STRING([--with-pcap-config=FILE], [Use given pcap-config]),
24 [pcapcfg="$withval" ],
25 [AC_PATH_PROG([pcapcfg], [pcap-config], [])])
26if test x$pcapcfg = "x"; then
27 AC_MSG_ERROR([pcap-config can not be found])
28fi
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020029
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010030dnl CentOS 5 and Debian 6.0 do not ship with a pcap-config and we somehow
31dnl need to support these versions. Once we drop support for these two distros
32dnl the below can be simplified again.
33AC_ARG_VAR([PCAP_LIBS], [PCAP library files])
34AC_ARG_VAR([PCAP_CFLAGS], [PCAP C compiler flags])
35
36if test "x$ac_cv_env_PCAP_LIBS_set" != "xset"; then
37 PCAP_LIBS=`$pcapcfg --libs`
38fi
39
40if test "x$ac_cv_env_PCAP_CFLAGS_set" != "xset"; then
41 PCAP_CFLAGS=`$pcapcfg --cflags`
42fi
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020043AC_SUBST([PCAP_LIBS])
44AC_SUBST([PCAP_CFLAGS])
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020045
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010046dnl checks for libraries
47PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
Holger Hans Peter Freytherb7a834b2015-09-10 16:45:45 +020048PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.2)
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010049PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
Holger Hans Peter Freythere0248692016-08-05 15:47:08 +020050PKG_CHECK_MODULES(LIBZMQ, libzmq >= 3.2.2)
Holger Hans Peter Freyther6d06bb12012-11-06 23:38:57 +010051
52
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020053# Coverage build taken from WebKit's configure.in
54AC_MSG_CHECKING([whether to enable code coverage support])
55AC_ARG_ENABLE(coverage,
56 AC_HELP_STRING([--enable-coverage],
57 [enable code coverage support [default=no]]),
58 [],[enable_coverage="no"])
59AC_MSG_RESULT([$enable_coverage])
60if test "$enable_coverage" = "yes"; then
61 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
62 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
63 AC_SUBST([COVERAGE_CFLAGS])
64 AC_SUBST([COVERAGE_LDFLAGS])
65fi
66
Holger Hans Peter Freyther530ecc02011-05-31 15:47:44 +020067AM_CONFIG_HEADER(osmopcapconfig.h)
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020068
69dnl Generate the output
70AC_OUTPUT(
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020071 include/Makefile
72 include/osmo-pcap/Makefile
73 src/Makefile
Daniel Willmann5d62ed02011-07-19 11:58:15 +020074 contrib/Makefile
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020075 Makefile)