vlc android 编译
很多同学都在尝试编译 android 版本的 vlc时候发现很多编译问题,一般都编译好几次都没有编译通过。我在这里将我在比较常用的两个发行平台上编译过程中出现的问题说明记录一下:
先阅读一下官方给定的教程: https://wiki.videolan.org/AndroidCompile/ ,按照教程中的内容配置环境变量NDK包。注意到目前我写此文章的时间官方支持的 ndk 的版本是 NDKr4b 所以下载ndk的使用请使用该版本进行下载。
由于官方文档推荐的是 ubuntu 系统进行讲解说明的。但是对于我这种比较喜欢 fedora 和 opensuse rpm 安装包的同学来说确实存在问题了,所以我这边将在 fedora 和 opensuse 系统上安装的过程记录下来。
fedora 平台请使用最新的fedora 发行版本,目前我的fedora 系统是 fedora 27,默认你的系统不是刚刚安装,如果是刚刚按抓给你的请执行
dnf update -y 将系统更新一下,然后安装如下的内容:
dnf install -y automake autoconfdnf install -y antdnf install -y gettext-develdnf install -y cmake#like debian os install build-essentialdnf groupinstall -y "Development Tools"dnf install -y libtooldnf install -y flexdnf install -y patchdnf install -y pkg-configdnf install -y protobuf-compilerdnf install -y rageldnf install -y subversiondnf install -y unzipdnf install -y git gitk
然后执行 ./compile.sh -l release或者 ./compile.sh 文章中推荐的命令。这样就会一直安装完成。
opensuse 平台我使用的是 opensuse-Tumbleweed 而不是比较稳定的 Leap 版本。 主要是有些软件例如: gettext 是有版要求的,而Leap 是使用比较老的版本。默认是需要跟行系统到比较新的版本,如果不是请先执行 zypper update -y,重启然后执行如下的命令按抓相关的软件:
zypper install -y automake autoconfzypper install -y antzypper install -y gettext-develzypper 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_basiszypper install -y libtoolzypper install -y flexzypper install -y patchzypper install -y pkg-config# dnf install -y protobuf-compiler# apt-get install -y protobuf-compiler# replace by follow in opensusezypper install -y libprotobuf-c-devel libprotobuf-c1 libprotobuf-lite15 protobuf-c protobuf-develzypper install -y ragelzypper install -y subversionzypper install -y unzipzypper install -y git gitk
在编译到一定的程度发现会报如下的错误:
configure: error: Cannot find native C99 compiler: please define BUILDCC.
该错误是没有发现你的 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/gccfor ac_prog in c11-gcc c11 c99-gcc c99do# 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) " >&6elseif test -n "$BUILDCC"; thenac_cv_prog_BUILDCC="$BUILDCC" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; thenac_cv_prog_BUILDCC="$ac_prog"$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFS
其中开始的 BUILDCC=/usr/bin/gcc 是我添加的,主要是该内容是在执行时是空,所以直接添加对应的内容。
其他的一些问题在执行 ./compile.sh 过程中发现有些下载不了的,这个需要设置代理(所谓的×××)去操作
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。