$OpenBSD: patch-configure,v 1.9 2010/08/31 17:57:21 ajacoutot Exp $
--- configure.orig	Mon Aug 30 09:31:47 2010
+++ configure	Tue Aug 31 15:14:03 2010
@@ -21780,12 +21780,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
@@ -21813,7 +21808,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
@@ -22153,21 +22148,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
@@ -22693,7 +22673,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
 
@@ -23103,8 +23083,10 @@ fi
 
 done
 
+# XXX force removing clucene support
+WITH_CLUCENE_TRUE='#'
+WITH_CLUCENE_FALSE=
 
-
 CFLAGS=$cflags_keep
 
 # Check for CLucene availability
@@ -24475,13 +24457,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
@@ -24541,7 +24523,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
