$OpenBSD: patch-configure,v 1.17 2017/01/03 19:30:58 landry Exp $
--- configure.orig.port	Mon Oct 31 15:43:29 2016
+++ configure	Mon Oct 31 15:46:17 2016
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/usr/bin/env bash
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for LibreOffice 5.2.2.2.0+.
 #
@@ -273,7 +273,7 @@ $0: the script under such a shell if you do have one."
 fi
 fi
 fi
-SHELL=${CONFIG_SHELL-/bin/sh}
+SHELL=${CONFIG_SHELL-/usr/bin/env bash}
 export SHELL
 # Unset more variables known to interfere with behavior of common tools.
 CLICOLOR_FORCE= GREP_OPTIONS=
@@ -5942,6 +5942,7 @@ openbsd*)
     test_gtk=yes
     test_tde=yes
     test_freetype=yes
+    test_kde4=yes
     PTHREAD_CFLAGS="-D_THREAD_SAFE"
     PTHREAD_LIBS="-pthread"
     _os=OpenBSD
@@ -9847,7 +9848,7 @@ fi
 # Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers.
 # NOTE: must _not_ be used for bundled external libraries!
 ISYSTEM=
-if test "$GCC" = "yes"; then
+if test "$GCC" = "yes" -a "$_os" != "OpenBSD" ; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -isystem " >&5
 $as_echo_n "checking for -isystem ... " >&6; }
     save_CFLAGS=$CFLAGS
@@ -23123,7 +23124,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+	for am_cv_pathless_PYTHON in python${MODPY_DEFAULT_VERSION_3} python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
 	  test "$am_cv_pathless_PYTHON" = none && break
 	  prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
@@ -23424,7 +23425,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+	for am_cv_pathless_PYTHON in python${MODPY_DEFAULT_VERSION_3} python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
 	  test "$am_cv_pathless_PYTHON" = none && break
 	  prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
@@ -23744,7 +23745,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+	for am_cv_pathless_PYTHON in python${MODPY_DEFAULT_VERSION_3} python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
 	  test "$am_cv_pathless_PYTHON" = none && break
 	  prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
@@ -37262,8 +37263,8 @@ if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE
     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
 
-    kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
-    kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
+    kde_incdirs="$KDE4INC /usr/include /usr/include/kde4 $x_includes"
+    kde_libdirs="$KDE4LIB /usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
 
     if test -n "$supports_multilib"; then
         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
@@ -37288,11 +37289,11 @@ if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE
     fi
 
     if test -n "$KDEDIR"; then
-        kde_incdirs="$KDEDIR/include $kde_incdirs"
+        kde_incdirs="$KDEDIR/include/kde $KDEDIR/include $kde_incdirs"
         if test -z "$supports_multilib"; then
-            kde_libdirs="$KDEDIR/lib $kde_libdirs"
+            kde_libdirs="$KDEDIR/lib/kde3 $KDEDIR/lib $kde_libdirs"	
         else
-            kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
+            kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib/kde3 $KDEDIR/lib $kde_libdirs"
         fi
     fi
     if test -n "$KDE4DIR"; then
@@ -37422,7 +37423,7 @@ the root of your Qt installation by exporting QT4DIR b
 $as_echo_n "checking for Qt4 libraries... " >&6; }
     qt_lib_dir="no"
     for lib_dir in $qt_libdirs; do
-        if test -r "$lib_dir/$qt_test_library"; then
+        if ls $lib_dir/$qt_test_library* /dev/null 2>&1 >/dev/null; then
             qt_lib_dir="$lib_dir"
             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
             break
@@ -37549,7 +37550,7 @@ $as_echo "$kde_incdir" >&6; }
 $as_echo_n "checking for KDE4 libraries... " >&6; }
     kde_libdir="no"
     for kde_check in $kde_libdirs; do
-        if test -r "$kde_check/$kde_test_library"; then
+        if ls $kde_check/$kde_test_library* /dev/null 2>&1 >/dev/null; then
             kde_libdir="$kde_check"
             break
         fi
