require conf/multilib.conf
require conf/machine/include/arm/armv7a/tune-cortexa9.inc
require conf/machine/include/baremetal-tc.conf

# Define all of the multilibs supproted by this configuration
MULTILIB_GLOBAL_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"

MULTILIBS  = "multilib:libarmv5tesoftfp multilib:libarmv5tehard"
MULTILIBS += "multilib:libnofp"
MULTILIBS += "multilib:libv7nofp multilib:libv7fpsoftfp multilib:libv7fphard"
MULTILIBS += "multilib:libv7anofp"
MULTILIBS += "multilib:libv7afpsoftfp"
MULTILIBS += "multilib:libv7afpthf multilib:libv7asimdsoftfp"
MULTILIBS += "multilib:libv7asimdhard multilib:libv7vesimdsoftfp"
MULTILIBS += "multilib:libvtvesimdhf"
MULTILIBS += "multilib:libv8anofp"
MULTILIBS += "multilib:libv8asimdsoftfp multilib:libv8asimdhard"

TUNE_CCARGS = "${TUNE_CCARGS:tune-${DEFAULTTUNE}}"
TUNE_PKGARCH = "${TUNE_PKGARCH:tune-${DEFAULTTUNE}}"

# Base configuration
# CFLAGS:
DEFAULTTUNE = "aarch32"

AVAILTUNES += "aarch32"
PACKAGE_EXTRA_ARCHS:tune-aarch32 = "${TUNE_PKGARCH:tune-aarch32}"
BASE_LIB:tune-aarch32 = "lib"
TUNE_FEATURES:tune-aarch32 = "arm"
TUNE_CCARGS:tune-aarch32 = ""
TUNE_PKGARCH:tune-aarch32 = "aarch32"


# arm/v5te/softfp
# CFLAGS: -marm -march=armv5te+fp -mfloat-abi=softfp
DEFAULTTUNE:virtclass-multilib-libarmv5tesoftfp = "armv5tesoftfp"

AVAILTUNES += "armv5tesoftfp"
PACKAGE_EXTRA_ARCHS:tune-armv5tesoftfp = "${TUNE_PKGARCH:tune-armv5tesoftfp}"
BASE_LIB:tune-armv5tesoftfp = "lib/arm/v5te/softfp"
TUNE_FEATURES:tune-armv5tesoftfp = "arm"
TUNE_CCARGS:tune-armv5tesoftfp = "-marm -march=armv5te+fp -mfloat-abi=softfp"
TUNE_PKGARCH:tune-armv5tesoftfp = "armv5tefp"


# arm/v5te/hard
# CFLAGS: -marm -march=armv5te+fp -mfloat-abi=hard
DEFAULTTUNE:virtclass-multilib-libarmv5tehard = "armv5tehard"

AVAILTUNES += "armv5tehard"
PACKAGE_EXTRA_ARCHS:tune-armv5tehard = "${TUNE_PKGARCH:tune-armv5tehard}"
BASE_LIB:tune-armv5tehard = "lib/arm/v5te/hard"
TUNE_FEATURES:tune-armv5tehard = "arm"
TUNE_CCARGS:tune-armv5tehard = "-marm -march=armv5te+fp -mfloat-abi=hard"
TUNE_PKGARCH:tune-armv5tehard = "armv5tefphf"


# thumb/nofp
# CFLAGS: -mthumb -mfloat-abi=soft
DEFAULTTUNE:virtclass-multilib-libnofp = "armnofp"

AVAILTUNES += "armnofp"
PACKAGE_EXTRA_ARCHS:tune-armnofp = "${TUNE_PKGARCH:tune-armnofp}"
BASE_LIB:tune-armnofp = "lib/thumb/nofp"
TUNE_FEATURES:tune-armnofp = "arm"
TUNE_CCARGS:tune-armnofp = "-mthumb -mfloat-abi=soft"
TUNE_PKGARCH:tune-armnofp = "armt"


# thumb/v7/nofp
# CFLAGS: -mthumb -march=armv7 -mfloat-abi=soft
DEFAULTTUNE:virtclass-multilib-libv7nofp = "armv7nofp"

AVAILTUNES += "armv7nofp"
PACKAGE_EXTRA_ARCHS:tune-armv7nofp = "${TUNE_PKGARCH:tune-armv7nofp}"
BASE_LIB:tune-armv7nofp = "lib/thumb/v7/nofp"
TUNE_FEATURES:tune-armv7nofp = "arm"
TUNE_CCARGS:tune-armv7nofp = "-mthumb -march=armv7 -mfloat-abi=soft"
TUNE_PKGARCH:tune-armv7nofp = "armv7t"


# thumb/v7+fp/softfp
# CFLAGS: -mthumb -march=armv7+fp -mfloat-abi=softfp
DEFAULTTUNE:virtclass-multilib-libv7fpsoftfp = "armv7fpsoftfp"

AVAILTUNES += "armv7fpsoftfp"
PACKAGE_EXTRA_ARCHS:tune-armv7fpsoftfp = "${TUNE_PKGARCH:tune-armv7fpsoftfp}"
BASE_LIB:tune-armv7fpsoftfp = "lib/thumb/v7+fp/softfp"
TUNE_FEATURES:tune-armv7fpsoftfp = "arm"
TUNE_CCARGS:tune-armv7fpsoftfp = "-mthumb -march=armv7+fp -mfloat-abi=softfp"
TUNE_PKGARCH:tune-armv7fpsoftfp = "armv7fpt"


# thumb/v7+fp/hard
# CFLAGS: -mthumb -march=armv7+fp -mfloat-abi=hard
DEFAULTTUNE:virtclass-multilib-libv7fphard = "armv7fphard"

AVAILTUNES += "armv7fphard"
PACKAGE_EXTRA_ARCHS:tune-armv7fphard = "${TUNE_PKGARCH:tune-armv7fphard}"
BASE_LIB:tune-armv7fphard = "lib/thumb/v7+fp/hard"
TUNE_FEATURES:tune-armv7fphard = "arm"
TUNE_CCARGS:tune-armv7fphard = "-mthumb -march=armv7+fp -mfloat-abi=hard"
TUNE_PKGARCH:tune-armv7fphard = "armv7fpthf"


# thumb/v7-a/nofp
# CFLAGS: -mthumb -march=armv7-a -mfloat-abi=soft
DEFAULTTUNE:virtclass-multilib-libv7anofp = "armv7anofp"

AVAILTUNES += "armv7anofp"
PACKAGE_EXTRA_ARCHS:tune-armv7anofp = "${TUNE_PKGARCH:tune-armv7anofp}"
BASE_LIB:tune-armv7anofp = "lib/thumb/v7-a/nofp"
TUNE_FEATURES:tune-armv7anofp = "arm"
TUNE_CCARGS:tune-armv7anofp = "-mthumb -march=armv7-a -mfloat-abi=soft"
TUNE_PKGARCH:tune-armv7anofp = "armv7at"


# thumb/v7-a+fp/softfp
# CFLAGS: -mthumb -march=armv7-a+fp -mfloat-abi=softfp
DEFAULTTUNE:virtclass-multilib-libv7afpsoftfp = "armv7afpsoftfp"

AVAILTUNES += "armv7afpsoftfp"
PACKAGE_EXTRA_ARCHS:tune-armv7afpsoftfp = "${TUNE_PKGARCH:tune-armv7afpsoftfp}"
BASE_LIB:tune-armv7afpsoftfp = "lib/thumb/v7-a+fp/softfp"
TUNE_FEATURES:tune-armv7afpsoftfp = "arm"
TUNE_CCARGS:tune-armv7afpsoftfp = "-mthumb -march=armv7-a+fp -mfloat-abi=softfp"
TUNE_PKGARCH:tune-armv7afpsoftfp = "armv7afpt"


# thumb/v7-a+fp/hard
# CFLAGS: -mthumb -march=armv7-a+fp -mfloat-abi=hard
DEFAULTTUNE:virtclass-multilib-libv7afpthf = "armv7afpthf"

AVAILTUNES += "armv7afpthf"
PACKAGE_EXTRA_ARCHS:tune-armv7afpthf = "${TUNE_PKGARCH:tune-armv7afpthf}"
BASE_LIB:tune-armv7afpthf = "lib/thumb/v7-a+fp/hard"
TUNE_FEATURES:tune-armv7afpthf = "arm"
TUNE_CCARGS:tune-armv7afpthf = "-mthumb -march=armv7-a+fp -mfloat-abi=hard"
TUNE_PKGARCH:tune-armv7afpthf = "armv7afpthf"

# thumb/v7-a+simd/softfp
# CFLAGS: -mthumb -march=armv7-a+simd -mfloat-abi=softfp
DEFAULTTUNE:virtclass-multilib-libv7asimdsoftfp = "armv7asimdsoftfp"

AVAILTUNES += "armv7asimdsoftfp"
PACKAGE_EXTRA_ARCHS:tune-armv7asimdsoftfp = "${TUNE_PKGARCH:tune-armv7asimdsoftfp}"
BASE_LIB:tune-armv7asimdsoftfp = "lib/thumb/v7-a+simd/softfp"
TUNE_FEATURES:tune-armv7asimdsoftfp = "arm"
TUNE_CCARGS:tune-armv7asimdsoftfp = "-mthumb -march=armv7-a+simd -mfloat-abi=softfp"
TUNE_PKGARCH:tune-armv7asimdsoftfp = "armv7asimdt"


# thumb/v7-a+simd/hard
# CFLAGS: -mthumb -march=armv7-a+simd -mfloat-abi=hard
DEFAULTTUNE:virtclass-multilib-libv7asimdhard = "armv7asimdhard"

AVAILTUNES += "armv7asimdhard"
PACKAGE_EXTRA_ARCHS:tune-armv7asimdhard = "${TUNE_PKGARCH:tune-armv7asimdhard}"
BASE_LIB:tune-armv7asimdhard = "lib/thumb/v7-a+simd/hard"
TUNE_FEATURES:tune-armv7asimdhard = "arm"
TUNE_CCARGS:tune-armv7asimdhard = "-mthumb -march=armv7-a+simd -mfloat-abi=hard"
TUNE_PKGARCH:tune-armv7asimdhard = "armv7asimdthf"


# thumb/v7ve+simd/softfp
# CFLAGS: -mthumb -march=armv7ve+simd -mfloat-abi=softfp
DEFAULTTUNE:virtclass-multilib-libv7vesimdsoftfp = "armv7vesimdsoftfp"

AVAILTUNES += "armv7vesimdsoftfp"
PACKAGE_EXTRA_ARCHS:tune-armv7vesimdsoftfp = "${TUNE_PKGARCH:tune-armv7vesimdsoftfp}"
BASE_LIB:tune-armv7vesimdsoftfp = "lib/thumb/v7ve+simd/softfp"
TUNE_FEATURES:tune-armv7vesimdsoftfp = "arm"
TUNE_CCARGS:tune-armv7vesimdsoftfp = "-mthumb -march=armv7ve+simd -mfloat-abi=softfp"
TUNE_PKGARCH:tune-armv7vesimdsoftfp = "armv7vesimdt"

# thumb/v7ve+simd/hard
# CFLAGS: -mthumb -march=armv7ve+simd -mfloat-abi=hard
DEFAULTTUNE:virtclass-multilib-libvtvesimdhf = "armvtvesimdhf"

AVAILTUNES += "armvtvesimdhf"
PACKAGE_EXTRA_ARCHS:tune-armvtvesimdhf = "${TUNE_PKGARCH:tune-armvtvesimdhf}"
BASE_LIB:tune-armvtvesimdhf = "lib/thumb/v7ve+simd/hard"
TUNE_FEATURES:tune-armvtvesimdhf = "arm"
TUNE_CCARGS:tune-armvtvesimdhf = "-mthumb -march=armv7ve+simd -mfloat-abi=hard"
TUNE_PKGARCH:tune-armvtvesimdhf = "armv7vesimdthf"


# thumb/v8-a/nofp
# CFLAGS: -mthumb -march=armv8-a -mfloat-abi=soft
DEFAULTTUNE:virtclass-multilib-libv8anofp = "armv8anofp"

AVAILTUNES += "armv8anofp"
PACKAGE_EXTRA_ARCHS:tune-armv8anofp = "${TUNE_PKGARCH:tune-armv8anofp}"
BASE_LIB:tune-armv8anofp = "lib/thumb/v8-a/nofp"
TUNE_FEATURES:tune-armv8anofp = "arm"
TUNE_CCARGS:tune-armv8anofp = "-mthumb -march=armv8-a -mfloat-abi=soft"
TUNE_PKGARCH:tune-armv8anofp = "armv8at"

# thumb/v8-a+simd/softfp
# CFLAGS: -mthumb -march=armv8-a+simd -mfloat-abi=softfp
DEFAULTTUNE:virtclass-multilib-libv8asimdsoftfp = "armv8asimdsoftfp"

AVAILTUNES += "armv8asimdsoftfp"
PACKAGE_EXTRA_ARCHS:tune-armv8asimdsoftfp = "${TUNE_PKGARCH:tune-armv8asimdsoftfp}"
BASE_LIB:tune-armv8asimdsoftfp = "lib/thumb/v8-a+simd/softfp"
TUNE_FEATURES:tune-armv8asimdsoftfp = "arm"
TUNE_CCARGS:tune-armv8asimdsoftfp = "-mthumb -march=armv8-a+simd -mfloat-abi=softfp"
TUNE_PKGARCH:tune-armv8asimdsoftfp = "armv8asimdt"


# thumb/v8-a+simd/hard
# CFLAGS:  -mthumb -march=armv8-a+simd -mfloat-abi=hard
DEFAULTTUNE:virtclass-multilib-libv8asimdhard = "armv8asimdhard"

AVAILTUNES += "armv8asimdhard"
PACKAGE_EXTRA_ARCHS:tune-armv8asimdhard = "${TUNE_PKGARCH:tune-armv8asimdhard}"
BASE_LIB:tune-armv8asimdhard = "lib/thumb/v8-a+simd/hard"
TUNE_FEATURES:tune-armv8asimdhard = "arm"
TUNE_CCARGS:tune-armv8asimdhard = "-mthumb -march=armv8-a+simd -mfloat-abi=hard"
TUNE_PKGARCH:tune-armv8asimdhard = "armv8asimdthf"
