$OpenBSD: patch-gas_configure_in,v 1.14 2003/10/11 00:52:22 brad Exp $
--- gas/configure.in.orig	2003-06-02 16:35:23.000000000 -0400
+++ gas/configure.in	2003-09-04 20:17:26.000000000 -0400
@@ -197,7 +197,8 @@ changequote([,])dnl
       arm*-*-linux-gnu*)		fmt=elf  em=linux ;;
       arm*-*-uclinux*)			fmt=elf  em=linux ;;
       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-      arm-*-*n*bsd*)			fmt=aout em=nbsd ;;
+      arm-*-netbsd*)			fmt=aout em=nbsd ;;
+      arm-*-openbsd*)			fmt=elf  em=obsd ;;
       arm-**-nto*)			fmt=elf ;;
       arm-*-oabi | thumb-*-oabi)	fmt=elf ;;
       arm-epoc-pe | thumb-epoc-pe)	fmt=coff em=epoc-pe ;;
@@ -224,7 +225,7 @@ changequote([,])dnl
       hppa-*-*elf*)			fmt=elf em=hppa ;;
       hppa-*-lites*)			fmt=elf em=hppa ;;
       hppa-*-netbsd*)			fmt=elf em=nbsd ;;
-      hppa-*-openbsd*)			fmt=elf em=hppa ;;
+      hppa-*-openbsd*)			fmt=elf em=obsd ;;
       hppa-*-osf*)			fmt=som em=hppa ;;
       hppa-*-rtems*)			fmt=elf em=hppa ;;
       hppa-*-hpux11*)	case ${cpu} in
@@ -254,10 +255,23 @@ changequote([,])dnl
       i386-*-netbsd0.8)			fmt=aout em=386bsd ;;
       i386-*-netbsdpe*)			fmt=coff em=pe ;;
       i386-*-netbsdelf*)		fmt=elf em=nbsd ;;
-      i386-*-*n*bsd*)	case ${cpu} in
+      i386-*-netbsd*)	case ${cpu} in
 			    x86_64)	fmt=elf em=nbsd ;;
 			    *)		fmt=aout em=nbsd ;;
 			esac ;;
+changequote(,)dnl
+      i386-*-openbsd*)     em=obsd bfd_gas=yes
+                            case ${cpu} in
+                             x86_64)   fmt=elf ;;
+                             *) case ${os} in
+                                 openbsd[0-2].* | openbsd3.[0-2])
+                                    fmt=aout ;;
+                                 *)
+                                    fmt=elf ;;
+                              esac
+                            esac
+                           ;;
+changequote([,])dnl
       i386-*-linux*aout*)		fmt=aout em=linux ;;
       i386-*-linux*oldld)		fmt=aout em=linux ;;
       i386-*-linux*coff*)		fmt=coff em=linux ;;
@@ -344,7 +358,7 @@ changequote([,])dnl
       m68k-*-lynxos*)			fmt=coff em=lynx ;;
       m68k-*-netbsdelf*)		fmt=elf em=nbsd ;;
       m68k-*-netbsd*)			fmt=aout em=nbsd bfd_gas=yes ;;
-      m68k-*-openbsd*)			fmt=aout em=nbsd bfd_gas=yes ;;
+      m68k-*-openbsd*)			fmt=aout em=obsd bfd_gas=yes ;;
       m68k-apple-aux*)			fmt=coff em=aux ;;
       m68k-*-psos*)			fmt=elf em=psos;;
 
@@ -355,7 +369,6 @@ changequote([,])dnl
       mcore-*-pe)			fmt=coff em=pe bfd_gas=yes ;;
 
       # don't change em like *-*-bsd does
-      mips-dec-openbsd*)		fmt=elf endian=little ;;
       mips-dec-bsd*)			fmt=aout endian=little ;;
       mips-sony-bsd*)			fmt=ecoff ;;
       mips-*-bsd*)
@@ -392,7 +405,8 @@ changequote([,])dnl
       ppc-*-aix5*)			fmt=coff em=aix5 ;;
       ppc-*-aix*)			fmt=coff ;;
       ppc-*-beos*)			fmt=coff ;;
-      ppc-*-*n*bsd* | ppc-*-elf*)	fmt=elf ;;
+      ppc-*-netbsd* | ppc-*-elf*)	fmt=elf ;;
+      ppc-*-openbsd*)                   fmt=elf em=obsd ;;
       ppc-*-eabi* | ppc-*-sysv4*)	fmt=elf ;;
       ppc-*-linux-gnu*)			fmt=elf
 	    case "$endian" in
@@ -439,7 +453,7 @@ changequote([,])dnl
       ns32k-pc532-mach*)		fmt=aout em=pc532mach ;;
       ns32k-pc532-ux*)			fmt=aout em=pc532mach ;;
       ns32k-pc532-lites*)		fmt=aout em=nbsd532 ;;
-      ns32k-*-*n*bsd*)			fmt=aout em=nbsd532 ;;
+      ns32k-*-netbsd*)			fmt=aout em=nbsd532 ;;
 
       sparc-*-rtemsaout*)		fmt=aout ;;
       sparc-*-rtemself*)		fmt=elf ;;
@@ -455,10 +469,21 @@ changequote([,])dnl
       sparc-*-sysv4*)			fmt=elf ;;
       sparc-*-solaris*)			fmt=elf ;;
       sparc-*-netbsdelf*)		fmt=elf em=nbsd ;;
-      sparc-*-*n*bsd*)	case ${cpu} in
+      sparc-*-netbsd*)	case ${cpu} in
 			    sparc64)	fmt=elf em=nbsd ;;
 			    *)		fmt=aout em=nbsd ;;
 			esac ;;
+changequote(,)dnl
+      sparc-*-openbsd*)   em=obsd bfd_gas=yes
+                            case ${os} in
+                               openbsd[0-2].* | openbsd3.[0-1])
+                                  fmt=aout ;;
+                               *)
+                                  fmt=elf ;;
+                            esac
+                          ;;
+changequote([,])dnl
+      sparc64-*-openbsd*) em=obsd bfd_gas=yes fmt=elf ;;
       strongarm-*-coff)			fmt=coff ;;
       strongarm-*-elf)			fmt=elf ;;
       strongarm-*-kaos*)		fmt=elf ;;
