blob: 755803c213f921019de589965e1e3c14a8c9c022 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001Subject: [PATCH] add libnet enable option
2
3Upstream-Status: Pending
4
5This would avoid a implicit auto-detecting result.
6
7Signed-off-by: Ming Liu <ming.liu@windriver.com>
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 configure.ac | 27 +++++++++++++++++----------
11 1 files changed, 17 insertions(+), 10 deletions(-)
12
13diff --git a/configure.ac b/configure.ac
14index b1e18b4..8e13025 100644
15--- a/configure.ac
16+++ b/configure.ac
17@@ -73,6 +73,9 @@ AC_CONFIG_HEADERS(config.h)
18 dnl ***************************************************************************
19 dnl Arguments
20
21+AC_ARG_ENABLE(libnet,
22+ [ --enable-libnet Enable libnet support.],, enable_libnet="no")
23+
24 AC_ARG_WITH(libnet,
25 [ --with-libnet=path use path to libnet-config script],
26 ,
27@@ -768,22 +771,26 @@ dnl ***************************************************************************
28 dnl libnet headers/libraries
29 dnl ***************************************************************************
30 AC_MSG_CHECKING(for LIBNET)
31-if test "x$with_libnet" = "x"; then
32- LIBNET_CONFIG="`which libnet-config`"
33-else
34- LIBNET_CONFIG="$with_libnet/libnet-config"
35-fi
36+if test "x$enable_libnet" = xyes; then
37+ if test "x$with_libnet" = "x"; then
38+ LIBNET_CONFIG="`which libnet-config`"
39+ else
40+ LIBNET_CONFIG="$with_libnet/libnet-config"
41+ fi
42+
43+ if test -n "$LIBNET_CONFIG" -a -x "$LIBNET_CONFIG"; then
44+ LIBNET_CFLAGS="`$LIBNET_CONFIG --defines`"
45+ LIBNET_LIBS="`$LIBNET_CONFIG --libs`"
46+ AC_MSG_RESULT(yes)
47+ else
48+ AC_MSG_ERROR([Could not find libnet, and libnet support was explicitly enabled.])
49+ fi
50
51-if test -n "$LIBNET_CONFIG" -a -x "$LIBNET_CONFIG"; then
52- LIBNET_CFLAGS="`$LIBNET_CONFIG --defines`"
53- LIBNET_LIBS="`$LIBNET_CONFIG --libs`"
54- AC_MSG_RESULT(yes)
55 else
56 LIBNET_LIBS=
57 AC_MSG_RESULT(no)
58 fi
59
60-
61 if test "x$enable_spoof_source" = "xauto"; then
62 AC_MSG_CHECKING(whether to enable spoof source support)
63 if test "x$LIBNET_LIBS" != "x"; then
64--
651.7.1
66