$OpenBSD: patch-libgo_configure,v 1.1.1.1 2019/01/04 15:50:40 pascal Exp $
Index: libgo/configure
--- libgo/configure.orig
+++ libgo/configure
@@ -656,6 +656,8 @@ LIBGO_IS_IRIX_FALSE
 LIBGO_IS_IRIX_TRUE
 LIBGO_IS_FREEBSD_FALSE
 LIBGO_IS_FREEBSD_TRUE
+LIBGO_IS_OPENBSD_FALSE
+LIBGO_IS_OPENBSD_TRUE
 LIBGO_IS_DARWIN_FALSE
 LIBGO_IS_DARWIN_TRUE
 go_include
@@ -10528,7 +10530,7 @@ openbsd*)
     *)				need_version=no  ;;
   esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  #finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     case $host_os in
@@ -13455,6 +13457,10 @@ fi
 # architectures don't support it.  FIXME: We should set a default
 # based on the host.
 
+case ${host} in
+powerpc*-*-*) with_libffi_default=no ;;
+esac
+
 # Check whether --with-libffi was given.
 if test "${with_libffi+set}" = set; then :
   withval=$with_libffi; :
@@ -13513,6 +13519,7 @@ ALLGOOS="aix android darwin dragonfly freebsd irix lin
 
 is_darwin=no
 is_freebsd=no
+is_openbsd=no
 is_irix=no
 is_linux=no
 is_netbsd=no
@@ -13525,6 +13532,7 @@ GOOS=unknown
 case ${host} in
   *-*-darwin*)   is_darwin=yes;  GOOS=darwin ;;
   *-*-freebsd*)  is_freebsd=yes; GOOS=freebsd ;;
+  *-*-openbsd*)  is_openbsd=yes; GOOS=openbsd ;;
   *-*-irix6*)    is_irix=yes;    GOOS=irix ;;
   *-*-linux*)    is_linux=yes;   GOOS=linux ;;
   *-*-netbsd*)	 is_netbsd=yes;  GOOS=netbsd ;;
@@ -13558,6 +13566,14 @@ else
   LIBGO_IS_IRIX_FALSE=
 fi
 
+ if test $is_openbsd = yes; then
+  LIBGO_IS_OPENBSD_TRUE=
+  LIBGO_IS_OPENBSD_FALSE='#'
+else
+  LIBGO_IS_OPENBSD_TRUE='#'
+  LIBGO_IS_OPENBSD_FALSE=
+fi
+
  if test $is_linux = yes; then
   LIBGO_IS_LINUX_TRUE=
   LIBGO_IS_LINUX_FALSE='#'
@@ -14235,13 +14251,13 @@ fi
 
 
 PTHREAD_LIBS=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -pthread" >&5
+$as_echo_n "checking for pthread_create in -pthread... " >&6; }
 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="-pthread  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -14272,7 +14288,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
 if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
-  PTHREAD_LIBS=-lpthread
+  PTHREAD_LIBS=-pthread
 fi
 
 
