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 | |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 17 | dnl checks for header files |
| 18 | AC_HEADER_STDC |
| 19 | |
| 20 | |
| 21 | dnl Checks for typedefs, structures and compiler characteristics |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 22 | AC_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], [])]) |
| 26 | if test x$pcapcfg = "x"; then |
| 27 | AC_MSG_ERROR([pcap-config can not be found]) |
| 28 | fi |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 29 | |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 30 | dnl CentOS 5 and Debian 6.0 do not ship with a pcap-config and we somehow |
| 31 | dnl need to support these versions. Once we drop support for these two distros |
| 32 | dnl the below can be simplified again. |
| 33 | AC_ARG_VAR([PCAP_LIBS], [PCAP library files]) |
| 34 | AC_ARG_VAR([PCAP_CFLAGS], [PCAP C compiler flags]) |
| 35 | |
| 36 | if test "x$ac_cv_env_PCAP_LIBS_set" != "xset"; then |
| 37 | PCAP_LIBS=`$pcapcfg --libs` |
| 38 | fi |
| 39 | |
| 40 | if test "x$ac_cv_env_PCAP_CFLAGS_set" != "xset"; then |
| 41 | PCAP_CFLAGS=`$pcapcfg --cflags` |
| 42 | fi |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 43 | AC_SUBST([PCAP_LIBS]) |
| 44 | AC_SUBST([PCAP_CFLAGS]) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 45 | |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 46 | dnl checks for libraries |
| 47 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) |
Holger Hans Peter Freyther | b7a834b | 2015-09-10 16:45:45 +0200 | [diff] [blame] | 48 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.2) |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 49 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
Holger Hans Peter Freyther | e024869 | 2016-08-05 15:47:08 +0200 | [diff] [blame] | 50 | PKG_CHECK_MODULES(LIBZMQ, libzmq >= 3.2.2) |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 51 | |
| 52 | |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 53 | # Coverage build taken from WebKit's configure.in |
| 54 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 55 | AC_ARG_ENABLE(coverage, |
| 56 | AC_HELP_STRING([--enable-coverage], |
| 57 | [enable code coverage support [default=no]]), |
| 58 | [],[enable_coverage="no"]) |
| 59 | AC_MSG_RESULT([$enable_coverage]) |
| 60 | if 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]) |
| 65 | fi |
| 66 | |
Holger Hans Peter Freyther | 530ecc0 | 2011-05-31 15:47:44 +0200 | [diff] [blame] | 67 | AM_CONFIG_HEADER(osmopcapconfig.h) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 68 | |
| 69 | dnl Generate the output |
| 70 | AC_OUTPUT( |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 71 | include/Makefile |
| 72 | include/osmo-pcap/Makefile |
| 73 | src/Makefile |
Daniel Willmann | 5d62ed0 | 2011-07-19 11:58:15 +0200 | [diff] [blame] | 74 | contrib/Makefile |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 75 | Makefile) |