$OpenBSD: patch-configure,v 1.7 2010/06/30 02:46:48 ajacoutot Exp $
--- configure.orig	Mon May 31 16:37:57 2010
+++ configure	Tue Jun 29 03:42:19 2010
@@ -21781,12 +21781,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
@@ -21814,7 +21809,7 @@ else
   with_distro=rhel
 fi
 
-if test "$with_distro" != "rhel" -a "$with_distro" != "suse" -a "$with_distro" != "sles"; then
+if test "$with_distro" != "rhel" -a "$with_distro" != "suse" -a "$with_distro" != "sles" -a "$with_distro" != "openbsd"; then
    { echo "$as_me:$LINENO: result: invalid distro, using rhel instead" >&5
 echo "${ECHO_T}invalid distro, using rhel instead" >&6; }
 else
@@ -22154,21 +22149,6 @@ echo "$as_me: error: Cannot execute $PHP_CONFIG" >&2;}
   PHP_LDFLAGS=`$PHP_CONFIG --ldflags`
   PHP_EXTENSION_DIR=`$PHP_CONFIG --extension-dir`
   PHP_VERSION=`$PHP_CONFIG --version`
-  # watch escaping for brackets
-  PHP_SYSCONF_DIR=`$PHP_CONFIG --configure-options | sed -e 's_.*with-config-file-scan-dir=\([^ ]\+\).*_\1_'`
-  if test ${PHP_SYSCONF_DIR:0:1} != "/"; then
-	# find path in existing paths
-	if test -d "/etc/php.d"; then
-		PHP_SYSCONF_DIR="/etc/php.d"
-	elif test -d "/etc/php5/conf.d"; then
-		PHP_SYSCONF_DIR="/etc/php5/conf.d"
-	else
-		# this happens on old distributions
-	    { echo "$as_me:$LINENO: result: Cannot find php sysconf path, forcing /usr/share/doc/zarafa" >&5
-echo "${ECHO_T}Cannot find php sysconf path, forcing /usr/share/doc/zarafa" >&6; }
-		PHP_SYSCONF_DIR="/usr/share/doc/zarafa"
-	fi
-  fi
 
   if test -z "$PHP_EXTENSION_DIR"; then
     { { echo "$as_me:$LINENO: error: Cannot find php-config. Please use --with-php-config=PATH" >&5
@@ -22694,7 +22674,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
 
@@ -23369,8 +23349,10 @@ else
   WITH_CLUCENE_FALSE=
 fi
 
+# XXX force removing clucene support
+WITH_CLUCENE_TRUE='#'
+WITH_CLUCENE_FALSE=
 
-
 CFLAGS=$cflags_keep
 CXXFLAGS=$cxxflags_keep
 ac_ext=c
@@ -24399,13 +24381,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
@@ -24465,7 +24447,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
