$OpenBSD: patch-libgo_configure,v 1.2 2014/05/25 21:45:39 pascal Exp $
--- libgo/configure.orig	Fri Apr  4 15:53:39 2014
+++ libgo/configure	Thu May 22 20:04:21 2014
@@ -669,6 +669,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
@@ -10533,7 +10535,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
@@ -13459,6 +13461,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; :
@@ -13486,6 +13492,7 @@ go_include="-include"
 
 is_darwin=no
 is_freebsd=no
+is_openbsd=no
 is_irix=no
 is_linux=no
 is_netbsd=no
@@ -13496,6 +13503,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 ;;
@@ -13527,6 +13535,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='#'
@@ -14121,13 +14137,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.  */
 
@@ -14158,7 +14174,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
 
 
