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> |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 9 | |
Brad Bishop | 2f97392 | 2019-11-11 07:58:48 -0500 | [diff] [blame] | 10 | Update for 3.24.1. |
| 11 | Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com> |
| 12 | --- |
| 13 | configure.ac | 28 ++++++++++++++++------------ |
| 14 | 1 file changed, 16 insertions(+), 12 deletions(-) |
| 15 | |
| 16 | diff --git a/configure.ac b/configure.ac |
| 17 | index 00eb566..e7d5ac1 100644 |
| 18 | --- a/configure.ac |
| 19 | +++ b/configure.ac |
| 20 | @@ -143,6 +143,9 @@ AC_CONFIG_HEADERS(config.h) |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 21 | dnl *************************************************************************** |
| 22 | dnl Arguments |
| 23 | |
Brad Bishop | 2f97392 | 2019-11-11 07:58:48 -0500 | [diff] [blame] | 24 | +AC_ARG_ENABLE(libnet, |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 25 | + [ --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 Bishop | 2f97392 | 2019-11-11 07:58:48 -0500 | [diff] [blame] | 30 | @@ -1047,19 +1050,20 @@ dnl *************************************************************************** |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 31 | 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 Bishop | 2f97392 | 2019-11-11 07:58:48 -0500 | [diff] [blame] | 45 | |
| 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 Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 53 | + 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 Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 61 | else |
| 62 | LIBNET_LIBS= |
Brad Bishop | 2f97392 | 2019-11-11 07:58:48 -0500 | [diff] [blame] | 63 | -- |
| 64 | 2.7.4 |
| 65 | |