[vlc-devel] [PATCH] modules: common: use full name as MODULE_NAME

Thomas Guillem thomas at gllm.fr
Fri Oct 26 17:07:10 CEST 2018


MODULE_NAME is only used for static builds:

Here is an example:

for codec/liba52_plugin_la-a52.lo
 MODULE_STRING=a52
 MODULE_NAME=codec_a52

for packetizer/a52.lo
 MODULE_STRING=a52
 MODULE_NAME=packetizer_a52

This patch will fix conflicts with the 2 vlc_entry__a52 symbols (that will now
be vlc_entry__codec_a52 and vlc_entry__packetize_a52).

On Android, we used objcopy to rename these symbols, but this tool is not
availaible on iOS toolchain.
---
 modules/common.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/common.am b/modules/common.am
index 37267f0341..6f95463799 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -15,9 +15,10 @@ CLEANFILES = $(BUILT_SOURCES)
 LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la
 
 # Module name from object or executable file name.
-MODULE_NAME = $$(p="$@"; p="$${p\#\#*/}"; p="$${p\#lib}"; p="$${p%_plugin*}"; p=$$(echo "$$p"|sed 's/-/_/g'); p="$${p%.lo}"; echo "$$p")
+MODULE_NAME = $$(p="$@"; p=$$(echo "$$p"|sed 's/lib//g'); p="$${p%_plugin*}"; p=$$(echo "$$p"|sed 's/[-\/]/_/g'); p="$${p%.lo}"; echo "$$p")
+MODULE_STRING = $$(p="$(MODULE_NAME)"; p="$${p\#\#*_}"; echo "$$p")
 
-AM_CPPFLAGS = -DMODULE_STRING=\"$(MODULE_NAME)\"
+AM_CPPFLAGS = -DMODULE_STRING=\"$(MODULE_STRING)\"
 if HAVE_DYNAMIC_PLUGINS
 AM_CPPFLAGS += -D__PLUGIN__
 else
-- 
2.19.1



More information about the vlc-devel mailing list