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]) |
Holger Hans Peter Freyther | 0b4b824 | 2016-09-08 15:09:16 +0200 | [diff] [blame] | 7 | AC_CONFIG_TESTDIR(tests) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 8 | |
| 9 | dnl kernel style compile messages |
| 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 11 | |
| 12 | dnl checks for programs |
| 13 | AC_PROG_MAKE_SET |
| 14 | AC_PROG_CC |
| 15 | AC_PROG_INSTALL |
| 16 | AC_PROG_RANLIB |
| 17 | |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 18 | dnl checks for header files |
| 19 | AC_HEADER_STDC |
| 20 | |
Holger Hans Peter Freyther | 0b4b824 | 2016-09-08 15:09:16 +0200 | [diff] [blame] | 21 | AC_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"]) |
| 25 | if 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 |
| 31 | fi |
| 32 | AC_MSG_CHECKING([whether to enable VTY tests]) |
| 33 | AC_MSG_RESULT([$enable_ext_tests]) |
| 34 | AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 35 | |
| 36 | dnl Checks for typedefs, structures and compiler characteristics |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 37 | AC_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], [])]) |
| 41 | if test x$pcapcfg = "x"; then |
| 42 | AC_MSG_ERROR([pcap-config can not be found]) |
| 43 | fi |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 44 | |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 45 | dnl CentOS 5 and Debian 6.0 do not ship with a pcap-config and we somehow |
| 46 | dnl need to support these versions. Once we drop support for these two distros |
| 47 | dnl the below can be simplified again. |
| 48 | AC_ARG_VAR([PCAP_LIBS], [PCAP library files]) |
| 49 | AC_ARG_VAR([PCAP_CFLAGS], [PCAP C compiler flags]) |
| 50 | |
| 51 | if test "x$ac_cv_env_PCAP_LIBS_set" != "xset"; then |
| 52 | PCAP_LIBS=`$pcapcfg --libs` |
| 53 | fi |
| 54 | |
| 55 | if test "x$ac_cv_env_PCAP_CFLAGS_set" != "xset"; then |
| 56 | PCAP_CFLAGS=`$pcapcfg --cflags` |
| 57 | fi |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 58 | AC_SUBST([PCAP_LIBS]) |
| 59 | AC_SUBST([PCAP_CFLAGS]) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 60 | |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 61 | dnl checks for libraries |
| 62 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) |
Holger Hans Peter Freyther | b7a834b | 2015-09-10 16:45:45 +0200 | [diff] [blame] | 63 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.2) |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 64 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
Holger Hans Peter Freyther | e024869 | 2016-08-05 15:47:08 +0200 | [diff] [blame] | 65 | PKG_CHECK_MODULES(LIBZMQ, libzmq >= 3.2.2) |
Holger Hans Peter Freyther | c266796 | 2016-08-25 23:07:44 +0200 | [diff] [blame^] | 66 | PKG_CHECK_MODULES(LIBGNUTLS, gnutls) |
Holger Hans Peter Freyther | 6d06bb1 | 2012-11-06 23:38:57 +0100 | [diff] [blame] | 67 | |
| 68 | |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 69 | # Coverage build taken from WebKit's configure.in |
| 70 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 71 | AC_ARG_ENABLE(coverage, |
| 72 | AC_HELP_STRING([--enable-coverage], |
| 73 | [enable code coverage support [default=no]]), |
| 74 | [],[enable_coverage="no"]) |
| 75 | AC_MSG_RESULT([$enable_coverage]) |
| 76 | if 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]) |
| 81 | fi |
| 82 | |
Holger Hans Peter Freyther | 530ecc0 | 2011-05-31 15:47:44 +0200 | [diff] [blame] | 83 | AM_CONFIG_HEADER(osmopcapconfig.h) |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 84 | |
| 85 | dnl Generate the output |
| 86 | AC_OUTPUT( |
Holger Hans Peter Freyther | 430366a | 2011-05-31 11:16:40 +0200 | [diff] [blame] | 87 | include/Makefile |
| 88 | include/osmo-pcap/Makefile |
| 89 | src/Makefile |
Daniel Willmann | 5d62ed0 | 2011-07-19 11:58:15 +0200 | [diff] [blame] | 90 | contrib/Makefile |
Holger Hans Peter Freyther | 0b4b824 | 2016-09-08 15:09:16 +0200 | [diff] [blame] | 91 | tests/Makefile |
Holger Hans Peter Freyther | fbea390 | 2011-05-31 10:19:47 +0200 | [diff] [blame] | 92 | Makefile) |