blob: 4ad0afa954f10fca9bbe3e055b8e13027820731a [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>
Patrick Williamsb48b7b42016-08-17 15:04:38 -05009
Brad Bishop2f973922019-11-11 07:58:48 -050010Update for 3.24.1.
11Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
12---
13 configure.ac | 28 ++++++++++++++++------------
14 1 file changed, 16 insertions(+), 12 deletions(-)
15
16diff --git a/configure.ac b/configure.ac
17index 00eb566..e7d5ac1 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -143,6 +143,9 @@ AC_CONFIG_HEADERS(config.h)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050021 dnl ***************************************************************************
22 dnl Arguments
23
Brad Bishop2f973922019-11-11 07:58:48 -050024+AC_ARG_ENABLE(libnet,
Patrick Williamsb48b7b42016-08-17 15:04:38 -050025+ [ --enable-libnet Enable libnet support.],, enable_libnet="no")
26+
27 AC_ARG_WITH(libnet,
28 [ --with-libnet=path use path to libnet-config script],
29 ,
Brad Bishop2f973922019-11-11 07:58:48 -050030@@ -1047,19 +1050,20 @@ dnl ***************************************************************************
Patrick Williamsb48b7b42016-08-17 15:04:38 -050031 dnl libnet headers/libraries
32 dnl ***************************************************************************
33 AC_MSG_CHECKING(for LIBNET)
34-if test "x$with_libnet" = "x"; then
35- LIBNET_CONFIG="`which libnet-config`"
36-else
37- LIBNET_CONFIG="$with_libnet/libnet-config"
38-fi
39+if test "x$enable_libnet" = xyes; then
40+ if test "x$with_libnet" = "x"; then
41+ LIBNET_CONFIG="`which libnet-config`"
42+ else
43+ LIBNET_CONFIG="$with_libnet/libnet-config"
44+ fi
Brad Bishop2f973922019-11-11 07:58:48 -050045
46-if test -n "$LIBNET_CONFIG" -a -x "$LIBNET_CONFIG"; then
47- LIBNET_CFLAGS="`$LIBNET_CONFIG --defines`"
48- LIBNET_LIBS="`$LIBNET_CONFIG --libs`"
49- AC_MSG_RESULT(yes)
50-dnl libnet-config does not provide the _DEFAULT_SOURCE define, that can cause warning during build
51-dnl as upstream libnet-config does uses _DEFAULT_SOURCE this is just a fix till
52- LIBNET_CFLAGS="$LIBNET_CFLAGS -D_DEFAULT_SOURCE"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050053+ if test -n "$LIBNET_CONFIG" -a -x "$LIBNET_CONFIG"; then
54+ LIBNET_CFLAGS="`$LIBNET_CONFIG --defines`"
55+ LIBNET_LIBS="`$LIBNET_CONFIG --libs`"
56+ AC_MSG_RESULT(yes)
57+ else
58+ AC_MSG_ERROR([Could not find libnet, and libnet support was explicitly enabled.])
59+ fi
60
Patrick Williamsb48b7b42016-08-17 15:04:38 -050061 else
62 LIBNET_LIBS=
Brad Bishop2f973922019-11-11 07:58:48 -050063--
642.7.4
65