summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Richardson <mcr@sandelman.ca>2015-02-15 12:58:20 -0500
committerMichael Richardson <mcr@sandelman.ca>2015-02-15 12:58:20 -0500
commit697bc41cd26cfd8270106cd980a89113ad9e2dc9 (patch)
tree73fc052d02ac5418192e5b4b1440f865417d2dc6
parente277377874a1b456c24a94251955f249e3ada941 (diff)
parentda145a521b6e02f002f0afe056582aea7de9e58f (diff)
downloadlibpcap-697bc41cd26cfd8270106cd980a89113ad9e2dc9.tar.gz
Merge branch 'add_with-libnl_switch' of https://github.com/mcr/libpcap into mcr-add_with-libnl_switch
-rw-r--r--Makefile.in5
-rwxr-xr-xconfigure17
-rw-r--r--configure.in30
3 files changed, 34 insertions, 18 deletions
diff --git a/Makefile.in b/Makefile.in
index b1866e58..755ada0a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53,8 +53,9 @@ DEFS = @DEFS@ @V_DEFS@
ADDLOBJS = @ADDLOBJS@
ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
LIBS = @LIBS@
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
+CROSSFLAGS=
+CFLAGS = @CFLAGS@ ${CROSSFLAGS}
+LDFLAGS = @LDFLAGS@ ${CROSSFLAGS}
DYEXT = @DYEXT@
V_RPATH_OPT = @V_RPATH_OPT@
DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
diff --git a/configure b/configure
index 1a800f57..1a391448 100755
--- a/configure
+++ b/configure
@@ -5515,6 +5515,13 @@ fi
if test x$with_libnl != xno ; then
have_any_nl="no"
+ incdir=-I/usr/include/libnl3
+ libnldir=
+ if test x$withval != x ; then
+ libnldir=-L${withval}/lib/.libs
+ incdir=-I${withval}/include
+ fi
+
#
# Try libnl 3.x first.
#
@@ -5524,7 +5531,7 @@ if ${ac_cv_lib_nl_3_nl_socket_alloc+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnl-3 $LIBS"
+LIBS="-lnl-3 ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -5559,7 +5566,7 @@ if test "x$ac_cv_lib_nl_3_nl_socket_alloc" = xyes; then :
#
# Yes, we have libnl 3.x.
#
- LIBS="-lnl-genl-3 -lnl-3 $LIBS"
+ LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
$as_echo "#define HAVE_LIBNL 1" >>confdefs.h
@@ -5572,7 +5579,7 @@ $as_echo "#define HAVE_LIBNL_NLE 1" >>confdefs.h
$as_echo "#define HAVE_LIBNL_SOCKETS 1" >>confdefs.h
- V_INCLS="$V_INCLS -I/usr/include/libnl3"
+ V_INCLS="$V_INCLS ${incdir}"
have_any_nl="yes"
fi
@@ -5623,7 +5630,7 @@ if test "x$ac_cv_lib_nl_nl_socket_alloc" = xyes; then :
#
# Yes, we have libnl 2.x.
#
- LIBS="-lnl-genl -lnl $LIBS"
+ LIBS="${libnldir} -lnl-genl -lnl $LIBS"
$as_echo "#define HAVE_LIBNL 1" >>confdefs.h
@@ -5687,7 +5694,7 @@ if test "x$ac_cv_lib_nl_nl_handle_alloc" = xyes; then :
#
# Yes.
#
- LIBS="-lnl $LIBS"
+ LIBS="${libnldir} -lnl $LIBS"
$as_echo "#define HAVE_LIBNL 1" >>confdefs.h
diff --git a/configure.in b/configure.in
index 55cfadae..7ddd7d31 100644
--- a/configure.in
+++ b/configure.in
@@ -360,11 +360,11 @@ dlpi)
#
# Checks to see if Solaris has the public libdlpi(3LIB) library.
# Note: The existence of /usr/include/libdlpi.h does not mean it is the
- # public libdlpi(3LIB) version. Before libdlpi was made public, a
- # private version also existed, which did not have the same APIs.
+ # public libdlpi(3LIB) version. Before libdlpi was made public, a
+ # private version also existed, which did not have the same APIs.
# Due to a gcc bug, the default search path for 32-bit libraries does
# not include /lib, we add it explicitly here.
- # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
+ # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
# Also, due to the bug above applications that link to libpcap with
# libdlpi will have to add "-L/lib" option to "configure".
#
@@ -446,6 +446,13 @@ linux)
if test x$with_libnl != xno ; then
have_any_nl="no"
+ incdir=-I/usr/include/libnl3
+ libnldir=
+ if test x$withval != x ; then
+ libnldir=-L${withval}/lib/.libs
+ incdir=-I${withval}/include
+ fi
+
#
# Try libnl 3.x first.
#
@@ -454,13 +461,14 @@ linux)
#
# Yes, we have libnl 3.x.
#
- LIBS="-lnl-genl-3 -lnl-3 $LIBS"
+ LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
+ V_INCLS="$V_INCLS ${incdir}"
have_any_nl="yes"
- ])
+ ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
if test x$have_any_nl = xno ; then
#
@@ -471,7 +479,7 @@ linux)
#
# Yes, we have libnl 2.x.
#
- LIBS="-lnl-genl -lnl $LIBS"
+ LIBS="${libnldir} -lnl-genl -lnl $LIBS"
AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
@@ -489,7 +497,7 @@ linux)
#
# Yes.
#
- LIBS="-lnl $LIBS"
+ LIBS="${libnldir} -lnl $LIBS"
AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
have_any_nl="yes"
])
@@ -527,7 +535,7 @@ bpf)
#include <net/if.h>
#include <net/bpf.h>],
[return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
- [
+ [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
[define if the system supports zerocopy BPF])
@@ -775,7 +783,7 @@ if test "$want_dag" != no; then
if test -z "$dag_lib_dir"; then
dag_lib_dir="$dag_root/lib"
fi
-
+
if test -z "$dag_tools_dir"; then
dag_tools_dir="$dag_root/tools"
fi
@@ -810,7 +818,7 @@ if test $ac_cv_lbl_dag_api = yes; then
AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
LIBS="$LIBS -ldag"
LDFLAGS="$LDFLAGS -L$dag_lib_dir"
-
+
AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
if test "$ac_dag_have_vdag" = 1; then
AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
@@ -1639,7 +1647,7 @@ if test "x$enable_dbus" != "xno"; then
#
AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on OS X])
esac
- else
+ else
case "$host_os" in
darwin*)