# $Id: VBoxXGccX86RedHatLinux.kmk 46390 2013-06-04 22:08:52Z vboxsync $ ## @file # kBuild Tool Config - GCC Cross compiler for CentOS 3 x86. # # # Copyright (C) 2013 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # VBoxXGccX86RedHatLinux := GCC Cross compiler for CentOS 3 x86. # Tool Specific Properties: ifndef VBoxXGccX86RedHatLinux_PREFIX VBoxXGccX86RedHatLinux_PREFIX := i386-redhat-linux- endif ifndef PATH_VBoxXGccX86RedHatLinux PATH_VBoxXGccX86RedHatLinux := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST)/i386-redhat-linux/*))) ifeq ($(PATH_VBoxXGccX86RedHatLinux),) PATH_VBoxXGccX86RedHatLinux := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/linux.x86/i386-redhat-linux/*))) endif endif VBoxXGccX86RedHatLinux_PREFIX := $(REDIRECT) -E COMPILER_PATH=$(PATH_VBoxXGccX86RedHatLinux)/bin/ -- $(PATH_VBoxXGccX86RedHatLinux)/bin/$(VBoxXGccX86RedHatLinux_PREFIX) VBoxXGccX86RedHatLinux_CC ?= $(VBoxXGccX86RedHatLinux_PREFIX)gcc$(HOSTSUFF_EXE) VBoxXGccX86RedHatLinux_CXX ?= $(VBoxXGccX86RedHatLinux_PREFIX)g++$(HOSTSUFF_EXE) VBoxXGccX86RedHatLinux_AS ?= $(VBoxXGccX86RedHatLinux_PREFIX)gcc$(HOSTSUFF_EXE) VBoxXGccX86RedHatLinux_AR ?= $(VBoxXGccX86RedHatLinux_PREFIX)ar$(HOSTSUFF_EXE) VBoxXGccX86RedHatLinux_LD ?= $(VBoxXGccX86RedHatLinux_PREFIX)g++$(HOSTSUFF_EXE) -Wl,-rpath-link,$(PATH_VBoxXGccX86RedHatLinux)/i386-redhat-linux/lib VBoxXGccX86RedHatLinux_LD_SYSMOD ?= $(VBoxXGccX86RedHatLinux_PREFIX)ld$(HOSTSUFF_EXE) VBoxXGccX86RedHatLinux_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) VBoxXGccX86RedHatLinux_LD_MAP ?= -Wl,-Map -Wl,$(1) -Wl,--cref VBoxXGccX86RedHatLinux_LD_SYSMOD_MAP ?= -Map $(1) --cref VBoxXGccX86RedHatLinux_LDFLAGS.dll ?= -shared VBoxXGccX86RedHatLinux_LDFLAGS.sysmod ?= -r ifdef SLKRUNS VBoxXGccX86RedHatLinux_CC += -fmessage-length=0 VBoxXGccX86RedHatLinux_CXX += -fmessage-length=0 endif # General Properties used by kBuild: VBoxXGccX86RedHatLinux_COBJSUFF ?= .o VBoxXGccX86RedHatLinux_CFLAGS ?= -g VBoxXGccX86RedHatLinux_CFLAGS.debug ?= -O0 VBoxXGccX86RedHatLinux_CFLAGS.release ?= -O2 VBoxXGccX86RedHatLinux_CFLAGS.profile ?= -O2 VBoxXGccX86RedHatLinux_CINCS ?= VBoxXGccX86RedHatLinux_CDEFS ?= VBoxXGccX86RedHatLinux_CXXOBJSUFF ?= .o VBoxXGccX86RedHatLinux_CXXOBJSUFF ?= .o VBoxXGccX86RedHatLinux_CXXFLAGS ?= -g VBoxXGccX86RedHatLinux_CXXFLAGS.debug ?= -O0 VBoxXGccX86RedHatLinux_CXXFLAGS.release ?= -O2 VBoxXGccX86RedHatLinux_CXXFLAGS.profile ?= -O2 VBoxXGccX86RedHatLinux_CXXINCS ?= VBoxXGccX86RedHatLinux_CXXDEFS ?= VBoxXGccX86RedHatLinux_ASFLAGS ?= -g -x assembler-with-cpp VBoxXGccX86RedHatLinux_ASOBJSUFF ?= .o VBoxXGccX86RedHatLinux_ARFLAGS ?= cr VBoxXGccX86RedHatLinux_ARLIBSUFF ?= .a VBoxXGccX86RedHatLinux_LDFLAGS ?= VBoxXGccX86RedHatLinux_LDFLAGS.debug ?= -g VBoxXGccX86RedHatLinux_LDFLAGS.release ?= -s VBoxXGccX86RedHatLinux_COMPILE_C_OUTPUT = VBoxXGccX86RedHatLinux_COMPILE_C_DEPEND = VBoxXGccX86RedHatLinux_COMPILE_C_DEPORD = define VBoxXGccX86RedHatLinux_COMPILE_C_CMDS $(QUIET)$(VBoxXGccX86RedHatLinux_CC) -c \ $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs)) \ -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ -o $(obj) \ $(abspath $(source)) endef VBoxXGccX86RedHatLinux_COMPILE_CXX_OUTPUT = VBoxXGccX86RedHatLinux_COMPILE_CXX_DEPEND = VBoxXGccX86RedHatLinux_COMPILE_CXX_DEPORD = define VBoxXGccX86RedHatLinux_COMPILE_CXX_CMDS $(QUIET)$(VBoxXGccX86RedHatLinux_CXX) -c \ $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs)) \ -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ -o $(obj) \ $(abspath $(source)) endef VBoxXGccX86RedHatLinux_COMPILE_AS_OUTPUT = VBoxXGccX86RedHatLinux_COMPILE_AS_DEPEND = VBoxXGccX86RedHatLinux_COMPILE_AS_DEPORD = define VBoxXGccX86RedHatLinux_COMPILE_AS_CMDS $(QUIET)$(VBoxXGccX86RedHatLinux_AS) -c \ $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs)) \ -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ -o $(obj) \ $(abspath $(source)) endef VBoxXGccX86RedHatLinux_LINK_LIBRARY_OUTPUT = $(out).ar-script VBoxXGccX86RedHatLinux_LINK_LIBRARY_DEPEND = $(othersrc) VBoxXGccX86RedHatLinux_LINK_LIBRARY_DEPORD = define VBoxXGccX86RedHatLinux_LINK_LIBRARY_CMDS $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)' $(QUIET)$(APPEND) -n $(out).ar-script \ $(foreach o,$(objs), 'ADDMOD $(o)') \ $(foreach o,$(othersrc), 'ADDLIB $(o)') $(QUIET)$(APPEND) $(out).ar-script 'SAVE' $(QUIET)$(APPEND) $(out).ar-script 'END' $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(VBoxXGccX86RedHatLinux_AR) -M endef VBoxXGccX86RedHatLinux_LINK_PROGRAM_OUTPUT = $(outbase).map VBoxXGccX86RedHatLinux_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) VBoxXGccX86RedHatLinux_LINK_PROGRAM_DEPORD = define VBoxXGccX86RedHatLinux_LINK_PROGRAM_CMDS $(QUIET)$(VBoxXGccX86RedHatLinux_LD) $(flags) -o $(out) $(objs) \ $(foreach p,$(libpath), -L$(p)) \ $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ $(call VBoxXGccX86RedHatLinux_LD_MAP,$(outbase).map) endef VBoxXGccX86RedHatLinux_LINK_DLL_OUTPUT = $(outbase).map VBoxXGccX86RedHatLinux_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) VBoxXGccX86RedHatLinux_LINK_DLL_DEPORD = define VBoxXGccX86RedHatLinux_LINK_DLL_CMDS $(QUIET)$(VBoxXGccX86RedHatLinux_LD) $(VBoxXGccX86RedHatLinux_LDFLAGS.dll) $(flags) -o $(out) \ $(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call VBoxXGccX86RedHatLinux_LD_SONAME,$(target),$(out))) \ $(objs) \ $(foreach p,$(libpath), -L$(p)) \ $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ $(call VBoxXGccX86RedHatLinux_LD_MAP,$(outbase).map) endef VBoxXGccX86RedHatLinux_LINK_SYSMOD_OUTPUT = $(outbase).map VBoxXGccX86RedHatLinux_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) VBoxXGccX86RedHatLinux_LINK_SYSMOD_DEPORD = define VBoxXGccX86RedHatLinux_LINK_SYSMOD_CMDS $(QUIET)$(VBoxXGccX86RedHatLinux_LD_SYSMOD) $(VBoxXGccX86RedHatLinux_LDFLAGS.sysmod) $(flags) -o $(out) $(objs) \ $(foreach p,$(libpath), -L$(p)) \ $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ $(call VBoxXGccX86RedHatLinux_LD_SYSMOD_MAP,$(outbase).map) endef