abs_top_srcdir=@abs_top_srcdir@

DEBUG_BUILD=@use_debug@
TOOLCHAIN=@use_toolchain@
NDKROOT=@use_ndk_path@
SDKROOT=@use_sdk_path@
CMAKE_SOURCE_DIR=$(abspath $(abs_top_srcdir)/../../)
TARBALLS_LOCATION=@use_tarballs@
PLATFORM=@deps_dir@
HOST=@use_host@
BUILD=@use_build@
BUILD_CPU=@use_buildcpu@
CPU=@use_cpu@
MESON_CPU=@meson_cpu@
MESON_SYSTEM=@meson_system@
NATIVEPLATFORM=@build_cpu@-@build_os@-native
NDK_LEVEL=@use_ndk_api@
RETRIEVE_TOOL=@CURL@
ARCHIVE_TOOL=@TAR@
PREFIX=@prefix@/@deps_dir@
NATIVEPREFIX=@prefix@/@tool_dir@
OS=@platform_os@
NATIVE_OS=@build_os@
CROSS_COMPILING=@cross_compiling@
ARCH_DEFINES=@ARCH_DEFINES@
NATIVE_ARCH_DEFINES=@NATIVE_ARCH_DEFINES@
TARGET_PLATFORM=@target_platform@
RENDER_SYSTEM=@app_rendersystem@
SHA512SUM=@SHA512SUM@
SHA256SUM=@SHA256SUM@
SHASUM=@SHASUM@
HASH_TOOL_FLAGS=-c --status

HAS_ZLIB=@has_zlib@
NEED_LIBICONV=@need_libiconv@
LINK_ICONV=@link_iconv@
ENABLE_GPLV3=@use_gplv3@

BASE_URL=http://mirrors.kodi.tv/build-deps/sources
ifneq ($(KODI_MIRROR),)
BASE_URL=$(KODI_MIRROR)/build-deps/sources
endif
RETRIEVE_TOOL_FLAGS=-LsS --create-dirs --retry 10 --retry-connrefused -o
ARCHIVE_TOOL_FLAGS=--strip-components=1 -xf
CONFIG_SUB=@prefix@/@tool_dir@/share/automake-1.16/config.sub
CONFIG_GUESS=@prefix@/@tool_dir@/share/automake-1.16/config.guess

USE_CCACHE=@use_ccache@

LD=@LD@
ifneq (@use_ccache@,yes)
  CC=@CC@
  CXX=@CXX@
  CPP=@CPP@
else
  CC=@CCACHE@ @CC@
  CXX=@CCACHE@ @CXX@
  CPP=@CCACHE@ @CPP@
endif
AR=@AR@
RANLIB=@RANLIB@
AS=@AS@
NM=@NM@
STRIP=@STRIP@
READELF=@READELF@
OBJDUMP=@OBJDUMP@

CMAKE=@prefix@/@tool_dir@/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/share/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=$(PREFIX)
CFLAGS=@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include
LDFLAGS=-L@prefix@/@deps_dir@/lib @platform_ldflags@
ASFLAGS=@platform_asflags@
CXXFLAGS=@platform_cxxflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include
CPPFLAGS=@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include
# set configured FFmpeg configure options
FFMPEG_CONFIGURE_OPTIONS=@ffmpeg_options@


ifneq (@use_build_toolchain@,)
  PATH:=@use_build_toolchain@/bin:@use_build_toolchain@/usr/bin:$(PATH)
endif
PATH:=@prefix@/@tool_dir@/bin:$(PATH)
LD_FOR_BUILD=@LD_FOR_BUILD@
CC_BINARY_FOR_BUILD=@CC_FOR_BUILD@
CXX_BINARY_FOR_BUILD=@CXX_FOR_BUILD@
ifneq (@use_ccache@,yes)
  CC_FOR_BUILD=@CC_FOR_BUILD@
  CXX_FOR_BUILD=@CXX_FOR_BUILD@
else
  CC_FOR_BUILD=@CCACHE@ @CC_FOR_BUILD@
  CXX_FOR_BUILD=@CCACHE@ @CXX_FOR_BUILD@
  CCACHE=@CCACHE@
endif
AR_FOR_BUILD=@AR_FOR_BUILD@
RANLIB_FOR_BUILD=@RANLIB_FOR_BUILD@
AS_FOR_BUILD=@AS_FOR_BUILD@
NM_FOR_BUILD=@NM_FOR_BUILD@
STRIP_FOR_BUILD=@STRIP_FOR_BUILD@
READELF_FOR_BUILD=@READELF_FOR_BUILD@
OBJDUMP_FOR_BUILD=@OBJDUMP_FOR_BUILD@
CMAKE_FOR_BUILD=@prefix@/@tool_dir@/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$(NATIVEPREFIX)/share/Toolchain-Native.cmake -DCMAKE_INSTALL_PREFIX=$(NATIVEPREFIX)

NATIVE_CFLAGS=@host_includes@ -I@prefix@/@tool_dir@/include
NATIVE_LDFLAGS=@host_includes@ -L@prefix@/@tool_dir@/lib
NATIVE_CPPFLAGS=@host_includes@ -I@prefix@/@tool_dir@/include
NATIVE_CXXFLAGS=@host_includes@ -I@prefix@/@tool_dir@/include

VERSION.TXT := $(CMAKE_SOURCE_DIR)/version.txt
APP_NAME=$(shell awk '/APP_NAME/ {print tolower($$2)}' $(VERSION.TXT))

# Python related vars
PYTHON_VERSION=3.11
PYTHON_SITE_PKG=@prefix@/@deps_dir@/lib/python${PYTHON_VERSION}/site-packages

ifeq ($(CPU), arm64)
  export GASPP_FIX_XCODE5=1
endif
export AUTOM4TE=@prefix@/@tool_dir@/bin/autom4te
export AUTOMAKE=@prefix@/@tool_dir@/bin/automake
export AUTOCONF=@prefix@/@tool_dir@/bin/autoconf
export ACLOCAL=@prefix@/@tool_dir@/bin/aclocal
export ACLOCAL_PATH=@prefix@/@deps_dir@/share/aclocal:@prefix@/@tool_dir@/share/aclocal
export AUTOPOINT=@prefix@/@tool_dir@/bin/autopoint
export AUTOHEADER=@prefix@/@tool_dir@/bin/autoheader
export LIBTOOL=@prefix@/@tool_dir@/bin/libtool
export LIBTOOLIZE=@prefix@/@tool_dir@/bin/libtoolize

export AUTORECONF=@prefix@/@tool_dir@/bin/autoreconf
export JSON_BUILDER=$(NATIVEPREFIX)/bin/JsonSchemaBuilder
