$OpenBSD: patch-configure,v 1.6 2010/01/09 14:03:25 ajacoutot Exp $
--- configure.orig	Wed Jan  6 04:28:18 2010
+++ configure	Sat Jan  9 14:10:30 2010
@@ -21647,12 +21647,7 @@ else
   want_release=no
 fi
 
-if test "$want_release" = "yes"; then
-    CXXFLAGS="$CXXFLAGS -O2 -fno-strict-aliasing"
-else
-# -fPIC must be present on x86_64 when -O2 isn't used
     CXXFLAGS="$CXXFLAGS -fPIC"
-fi
 
 # Check whether --enable-tcmalloc was given.
 if test "${enable_tcmalloc+set}" = set; then
@@ -22494,7 +22489,7 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 _ACEOF
 
 		VMIME_CFLAGS=-I$VMIME_PREFIX
-	VMIME_LIBS="-lvmime"
+	VMIME_LIBS="${ZAFARA_LDFLAGS} -lvmime-zarafa"
 
 else
 
@@ -22897,7 +22892,7 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
   ICAL_CFLAGS=-I$ICAL_PREFIX
-	ICAL_LIBS="-lical -licalss"
+	ICAL_LIBS="${ZAFARA_LDFLAGS} -lical-zarafa -licalss-zarafa"
 else
   WITH_ICAL=no
 fi
@@ -23766,13 +23761,13 @@ LIBS=$libs_keep
 libs_keep=$LIBS
 # check lib, but do not set in link list
 
-{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for pthread_create in -pthread" >&5
+echo $ECHO_N "checking for pthread_create in -pthread... $ECHO_C" >&6; }
 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="-pthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23832,7 +23827,7 @@ if test $ac_cv_lib_pthread_pthread_create = yes; then
 #define HAVE_LIBPTHREAD 1
 _ACEOF
 
-  LIBS="-lpthread $LIBS"
+  LIBS="-pthread $LIBS"
 
 else
   { { echo "$as_me:$LINENO: error: required library libpthread missing or unusable" >&5
