Description: Warn about unknown configure options instead of bailing out
 Avoids "Invalid option: --build=x86_64-linux-gnu" build error.
 .
 Additionally make it understand some configure options passed by
 debhelper by default, namely --prefix, --libdir and --includedir.
Author: Axel Beckert <abe@debian.org>
Forwarded: no
Bug: https://github.com/aabc/ipt-netflow/issues/134

--- a/configure
+++ b/configure
@@ -325,11 +325,14 @@
   esac
 
   case "$ac_option" in
+    --prefix=*) prefix="$ac_optarg" ;;
     --ipt-bin=*) IPTBIN="$ac_optarg" ;;
     --ipt-lib=*) IPTLIB="$ac_optarg" ;;
+    --libdir=*) IPTLIB="$ac_optarg/xtables" ;;
     --ipt-src=*) IPTSRC="$ac_optarg" ;;
     --ipt-ver=*) IPTVER="$ac_optarg" ;;
     --ipt-inc=*) IPTINC="-I$ac_optarg" ;;
+    --includedir=*) IPTINC="-I$ac_optarg" ;;
     --kver=*)  KVERSION="$ac_optarg" ;;
     --kdir=*)      KDIR="$ac_optarg" ;;
     --enable-nat*)   KOPTS="$KOPTS -DENABLE_NAT" ;;
@@ -352,11 +355,14 @@
     --make) echo called from make; CARGS=`echo $CARGS | sed s/--make//g` ;;
     -Werror) KOPTS="$KOPTS -Werror" ;;
     --help|-h) show_help ;;
-    -*) echo Invalid option: $ac_option; exit 1 ;;
+    -*) echo WARNING: Ignoring unknown option: $ac_option ;;
 #    *) ni="$ni $ac_option" ;;
   esac
 done
 
+eval "IPTLIB=$IPTLIB"
+eval "IPTINC=$IPTINC"
+
 if [ "$ENABLE_PROMISC" = 1 ]; then KOPTS="$KOPTS -DENABLE_PROMISC"; fi
 if [ "$PROMISC_MPLS" = 1 ]; then
   KOPTS="$KOPTS -DPROMISC_MPLS"
