mirror of
https://github.com/CoderSherlock/CoderSherlock.github.io.git
synced 2026-06-13 08:08:10 -07:00
381 lines
9.2 KiB
HTML
381 lines
9.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="description" content="">
|
|
<meta name="generator" content="Hugo 0.16" />
|
|
|
|
<title>Cross Compile Seafile 2 ARM · Mil años de solitario</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
|
|
|
|
<!--[if lte IE 8]>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-responsive-old-ie-min.css">
|
|
<![endif]-->
|
|
<!--[if gt IE 8]><!-->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-responsive-min.css">
|
|
<!--<![endif]-->
|
|
|
|
<!--[if lte IE 8]>
|
|
<link rel="stylesheet" href="/css/side-menu-old-ie.css">
|
|
<![endif]-->
|
|
<!--[if gt IE 8]><!-->
|
|
<link rel="stylesheet" href="/css/side-menu.css">
|
|
<!--<![endif]-->
|
|
|
|
<link rel="stylesheet" href="/css/blackburn.css">
|
|
|
|
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
|
|
|
|
|
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="shortcut icon" href="https://codersherlock.github.io/img/favicon.ico" type="image/x-icon" />
|
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
<div id="layout">
|
|
|
|
|
|
<a href="#menu" id="menuLink" class="menu-link">
|
|
|
|
<span></span>
|
|
</a>
|
|
<div id="menu">
|
|
|
|
|
|
|
|
<div class="pure-menu">
|
|
<ul class="pure-menu-list">
|
|
|
|
|
|
<li class="pure-menu-item">
|
|
<a class="pure-menu-link" href="/"><i class='fa fa-home fa-fw'></i>Home</a>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="pure-menu-item">
|
|
<a class="pure-menu-link" href="/post/"><i class='fa fa-list fa-fw'></i>Posts</a>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="pure-menu-item">
|
|
<a class="pure-menu-link" href="/about/"><i class='fa fa-user fa-fw'></i>About</a>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="pure-menu-item">
|
|
<a class="pure-menu-link" href="/contact/"><i class='fa fa-phone fa-fw'></i>Contact</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="pure-menu social">
|
|
<ul class="pure-menu-list">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<div class="small-print">
|
|
<small></small>
|
|
</div>
|
|
<div class="small-print">
|
|
<small>Built with <a href="https://gohugo.io/" target="_blank">Hugo</a></small>
|
|
<small>Theme <a href="https://github.com/yoshiharuyamashita/blackburn" target="_blank">Blackburn</a></small>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div id="main">
|
|
|
|
|
|
<div class="header">
|
|
<h1>Cross Compile Seafile 2 ARM</h1>
|
|
<h2></h2>
|
|
</div>
|
|
<div class="content">
|
|
|
|
<div class="post-meta">
|
|
|
|
<div>
|
|
<i class="fa fa-calendar fa-fw"></i>
|
|
<time>30 Jul 2016, 14:02</time>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
<i class="fa fa-tags fa-fw"></i>
|
|
|
|
<a class="post-taxonomy-tag" href="https://codersherlock.github.io/tags/android">android</a> /
|
|
|
|
<a class="post-taxonomy-tag" href="https://codersherlock.github.io/tags/arm">arm</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h1 id="cross-compile-seafile-to-arm-platform">Cross Compile Seafile to ARM platform</h1>
|
|
|
|
<h2 id="motivation">Motivation</h2>
|
|
|
|
<p>This project is working for delta sync from mobile to server. Currently, there’s no mobile program/solution has supporting to delta sync(Include Dropbox/ Goggle Drive). But the truth is that almost every pc version sync program can work as delta sync properly or not. So in this article, I’ll provide a workbench for cross compilation and evaluation. And finally come up with a reason of how to port better incremental synchronize solution on mobile platform.</p>
|
|
|
|
<h2 id="pre-work">Pre-work</h2>
|
|
|
|
<p>Basically, I used the native android compilation tool-chains, <a href="https://developer.android.com/ndk/downloads/index.html">Android NDK</a>, as working tools. Due to my working situation, I use a <a href="https://shield.nvidia.com/tablet/k1">Nvidia Shield Tablet</a> as target device. As <em>Zengwen</em> said in his <a href="http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/">blog</a>, newest updated NDK might has some issue which can influence compilation progress. So you can find <a href="http://stackoverflow.com/questions/6849981/where-do-i-find-old-versions-of-android-ndk">other version</a> of NDK once you have some problems. Based on what <em>Zengwen’s</em> blog mentioned, we can write following useful system environment and export in terminal.</p>
|
|
|
|
<h3 id="prerequisites">Prerequisites</h3>
|
|
|
|
<pre><code>$ sudo apt-get install build-essential
|
|
$ sudo apt-get install pkg-config automake autoconf libtool
|
|
</code></pre>
|
|
|
|
<h3 id="link-with-standalone-tool-chains">Link with standalone tool-chains</h3>
|
|
|
|
<p>In order to build standalone tool-chains, we need first to export following system environment. After doing that, we can use following command to build a standalone tool-chains from downloaded NDK.</p>
|
|
|
|
<pre><code>$ ${NDK}/build/tools/make-standalone-toolchain.sh \
|
|
--toolchain=arm-linux-androideabi-4.9 \
|
|
--stl=gnustl \
|
|
--arch=arm \
|
|
--ndk-dir=/home/moslab/Android/android-ndk-r12b \
|
|
--package-dir=/home/moslab/Android \
|
|
--install-dir=/home/moslab/Android/android-ndk-toolchain \
|
|
--platform=android-22
|
|
</code></pre>
|
|
|
|
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
|
|
|
<p>[TODO]-> I will fix this part later.</p>
|
|
|
|
<pre><code># Android NDK sources and standalone toolchain is put here
|
|
export DEV=~/Android/
|
|
|
|
# All the built binaries, libs and their header will be installed here
|
|
export PREFIX=/opt/android
|
|
|
|
# Don't mix up .pc files from your host and build target
|
|
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
|
|
|
|
# GCC for Android version to use
|
|
# 4.9 is the only available version since NDK r11!
|
|
export GCC_VER=4.9
|
|
|
|
# The building system we are using (Linux x86_64)
|
|
export BUILD_SYS=x86_64-linux-gnu
|
|
|
|
# Set Android target API level
|
|
export ANDROID_API=22
|
|
|
|
# Set Android target arch
|
|
export ANDROID_ARCH=arm
|
|
|
|
# Set Android target name, according to Table 2 in
|
|
# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
|
export ANDROID_TARGET=armv7-none-linux-androideabi
|
|
|
|
# The cross-compile toolchain we use
|
|
export TOOLCHAIN=arm-linux-androideabi
|
|
|
|
# This is a symlink pointing to the real Android NDK r12b
|
|
export NDK=${DEV}/android-ndk
|
|
|
|
# The path of standalone NDK toolchain
|
|
# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
|
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
|
|
|
# this one is the absolute, prebuilt path
|
|
export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
|
|
|
# this one is the absolute, prebuilt path
|
|
export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
|
|
|
# Non-exhaustive lists of compiler + binutils
|
|
export AR=${CROSS_PREFIX}-ar
|
|
export AS=${CROSS_PREFIX}-as
|
|
export LD=${CROSS_PREFIX}-ld
|
|
export NM=${CROSS_PREFIX}-nm
|
|
export CC=${CROSS_PREFIX}-gcc
|
|
export CXX=${CROSS_PREFIX}-g++
|
|
export CPP=${CROSS_PREFIX}-cpp
|
|
export CXXCPP=${CROSS_PREFIX}-cpp
|
|
export STRIP=${CROSS_PREFIX}-strip
|
|
export RANLIB=${CROSS_PREFIX}-ranlib
|
|
export STRINGS=${CROSS_PREFIX}-strings
|
|
|
|
# Set build flags
|
|
# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
|
export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
|
|
export CFLAGS="--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar"
|
|
export CXXFLAGS=${CFLAGS}
|
|
export CPPFLAGS="--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid"
|
|
export LIBS="-lc -lstdc++ -ld"
|
|
export LDFLAGS="-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib"
|
|
</code></pre>
|
|
|
|
<h2 id="compile-process">Compile Process</h2>
|
|
|
|
<p>To compile seafile, we should compile ccnet and libsearpc first. As for these two projects, they all have their own dependencies, so we must follow some order to run the compilation.</p>
|
|
|
|
<h3 id="libsearpc">libsearpc</h3>
|
|
|
|
<h4 id="glib">glib</h4>
|
|
|
|
<h5 id="libiconv">libiconv</h5>
|
|
|
|
<h5 id="libffi">libffi</h5>
|
|
|
|
<h5 id="gettext">gettext</h5>
|
|
|
|
<h4 id="libjasson">libjasson</h4>
|
|
|
|
<h3 id="ccnet">ccnet</h3>
|
|
|
|
<h4 id="libuuid">libuuid</h4>
|
|
|
|
<h3 id="seafile">seafile</h3>
|
|
|
|
<h2 id="preferences">Preferences</h2>
|
|
|
|
<ul>
|
|
<li><a href="http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/">zwyuan</a></li>
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="prev-next-post pure-g">
|
|
<div class="pure-u-1-24" style="text-align: left;">
|
|
|
|
</div>
|
|
<div class="pure-u-10-24">
|
|
|
|
</div>
|
|
<div class="pure-u-2-24">
|
|
|
|
</div>
|
|
<div class="pure-u-10-24">
|
|
|
|
<nav class="next">
|
|
<a href="https://codersherlock.github.io/post/Pokemon-Go-Hack/">Pokemon Go Hack</a>
|
|
</nav>
|
|
|
|
</div>
|
|
<div class="pure-u-1-24" style="text-align: right;">
|
|
|
|
<a href="https://codersherlock.github.io/post/Pokemon-Go-Hack/"><i class="fa fa-chevron-right"></i></a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<script src="https://codersherlock.github.io/js/ui.js"></script>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|