Difference between revisions of "Compiling ScummVM/Android"

Jump to navigation Jump to search
Line 109: Line 109:


Also, after setting up these variables, run the following command:
Also, after setting up these variables, run the following command:
mkdir -p "${ANDROID_SDK_ROOT}" "${ANDROID_SDK_HOME}" "${GRADLE_USER_HOME}"
cp -R "${RO_ANDROID_ROOT}"/sdk/licenses "${ANDROID_SDK_ROOT}"/licenses


<code>mkdir -p "${ANDROID_SDK_ROOT}" "${ANDROID_SDK_HOME}" "${GRADLE_USER_HOME}"</code>
<code>cp -R "${RO_ANDROID_ROOT}"/sdk/licenses "${ANDROID_SDK_ROOT}"/licenses</code>
*Important note: The above command is only required to be run once, since it sets up some required folders and copies required SDK licenses to the external mounted folders (on the host Linux, outside the container itself)  
*Important note: The above command is only required to be run once, since it sets up some required folders and copies required SDK licenses to the external mounted folders (on the host Linux, outside the container itself)  


Line 118: Line 119:


You should probably first make sure you are working with the latest ScummVM code. Please, run:
You should probably first make sure you are working with the latest ScummVM code. Please, run:
cd ~/Workspace/scummvm
 
git pull
<code>cd ~/Workspace/scummvm</code>
 
<code>git pull</code>


<u>From the Docker container shell</u>:
<u>From the Docker container shell</u>:


Clean up any remnants folders from a previous build:
Clean up any remnants folders from a previous build:
rm -rf android_project
rm -rf debug
rm -rf release


<code>rm -rf android_project</code>
<code>rm -rf debug</code>
<code>rm -rf release</code>
=== '''Configure and build ScummVM''' ===
=== '''Configure and build ScummVM''' ===
Supported target architectures for the configure command (values for the <code>--host</code> switch parameter):
Supported target architectures for the configure command (values for the <code>--host</code> switch parameter):
Line 138: Line 143:
First run a <code>make clean</code> and <code>configure</code> command from inside the local scummvm repository folder (you should be in there by default after running the <code>docker run</code> command). Choose one of the following commands based on the target android architecture:
First run a <code>make clean</code> and <code>configure</code> command from inside the local scummvm repository folder (you should be in there by default after running the <code>docker run</code> command). Choose one of the following commands based on the target android architecture:


* <u>Target android-arm64-v8a:</u>
* ''Target android-arm64-v8a:''
 
<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/aarch64-linux-android21-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/aarch64-linux-android/21/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/aarch64-linux-android/21" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-arm64-v8a --enable-debug</code>
CXX="ccache ${ANDROID_TOOLCHAIN}/bin/aarch64-linux-android21-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/aarch64-linux-android/21/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/aarch64-linux-android/21" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-arm64-v8a --enable-debug
* ''Target android-arm-v7a:''


* <u>Target android-arm-v7a:</u>
<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/armv7a-linux-androideabi16-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/arm-linux-androideabi/16/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/arm-linux-androideabi/16" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-arm-v7a --enable-debug</code>


<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/aarch64-linux-android21-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/aarch64-linux-android/21/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/aarch64-linux-android/21" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-arm64-v8a  --enable-debug</code>
* ''Target android-x86:''


* <u>Target android-x86</u>
<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/i686-linux-android16-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/i686-linux-android/16/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/i686-linux-android/16" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-x86 --enable-debug</code>


* ''Target android-x86_64:''
<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/x86_64-linux-android21-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/x86_64-linux-android/21/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/x86_64-linux-android/21" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-x86_64 --enable-debug</code>
   
   


* <u>Target android-x86_64</u>
Finally, in order to start the build process for '''all the above target architectures''' cases run:


<code>make -j$(nproc) androiddistdebug</code>
Finally, in order to start the build process for '''all the above target architectures''' cases run:
make -j$(nproc) androiddistdebug


If successful, the debug apk file will be created inside a <code>debug</code> subfolder in the ScummVM repository folder. The default name will be <code>ScummVM-debug.apk</code>.
If successful, the debug apk file will be created inside a <code>debug</code> subfolder in the ScummVM repository folder. The default name will be <code>ScummVM-debug.apk</code>.
Line 165: Line 170:
First run a <code>make clean</code> and <code>configure</code> command from inside the local scummvm repository folder (you should be in there by default after running the <code>docker run</code> command). Choose one of the following commands based on the target android architecture:
First run a <code>make clean</code> and <code>configure</code> command from inside the local scummvm repository folder (you should be in there by default after running the <code>docker run</code> command). Choose one of the following commands based on the target android architecture:


* <u>Target android-arm64-v8a:</u>
* ''Target android-arm64-v8a:''
 
<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/aarch64-linux-android21-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/aarch64-linux-android/21/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/aarch64-linux-android/21" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-arm64-v8a  --disable-debug --enable-release</code>
CXX="ccache ${ANDROID_TOOLCHAIN}/bin/aarch64-linux-android21-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/aarch64-linux-android/21/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/aarch64-linux-android/21" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-arm64-v8a  --disable-debug --enable-release
* ''Target android-arm-v7a:''
<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/armv7a-linux-androideabi16-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/arm-linux-androideabi/16/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/arm-linux-androideabi/16" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-arm-v7a --disable-debug --enable-release</code>


* <u>Target android-arm-v7a:</u>
* ''Target android-x86:''


<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/i686-linux-android16-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/i686-linux-android/16/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/i686-linux-android/16" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-x86 --disable-debug --enable-release</code>
* ''Target android-x86_64:''


* <u>Target android-x86:</u>
<code>CXX="ccache ${ANDROID_TOOLCHAIN}/bin/x86_64-linux-android21-clang++" PKG_CONFIG_LIBDIR="${ANDROID_TOOLCHAIN}/sysroot/usr/lib/x86_64-linux-android/21/pkgconfig" PATH=${PATH}:"${ANDROID_TOOLCHAIN}/sysroot/usr/bin/x86_64-linux-androidd/21" make clean; ./configure --enable-verbose-build --enable-all-engines --host=android-x86_64 --disable-debug --enable-release</code>


   
   
Finally, in order to start the build process for '''all the above target architectures''' cases run:


* <u>Target android-x86_64:</u>
<code>make -j$(nproc) androiddistrelease</code>
 
Finally, in order to start the build process for '''all the above target architectures''' cases run:
make -j$(nproc) androiddistrelease


If successful, the release apk file will be created inside a <code>release</code> subfolder in the ScummVM repository folder.
If successful, the release apk file will be created inside a <code>release</code> subfolder in the ScummVM repository folder.
1,310

edits

Navigation menu