ARM_update

This commit is contained in:
2016-08-01 23:38:42 -04:00
parent 2b41cced49
commit b8ec4e14d0
6 changed files with 96 additions and 60 deletions
+16 -10
View File
@@ -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>
<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>
<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
export PREFIX=/opt/android
@@ -71,14 +75,14 @@ export GCC_VER=4.9
export BUILD_SYS=x86_64-linux-gnu
/# Set Android target API level
export ANDROID_API=19
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=armv5te-none-linux-androideabi
export ANDROID_TARGET=armv7-none-linux-androideabi
/# The cross-compile toolchain we use
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
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
/# 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
/# 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
export AR=${CROSS_PREFIX}-ar
@@ -119,9 +119,15 @@ 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"
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="preferences">Preferences</h2>
<ul>
<li><a href="http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/">zwyuan</a></li>
</ul>
</description>
</item>
+16 -10
View File
@@ -52,10 +52,14 @@ Anyway, after coming back, I think I write too much on useless words, so let me
&lt;h2 id=&#34;pre-work&#34;&gt;Pre-work&lt;/h2&gt;
&lt;h3 id=&#34;tool-chain&#34;&gt;Tool-Chain&lt;/h3&gt;
&lt;p&gt;Basically, I used the native android compilation tool-chains, &lt;a href=&#34;https://developer.android.com/ndk/downloads/index.html&#34;&gt;Android NDK&lt;/a&gt;, as working tools. Due to my working situation, I use a &lt;a href=&#34;https://shield.nvidia.com/tablet/k1&#34;&gt;Nvidia Shield Tablet&lt;/a&gt; as target device. As &lt;em&gt;Zengwen&lt;/em&gt; said in his &lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;blog&lt;/a&gt;, newest updated NDK might has some issue which can influence compilation progress. So you can find &lt;a href=&#34;http://stackoverflow.com/questions/6849981/where-do-i-find-old-versions-of-android-ndk&#34;&gt;other version&lt;/a&gt; of NDK once you have some problems. Based on what &lt;em&gt;Zengwen&amp;rsquo;s&lt;/em&gt; blog mentioned, we can write following useful system environment and export in terminal.&lt;/p&gt;
&lt;h3 id=&#34;original-system-environment-configuration&#34;&gt;Original System Environment Configuration&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;/# 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
export PREFIX=/opt/android
@@ -71,14 +75,14 @@ export GCC_VER=4.9
export BUILD_SYS=x86_64-linux-gnu
/# Set Android target API level
export ANDROID_API=19
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=armv5te-none-linux-androideabi
export ANDROID_TARGET=armv7-none-linux-androideabi
/# The cross-compile toolchain we use
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
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
/# 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
/# 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
export AR=${CROSS_PREFIX}-ar
@@ -119,9 +119,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
export CFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&amp;quot;
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&amp;quot;
export LIBS=&amp;quot;-lc&amp;quot;
export LIBS=&amp;quot;-lc -lstdc++ -ld&amp;quot;
export LDFLAGS=&amp;quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;preferences&#34;&gt;Preferences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;zwyuan&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
+16 -10
View File
@@ -98,10 +98,14 @@
<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>
<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
export PREFIX=/opt/android
@@ -117,14 +121,14 @@ export GCC_VER=4.9
export BUILD_SYS=x86_64-linux-gnu
/# Set Android target API level
export ANDROID_API=19
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=armv5te-none-linux-androideabi
export ANDROID_TARGET=armv7-none-linux-androideabi
/# The cross-compile toolchain we use
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
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
/# 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
/# 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
export AR=${CROSS_PREFIX}-ar
@@ -165,10 +165,16 @@ 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 CXXFLAGS=${CFLAGS}
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;
</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>
+16 -10
View File
@@ -52,10 +52,14 @@ Anyway, after coming back, I think I write too much on useless words, so let me
&lt;h2 id=&#34;pre-work&#34;&gt;Pre-work&lt;/h2&gt;
&lt;h3 id=&#34;tool-chain&#34;&gt;Tool-Chain&lt;/h3&gt;
&lt;p&gt;Basically, I used the native android compilation tool-chains, &lt;a href=&#34;https://developer.android.com/ndk/downloads/index.html&#34;&gt;Android NDK&lt;/a&gt;, as working tools. Due to my working situation, I use a &lt;a href=&#34;https://shield.nvidia.com/tablet/k1&#34;&gt;Nvidia Shield Tablet&lt;/a&gt; as target device. As &lt;em&gt;Zengwen&lt;/em&gt; said in his &lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;blog&lt;/a&gt;, newest updated NDK might has some issue which can influence compilation progress. So you can find &lt;a href=&#34;http://stackoverflow.com/questions/6849981/where-do-i-find-old-versions-of-android-ndk&#34;&gt;other version&lt;/a&gt; of NDK once you have some problems. Based on what &lt;em&gt;Zengwen&amp;rsquo;s&lt;/em&gt; blog mentioned, we can write following useful system environment and export in terminal.&lt;/p&gt;
&lt;h3 id=&#34;original-system-environment-configuration&#34;&gt;Original System Environment Configuration&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;/# 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
export PREFIX=/opt/android
@@ -71,14 +75,14 @@ export GCC_VER=4.9
export BUILD_SYS=x86_64-linux-gnu
/# Set Android target API level
export ANDROID_API=19
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=armv5te-none-linux-androideabi
export ANDROID_TARGET=armv7-none-linux-androideabi
/# The cross-compile toolchain we use
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
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
/# 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
/# 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
export AR=${CROSS_PREFIX}-ar
@@ -119,9 +119,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
export CFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&amp;quot;
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&amp;quot;
export LIBS=&amp;quot;-lc&amp;quot;
export LIBS=&amp;quot;-lc -lstdc++ -ld&amp;quot;
export LDFLAGS=&amp;quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;preferences&#34;&gt;Preferences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;zwyuan&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
+16 -10
View File
@@ -25,10 +25,14 @@
&lt;h2 id=&#34;pre-work&#34;&gt;Pre-work&lt;/h2&gt;
&lt;h3 id=&#34;tool-chain&#34;&gt;Tool-Chain&lt;/h3&gt;
&lt;p&gt;Basically, I used the native android compilation tool-chains, &lt;a href=&#34;https://developer.android.com/ndk/downloads/index.html&#34;&gt;Android NDK&lt;/a&gt;, as working tools. Due to my working situation, I use a &lt;a href=&#34;https://shield.nvidia.com/tablet/k1&#34;&gt;Nvidia Shield Tablet&lt;/a&gt; as target device. As &lt;em&gt;Zengwen&lt;/em&gt; said in his &lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;blog&lt;/a&gt;, newest updated NDK might has some issue which can influence compilation progress. So you can find &lt;a href=&#34;http://stackoverflow.com/questions/6849981/where-do-i-find-old-versions-of-android-ndk&#34;&gt;other version&lt;/a&gt; of NDK once you have some problems. Based on what &lt;em&gt;Zengwen&amp;rsquo;s&lt;/em&gt; blog mentioned, we can write following useful system environment and export in terminal.&lt;/p&gt;
&lt;h3 id=&#34;original-system-environment-configuration&#34;&gt;Original System Environment Configuration&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;/# 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
export PREFIX=/opt/android
@@ -44,14 +48,14 @@ export GCC_VER=4.9
export BUILD_SYS=x86_64-linux-gnu
/# Set Android target API level
export ANDROID_API=19
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=armv5te-none-linux-androideabi
export ANDROID_TARGET=armv7-none-linux-androideabi
/# The cross-compile toolchain we use
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
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
/# 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
/# 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
export AR=${CROSS_PREFIX}-ar
@@ -92,9 +92,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
export CFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&amp;quot;
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&amp;quot;
export LIBS=&amp;quot;-lc&amp;quot;
export LIBS=&amp;quot;-lc -lstdc++ -ld&amp;quot;
export LDFLAGS=&amp;quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;preferences&#34;&gt;Preferences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;zwyuan&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
+16 -10
View File
@@ -25,10 +25,14 @@
&lt;h2 id=&#34;pre-work&#34;&gt;Pre-work&lt;/h2&gt;
&lt;h3 id=&#34;tool-chain&#34;&gt;Tool-Chain&lt;/h3&gt;
&lt;p&gt;Basically, I used the native android compilation tool-chains, &lt;a href=&#34;https://developer.android.com/ndk/downloads/index.html&#34;&gt;Android NDK&lt;/a&gt;, as working tools. Due to my working situation, I use a &lt;a href=&#34;https://shield.nvidia.com/tablet/k1&#34;&gt;Nvidia Shield Tablet&lt;/a&gt; as target device. As &lt;em&gt;Zengwen&lt;/em&gt; said in his &lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;blog&lt;/a&gt;, newest updated NDK might has some issue which can influence compilation progress. So you can find &lt;a href=&#34;http://stackoverflow.com/questions/6849981/where-do-i-find-old-versions-of-android-ndk&#34;&gt;other version&lt;/a&gt; of NDK once you have some problems. Based on what &lt;em&gt;Zengwen&amp;rsquo;s&lt;/em&gt; blog mentioned, we can write following useful system environment and export in terminal.&lt;/p&gt;
&lt;h3 id=&#34;original-system-environment-configuration&#34;&gt;Original System Environment Configuration&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;/# 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
export PREFIX=/opt/android
@@ -44,14 +48,14 @@ export GCC_VER=4.9
export BUILD_SYS=x86_64-linux-gnu
/# Set Android target API level
export ANDROID_API=19
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=armv5te-none-linux-androideabi
export ANDROID_TARGET=armv7-none-linux-androideabi
/# The cross-compile toolchain we use
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
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
/# 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
/# 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
export AR=${CROSS_PREFIX}-ar
@@ -92,9 +92,15 @@ export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib
export CFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${PREFIX}/include -fPIE -DANDROID -Wno-multichar&amp;quot;
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=&amp;quot;--sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${NDK_TOOLCHAIN}/include/c++/ -DANDROID -DNO_XMALLOC -mandroid&amp;quot;
export LIBS=&amp;quot;-lc&amp;quot;
export LIBS=&amp;quot;-lc -lstdc++ -ld&amp;quot;
export LDFLAGS=&amp;quot;-Wl,-rpath-link=-I${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib -L${PREFIX}/lib -L${NDK_TOOLCHAIN}/lib&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;preferences&#34;&gt;Preferences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/&#34;&gt;zwyuan&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>