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