diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-11-06 23:38:57 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-11-06 23:38:57 +0100 |
commit | 6d06bb15009e82469ef125918614cb9cb47cc09e (patch) | |
tree | 1ed0cafbb8849ed59dfde7e8b06c1a465622aec7 /configure.ac | |
parent | fc3a427fb112223b75ab85945cfeab95f0ce4e05 (diff) |
build: Allow to set the PCAP_CFLAGS and PCAP_LIBS externally
pcap-config might not be available, e.g. on Debian6.0 and CentOS5.x. Allow
the code to be built anyway.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 2f4de9d..d0738f8 100644 --- a/configure.ac +++ b/configure.ac @@ -14,10 +14,6 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB -dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) - dnl checks for header files AC_HEADER_STDC @@ -31,11 +27,27 @@ if test x$pcapcfg = "x"; then AC_MSG_ERROR([pcap-config can not be found]) fi -PCAP_LIBS=`$pcapcfg --libs` -PCAP_CFLAGS=`$pcapcfg --cflags` +dnl CentOS 5 and Debian 6.0 do not ship with a pcap-config and we somehow +dnl need to support these versions. Once we drop support for these two distros +dnl the below can be simplified again. +AC_ARG_VAR([PCAP_LIBS], [PCAP library files]) +AC_ARG_VAR([PCAP_CFLAGS], [PCAP C compiler flags]) + +if test "x$ac_cv_env_PCAP_LIBS_set" != "xset"; then + PCAP_LIBS=`$pcapcfg --libs` +fi + +if test "x$ac_cv_env_PCAP_CFLAGS_set" != "xset"; then + PCAP_CFLAGS=`$pcapcfg --cflags` +fi AC_SUBST([PCAP_LIBS]) AC_SUBST([PCAP_CFLAGS]) +dnl checks for libraries +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) + + # Coverage build taken from WebKit's configure.in AC_MSG_CHECKING([whether to enable code coverage support]) AC_ARG_ENABLE(coverage, |