EmuELEC 前身为 Sx05RE。Sx05RE 整合了 Lakka、KODI、EmulationStation,常被人简称为三合一。因 Sx05RE 项目只有墨西哥的 Shantigilbert 一人开发,而 KODI 经常出现各种需要修复的 BUG,浪费了大神的大量时间。出于时间严重不足的考虑,Shantigilbert 决定从 Sx05RE中删除 KODI,并将系统改名成 EmuELEC,使系统专为游戏服务。
这就是大家目前熟悉的EmuELEC。
前段时间,有朋友让我在S805上运行Sx05RE,刚好乘此机会体验了一把。那就从下载源码开始介绍。目前S805的包屈指可数
首先我们找到github上的Sx05RE源码:https://github.com/EmuELEC/Sx05RE
进入github后,我们看下readme,做任何github项目开发,必须先看这些,不要一上来就无脑冲,结果无用功,各种报错。养成看readme的习惯,可以让我们开发编译更加顺畅,否则上传源码的作者就没必要写。
注意以上,作者说用了16.04.3,好吧既然这样,我们也用这个系统,去ubuntu的官网下载,装个虚拟机即可。
然后就是一顿安装,git clone,这里说一下 git clone https://github.com/shantigilbert/LibreELEC.tv.git Sx05RE
仓库的地址已经无法clone仓库了,所以这里注意一下,使用git clone https://github.com/EmuELEC/Sx05RE.git
同时需要把自己ubuntu的sshkey同步到github上,这样才会有权限下载,这里不过多详细,百度即可很多教程。
当把github的源码git clone完成后。即将开始编译,首先那就是命令。github给的是905的编译命令。
make image PROJECT=S905 ARCH=arm DISTRO=Sx05RE
如何编译805呢?这里我们就需要看PROJEC即可,找到projects的文件夹;
/project/Sx05RE/projects$ ls
Generic imx6 Odroid_C2 RPi RPi2 S805 S905 S912 Slice Slice3 WeTek_Core WeTek_Hub WeTek_Play WeTek_Play_2
很明显可以使用:
make image PROJECT=S805 ARCH=arm DISTRO=Sx05RE
那就使用这个命令开始编译。
上来就报错
.1/remote-stub.c
mv -f .deps/strcache.Tpo .deps/strcache.Po
mv -f .deps/remote-stub.Tpo .deps/remote-stub.Po
mv -f .deps/hash.Tpo .deps/hash.Po
mv -f .deps/vpath.Tpo .deps/vpath.Po
mv -f .deps/remake.Tpo .deps/remake.Po
mv -f .deps/main.Tpo .deps/main.Po
mv -f .deps/variable.Tpo .deps/variable.Po
mv -f .deps/read.Tpo .deps/read.Po
/usr/bin/gcc -O2 -Wall -pipe -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/include -Wno-format-security -Wl,--export-dynamic -Wl,-rpath,/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/lib -L/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/lib -o make ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o guile.o implicit.o job.o load.o loadapi.o main.o misc.o posixos.o output.o read.o remake.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o remote-stub.o glob/libglob.a -ldl
glob/libglob.a(glob.o): In function `glob_in_dir':
glob.c:(.text+0x2c1): undefined reference to `__alloca'
glob.c:(.text+0x43e): undefined reference to `__alloca'
glob.c:(.text+0x5f8): undefined reference to `__alloca'
glob.c:(.text+0x658): undefined reference to `__alloca'
glob/libglob.a(glob.o): In function `glob':
glob.c:(.text+0x95b): undefined reference to `__alloca'
glob/libglob.a(glob.o):glob.c:(.text+0x101a): more undefined references to `__alloca' follow
collect2: error: ld returned 1 exit status
Makefile:655: recipe for target 'make' failed
make[3]: *** [make] Error 1
make[3]: Leaving directory '/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/make-4.2.1/.x86_64-linux-gnu'
Makefile:798: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/make-4.2.1/.x86_64-linux-gnu'
Makefile:534: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/make-4.2.1/.x86_64-linux-gnu'
Makefile:12: recipe for target 'image' failed
make: *** [image] Error 2
看到报错不要慌,有些初入门开发的同学,一看到failed就不知所措,不知道怎么下手。
这里举个例子,其实这些报错都比较简单。自己认真看下报错原因,很简单,只不过是glob.c有个未定义。
直接找到glob.c定义就好,直接find ./ -name glob.c,然后到这个文件路径下定义
#define __alloca alloca
这个错误是glibc2.7引起的,只要定义一下就可以编译过去。
继续编译...
libtool: compile: /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/bin/host-gcc -DHAVE_CONFIG_H -I. -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib -I.. -I.. -I../glib -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -fvisibility=hidden -O2 -Wall -pipe -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/include -Wno-format-security -MT libglib_2_0_la-ghash.lo -MD -MP -MF .deps/libglib_2_0_la-ghash.Tpo -c /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib/ghash.c -o libglib_2_0_la-ghash.o
libtool: compile: /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/bin/host-gcc -DHAVE_CONFIG_H -I. -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib -I.. -I.. -I../glib -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -fvisibility=hidden -O2 -Wall -pipe -I/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/include -Wno-format-security -MT libglib_2_0_la-ggettext.lo -MD -MP -MF .deps/libglib_2_0_la-ggettext.Tpo -c /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib/ggettext.c -o libglib_2_0_la-ggettext.o
/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib/gdate.c: In function 'g_date_strftime':
/home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/pkg-config-0.29.1/glib/glib/gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral]
tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);
^~~~~~
cc1: some warnings being treated as errors
make[7]: *** [Makefile:1387: libglib_2_0_la-gdate.lo] Error 1
make[7]: *** Waiting for unfinished jobs....
停了下来,莫慌,继续看报错。先找到该文件#find ./ -name "gdate.c"
修改该文件找到g_date_strftime函数实现的地方,将添加上去
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
g_date_strftime()
{
}
#pragma GCC diagnostic pop
报错解决,继续编译...
checking for gcj... no
checking for x86_64-linux-gnu-windres... no
checking for windres... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: linking /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/libtool-2.4.6/GNUmakefile to GNUmakefile
config.status: executing tests/atconfig commands
config.status: executing depfiles commands
config.status: executing libtool commands
Executing (host): make
cd /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/libtool-2.4.6 && /bin/sh /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/libtool-2.4.6/build-aux/missing automake-1.15 --gnu Makefile
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/toolchain/bin/automake-1.15 line 3936.
make: *** [Makefile:1002: /home/leo/project/Sx05RE/build.Sx05RE-S805.arm-1.8.6/libtool-2.4.6/Makefile.in] Error 255
找到substitute_ac_subst_variables_worker,替换
#$text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
$text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
期间还有源失效,重新替换源即可,还有各种报错一一解决。
终于到了最后编译完成。烧录进去发现直接进kodi了。
下次有空再写,如何去掉kodi,只保留EmulationStation,然后进行EmulationStation和模拟器的定制修改。