blob: 2f4de9d51f57b581cc430be410f9bb7db27ef656 [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
17dnl checks for libraries
Daniel Willmannb0003682011-07-17 17:48:19 +020018PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020019PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
20
21dnl checks for header files
22AC_HEADER_STDC
23
24
25dnl Checks for typedefs, structures and compiler characteristics
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020026AC_ARG_WITH([pcap-config],
27 AC_HELP_STRING([--with-pcap-config=FILE], [Use given pcap-config]),
28 [pcapcfg="$withval" ],
29 [AC_PATH_PROG([pcapcfg], [pcap-config], [])])
30if test x$pcapcfg = "x"; then
31 AC_MSG_ERROR([pcap-config can not be found])
32fi
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020033
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020034PCAP_LIBS=`$pcapcfg --libs`
35PCAP_CFLAGS=`$pcapcfg --cflags`
36AC_SUBST([PCAP_LIBS])
37AC_SUBST([PCAP_CFLAGS])
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020038
39# Coverage build taken from WebKit's configure.in
40AC_MSG_CHECKING([whether to enable code coverage support])
41AC_ARG_ENABLE(coverage,
42 AC_HELP_STRING([--enable-coverage],
43 [enable code coverage support [default=no]]),
44 [],[enable_coverage="no"])
45AC_MSG_RESULT([$enable_coverage])
46if test "$enable_coverage" = "yes"; then
47 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
48 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
49 AC_SUBST([COVERAGE_CFLAGS])
50 AC_SUBST([COVERAGE_LDFLAGS])
51fi
52
Holger Hans Peter Freyther530ecc02011-05-31 15:47:44 +020053AM_CONFIG_HEADER(osmopcapconfig.h)
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020054
55dnl Generate the output
56AC_OUTPUT(
Holger Hans Peter Freyther430366a2011-05-31 11:16:40 +020057 include/Makefile
58 include/osmo-pcap/Makefile
59 src/Makefile
Daniel Willmann5d62ed02011-07-19 11:58:15 +020060 contrib/Makefile
Holger Hans Peter Freytherfbea3902011-05-31 10:19:47 +020061 Makefile)