5 kx # include once
5 kx ifndef TARGET_SETUP_MK
5 kx
5 kx
5 kx include $(BUILDSYSTEM)/constants.mk
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx # Get hw_id & hw_name by HARDWARE functions:
5 kx #
5 kx # hw_id(), hw_name()
5 kx #
5 kx hw_id = $($(strip $(foreach v, $(filter-out HARDWARE_NAMES HARDWARE_ALL,$(filter HARDWARE_%, $(.VARIABLES))), \
5 kx $(if $(filter $1, $($(v))), \
5 kx $(addsuffix _ID_STD,$(subst HARDWARE_,,$(v))), \
5 kx ))))
5 kx
5 kx
5 kx hw_name = $(strip $(foreach v, $(filter-out HARDWARE_NAMES HARDWARE_ALL,$(filter HARDWARE_%, $(.VARIABLES))), \
5 kx $(if $(filter $1, $($(v))),$(subst HARDWARE_,,$(v)),)))
5 kx
5 kx # usage:
5 kx # HW_ID = $(call hw_id,$(HARDWARE))
5 kx #
5 kx # Get hw_id & hw_name by HARDWARE function.
5 kx ################################################################
5 kx
5 kx
5 kx HW_DEFS = $(strip \
5 kx $(foreach v, \
5 kx $(filter-out HARDWARE_ALL HARDWARE_NAMES HARDWARE_NOARCH HARDWARE_BUILD, \
5 kx $(filter HARDWARE_%, $(.VARIABLES))), \
5 kx -D$(subst HARDWARE_,,$(v))=$($(strip $(addsuffix _ID_STD,$(subst HARDWARE_,,$(v)))))))
5 kx
5 kx
5 kx ################################################################
5 kx # Is the switch --sysroot=$(TARGET_DEST_DIR) should be used.
5 kx #
5 kx sysroot = $($(strip \
5 kx $(foreach v, $(filter TOOLCHAIN_%, \
5 kx $(filter-out TOOLCHAIN_ALL \
5 kx TOOLCHAIN_NAMES \
5 kx TOOLCHAIN_DIR \
5 kx TOOLCHAIN_PATH \
5 kx TOOLCHAIN_VERSION \
5 kx TOOLCHAIN_INCPATH, \
5 kx $(.VARIABLES))), \
5 kx $(if $(filter $1, $($(v))), \
5 kx $(addsuffix _DEST_SYSROOT,$(subst TOOLCHAIN_,,$(v))), \
5 kx ))))
5 kx
5 kx # usage:
5 kx # enable_sysroot = $(call sysroot,$(TOOLCHAIN))
5 kx #
5 kx # Is the switch --sysroot=$(TARGET_DEST_DIR) should be used.
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx # The name of toolchain sysroot directory (default 'sys-root').
5 kx #
5 kx
5 kx # This is a last directory name in the absolute toolchain
5 kx # sysroot path. If this name is 'sys-root' then absolute
5 kx # toolchain system root is placed in
5 kx #
5 kx # $(TOOLCHAIN_PATH)/$(TARGET)/sys-root
5 kx #
5 kx # directory. If this function returns "", then toolchain
5 kx # has been built without '--with-sysroot=DIR' switch.
5 kx
5 kx toolchain-sysroot = $($(strip \
5 kx $(foreach v, $(filter TOOLCHAIN_%, \
5 kx $(filter-out TOOLCHAIN_ALL \
5 kx TOOLCHAIN_NAMES \
5 kx TOOLCHAIN_DIR \
5 kx TOOLCHAIN_PATH \
5 kx TOOLCHAIN_VERSION \
5 kx TOOLCHAIN_INCPATH, \
5 kx $(.VARIABLES))), \
5 kx $(if $(filter $1, $($(v))), \
5 kx $(addsuffix _SYSROOT,$(subst TOOLCHAIN_,,$(v))), \
5 kx ))))
5 kx
5 kx # usage:
5 kx # toolchain_sysroot = $(call toolchain-sysroot,$(TOOLCHAIN))
5 kx #
5 kx # The name of toolchain sysroot directory.
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx # Is there 'patchelf' utility in the toolchain.
5 kx #
5 kx has-patchelf = $($(strip \
5 kx $(foreach v, $(filter TOOLCHAIN_%, \
5 kx $(filter-out TOOLCHAIN_ALL \
5 kx TOOLCHAIN_NAMES \
5 kx TOOLCHAIN_DIR \
5 kx TOOLCHAIN_PATH \
5 kx TOOLCHAIN_VERSION \
5 kx TOOLCHAIN_INCPATH, \
5 kx $(.VARIABLES))), \
5 kx $(if $(filter $1, $($(v))), \
5 kx $(addsuffix _HAS_PATCHELF,$(subst TOOLCHAIN_,,$(v))), \
5 kx ))))
5 kx
5 kx # usage:
5 kx # enable_patchelf = $(call has-patchelf,$(TOOLCHAIN))
5 kx #
5 kx # Is there 'patchelf' utility in the toolchain.
5 kx ################################################################
5 kx
5 kx
5 kx #######
5 kx ####### Setup ccache:
5 kx #######
5 kx
5 kx ifeq ($(NO_CCACHE),)
5 kx CCACHE = /usr/bin/ccache$(space)
5 kx
5 kx ifeq ($(wildcard $(CCACHE)),)
5 kx $(info )
5 kx $(info #######)
5 kx $(info ####### Please install 'ccache' package)
5 kx $(info ####### or disable ccache with "NO_CCACHE=1 make ...")
5 kx $(info #######)
5 kx $(info )
5 kx $(error Error: ccache not found)
5 kx endif
5 kx
5 kx ifeq ($(wildcard $(CACHED_CC_OUTPUT)),)
5 kx $(info )
5 kx $(info #######)
5 kx $(info ####### Please create directory $(CACHED_CC_OUTPUT) for cached compiler output)
5 kx $(info ####### or disable ccache with "NO_CCACHE=1 make ...")
5 kx $(info #######)
5 kx $(info )
5 kx $(error Error: cached compiler output directory doesn't exist)
5 kx endif
5 kx
5 kx export CCACHE_BASEDIR = $(TOP_BUILD_DIR_ABS)
5 kx export CCACHE_DIR = $(CACHED_CC_OUTPUT)
5 kx export CCACHE_UMASK = 000
5 kx
5 kx unexport CCACHE_PREFIX
5 kx else
5 kx CCACHE =
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### Setup current toolchain variables:
5 kx #######
5 kx
5 kx ifeq ($(TOOLCHAIN),$(TOOLCHAIN_BUILD_MACHINE))
5 kx TOOLCHAIN_PATH = $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_PATH)
5 kx else
5 kx TOOLCHAIN_PATH = $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_PATH)/$(TOOLCHAIN_VERSION)
5 kx endif
5 kx
5 kx TOOLCHAIN_TARBALL = $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_TARBALL)
5 kx TOOLCHAIN_VERSION = $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_VERSION)
5 kx TOOLCHAIN_DIR = $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_DIR)
5 kx TARGET = $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_ARCH)
5 kx
5 kx ARCH_DEFS ?= $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_ARCH_DEFS)
5 kx ARCH_FLAGS ?= $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_ARCH_FLAGS)
5 kx ARCH_OPTIMIZATION ?= $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_OPTIMIZATION)
5 kx
5 kx ifeq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_NOARCH) $(TOOLCHAIN_BUILD_MACHINE)),)
5 kx HW_FLAGS = -D__HARDWARE__=$(call hw_id,$(HARDWARE)) $(HW_DEFS)
5 kx endif
5 kx
5 kx
5 kx ifeq ($(filter $(TOOLCHAIN), $(TOOLCHAIN_NOARCH) $(TOOLCHAIN_BUILD_MACHINE)),)
5 kx CC = $(CCACHE)$(TOOLCHAIN_PATH)/bin/$(TARGET)-gcc
5 kx CXX = $(CCACHE)$(TOOLCHAIN_PATH)/bin/$(TARGET)-g++
5 kx ADDR2LINE = $(TOOLCHAIN_PATH)/bin/$(TARGET)-addr2line
5 kx AS = $(TOOLCHAIN_PATH)/bin/$(TARGET)-as
5 kx AR = $(TOOLCHAIN_PATH)/bin/$(TARGET)-ar
5 kx LD = $(TOOLCHAIN_PATH)/bin/$(TARGET)-ld
5 kx RANLIB = $(TOOLCHAIN_PATH)/bin/$(TARGET)-ranlib
5 kx SIZE = $(TOOLCHAIN_PATH)/bin/$(TARGET)-size
5 kx STRIP = $(TOOLCHAIN_PATH)/bin/$(TARGET)-strip
5 kx OBJCOPY = $(TOOLCHAIN_PATH)/bin/$(TARGET)-objcopy
5 kx OBJDUMP = $(TOOLCHAIN_PATH)/bin/$(TARGET)-objdump
5 kx READELF = $(TOOLCHAIN_PATH)/bin/$(TARGET)-readelf
5 kx NM = $(TOOLCHAIN_PATH)/bin/$(TARGET)-nm
5 kx CROSS_PREFIX = $(TOOLCHAIN_PATH)/bin/$(TARGET)-
5 kx PATCHELF = $(strip \
5 kx $(if $(filter yes,$(call has-patchelf,$(TOOLCHAIN))), \
5 kx $(TOOLCHAIN_PATH)/bin/$(TARGET)-patchelf, \
5 kx ))
5 kx else
5 kx ifeq ($(TOOLCHAIN),$(TOOLCHAIN_BUILD_MACHINE))
5 kx CC = $(TOOLCHAIN_PATH)/bin/gcc
5 kx CXX = $(TOOLCHAIN_PATH)/bin/g++
5 kx ADDR2LINE = $(TOOLCHAIN_PATH)/bin/addr2line
5 kx AS = $(TOOLCHAIN_PATH)/bin/as
5 kx AR = $(TOOLCHAIN_PATH)/bin/ar
5 kx LD = $(TOOLCHAIN_PATH)/bin/ld
5 kx RANLIB = $(TOOLCHAIN_PATH)/bin/ranlib
5 kx SIZE = $(TOOLCHAIN_PATH)/bin/size
5 kx STRIP = $(TOOLCHAIN_PATH)/bin/strip
5 kx OBJCOPY = $(TOOLCHAIN_PATH)/bin/objcopy
5 kx OBJDUMP = $(TOOLCHAIN_PATH)/bin/objdump
5 kx READELF = $(TOOLCHAIN_PATH)/bin/readelf
5 kx NM = $(TOOLCHAIN_PATH)/bin/nm
5 kx PATCHELF = $(strip \
5 kx $(if $(filter yes,$(call has-patchelf,$(TOOLCHAIN))), \
5 kx $(TOOLCHAIN_PATH)/bin/patchelf, \
5 kx ))
5 kx else
5 kx # TOOLCHAIN_NOARCH doesn't need these variables but:
5 kx CC = gcc
5 kx CXX = g++
5 kx ADDR2LINE = addr2line
5 kx AS = as
5 kx AR = ar
5 kx LD = ld
5 kx RANLIB = ranlib
5 kx SIZE = size
5 kx STRIP = strip
5 kx OBJCOPY = objcopy
5 kx OBJDUMP = objdump
5 kx READELF = readelf
5 kx NM = nm
5 kx endif
5 kx endif
5 kx
5 kx #######
5 kx ####### Packages ARCH:
5 kx #######
5 kx
5 kx PKGARCH = $(word 1,$(subst -, ,$(TARGET)))
5 kx
5 kx
5 kx #
5 kx # The user may reject the sysroot usage. For this the user have to declare
5 kx # the USE_TARGET_DEST_DIR_SYSROOT variable with value 'no':
5 kx #
5 kx # USE_TARGET_DEST_DIR_SYSROOT = no
5 kx #
5 kx ifneq ($(USE_TARGET_DEST_DIR_SYSROOT),no)
5 kx USE_TARGET_DEST_DIR_SYSROOT := yes
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### Build machine triplet:
5 kx #######
5 kx
5 kx ifeq ($(shell echo $(shell ${BUILDSYSTEM}/canonical-build 2> /dev/null)),)
5 kx BUILD = unknown-unknown-unknown-unknown
5 kx $(error Errorr: Unknown BUILD System '${BUILD}')
5 kx else
5 kx BUILD = $(shell echo $(shell ${BUILDSYSTEM}/canonical-build 2> /dev/null))
5 kx endif
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Include Directories setup Section:
5 kx #######
5 kx
5 kx INCPATH += -I.
5 kx
5 kx TARGET_INCPATH += -I$(TARGET_DEST_DIR)/usr/include
5 kx
5 kx ROOTFS_INCPATH += -I$(ROOTFS_DEST_DIR)/usr/include
5 kx
5 kx #
5 kx # Toolchain include path:
5 kx #
5 kx ifneq ($(call toolchain-sysroot,$(TOOLCHAIN)),)
5 kx TOOLCHAIN_INCPATH += -I$(TOOLCHAIN_PATH)/$(TARGET)/$(call toolchain-sysroot,$(TOOLCHAIN))/usr/include
5 kx endif
5 kx
5 kx #######
5 kx ####### End of Include Directories setup Section.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Library directory suffixes for BUILD MACHINE.
5 kx #######
5 kx
5 kx #
5 kx # NOTE: LIBSUFFIX=64 is valid for Slackware64 distro where native libraries are placed in /usr/lib64 directory
5 kx # for example ubuntu has /usr/lib for x86_64 libraries and /usr/lib32 for x86_32 libraries as well as
5 kx # our X86_64-glibc toolchain.
5 kx # TODO: Create the canonical-distro script such as $(BULDSYSTEM)/canonical-build we have.
5 kx #
5 kx ifeq ($(TOOLCHAIN),$(TOOLCHAIN_BUILD_MACHINE))
5 kx LIBSUFFIX ?= 64
5 kx endif
5 kx
5 kx #
5 kx # BUILD_CC lib SUFFIX
5 kx #
5 kx BUILD_MULTILIB_X86_32_SUFFIX = $(shell echo $(shell gcc -m32 -print-multi-os-directory) | sed -e 's/\(^.*lib\)\([0-9]*\)/\2/')
5 kx BUILD_MULTILIB_SUFFIX = $(shell echo $(shell gcc -print-multi-os-directory) | sed -e 's/\(^.*lib\)\([0-9]*\)/\2/')
5 kx
5 kx #######
5 kx ####### End of Library directory suffixes for BUILD MACHINE.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx # NOTE:
5 kx # ====
5 kx #
5 kx # Default optimization is -O3 and defined by 'OPTIMIZATION_FLAGS' variable
5 kx # in the target-setup.mk. The 'OPTIMIZATION_FLAGS' variable can be overriden
5 kx # in user Makefile by following definition.
5 kx #
5 kx # OPTIMIZATION_FLAGS = -O2
5 kx #
5 kx # However some HW requires specific optimization which should't be overriden
5 kx # by user. In this case we define toolchain depended variable *_OPTIMIZATION
5 kx # within constants.mk file. This variable is used to assign a value to the
5 kx # ARCH_OPTIMIZATION variable, which, in turn, sets the actual (depending on
5 kx # the current HW) optimization.
5 kx #
5 kx # This way allow us prioritize the HW specific optimisation. If user
5 kx # want to override HW specific optimization then hi can override the
5 kx # ARCH_OPTIMISATION variable. In this case user have to be sure that
5 kx # this redefinition doesn't affect other HW:
5 kx #
5 kx # ifeq ($(HARDWARE),$(HARDWARE_CI20))
5 kx # ARCH_OPTIMIZATION = -O2
5 kx # endif
5 kx #
5 kx # Resume:
5 kx # ------
5 kx # - OPTIMIZATION_FLAGS can be overriden only if ARCH_OPTIMIZATION is not set.
5 kx # - ARCH_OPTIMIZATION can be overriden always and ARCH_OPTIMIZATION has highest priority.
5 kx # - default optimization is -O3
5 kx # - the condition (OPTIMIZATION_FLAGS == ARCH_OPTIMIZATION) is always true.
5 kx #
5 kx ifneq ($(ARCH_OPTIMIZATION),)
5 kx OPTIMIZATION_FLAGS = $(ARCH_OPTIMIZATION)
5 kx else
5 kx OPTIMIZATION_FLAGS ?= -O3
5 kx ARCH_OPTIMIZATION = $(OPTIMIZATION_FLAGS)
5 kx endif
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Common Compiler & Linker flags:
5 kx #######
5 kx
5 kx ifeq ($(USE_TARGET_DEST_DIR_SYSROOT),yes)
5 kx LDFLAGS += -L$(TARGET_DEST_DIR)/lib$(LIBSUFFIX) -L$(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)
5 kx endif
5 kx
5 kx # Common CPP/C/C++ flags
5 kx COMMON_FLAGS = $(INCPATH)
5 kx ifeq ($(USE_TARGET_DEST_DIR_SYSROOT),yes)
5 kx COMMON_FLAGS += $(TARGET_INCPATH)
5 kx endif
5 kx COMMON_FLAGS += -g $(OPTIMIZATION_FLAGS) $(ARCH_FLAGS) $(ARCH_DEFS) $(HW_FLAGS)
5 kx
5 kx
5 kx CFLAGS += $(COMMON_FLAGS)
5 kx CXXFLAGS += $(COMMON_FLAGS)
5 kx
5 kx #######
5 kx ####### End of Common Compiler & Linker flags.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Default Linkers:
5 kx #######
5 kx
5 kx ifeq ($(call sysroot,$(TOOLCHAIN))_$(USE_TARGET_DEST_DIR_SYSROOT),yes_yes)
5 kx CC_LINKER = $(CC) --sysroot=$(TARGET_DEST_DIR)
5 kx CXX_LINKER = $(CXX) --sysroot=$(TARGET_DEST_DIR)
5 kx else
5 kx CC_LINKER = $(CC)
5 kx CXX_LINKER = $(CXX)
5 kx endif
5 kx
5 kx #######
5 kx ####### Default Linkers.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Development environment:
5 kx #######
5 kx
5 kx
5 kx BUILD_ENVIRONMENT = PATH=$(PATH):$(TOOLCHAIN_PATH)/bin
5 kx
5 kx ifeq ($(call sysroot,$(TOOLCHAIN))_$(USE_TARGET_DEST_DIR_SYSROOT),yes_yes)
5 kx BUILD_ENVIRONMENT += CC="$(CC) --sysroot=$(TARGET_DEST_DIR)"
5 kx BUILD_ENVIRONMENT += CXX="$(CXX) --sysroot=$(TARGET_DEST_DIR)"
5 kx BUILD_ENVIRONMENT += LD="$(LD) --sysroot=$(TARGET_DEST_DIR)"
5 kx else
5 kx BUILD_ENVIRONMENT += CC="$(CC)" CXX="$(CXX)" LD="$(LD)"
5 kx endif
5 kx
5 kx BUILD_ENVIRONMENT += AS="$(AS)" AR="$(AR)" RANLIB="$(RANLIB)" SIZE="$(SIZE)" STRIP="$(STRIP)" OBJCOPY="$(OBJCOPY)" OBJDUMP="$(OBJDUMP)" NM="$(NM)"
5 kx BUILD_ENVIRONMENT += BUILD_CC="$(BUILD_CC)" BUILD_CXX="$(BUILD_CXX)" BUILD_AS="$(BUILD_AS)" BUILD_AR="$(BUILD_AR)" BUILD_LD="$(BUILD_LD)" BUILD_RANLIB="$(BUILD_RANLIB)" BUILD_SIZE="$(BUILD_SIZE)" BUILD_STRIP="$(BUILD_STRIP)" BUILD_OBJCOPY="$(BUILD_OBJCOPY)" BUILD_OBJDUMP="$(BUILD_OBJDUMP)" BUILD_NM="$(BUILD_NM)"
5 kx BUILD_ENVIRONMENT += CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)"
5 kx BUILD_ENVIRONMENT += LDFLAGS="$(LDFLAGS)"
5 kx
5 kx #
5 kx # PKG_CONFIG_PATH - directories to add to pkg-config's search path
5 kx #
5 kx PKG_CONFIG_PATH = $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig:$(TARGET_DEST_DIR)/usr/share/pkgconfig
5 kx PKG_CONFIG_LIBDIR = $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig:$(TARGET_DEST_DIR)/usr/share/pkgconfig
5 kx
5 kx BUILD_ENVIRONMENT += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
5 kx BUILD_ENVIRONMENT += PKG_CONFIG_LIBDIR="$(PKG_CONFIG_LIBDIR)"
5 kx
5 kx #######
5 kx ####### Development environment.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Multilib Support:
5 kx #######
5 kx
5 kx
5 kx #######
5 kx ####### x86_32:
5 kx #######
5 kx
5 kx ####### Multilib directory suffixes for TARGETs:
5 kx
5 kx ifeq ($(TOOLCHAIN),$(TOOLCHAIN_X86_64_GLIBC))
5 kx MULTILIB_X86_32_SUFFIX ?= 32
5 kx endif
5 kx
5 kx ifneq ($(filter $(HARDWARE),$(HARDWARE_INTEL_PC64)),)
5 kx ifeq ($(CREATE_X86_32_PACKAGE),true)
5 kx
5 kx CC += -m32
5 kx CXX += -m32
5 kx
5 kx ifeq ($(USE_TARGET_DEST_DIR_SYSROOT),yes)
5 kx LDFLAGS = -L$(TARGET_DEST_DIR)/lib$(MULTILIB_X86_32_SUFFIX)
5 kx LDFLAGS += -L$(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)
5 kx endif
5 kx
5 kx PKG_CONFIG_PATH = $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig:$(TARGET_DEST_DIR)/usr/share/pkgconfig
5 kx PKG_CONFIG_LIBDIR = $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig:$(TARGET_DEST_DIR)/usr/share/pkgconfig
5 kx
5 kx ARCH_FLAGS = -m32 -march=i686 -mtune=i686
5 kx
5 kx TARGET32 = $(shell echo $(TARGET) | sed 's/x86_64/i686/')
5 kx
5 kx endif
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### powerpc32:
5 kx #######
5 kx
5 kx ####### Multilib directory suffixes for TARGETs:
5 kx
5 kx ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_POWER8_GLIBC) \
5 kx $(TOOLCHAIN_POWER9_GLIBC)),)
5 kx MULTILIB_PPC32_SUFFIX ?= 32
5 kx endif
5 kx
5 kx ifneq ($(filter $(HARDWARE),$(HARDWARE_S824L) \
5 kx $(HARDWARE_VESNIN) \
5 kx $(HARDWARE_TL2WK2) \
5 kx $(HARDWARE_TL2SV2)),)
5 kx ifeq ($(CREATE_PPC32_PACKAGE),true)
5 kx
5 kx CC += -m32
5 kx CXX += -m32
5 kx
5 kx ifeq ($(USE_TARGET_DEST_DIR_SYSROOT),yes)
5 kx LDFLAGS = -L$(TARGET_DEST_DIR)/lib$(MULTILIB_PPC32_SUFFIX)
5 kx LDFLAGS += -L$(TARGET_DEST_DIR)/usr/lib$(MULTILIB_PPC32_SUFFIX)
5 kx endif
5 kx
5 kx PKG_CONFIG_PATH = $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_PPC32_SUFFIX)/pkgconfig:$(TARGET_DEST_DIR)/usr/share/pkgconfig
5 kx PKG_CONFIG_LIBDIR = $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_PPC32_SUFFIX)/pkgconfig:$(TARGET_DEST_DIR)/usr/share/pkgconfig
5 kx
5 kx ifeq ($(TOOLCHAIN),$(TOOLCHAIN_POWER8_GLIBC))
5 kx ARCH_FLAGS = -m32 -mcpu=power8 -mlong-double-128
5 kx endif
5 kx ifeq ($(TOOLCHAIN),$(TOOLCHAIN_POWER9_GLIBC))
5 kx ARCH_FLAGS = -m32 -mcpu=power9 -mlong-double-128
5 kx endif
5 kx
5 kx TARGET32 = $(shell echo $(TARGET) | sed 's/ppc64/ppc/')
5 kx
5 kx endif
5 kx endif
5 kx
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### End of Multilib Support.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx #######
5 kx ####### Setup actual Distribution info:
5 kx #######
5 kx
5 kx DISTRO_REPOSITORY_URL = $(shell $(BUILDSYSTEM)/build-version --system --repo)
5 kx DISTRO_BUILD_BRANCH = $(shell $(BUILDSYSTEM)/build-version --system --branch)
5 kx DISTRO_BUILD_REVISION = $(shell $(BUILDSYSTEM)/build-version --system)
5 kx DISTRO_FULL_VERSION = $(DISTRO_VERSION).$(DISTRO_BUILD_REVISION)
5 kx
5 kx BUILD_SYSTEM_REPOSITORY_URL = $(shell $(BUILDSYSTEM)/build-version --repo)
5 kx BUILD_SYSTEM_BUILD_BRANCH = $(shell $(BUILDSYSTEM)/build-version --branch)
5 kx BUILD_SYSTEM_BUILD_REVISION = $(shell $(BUILDSYSTEM)/build-version)
5 kx
5 kx TOOLSHAINS_RELATIVE_URL = $(TOOLCHAINS_FTP_BASE)/$(TOOLCHAIN_VERSION)
5 kx
5 kx SOURCES_RELATIVE_URL = sources
5 kx
13 kx PACKAGES_BASE_URL = $(DOWNLOAD_SERVER)/$(DISTRO_NAME)/system/releases
5 kx PACKAGES_RELATIVE_URL = $(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)
5 kx
5 kx PACKAGES_REPOSITORY = https://pkg.radix.pro
5 kx
5 kx
5 kx
5 kx
5 kx TARGET_SETUP_MK=1
5 kx endif