Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | Subject: [PATCH] add libnet enable option |
| 2 | |
| 3 | Upstream-Status: Pending |
| 4 | |
| 5 | This would avoid a implicit auto-detecting result. |
| 6 | |
| 7 | Signed-off-by: Ming Liu <ming.liu@windriver.com> |
| 8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
| 9 | --- |
| 10 | configure.ac | 27 +++++++++++++++++---------- |
| 11 | 1 files changed, 17 insertions(+), 10 deletions(-) |
| 12 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 13 | Index: 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 Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 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 | , |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 27 | @@ -893,22 +896,26 @@ dnl ************************************ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 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 |