# Use recent master libffi, because 3.3 is broken=checking host system type... Invalid configuration `arm-none-linux-eabi=machine `arm-none-linux not recognized
# Dont mix up .pc files from your host and build target
exportPKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
# setting PKG_CONFIG_PATH alone does not seem to be enough to avoid mixing up with the host, also set PKG_CONFIG_LIBDIR
exportPKG_CONFIG_LIBDIR=$PKG_CONFIG_PATH
# Set Android target API level
# when compiling with clang use at least 28 as this makes sure that android provides the posix_spawn functions, so the compilation of gettext will (should) work out of the box
# its probably a bug of gettext, if posix_spawn is not available it replaces it with its own implementation. Autotools of gettext set HAVE_POSIX_SPAWN==0 (which is correct) but for some reason REPLACE_POSIX_SPAWN==0 (which is wrong, as it should be 1).
#
# NOTE=API 24 is required because it provides fseeko() and ftello() required by libflac
exportANDROID_API=24
# Tell configure what flags Android requires.
# Turn Wimplicit-function-declaration into errors. Else autotools will be fooled when checking for available functions (that in fact are NOT available) and compilation will fail later on.
# Also disable clangs integrated assembler, as the hand written assembly of libffi is not recognized by it, cf. https://crbug.com/801303