]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Unit-tests] Add --enable-fake-dlclose configure flag so modules are not unloaded...
authorAndrey Volk <andywolk@gmail.com>
Sun, 4 Oct 2020 15:24:30 +0000 (19:24 +0400)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:36 +0000 (22:00 +0300)
configure.ac
src/switch_dso.c

index db82222e0d88c036c39d2b371865ed663d2bb3d1..5a7b9f0cbcb161921217fbfc6acf8016726ba3b5 100644 (file)
@@ -1986,6 +1986,16 @@ if test "${enable_address_sanitizer}" = "yes"; then
   APR_ADDTO(LDFLAGS, -fsanitize=address)
 fi
 
+#  Enable fake dlclose
+AC_ARG_ENABLE(fake_dlclose,
+  [AC_HELP_STRING([--enable-fake-dlclose],[Do not unload dynamic libraries])],
+  [enable_fake_dlclose="$enable_fake_dlclose"],
+  [enable_fake_dlclose="no"])
+
+if test "${enable_fake_dlclose}" = "yes"; then
+  APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_FAKE_DLCLOSE)
+fi
+
 AC_ARG_ENABLE(,
   [AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])],
   [enable_pool_sanitizer="$enable_pool_sanitizer"],
index a78bba2f8c4cf4ece4935fe6846abeb6001cde72..86ffb0f419f354521fef40cf25c9c8316fca5cef 100644 (file)
@@ -91,7 +91,9 @@ SWITCH_DECLARE(void *) switch_dso_data_sym(switch_dso_lib_t lib, const char *sym
 void switch_dso_destroy(switch_dso_lib_t *lib)
 {
        if (lib && *lib) {
+#ifndef HAVE_FAKE_DLCLOSE
                dlclose(*lib);
+#endif
                *lib = NULL;
        }
 }