$OpenBSD: patch-configure,v 1.21 2016/09/07 10:02:59 jasper Exp $
--- configure.orig	Mon Apr 25 15:36:01 2016
+++ configure	Wed Sep  7 12:02:30 2016
@@ -839,6 +839,7 @@ case "$target" in
   s390x*-*-linux*)              arch=s390x; model=z10; system=elf;;
   armv6*-*-linux-gnueabihf)     arch=arm; model=armv6; system=linux_eabihf;;
   arm*-*-linux-gnueabihf)       arch=arm; system=linux_eabihf;;
+  arm*-*-openbsd*)              arch=arm; system=bsd;;
   armv7*-*-linux-gnueabi)       arch=arm; model=armv7; system=linux_eabi;;
   armv6t2*-*-linux-gnueabi)     arch=arm; model=armv6t2; system=linux_eabi;;
   armv6*-*-linux-gnueabi)       arch=arm; model=armv6; system=linux_eabi;;
@@ -1673,11 +1674,11 @@ echo "X11_LINK=$x11_link" >> Makefile
 
 # Look for BFD library
 
-if sh ./hasgot -DPACKAGE=ocaml -i bfd.h && \
-   sh ./hasgot -DPACKAGE=ocaml -lbfd -ldl -liberty -lz bfd_openr; then
+if sh ./hasgot -I${OPENBSD_LOCALBASE}/include -DPACKAGE=ocaml -i bfd.h && \
+   sh ./hasgot -L${OPENBSD_LOCALBASE}/lib -DPACKAGE=ocaml -lbfd -liberty -lz bfd_openr; then
   inf "BFD library found."
   echo "#define HAS_LIBBFD" >> s.h
-  echo "LIBBFD_LINK=-lbfd -ldl -liberty -lz" >> Makefile
+  echo "LIBBFD_LINK=-I${OPENBSD_LOCALBASE}/include -L${OPENBSD_LOCALBASE}/lib -lbfd -liberty -lz" >> Makefile
   echo LIBBFD_INCLUDE= >>Makefile
 elif sh ./hasgot -DPACKAGE=ocaml -I/opt/local/include -i bfd.h && \
      sh ./hasgot -DPACKAGE=ocaml -L/opt/local/lib -lbfd -ldl \
