blob: 553f4a5171ed163f51e567925839be16dc6b618b [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
Brad Bishop316dfdd2018-06-25 12:45:53 -040013Index: syslog-ng-3.8.1/configure.ac
14===================================================================
15--- syslog-ng-3.8.1.orig/configure.ac
16+++ syslog-ng-3.8.1/configure.ac
17@@ -104,6 +104,9 @@ AC_CONFIG_HEADERS(config.h)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050018 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 ,
Brad Bishop316dfdd2018-06-25 12:45:53 -040027@@ -893,22 +896,26 @@ dnl ************************************
Patrick Williamsb48b7b42016-08-17 15:04:38 -050028 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