$OpenBSD: patch-configure,v 1.20 2017/07/31 21:45:37 robert Exp $

Index: configure
--- configure.orig
+++ configure
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/usr/bin/env bash
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.68 for LibreOffice 5.2.7.2.
 #
@@ -245,7 +245,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=
@@ -5921,6 +5921,7 @@ openbsd*)
     test_gtk=yes
     test_tde=yes
     test_freetype=yes
+    test_kde4=yes
     PTHREAD_CFLAGS="-D_THREAD_SAFE"
     PTHREAD_LIBS="-pthread"
     _os=OpenBSD
@@ -9831,7 +9832,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
@@ -23121,7 +23122,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 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 python3.6 ython python2 python3 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
@@ -23387,7 +23388,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 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 python3.6 python python2 python3 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
@@ -23672,7 +23673,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 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 python3.6 python python2 python3 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
@@ -33285,7 +33286,7 @@ $as_echo "internal" >&6; }
     if test "$COM" = "MSC"; then
         HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
     else
-        HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
+        HYPHEN_LIB="${WORKDIR}/UnpackedTarball/hyphen/.libs/libhyphen.a"
     fi
 fi
 
@@ -33525,7 +33526,7 @@ $as_echo "internal" >&6; }
     if test "$COM" = "MSC"; then
         MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
     else
-        MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
+        MYTHES_LIBS="${WORKDIR}/UnpackedTarball/mythes/.libs/libmythes-1.2.a"
     fi
 fi
 
@@ -37157,9 +37158,9 @@ 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"
         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
@@ -37183,11 +37184,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
@@ -37317,7 +37318,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
@@ -37444,7 +37445,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
