mirror of
https://github.com/CoderSherlock/CoderSherlock.github.io.git
synced 2026-06-13 08:08:10 -07:00
348 lines
15 KiB
HTML
348 lines
15 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="generator" content="Hugo 0.16" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
|
<link rel='stylesheet' href='//fonts.googleapis.com/css?family=Open+Sans|Marcellus+SC'>
|
|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
|
|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/solarized_dark.min.css">
|
|
<link rel="stylesheet" href="https://codersherlock.github.io/css/styles.css">
|
|
<link rel="stylesheet" href="https://codersherlock.github.io/css/custom.css">
|
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="https://codersherlock.github.io//index.xml">
|
|
|
|
|
|
<title>Cross Compile Seafile to ARM - Mil años de solitario</title>
|
|
<meta property='og:title' content="Cross Compile Seafile to ARM - Mil años de solitario">
|
|
<meta property="og:type" content="article">
|
|
|
|
|
|
<meta property="og:url" content="https://codersherlock.github.io/post/Cross-Compile-Seafile-2-ARM/">
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<header class="site">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="https://codersherlock.github.io/">Mil años de solitario</a>
|
|
</div>
|
|
|
|
<div id="navbar" class="collapse navbar-collapse">
|
|
|
|
<ul class="nav navbar-nav navbar-right">
|
|
|
|
|
|
<li><a href="https://CoderSherlock.github.io/about/">about me</a></li>
|
|
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<div class="site">
|
|
<div class="container">
|
|
|
|
|
|
|
|
<div class="single">
|
|
|
|
<div class="row">
|
|
<div class="col-md-8">
|
|
|
|
<article class="single" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
|
|
<meta itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" content="https://codersherlock.github.io/"/>
|
|
<meta itemprop="dateModified" content="2016-07-30T14:02:34-04:00">
|
|
<meta itemprop="headline" content="Cross Compile Seafile to ARM">
|
|
<meta itemprop="description" content="Motivation 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.">
|
|
<meta itemprop="url" content="https://codersherlock.github.io/post/Cross-Compile-Seafile-2-ARM/">
|
|
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
|
|
<meta itemprop="url" content="https://codersherlock.github.io/images/default.jpg" />
|
|
<meta itemprop="width" content="800">
|
|
<meta itemprop="height" content="800">
|
|
</div>
|
|
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
|
|
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
|
|
<meta itemprop="url" content="https://codersherlock.github.io/images/logo.jpg">
|
|
<meta itemprop="width" content="100">
|
|
<meta itemprop="height" content="100">
|
|
</div>
|
|
<meta itemprop="name" content="Mil años de solitario">
|
|
</div>
|
|
<div itemprop="author" itemscope itemtype="https://schema.org/Person">
|
|
<meta itemprop="name" content="">
|
|
</div>
|
|
|
|
<header class="article-header">
|
|
<time itemprop="datePublished" pubdate="pubdate" datetime="2016-07-30T14:02:34-04:00">Sat, Jul 30, 2016</time>
|
|
<h1 class="article-title">Cross Compile Seafile to ARM</h1>
|
|
</header>
|
|
|
|
<div class="article-body" itemprop="articleBody">
|
|
|
|
|
|
<h1 id="motivation">Motivation</h1>
|
|
|
|
<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>
|
|
|
|
<h1 id="pre-work">Pre-work</h1>
|
|
|
|
<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>
|
|
|
|
<h2 id="prerequisites">Prerequisites</h2>
|
|
|
|
<pre><code>$ sudo apt-get install build-essential
|
|
$ sudo apt-get install pkg-config automake autoconf libtool
|
|
</code></pre>
|
|
|
|
<h2 id="link-with-standalone-tool-chains">Link with standalone tool-chains</h2>
|
|
|
|
<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>
|
|
|
|
<h2 id="original-system-environment-configuration">Original System Environment Configuration</h2>
|
|
|
|
<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>
|
|
|
|
<h1 id="compile-process">Compile Process</h1>
|
|
|
|
<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>
|
|
|
|
<h2 id="libsearpc">libsearpc</h2>
|
|
|
|
<h3 id="glib">glib</h3>
|
|
|
|
<h4 id="libiconv">libiconv</h4>
|
|
|
|
<h4 id="libffi">libffi</h4>
|
|
|
|
<h4 id="gettext">gettext</h4>
|
|
|
|
<h3 id="libjasson">libjasson</h3>
|
|
|
|
<h2 id="ccnet">ccnet</h2>
|
|
|
|
<h3 id="libuuid">libuuid</h3>
|
|
|
|
<h2 id="seafile">seafile</h2>
|
|
|
|
<h1 id="preferences">Preferences</h1>
|
|
|
|
<ul>
|
|
<li><a href="http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/">zwyuan</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
<aside>
|
|
<div class="section"><a href="https://codersherlock.github.io/tags/android" class="tag">android</a> <a href="https://codersherlock.github.io/tags/arm" class="tag">arm</a> <a href="https://codersherlock.github.io/tags/research" class="tag">research</a> </div>
|
|
|
|
<div class="section share">
|
|
<a href="http://www.facebook.com/sharer.php?src=bm&u=https%3a%2f%2fcodersherlock.github.io%2fpost%2fCross-Compile-Seafile-2-ARM%2f&t=Cross%20Compile%20Seafile%20to%20ARM" onclick="window.open(this.href, 'PCwindow', 'width=550, height=350, menubar=no, toolbar=no, scrollbars=yes'); return false;"><i class="fa fa-facebook"></i></a>
|
|
<a href="http://twitter.com/intent/tweet?url=https%3a%2f%2fcodersherlock.github.io%2fpost%2fCross-Compile-Seafile-2-ARM%2f&text=Cross%20Compile%20Seafile%20to%20ARM&tw_p=tweetbutton" onclick="window.open(this.href, 'PCwindow', 'width=550, height=350, menubar=no, toolbar=no, scrollbars=yes'); return false;"><i class="fa fa-twitter"></i></a>
|
|
<a href="https://plus.google.com/share?url=https%3a%2f%2fcodersherlock.github.io%2fpost%2fCross-Compile-Seafile-2-ARM%2f" onclick="window.open(this.href, 'PCwindow', 'width=550, height=350, menubar=no, toolbar=no, scrollbars=yes'); return false;"><i class="fa fa-google-plus"></i></a>
|
|
<a href="http://getpocket.com/edit?url=https%3a%2f%2fcodersherlock.github.io%2fpost%2fCross-Compile-Seafile-2-ARM%2f&title=Cross%20Compile%20Seafile%20to%20ARM" onclick="window.open(this.href, 'PCwindow', 'width=550, height=350, menubar=no, toolbar=no, scrollbars=yes'); return false;"><i class="fa fa-get-pocket"></i></a>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="section">
|
|
<div id="disqus_thread"></div>
|
|
<script type="text/javascript">
|
|
(function() {
|
|
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
|
var disqus_shortname = 'codersherlockblog';
|
|
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
|
})();
|
|
</script>
|
|
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
|
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
|
</div>
|
|
|
|
|
|
</aside>
|
|
|
|
</article>
|
|
|
|
</div>
|
|
<div class="col-md-4">
|
|
|
|
<aside class="site">
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h2 class="panel-title">LatestPosts</h2>
|
|
</div>
|
|
<div class="list-group">
|
|
|
|
<a href="https://codersherlock.github.io/post/Cross-Compile-RSync-ARM/" class="list-group-item">Cross Compile RSync ARM</a>
|
|
|
|
<a href="https://codersherlock.github.io/post/Pokemon-Go-Hack/" class="list-group-item">Pokemon Go Hack</a>
|
|
|
|
<a href="https://codersherlock.github.io/post/Cross-Compile-Seafile-2-ARM/" class="list-group-item">Cross Compile Seafile to ARM</a>
|
|
|
|
<a href="https://codersherlock.github.io/about/" class="list-group-item">about me</a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h2 class="panel-title">category</h2>
|
|
</div>
|
|
<div class="list-group">
|
|
|
|
<a href="https://codersherlock.github.io/categories/cross-compile" class="list-group-item">cross-compile</a>
|
|
|
|
<a href="https://codersherlock.github.io/categories/game" class="list-group-item">game</a>
|
|
|
|
<a href="https://codersherlock.github.io/categories/hack" class="list-group-item">hack</a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h2 class="panel-title">tag</h2>
|
|
</div>
|
|
<div class="list-group">
|
|
|
|
<a href="https://codersherlock.github.io/tags/android" class="list-group-item">android</a>
|
|
|
|
<a href="https://codersherlock.github.io/tags/arm" class="list-group-item">arm</a>
|
|
|
|
<a href="https://codersherlock.github.io/tags/research" class="list-group-item">research</a>
|
|
|
|
<a href="https://codersherlock.github.io/tags/game" class="list-group-item">game</a>
|
|
|
|
<a href="https://codersherlock.github.io/tags/github" class="list-group-item">github</a>
|
|
|
|
<a href="https://codersherlock.github.io/tags/hack" class="list-group-item">hack</a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</aside>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="site">
|
|
<div class="container">
|
|
<p>Copyright (c) 2016 - 2016, Pengzhan Hao; all rights reserved.</p>
|
|
<p>Powered by <a href="http://gohugo.io" target="_blank" rel="nofollow">Hugo</a>, Theme <a href="https://github.com/dim0627/hugo_theme_beg" target="_blank" rel="nofollow">beg</a> designed by <a href="http://yet.unresolved.xyz" target="_blank" rel="nofollow">Daisuke Tsuji</a></p>
|
|
</div>
|
|
</footer>
|
|
|
|
<script src="//code.jquery.com/jquery-2.2.1.min.js"></script>
|
|
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
|
|
<script>hljs.initHighlightingOnLoad();</script>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|