[Android] [PATCH] compile-libvlc: NO_OPTIM is not set before use

Zhao Zhili quinkblack at foxmail.com
Wed Nov 8 16:42:29 CET 2017


---
 compile-libvlc.sh | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index abee5c427..6c2eef6dc 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -21,6 +21,7 @@ MEDIALIBRARY_HASH=1f7e168
 BUILD_ML=1
 RELEASE=0
 ASAN=0
+NO_OPTIM=1
 while [ $# -gt 0 ]; do
     case $1 in
         help|--help)
@@ -369,6 +370,19 @@ fi
 
 VLC_CFLAGS="-std=gnu11"
 VLC_CXXFLAGS="-std=gnu++11"
+
+# Release or not?
+if [ "$RELEASE" = 1 ]; then
+    OPTS=""
+    EXTRA_CFLAGS="${EXTRA_CFLAGS} -DNDEBUG "
+    NDK_DEBUG=0
+    NO_OPTIM=0
+else
+    OPTS="--enable-debug"
+    NDK_DEBUG=1
+    NO_OPTIM=1
+fi
+
 if [ "$NO_OPTIM" = "1" ];
 then
      VLC_CFLAGS="${VLC_CFLAGS} -g -O0"
@@ -417,16 +431,6 @@ fi
 EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -L${NDK_LIB_DIR} -lc++abi -lc++_static"
 VLC_LDFLAGS="${EXTRA_LDFLAGS}"
 
-# Release or not?
-if [ "$RELEASE" = 1 ]; then
-    OPTS=""
-    EXTRA_CFLAGS="${EXTRA_CFLAGS} -DNDEBUG "
-    NDK_DEBUG=0
-else
-    OPTS="--enable-debug"
-    NDK_DEBUG=1
-fi
-
 if [ "${ASAN}" = 1 ];then
     VLC_CFLAGS="${VLC_CFLAGS} -O0 -fno-omit-frame-pointer -fsanitize=address"
     VLC_CXXFLAGS="${VLC_CXXFLAGS} -O0 -fno-omit-frame-pointer -fsanitize=address"
-- 
2.14.2





More information about the Android mailing list