blob: 32265196f6233ac9d0ca9e08a0eb475de9f040e9 [file] [log] [blame]
From 5acca28e08f3a2a4cd4383546ba59cc0f0b1ed2d Mon Sep 17 00:00:00 2001
From: Ben Chan <benchan@chromium.org>
Date: Tue, 31 Jul 2018 14:26:23 -0700
Subject: [PATCH] disable dynamic modules
This patch adds a flag to remove the dynamic module loading support
given that it is not used.
---
configure.ac | 14 +++++++++++++-
src/Makefile.am | 5 ++++-
src/parse.c | 3 +++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index ea16b8c..ad883e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,13 @@ fi
AC_MSG_RESULT([$build_result])
+AC_MSG_CHECKING([whether building with dynamic module loading support])
+AC_ARG_ENABLE(dynamic-modules,
+[ --disable-dynamic-modules Disable support for dynamic module loading],
+[if test "$enableval" = yes; then dynamic_modules=yes; else dynamic_modules=no; fi],
+dynamic_modules=yes)
+AC_MSG_RESULT([$dynamic_modules])
+
AC_MSG_CHECKING([whether debugging is enabled])
AC_ARG_ENABLE(debug,
[ --enable-debug Compile in debug information
@@ -280,7 +287,12 @@ AC_SUBST(DAV)
AC_SUBST(DAV_LS)
AC_SUBST(LIBDAV)
-AC_CHECK_LIB(dl, dlopen)
+if test "$dynamic_modules" = yes; then
+ AC_CHECK_LIB(dl, dlopen)
+ AC_DEFINE(USE_DYNAMIC_MODULES, 1, [Define to 1 if dynamic module loading is enabled])
+fi
+AM_CONDITIONAL(USE_DYNAMIC_MODULES, test x$dynamic_modules = xyes)
+
AC_CHECK_LIB(pthread, pthread_create)
if test -z "`echo "$LIBS"|grep pthread`"; then
LIBS="$LIBS -pthread"
diff --git a/src/Makefile.am b/src/Makefile.am
index 43b6bde..03c17f9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,6 @@ libavfscore_la_SOURCES = utils.c \
oper.c \
fdops.c \
virtual.c \
- modload.c \
remote.c \
archive.c \
archutil.c \
@@ -38,6 +37,10 @@ libavfscore_la_SOURCES = utils.c \
realfile.c \
bzread.c
+if USE_DYNAMIC_MODULES
+libavfscore_la_SOURCES += modload.c
+endif
+
if USE_LIBLZMA
libavfscore_la_SOURCES += xzread.c
endif
diff --git a/src/parse.c b/src/parse.c
index 1af1966..2dbd8b0 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -9,6 +9,7 @@
Path parser module
*/
+#include "config.h"
#include "internal.h"
#include "version.h"
#include "local.h"
@@ -227,7 +228,9 @@ static int init()
if(res == 0) {
av_init_avfsstat();
av_init_static_modules();
+#ifdef USE_DYNAMIC_MODULES
av_init_dynamic_modules();
+#endif
av_init_logstat();
init_stats();
av_init_cache();
--
2.18.0.597.ga71716f1ad-goog