--- configure.orig	2010-04-21 15:49:32.000000000 +0200
+++ configure	2010-04-25 18:02:53.185508083 +0200
@@ -1060,7 +1060,7 @@
 psdir='${docdir}'
 libdir='${exec_prefix}/lib'
 localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
+mandir='${prefix}/man'
 
 ac_prev=
 ac_dashdash=
@@ -7909,20 +7909,6 @@
 
   fi
 
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if building on FreeBSD" >&5
-$as_echo_n "checking if building on FreeBSD... " >&6; }
-
-if test `uname -s` = "FreeBSD" ; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	CPPFLAGS="$CFLAGS -I/usr/local/include"
-	LDFLAGS="$LDFLAGS -L/usr/local/lib"
-else
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if building on NetBSD" >&5
 $as_echo_n "checking if building on NetBSD... " >&6; }
 
@@ -14858,7 +14844,7 @@
 $as_echo_n "checking if more special flags are required for pthreads... " >&6; }
         flag=no
         case "${host_cpu}-${host_os}" in
-                *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+                *-aix* | *-darwin*) flag="-D_THREAD_SAFE";;
                 *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
         esac
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5
@@ -15461,7 +15447,7 @@
 
 if test "$enable_libical" = "yes"; then
 	OLD_CFLAGS="$CFLAGS"
-	LIBS="$LIBS $ICAL_LIBS -lpthread -lical"
+	LIBS="$LIBS $ICAL_LIBS -pthread -lical"
 	CFLAGS="$CFLAGS $ICAL_CFLAGS"
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libical is installed" >&5
 $as_echo_n "checking whether libical is installed... " >&6; }
@@ -15883,7 +15869,7 @@
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbluetooth  $LIBS"
+LIBS="-lsdp -lbluetooth  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -15914,7 +15900,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_bt_aton" >&5
 $as_echo "$ac_cv_lib_bluetooth_bt_aton" >&6; }
 if test "x$ac_cv_lib_bluetooth_bt_aton" = x""yes; then :
-  BLUETOOTH_LIBS="-lbluetooth" ac_cv_have_bt_lib=yes
+  BLUETOOTH_LIBS="-lsdp -lbluetooth" ac_cv_have_bt_lib=yes
 else
   ac_cv_have_bt_lib=no
 fi
@@ -16011,7 +15997,7 @@
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbluetooth  $LIBS"
+LIBS="-lsdp -lbluetooth  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -16042,7 +16028,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_bt_aton" >&5
 $as_echo "$ac_cv_lib_bluetooth_bt_aton" >&6; }
 if test "x$ac_cv_lib_bluetooth_bt_aton" = x""yes; then :
-  BLUETOOTH_LIBS="-lbluetooth" ac_cv_have_bt_lib=yes
+  BLUETOOTH_LIBS="-lsdp -lbluetooth" ac_cv_have_bt_lib=yes
 else
   ac_cv_have_bt_lib=no
 fi
@@ -16612,7 +16598,7 @@
 $as_echo "$ac_cv_lib_Xpm_XpmWriteFileFromXpmImage" >&6; }
 if test "x$ac_cv_lib_Xpm_XpmWriteFileFromXpmImage" = x""yes; then :
    XPM_CFLAGS="$XINCL"
-                  XPM_LIBS="$XLIBS -lXpm -lX11"
+                  XPM_LIBS="$XLIBS -lXpm -lX11 -lroken -lcrypt"
 
 $as_echo "#define XPM 1" >>confdefs.h
 
