--- configure.orig	2004-04-13 19:20:51.000000000 +0200
+++ configure	2007-11-10 22:48:39.000000000 +0100
@@ -5540,13 +5540,13 @@
 
   ;;
   *-*-freebsd*)
-    echo "$as_me:$LINENO: checking for getopt_long in -lgnugetopt" >&5
-echo $ECHO_N "checking for getopt_long in -lgnugetopt... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking for getopt_long in -lc" >&5
+echo $ECHO_N "checking for getopt_long in -lc... $ECHO_C" >&6
 if test "${ac_cv_lib_gnugetopt_getopt_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgnugetopt  $LIBS"
+#LIBS="-lgnugetopt  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
@@ -5595,7 +5595,7 @@
 echo "$as_me:$LINENO: result: $ac_cv_lib_gnugetopt_getopt_long" >&5
 echo "${ECHO_T}$ac_cv_lib_gnugetopt_getopt_long" >&6
 if test $ac_cv_lib_gnugetopt_getopt_long = yes; then
-  LIBS="$LIBS -lgnugetopt"
+#  LIBS="$LIBS -lgnugetopt"
 else
   { { echo "$as_me:$LINENO: error: FreeBSD gnugetopt library required" >&5
 echo "$as_me: error: FreeBSD gnugetopt library required" >&2;}
@@ -5677,7 +5677,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpci  $LIBS"
+LIBS="-lpci -lz $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
@@ -5726,7 +5726,7 @@
 echo "$as_me:$LINENO: result: $ac_cv_lib_pci_pci_init" >&5
 echo "${ECHO_T}$ac_cv_lib_pci_pci_init" >&6
 if test $ac_cv_lib_pci_pci_init = yes; then
-  LIBS="$LIBS -lpci" pciutils_libname="pci"
+  LIBS="$LIBS -lpci -lz" pciutils_libname="pci"
 else
   echo "$as_me:$LINENO: checking for pci_init in -lpciutils" >&5
 echo $ECHO_N "checking for pci_init in -lpciutils... $ECHO_C" >&6
