不少同窗都在尝试编译 android 版本的 vlc时候发现不少编译问题,通常都编译好几回都没有编译经过。我在这里将我在比较经常使用的两个发行平台上编译过程当中出现的问题说明记录一下:linux
先阅读一下官方给定的教程: https://wiki.videolan.org/AndroidCompile/ ,按照教程中的内容配置环境变量NDK包。注意到目前我写此文章的时间官方支持的 ndk 的版本是 NDKr4b 因此下载ndk的使用请使用该版本进行下载。android
因为官方文档推荐的是 ubuntu 系统进行讲解说明的。可是对于我这种比较喜欢 fedora 和 opensuse rpm 安装包的同窗来讲确实存在问题了,因此我这边将在 fedora 和 opensuse 系统上安装的过程记录下来。git
请使用最新的fedora 发行版本,目前个人fedora 系统是 fedora 27,默认你的系统不是刚刚安装,若是是刚刚按抓给你的请执行ubuntu
dnf update -y 将系统更新一下,而后安装以下的内容:ide
dnf install -y automake autoconf dnf install -y ant dnf install -y gettext-devel dnf install -y cmake #like debian os install build-essential dnf groupinstall -y "Development Tools" dnf install -y libtool dnf install -y flex dnf install -y patch dnf install -y pkg-config dnf install -y protobuf-compiler dnf install -y ragel dnf install -y subversion dnf install -y unzip dnf install -y git gitk
而后执行 ./compile.sh -l release或者 ./compile.sh 文章中推荐的命令。这样就会一直安装完成。flex
我使用的是 opensuse-Tumbleweed 而不是比较稳定的 Leap 版本。 主要是有些软件例如: gettext 是有版要求的,而Leap 是使用比较老的版本。默认是须要跟行系统到比较新的版本,若是不是请先执行 zypper update -y,重启而后执行以下的命令按抓相关的软件:ui
zypper install -y automake autoconf zypper install -y ant zypper install -y gettext-devel zypper install -y cmake #like debian os: apt-get install build-essential #like fedora os: dnf groupinstall -y "Development Tools" zypper install -y --type pattern devel_basis zypper install -y libtool zypper install -y flex zypper install -y patch zypper install -y pkg-config # dnf install -y protobuf-compiler # apt-get install -y protobuf-compiler # replace by follow in opensuse zypper install -y libprotobuf-c-devel libprotobuf-c1 libprotobuf-lite15 protobuf-c protobuf-devel zypper install -y ragel zypper install -y subversion zypper install -y unzip zypper install -y git gitk
在编译到必定的程度发现会报以下的错误:代理
configure: error: Cannot find native C99 compiler: please define BUILDCC.code
该错误是没有发现你的 gcc 编译器,在 https://www.linuxquestions.org/questions/slackware-14/vlc-complains-that-my-compiler-is-not-native-c99-4175548893/ 上面有对应的解决方案。文章太长我将个人解决方案直接告诉你们吧:
进入 vlc 的目录下修改 configure 文件的以下内容:教程
test -n "$DESKTOP_FILE_VALIDATE" || DESKTOP_FILE_VALIDATE=":" BUILDCC=/usr/bin/gcc for ac_prog in c11-gcc c11 c99-gcc c99 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_BUILDCC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$BUILDCC"; then ac_cv_prog_BUILDCC="$BUILDCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_BUILDCC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS
其中开始的 BUILDCC=/usr/bin/gcc 是我添加的,主要是该内容是在执行时是空,因此直接添加对应的内容。
在执行 ./compile.sh 过程当中发现有些下载不了的,这个须要设置代理(所谓的×××)去操做