Skip to content

Android: fix build of Autoconf-based libraries

Before this commit, autoconf-based libraries in 3rdparty would find the compiler that is provided by the system, instead of the Android-based toolchain.

It was not noticed previously because the install path for all 3rdparty dependencies was not exported in Android builds, so they were not able to find each other.

This commit fixes this issue by:

  • first, deploying a standalone copy of the Android toolchain
  • exporting all relevant Autoconf variables pointing to the corresponding tools
  • exporting the host triplet to the Autoconf profile provided by CMake
  • exporting the install paths through CMAKE_FIND_ROOT_PATH
  • clearing the variables after building all the dependencies

See https://developer.android.com/ndk/guides/standalone_toolchain for the reasoning behind these points, and https://binary-factory.kde.org/job/Krita_Android_arm64-v8a_Dependency_Build/11/console (grep checking host system type... x86_64-pc-linux-gnu) for a proof of the issue.

BUG: 427842

CCMAIL: kimageshop@kde.org

Test Plan

Rebuild Krita with this commit and check all libraries in $BUILD_ROOT/i/lib and $BUILD_ROOT/kf5/kde/install/lib match in architecture.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports