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