--- configure.in	2003-10-15 01:40:00.000000000 +0200
+++ configure.in.oden	2004-06-25 19:35:24.225317360 +0200
@@ -127,11 +127,12 @@
      ;;
   *)
      AC_MSG_RESULT($withval)
-     if test -f $withval/include/libnet.h -a -f $withval/lib/libnet.a -a -f $withval/libnet-config ; then
+     if test -f $withval/include/libnet.h -a -f $withval/lib/libnet.so -a -f /usr/bin/libnet-config ; then
         owd=`pwd`
         if cd $withval; then withval=`pwd`; cd $owd; fi
-	LNET_CFLAGS="-I$withval/include `$withval/libnet-config --defines`"
-	LNETLIB="-L$withval/lib -lnet"
+	LNET_CFLAGS="`/usr/bin/libnet-config --cflags` `/usr/bin/libnet-config --defines`"
+	LNETLIB="`/usr/bin/libnet-config --libs`"
+	LDFLAGS="$LDFLAGS `/usr/bin/libnet-config --libs`"
      elif test -f $withval/include/libnet.h -a -f $withval/src/libnet.a; then
         owd=`pwd`
         if cd $withval; then withval=`pwd`; cd $owd; fi
@@ -146,12 +147,14 @@
 [ if test "x"$LIBNET_VER = "x"-1 ; then
 	AC_MSG_RESULT(skipping libnet)
   else
-	if test -f ${prefix}/include/libnet.h -a ${exec_prefix}/lib/libnet.a ; then
-	     LNET_CFLAGS="-I${prefix}/include `${exec_prefix}/bin/libnet-config --defines 2>/dev/null`"
-	     LNETLIB="-L${exec_prefix}/lib -lnet"
+	if test -f ${prefix}/include/libnet.h -a ${exec_prefix}/lib/libnet.so ; then
+	     LNET_CFLAGS="`/usr/bin/libnet-config --cflags` `/usr/bin/libnet-config --defines 2>/dev/null`"
+	     LNETLIB="`/usr/bin/libnet-config --libs`"
+	     LDFLAGS="$LDFLAGS `/usr/bin/libnet-config --libs`"
 	else
-	     LNET_CFLAGS="`libnet-config --defines 2>/dev/null`"
-	     LNETLIB="-lnet"
+	     LNET_CFLAGS="`/usr/bin/libnet-config --cflags` `/usr/bin/libnet-config --defines 2>/dev/null`"
+	     LNETLIB="`/usr/bin/libnet-config --libs`"
+	     LDFLAGS="$LDFLAGS `/usr/bin/libnet-config --libs`"
 	fi
   fi ]
 )
