mirror of
https://github.com/CoderSherlock/CoderSherlock.github.io.git
synced 2026-06-13 08:08:10 -07:00
ARM_update
This commit is contained in:
@@ -52,10 +52,14 @@ Anyway, after coming back, I think I write too much on useless words, so let me
|
|||||||
|
|
||||||
<h2 id="pre-work">Pre-work</h2>
|
<h2 id="pre-work">Pre-work</h2>
|
||||||
|
|
||||||
|
<h3 id="tool-chain">Tool-Chain</h3>
|
||||||
|
|
||||||
|
<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&rsquo;s</em> blog mentioned, we can write following useful system environment and export in terminal.</p>
|
||||||
|
|
||||||
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
||||||
|
|
||||||
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
||||||
export DEV=${HOME}/dev
|
export DEV=~/Android/
|
||||||
|
|
||||||
/# All the built binaries, libs and their header will be installed here
|
/# All the built binaries, libs and their header will be installed here
|
||||||
export PREFIX=/opt/android
|
export PREFIX=/opt/android
|
||||||
@@ -71,14 +75,14 @@ export GCC_VER=4.9
|
|||||||
export BUILD_SYS=x86_64-linux-gnu
|
export BUILD_SYS=x86_64-linux-gnu
|
||||||
|
|
||||||
/# Set Android target API level
|
/# Set Android target API level
|
||||||
export ANDROID_API=19
|
export ANDROID_API=22
|
||||||
|
|
||||||
/# Set Android target arch
|
/# Set Android target arch
|
||||||
export ANDROID_ARCH=arm
|
export ANDROID_ARCH=arm
|
||||||
|
|
||||||
/# Set Android target name, according to Table 2 in
|
/# Set Android target name, according to Table 2 in
|
||||||
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export ANDROID_TARGET=armv5te-none-linux-androideabi
|
export ANDROID_TARGET=armv7-none-linux-androideabi
|
||||||
|
|
||||||
/# The cross-compile toolchain we use
|
/# The cross-compile toolchain we use
|
||||||
export TOOLCHAIN=arm-linux-androideabi
|
export TOOLCHAIN=arm-linux-androideabi
|
||||||
@@ -90,15 +94,11 @@ export NDK=${DEV}/android-ndk
|
|||||||
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
||||||
|
|
||||||
/# Set Android Sysroot according to API and arch
|
|
||||||
export SYSROOT=${NDK_TOOLCHAIN}/sysroot
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
||||||
|
|
||||||
/# Binutils path
|
|
||||||
export CROSS_PREFIX=${NDK_TOOLCHAIN}/bin/${TOOLCHAIN}
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
||||||
|
|
||||||
/# Non-exhaustive lists of compiler + binutils
|
/# Non-exhaustive lists of compiler + binutils
|
||||||
export AR=${CROSS_PREFIX}-ar
|
export AR=${CROSS_PREFIX}-ar
|
||||||
@@ -119,9 +119,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
|
|||||||
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
||||||
export CXXFLAGS=${CFLAGS}
|
export CXXFLAGS=${CFLAGS}
|
||||||
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
||||||
export LIBS=&quot;-lc&quot;
|
export LIBS=&quot;-lc -lstdc++ -ld&quot;
|
||||||
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
@@ -52,10 +52,14 @@ Anyway, after coming back, I think I write too much on useless words, so let me
|
|||||||
|
|
||||||
<h2 id="pre-work">Pre-work</h2>
|
<h2 id="pre-work">Pre-work</h2>
|
||||||
|
|
||||||
|
<h3 id="tool-chain">Tool-Chain</h3>
|
||||||
|
|
||||||
|
<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&rsquo;s</em> blog mentioned, we can write following useful system environment and export in terminal.</p>
|
||||||
|
|
||||||
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
||||||
|
|
||||||
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
||||||
export DEV=${HOME}/dev
|
export DEV=~/Android/
|
||||||
|
|
||||||
/# All the built binaries, libs and their header will be installed here
|
/# All the built binaries, libs and their header will be installed here
|
||||||
export PREFIX=/opt/android
|
export PREFIX=/opt/android
|
||||||
@@ -71,14 +75,14 @@ export GCC_VER=4.9
|
|||||||
export BUILD_SYS=x86_64-linux-gnu
|
export BUILD_SYS=x86_64-linux-gnu
|
||||||
|
|
||||||
/# Set Android target API level
|
/# Set Android target API level
|
||||||
export ANDROID_API=19
|
export ANDROID_API=22
|
||||||
|
|
||||||
/# Set Android target arch
|
/# Set Android target arch
|
||||||
export ANDROID_ARCH=arm
|
export ANDROID_ARCH=arm
|
||||||
|
|
||||||
/# Set Android target name, according to Table 2 in
|
/# Set Android target name, according to Table 2 in
|
||||||
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export ANDROID_TARGET=armv5te-none-linux-androideabi
|
export ANDROID_TARGET=armv7-none-linux-androideabi
|
||||||
|
|
||||||
/# The cross-compile toolchain we use
|
/# The cross-compile toolchain we use
|
||||||
export TOOLCHAIN=arm-linux-androideabi
|
export TOOLCHAIN=arm-linux-androideabi
|
||||||
@@ -90,15 +94,11 @@ export NDK=${DEV}/android-ndk
|
|||||||
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
||||||
|
|
||||||
/# Set Android Sysroot according to API and arch
|
|
||||||
export SYSROOT=${NDK_TOOLCHAIN}/sysroot
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
||||||
|
|
||||||
/# Binutils path
|
|
||||||
export CROSS_PREFIX=${NDK_TOOLCHAIN}/bin/${TOOLCHAIN}
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
||||||
|
|
||||||
/# Non-exhaustive lists of compiler + binutils
|
/# Non-exhaustive lists of compiler + binutils
|
||||||
export AR=${CROSS_PREFIX}-ar
|
export AR=${CROSS_PREFIX}-ar
|
||||||
@@ -119,9 +119,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
|
|||||||
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
||||||
export CXXFLAGS=${CFLAGS}
|
export CXXFLAGS=${CFLAGS}
|
||||||
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
||||||
export LIBS=&quot;-lc&quot;
|
export LIBS=&quot;-lc -lstdc++ -ld&quot;
|
||||||
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
@@ -98,10 +98,14 @@
|
|||||||
|
|
||||||
<h2 id="pre-work">Pre-work</h2>
|
<h2 id="pre-work">Pre-work</h2>
|
||||||
|
|
||||||
|
<h3 id="tool-chain">Tool-Chain</h3>
|
||||||
|
|
||||||
|
<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="original-system-environment-configuration">Original System Environment Configuration</h3>
|
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
||||||
|
|
||||||
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
||||||
export DEV=${HOME}/dev
|
export DEV=~/Android/
|
||||||
|
|
||||||
/# All the built binaries, libs and their header will be installed here
|
/# All the built binaries, libs and their header will be installed here
|
||||||
export PREFIX=/opt/android
|
export PREFIX=/opt/android
|
||||||
@@ -117,14 +121,14 @@ export GCC_VER=4.9
|
|||||||
export BUILD_SYS=x86_64-linux-gnu
|
export BUILD_SYS=x86_64-linux-gnu
|
||||||
|
|
||||||
/# Set Android target API level
|
/# Set Android target API level
|
||||||
export ANDROID_API=19
|
export ANDROID_API=22
|
||||||
|
|
||||||
/# Set Android target arch
|
/# Set Android target arch
|
||||||
export ANDROID_ARCH=arm
|
export ANDROID_ARCH=arm
|
||||||
|
|
||||||
/# Set Android target name, according to Table 2 in
|
/# Set Android target name, according to Table 2 in
|
||||||
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export ANDROID_TARGET=armv5te-none-linux-androideabi
|
export ANDROID_TARGET=armv7-none-linux-androideabi
|
||||||
|
|
||||||
/# The cross-compile toolchain we use
|
/# The cross-compile toolchain we use
|
||||||
export TOOLCHAIN=arm-linux-androideabi
|
export TOOLCHAIN=arm-linux-androideabi
|
||||||
@@ -136,15 +140,11 @@ export NDK=${DEV}/android-ndk
|
|||||||
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
||||||
|
|
||||||
/# Set Android Sysroot according to API and arch
|
|
||||||
export SYSROOT=${NDK_TOOLCHAIN}/sysroot
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
||||||
|
|
||||||
/# Binutils path
|
|
||||||
export CROSS_PREFIX=${NDK_TOOLCHAIN}/bin/${TOOLCHAIN}
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
||||||
|
|
||||||
/# Non-exhaustive lists of compiler + binutils
|
/# Non-exhaustive lists of compiler + binutils
|
||||||
export AR=${CROSS_PREFIX}-ar
|
export AR=${CROSS_PREFIX}-ar
|
||||||
@@ -165,10 +165,16 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
|
|||||||
export CFLAGS="--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar"
|
export CFLAGS="--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar"
|
||||||
export CXXFLAGS=${CFLAGS}
|
export CXXFLAGS=${CFLAGS}
|
||||||
export CPPFLAGS="--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid"
|
export CPPFLAGS="--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid"
|
||||||
export LIBS="-lc"
|
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"
|
export LDFLAGS="-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib"
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+16
-10
@@ -52,10 +52,14 @@ Anyway, after coming back, I think I write too much on useless words, so let me
|
|||||||
|
|
||||||
<h2 id="pre-work">Pre-work</h2>
|
<h2 id="pre-work">Pre-work</h2>
|
||||||
|
|
||||||
|
<h3 id="tool-chain">Tool-Chain</h3>
|
||||||
|
|
||||||
|
<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&rsquo;s</em> blog mentioned, we can write following useful system environment and export in terminal.</p>
|
||||||
|
|
||||||
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
||||||
|
|
||||||
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
||||||
export DEV=${HOME}/dev
|
export DEV=~/Android/
|
||||||
|
|
||||||
/# All the built binaries, libs and their header will be installed here
|
/# All the built binaries, libs and their header will be installed here
|
||||||
export PREFIX=/opt/android
|
export PREFIX=/opt/android
|
||||||
@@ -71,14 +75,14 @@ export GCC_VER=4.9
|
|||||||
export BUILD_SYS=x86_64-linux-gnu
|
export BUILD_SYS=x86_64-linux-gnu
|
||||||
|
|
||||||
/# Set Android target API level
|
/# Set Android target API level
|
||||||
export ANDROID_API=19
|
export ANDROID_API=22
|
||||||
|
|
||||||
/# Set Android target arch
|
/# Set Android target arch
|
||||||
export ANDROID_ARCH=arm
|
export ANDROID_ARCH=arm
|
||||||
|
|
||||||
/# Set Android target name, according to Table 2 in
|
/# Set Android target name, according to Table 2 in
|
||||||
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export ANDROID_TARGET=armv5te-none-linux-androideabi
|
export ANDROID_TARGET=armv7-none-linux-androideabi
|
||||||
|
|
||||||
/# The cross-compile toolchain we use
|
/# The cross-compile toolchain we use
|
||||||
export TOOLCHAIN=arm-linux-androideabi
|
export TOOLCHAIN=arm-linux-androideabi
|
||||||
@@ -90,15 +94,11 @@ export NDK=${DEV}/android-ndk
|
|||||||
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
||||||
|
|
||||||
/# Set Android Sysroot according to API and arch
|
|
||||||
export SYSROOT=${NDK_TOOLCHAIN}/sysroot
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
||||||
|
|
||||||
/# Binutils path
|
|
||||||
export CROSS_PREFIX=${NDK_TOOLCHAIN}/bin/${TOOLCHAIN}
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
||||||
|
|
||||||
/# Non-exhaustive lists of compiler + binutils
|
/# Non-exhaustive lists of compiler + binutils
|
||||||
export AR=${CROSS_PREFIX}-ar
|
export AR=${CROSS_PREFIX}-ar
|
||||||
@@ -119,9 +119,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
|
|||||||
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
||||||
export CXXFLAGS=${CFLAGS}
|
export CXXFLAGS=${CFLAGS}
|
||||||
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
||||||
export LIBS=&quot;-lc&quot;
|
export LIBS=&quot;-lc -lstdc++ -ld&quot;
|
||||||
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
+16
-10
@@ -25,10 +25,14 @@
|
|||||||
|
|
||||||
<h2 id="pre-work">Pre-work</h2>
|
<h2 id="pre-work">Pre-work</h2>
|
||||||
|
|
||||||
|
<h3 id="tool-chain">Tool-Chain</h3>
|
||||||
|
|
||||||
|
<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&rsquo;s</em> blog mentioned, we can write following useful system environment and export in terminal.</p>
|
||||||
|
|
||||||
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
||||||
|
|
||||||
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
||||||
export DEV=${HOME}/dev
|
export DEV=~/Android/
|
||||||
|
|
||||||
/# All the built binaries, libs and their header will be installed here
|
/# All the built binaries, libs and their header will be installed here
|
||||||
export PREFIX=/opt/android
|
export PREFIX=/opt/android
|
||||||
@@ -44,14 +48,14 @@ export GCC_VER=4.9
|
|||||||
export BUILD_SYS=x86_64-linux-gnu
|
export BUILD_SYS=x86_64-linux-gnu
|
||||||
|
|
||||||
/# Set Android target API level
|
/# Set Android target API level
|
||||||
export ANDROID_API=19
|
export ANDROID_API=22
|
||||||
|
|
||||||
/# Set Android target arch
|
/# Set Android target arch
|
||||||
export ANDROID_ARCH=arm
|
export ANDROID_ARCH=arm
|
||||||
|
|
||||||
/# Set Android target name, according to Table 2 in
|
/# Set Android target name, according to Table 2 in
|
||||||
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export ANDROID_TARGET=armv5te-none-linux-androideabi
|
export ANDROID_TARGET=armv7-none-linux-androideabi
|
||||||
|
|
||||||
/# The cross-compile toolchain we use
|
/# The cross-compile toolchain we use
|
||||||
export TOOLCHAIN=arm-linux-androideabi
|
export TOOLCHAIN=arm-linux-androideabi
|
||||||
@@ -63,15 +67,11 @@ export NDK=${DEV}/android-ndk
|
|||||||
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
||||||
|
|
||||||
/# Set Android Sysroot according to API and arch
|
|
||||||
export SYSROOT=${NDK_TOOLCHAIN}/sysroot
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
||||||
|
|
||||||
/# Binutils path
|
|
||||||
export CROSS_PREFIX=${NDK_TOOLCHAIN}/bin/${TOOLCHAIN}
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
||||||
|
|
||||||
/# Non-exhaustive lists of compiler + binutils
|
/# Non-exhaustive lists of compiler + binutils
|
||||||
export AR=${CROSS_PREFIX}-ar
|
export AR=${CROSS_PREFIX}-ar
|
||||||
@@ -92,9 +92,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
|
|||||||
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
||||||
export CXXFLAGS=${CFLAGS}
|
export CXXFLAGS=${CFLAGS}
|
||||||
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
||||||
export LIBS=&quot;-lc&quot;
|
export LIBS=&quot;-lc -lstdc++ -ld&quot;
|
||||||
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
+16
-10
@@ -25,10 +25,14 @@
|
|||||||
|
|
||||||
<h2 id="pre-work">Pre-work</h2>
|
<h2 id="pre-work">Pre-work</h2>
|
||||||
|
|
||||||
|
<h3 id="tool-chain">Tool-Chain</h3>
|
||||||
|
|
||||||
|
<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&rsquo;s</em> blog mentioned, we can write following useful system environment and export in terminal.</p>
|
||||||
|
|
||||||
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
<h3 id="original-system-environment-configuration">Original System Environment Configuration</h3>
|
||||||
|
|
||||||
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
<pre><code>/# Android NDK sources and standalone toolchain is put here
|
||||||
export DEV=${HOME}/dev
|
export DEV=~/Android/
|
||||||
|
|
||||||
/# All the built binaries, libs and their header will be installed here
|
/# All the built binaries, libs and their header will be installed here
|
||||||
export PREFIX=/opt/android
|
export PREFIX=/opt/android
|
||||||
@@ -44,14 +48,14 @@ export GCC_VER=4.9
|
|||||||
export BUILD_SYS=x86_64-linux-gnu
|
export BUILD_SYS=x86_64-linux-gnu
|
||||||
|
|
||||||
/# Set Android target API level
|
/# Set Android target API level
|
||||||
export ANDROID_API=19
|
export ANDROID_API=22
|
||||||
|
|
||||||
/# Set Android target arch
|
/# Set Android target arch
|
||||||
export ANDROID_ARCH=arm
|
export ANDROID_ARCH=arm
|
||||||
|
|
||||||
/# Set Android target name, according to Table 2 in
|
/# Set Android target name, according to Table 2 in
|
||||||
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export ANDROID_TARGET=armv5te-none-linux-androideabi
|
export ANDROID_TARGET=armv7-none-linux-androideabi
|
||||||
|
|
||||||
/# The cross-compile toolchain we use
|
/# The cross-compile toolchain we use
|
||||||
export TOOLCHAIN=arm-linux-androideabi
|
export TOOLCHAIN=arm-linux-androideabi
|
||||||
@@ -63,15 +67,11 @@ export NDK=${DEV}/android-ndk
|
|||||||
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
/# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||||
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
export NDK_TOOLCHAIN=${DEV}/android-ndk-toolchain
|
||||||
|
|
||||||
/# Set Android Sysroot according to API and arch
|
|
||||||
export SYSROOT=${NDK_TOOLCHAIN}/sysroot
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
export SYSROOT=${NDK}/platforms/android-${ANDROID_API}/arch-${ANDROID_ARCH}
|
||||||
|
|
||||||
/# Binutils path
|
|
||||||
export CROSS_PREFIX=${NDK_TOOLCHAIN}/bin/${TOOLCHAIN}
|
|
||||||
/# this one is the absolute, prebuilt path
|
/# this one is the absolute, prebuilt path
|
||||||
/# export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
export CROSS_PREFIX=${NDK}/toolchains/${TOOLCHAIN}-${GCC_VER}/prebuilt/linux-x86_64/bin/${TOOLCHAIN}
|
||||||
|
|
||||||
/# Non-exhaustive lists of compiler + binutils
|
/# Non-exhaustive lists of compiler + binutils
|
||||||
export AR=${CROSS_PREFIX}-ar
|
export AR=${CROSS_PREFIX}-ar
|
||||||
@@ -92,9 +92,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
|
|||||||
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
export CFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&quot;
|
||||||
export CXXFLAGS=${CFLAGS}
|
export CXXFLAGS=${CFLAGS}
|
||||||
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&quot;
|
||||||
export LIBS=&quot;-lc&quot;
|
export LIBS=&quot;-lc -lstdc++ -ld&quot;
|
||||||
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
export LDFLAGS=&quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&quot;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user