$OpenBSD: patch-configure,v 1.3 2018/03/16 00:52:35 sthen Exp $

Last hunk: the check for Ada bootstrap fails if there's any output on
stdout/stderr, which occurs if bootstrap copies of system libs don't
match base system libs (e.g. libm minor bump was causing problems
with this). Hack around it for now, but can the bootstrap be improved
to avoid the warning?

Index: configure
--- configure.orig
+++ configure
@@ -2762,8 +2762,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk 
 host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools"
 
 # libgcj represents the runtime libraries only used by gcj.
-libgcj="target-libffi \
-	target-zlib \
+libgcj="target-zlib \
 	target-libjava"
 
 # these libraries are built for the target environment, and are built after
@@ -2784,6 +2783,7 @@ target_libraries="target-libgcc \
 		target-libquadmath \
 		target-libgfortran \
 		target-boehm-gc \
+		target-libffi \
 		${libgcj} \
 		target-libobjc \
 		target-libada \
@@ -3095,7 +3095,7 @@ fi
 
 # Save it here so that, even in case of --enable-libgcj, if the Java
 # front-end isn't enabled, we still get libgcj disabled.
-libgcj_saved=$libgcj
+libgcj_saved="target-libffi ${libgcj}"
 case $enable_libgcj in
 yes)
   # If we reset it here, it won't get added to noconfigdirs in the
@@ -3106,7 +3106,7 @@ yes)
 no)
   # Make sure we get it printed in the list of not supported target libs.
   # Don't disable libffi, though, other languages use it.
-  noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
+  noconfigdirs="$noconfigdirs ${libgcj}"
   # Clear libgcj_saved so that even if java is enabled libffi won't be
   # built.
   libgcj_saved=
@@ -3336,6 +3336,8 @@ case "${target}" in
     ;;
   powerpc64-*-freebsd*)
     ;;
+  powerpc-*-openbsd*)
+    ;;
   powerpc*-*-rtems*)
     ;;
   s390-*-* | s390x-*-*)
@@ -5210,8 +5212,7 @@ acx_cv_cc_gcc_supports_ada=no
 # Other compilers, like HP Tru64 UNIX cc, exit successfully when
 # given a .adb file, but produce no object file.  So we must check
 # if an object file was really produced to guard against this.
-errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
-if test x"$errors" = x && test -f conftest.$ac_objext; then
+if ${CC} -c conftest.adb && test -f conftest.$ac_objext; then
   acx_cv_cc_gcc_supports_ada=yes
 fi
 rm -f conftest.*
