Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script |
| 2 | AC_INIT([osmo-pcap], |
| 3 | m4_esyscmd([./git-version-gen .tarball-version]), |
| 4 | [openbsc-devel@lists.openbsc.org]) |
| 5 | |
| 6 | AM_INIT_AUTOMAKE([dist-bzip2]) |
| 7 | |
| 8 | dnl kernel style compile messages |
| 9 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 10 | |
| 11 | dnl checks for programs |
| 12 | AC_PROG_MAKE_SET |
| 13 | AC_PROG_CC |
| 14 | AC_PROG_INSTALL |
| 15 | AC_PROG_RANLIB |
| 16 | |
| 17 | dnl checks for libraries |
Daniel Willmann | b000368 | 2011-07-17 17:48:19 +0200 | [diff] [blame^] | 18 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 19 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
| 20 | |
| 21 | dnl checks for header files |
| 22 | AC_HEADER_STDC |
| 23 | |
| 24 | |
| 25 | dnl Checks for typedefs, structures and compiler characteristics |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 26 | AC_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], [])]) |
| 30 | if test x$pcapcfg = "x"; then |
| 31 | AC_MSG_ERROR([pcap-config can not be found]) |
| 32 | fi |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 33 | |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 34 | PCAP_LIBS=`$pcapcfg --libs` |
| 35 | PCAP_CFLAGS=`$pcapcfg --cflags` |
| 36 | AC_SUBST([PCAP_LIBS]) |
| 37 | AC_SUBST([PCAP_CFLAGS]) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 38 | |
| 39 | # Coverage build taken from WebKit's configure.in |
| 40 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 41 | AC_ARG_ENABLE(coverage, |
| 42 | AC_HELP_STRING([--enable-coverage], |
| 43 | [enable code coverage support [default=no]]), |
| 44 | [],[enable_coverage="no"]) |
| 45 | AC_MSG_RESULT([$enable_coverage]) |
| 46 | if 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]) |
| 51 | fi |
| 52 | |
Holger Hans Peter Freyther | 530ecc0 | 2011-05-31 15:47:44 +0200 | [diff] [blame] | 53 | AM_CONFIG_HEADER(osmopcapconfig.h) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 54 | |
| 55 | dnl Generate the output |
| 56 | AC_OUTPUT( |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 57 | include/Makefile |
| 58 | include/osmo-pcap/Makefile |
| 59 | src/Makefile |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 60 | Makefile) |