$OpenBSD: patch-Source_setup_configure_py,v 1.3 2016/06/14 08:39:23 czarkoff Exp $

1) Fix broken lib auto-detection. The configure script will try to stat a
   shared library file, but we don't know the exact filename because it depends
   on the shared library version. So look for a .la file instead. These are
   present for all libraries the script is looking for.

2) Add missing OpenBSD-specific bits.

--- Source/setup_configure.py.orig	Wed Jun  1 02:38:57 2016
+++ Source/setup_configure.py	Wed Jun  1 02:44:21 2016
@@ -184,6 +184,9 @@ class Setup:
             elif sys.platform.startswith('freebsd'):
                 self.platform = 'freebsd'
 
+            elif sys.platform.startswith('openbsd'):
+                self.platform = 'openbsd'
+
             elif sys.platform == 'cygwin':
                 self.platform = 'cygwin'
 
@@ -206,6 +209,10 @@ class Setup:
             self.c_utils = FreeBsdCompilerGCC( self )
             self.c_pysvn = FreeBsdCompilerGCC( self )
 
+        elif self.platform == 'openbsd':
+            self.c_utils = OpenBsdCompilerGCC( self )
+            self.c_pysvn = OpenBsdCompilerGCC( self )
+
         elif self.platform == 'cygwin':
             self.c_utils = CygwinCompilerGCC( self )
             self.c_pysvn = CygwinCompilerGCC( self )
@@ -1206,6 +1213,8 @@ class UnixCompilerGCC(CompilerGCC):
     def get_lib_name_for_platform( self, libname ):
         if self.setup.platform == 'cygwin':
             return ['%s.dll.a' % libname]
+        elif self.setup.platform == 'openbsd':
+            return ['%s.la' % libname]
         else:
             return ['%s.so' % libname]
 
@@ -1298,6 +1307,25 @@ class FreeBsdCompilerGCC(UnixCompilerGCC):
                 '-lcom_err',
                 '-lexpat',
                 '-lneon',
+                ] )
+        return py_ld_libs
+
+class OpenBsdCompilerGCC(UnixCompilerGCC):
+    def __init__( self, setup ):
+        UnixCompilerGCC.__init__( self, setup )
+
+    def _getLdLibs( self ):
+        py_ld_libs = [
+                '-L%(SVN_LIB)s',
+                '-Wl,--rpath',
+                '-Wl,/usr/lib:/usr/local/lib',
+                '-lsvn_client-1',
+                '-lsvn_diff-1',
+                '-lsvn_repos-1',
+                ]
+
+        py_ld_libs.extend( [
+                '-lexpat',
                 ] )
         return py_ld_libs
 
