$OpenBSD: patch-konq-embed_dropin_klibloader_cpp,v 1.3 2002/03/25 00:35:41 brad Exp $
--- konq-embed/dropin/klibloader.cpp.orig	Sun Feb  3 10:25:38 2002
+++ konq-embed/dropin/klibloader.cpp	Sun Mar 24 02:09:01 2002
@@ -27,6 +27,8 @@
 #include "kglobal.h"
 #include <kstddirs.h>
 
+#include <stdlib.h>
+#include <string.h>
 #include <assert.h>
 
 #if defined(HAVE_DLFCN)
@@ -87,6 +89,17 @@ KDLOpenLibrary::~KDLOpenLibrary()
 void *KDLOpenLibrary::symbol( const char *name )
 {
     void *res = dlsym( m_handle, name );
+#ifdef __OpenBSD__
+    if ( !res ) {
+    	char *name2 = (char *)malloc(strlen(name)+2);
+	if (name2) {
+	    name2[0] = '_';
+	    strcpy(name2+1, name);
+	    res = dlsym( m_handle, name2);
+	    free(name2);
+	}
+    }
+#endif
     if ( !res )
         res = KLibrary::symbol( name );
     return res;
@@ -144,6 +157,9 @@ KLibrary *KLibLoader::library( const cha
 
 KLibrary *KLibLoader::globalLibrary( const char *name )
 {
+#ifndef RTLD_GLOBAL
+# define RTLD_GLOBAL 0
+#endif 
 #if defined(HAVE_DLFCN)
     void *handle = dlopen( name, RTLD_LAZY | RTLD_GLOBAL );
     if ( !handle )
