[Android] build: symbols and module names are now unique
Thomas Guillem
git at videolan.org
Fri Oct 26 16:06:21 CEST 2018
vlc-android | branch: 4.0 | Thomas Guillem <thomas at gllm.fr> | Fri Oct 26 16:05:01 2018 +0200| [eae3075b37f9d7014960d22c6966b5c5a1a827b8] | committer: Thomas Guillem
build: symbols and module names are now unique
> https://code.videolan.org/videolan/vlc-android/commit/eae3075b37f9d7014960d22c6966b5c5a1a827b8
---
compile-libvlc.sh | 36 ++++--------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index b97a8925c..03fb61d0a 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -613,40 +613,15 @@ get_symbol()
echo "$1" | grep vlc_entry_$2|cut -d" " -f 3
}
-VLC_MODULES=$(find_modules vlc/$VLC_BUILD_DIR/modules)
+VLC_MODULES=$(find_modules $VLC_SRC_DIR/$VLC_BUILD_DIR/modules)
DEFINITION="";
BUILTINS="const void *vlc_static_modules[] = {\n";
for file in $VLC_MODULES; do
- outfile=${REDEFINED_VLC_MODULES_DIR}/`basename $file`
- name=`echo $file | sed 's/.*\.libs\/lib//' | sed 's/_plugin\.a//'`;
symbols=$("${CROSS_TOOLS}nm" -g $file)
+ name=`echo "$symbols"|grep "vlc_entry__"|cut -d" " -f 3`
- # assure that all modules have differents symbol names
- entry=$(get_symbol "$symbols" _)
- copyright=$(get_symbol "$symbols" copyright)
- license=$(get_symbol "$symbols" license)
- cat <<EOF > ${REDEFINED_VLC_MODULES_DIR}/syms
-AccessOpen AccessOpen__$name
-AccessClose AccessClose__$name
-StreamOpen StreamOpen__$name
-StreamClose StreamClose__$name
-OpenDemux OpenDemux__$name
-CloseDemux CloseDemux__$name
-DemuxOpen DemuxOpen__$name
-DemuxClose DemuxClose__$name
-OpenFilter OpenFilter__$name
-CloseFilter CloseFilter__$name
-Open Open__$name
-Close Close__$name
-$entry vlc_entry__$name
-$copyright vlc_entry_copyright__$name
-$license vlc_entry_license__$name
-EOF
- ${CROSS_TOOLS}objcopy --redefine-syms ${REDEFINED_VLC_MODULES_DIR}/syms $file $outfile
- checkfail "objcopy failed"
-
- DEFINITION=$DEFINITION"int vlc_entry__$name (int (*)(void *, void *, int, ...), void *);\n";
- BUILTINS="$BUILTINS vlc_entry__$name,\n";
+ DEFINITION=$DEFINITION"int $name (int (*)(void *, void *, int, ...), void *);\n";
+ BUILTINS="$BUILTINS $name,\n";
done;
BUILTINS="$BUILTINS NULL\n};\n"; \
printf "/* Autogenerated from the list of modules */\n#include <unistd.h>\n$DEFINITION\n$BUILTINS\n" > libvlc/jni/libvlcjni-modules.c
@@ -661,13 +636,10 @@ done
BUILTINS="$BUILTINS NULL\n};\n"; \
printf "/* Autogenerated from the list of modules */\n#include <unistd.h>\n$DEFINITION\n$BUILTINS\n" > libvlc/jni/libvlcjni-symbols.c
-rm ${REDEFINED_VLC_MODULES_DIR}/syms
-
############################################
# NDK-Build for libvlc.so and libvlcjni.so #
############################################
-VLC_MODULES=$(find_modules ${REDEFINED_VLC_MODULES_DIR})
VLC_CONTRIB_LDFLAGS=`for i in $(/bin/ls $VLC_CONTRIB/lib/pkgconfig/*.pc); do PKG_CONFIG_PATH="$VLC_CONTRIB/lib/pkgconfig/" pkg-config --libs $i; done |xargs`
echo -e "ndk-build vlc"
More information about the Android
mailing list