dcc978
--- apr-1.4.8/dso/unix/dso.c.deepbind
dcc978
+++ apr-1.4.8/dso/unix/dso.c
dcc978
@@ -38,6 +38,8 @@
dcc978
 #define DYLD_LIBRARY_HANDLE (void *)-1
dcc978
 #endif
dcc978
 
dcc978
+static int use_deepbind; /* 0 = unset, 1 = use DEEPBIND, -1, don't use DEEPBIND */
dcc978
+
dcc978
 APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso,
dcc978
                                                 apr_os_dso_handle_t osdso,
dcc978
                                                 apr_pool_t *pool)
dcc978
@@ -125,6 +127,12 @@
dcc978
 #else
dcc978
     int flags = RTLD_NOW | RTLD_GLOBAL;
dcc978
     void *os_handle;
dcc978
+
dcc978
+    if (use_deepbind == 0)
dcc978
+        use_deepbind = getenv("APR_DEEPBIND") != NULL ? 1 : -1;
dcc978
+    if (use_deepbind == 1)
dcc978
+        flags |= RTLD_DEEPBIND;
dcc978
+
dcc978
 #ifdef _AIX
dcc978
     if (strchr(path + 1, '(') && path[strlen(path) - 1] == ')')
dcc978
     {