1 | # $Id: VBoxXGccX86RedHatLinux.kmk 46564 2013-06-14 15:18:43Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # kBuild Tool Config - GCC Cross compiler for CentOS 3 x86.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2013 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | TOOL_VBoxXGccX86RedHatLinux := GCC Cross compiler for CentOS 3 x86.
|
---|
19 |
|
---|
20 | # Tool Specific Properties:
|
---|
21 | ifndef TOOL_VBoxXGccX86RedHatLinux_PREFIX
|
---|
22 | TOOL_VBoxXGccX86RedHatLinux_PREFIX := i386-redhat-linux-
|
---|
23 | endif
|
---|
24 | ifndef PATH_TOOL_VBoxXGccX86RedHatLinux
|
---|
25 | PATH_TOOL_VBoxXGccX86RedHatLinux := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST)/i386-redhat-linux/*)))
|
---|
26 | ifeq ($(PATH_TOOL_VBoxXGccX86RedHatLinux),)
|
---|
27 | PATH_TOOL_VBoxXGccX86RedHatLinux := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/i386-redhat-linux/*)))
|
---|
28 | endif
|
---|
29 | endif
|
---|
30 | TOOL_VBoxXGccX86RedHatLinux_PREFIX := $(REDIRECT) -E COMPILER_PATH=$(PATH_TOOL_VBoxXGccX86RedHatLinux)/bin/ -- $(PATH_TOOL_VBoxXGccX86RedHatLinux)/bin/$(TOOL_VBoxXGccX86RedHatLinux_PREFIX)
|
---|
31 |
|
---|
32 | TOOL_VBoxXGccX86RedHatLinux_CC ?= $(TOOL_VBoxXGccX86RedHatLinux_PREFIX)gcc$(HOSTSUFF_EXE)
|
---|
33 | TOOL_VBoxXGccX86RedHatLinux_CXX ?= $(TOOL_VBoxXGccX86RedHatLinux_PREFIX)g++$(HOSTSUFF_EXE)
|
---|
34 | TOOL_VBoxXGccX86RedHatLinux_AS ?= $(TOOL_VBoxXGccX86RedHatLinux_PREFIX)gcc$(HOSTSUFF_EXE)
|
---|
35 | TOOL_VBoxXGccX86RedHatLinux_AR ?= $(TOOL_VBoxXGccX86RedHatLinux_PREFIX)ar$(HOSTSUFF_EXE)
|
---|
36 | TOOL_VBoxXGccX86RedHatLinux_LD ?= $(TOOL_VBoxXGccX86RedHatLinux_PREFIX)g++$(HOSTSUFF_EXE) -Wl,-rpath-link,$(PATH_TOOL_VBoxXGccX86RedHatLinux)/i386-redhat-linux/lib
|
---|
37 | TOOL_VBoxXGccX86RedHatLinux_LD_SYSMOD ?= $(TOOL_VBoxXGccX86RedHatLinux_PREFIX)ld$(HOSTSUFF_EXE)
|
---|
38 |
|
---|
39 | TOOL_VBoxXGccX86RedHatLinux_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
40 | TOOL_VBoxXGccX86RedHatLinux_LD_MAP ?= -Wl,-Map -Wl,$(1) -Wl,--cref
|
---|
41 | TOOL_VBoxXGccX86RedHatLinux_LD_SYSMOD_MAP ?= -Map $(1) --cref
|
---|
42 | TOOL_VBoxXGccX86RedHatLinux_LDFLAGS.dll ?= -shared
|
---|
43 | TOOL_VBoxXGccX86RedHatLinux_LDFLAGS.sysmod ?= -r
|
---|
44 |
|
---|
45 | ifdef SLKRUNS
|
---|
46 | TOOL_VBoxXGccX86RedHatLinux_CC += -fmessage-length=0
|
---|
47 | TOOL_VBoxXGccX86RedHatLinux_CXX += -fmessage-length=0
|
---|
48 | endif
|
---|
49 |
|
---|
50 | # General Properties used by kBuild:
|
---|
51 | TOOL_VBoxXGccX86RedHatLinux_COBJSUFF ?= .o
|
---|
52 | TOOL_VBoxXGccX86RedHatLinux_CFLAGS ?= -g
|
---|
53 | TOOL_VBoxXGccX86RedHatLinux_CFLAGS.debug ?= -O0
|
---|
54 | TOOL_VBoxXGccX86RedHatLinux_CFLAGS.release ?= -O2
|
---|
55 | TOOL_VBoxXGccX86RedHatLinux_CFLAGS.profile ?= -O2
|
---|
56 | TOOL_VBoxXGccX86RedHatLinux_CINCS ?=
|
---|
57 | TOOL_VBoxXGccX86RedHatLinux_CDEFS ?=
|
---|
58 |
|
---|
59 | TOOL_VBoxXGccX86RedHatLinux_CXXOBJSUFF ?= .o
|
---|
60 | TOOL_VBoxXGccX86RedHatLinux_CXXOBJSUFF ?= .o
|
---|
61 | TOOL_VBoxXGccX86RedHatLinux_CXXFLAGS ?= -g
|
---|
62 | TOOL_VBoxXGccX86RedHatLinux_CXXFLAGS.debug ?= -O0
|
---|
63 | TOOL_VBoxXGccX86RedHatLinux_CXXFLAGS.release ?= -O2
|
---|
64 | TOOL_VBoxXGccX86RedHatLinux_CXXFLAGS.profile ?= -O2
|
---|
65 | TOOL_VBoxXGccX86RedHatLinux_CXXINCS ?=
|
---|
66 | TOOL_VBoxXGccX86RedHatLinux_CXXDEFS ?=
|
---|
67 |
|
---|
68 | TOOL_VBoxXGccX86RedHatLinux_ASFLAGS ?= -g -x assembler-with-cpp
|
---|
69 | TOOL_VBoxXGccX86RedHatLinux_ASOBJSUFF ?= .o
|
---|
70 |
|
---|
71 | TOOL_VBoxXGccX86RedHatLinux_ARFLAGS ?= cr
|
---|
72 | TOOL_VBoxXGccX86RedHatLinux_ARLIBSUFF ?= .a
|
---|
73 | TOOL_VBoxXGccX86RedHatLinux_LDFLAGS ?=
|
---|
74 | TOOL_VBoxXGccX86RedHatLinux_LDFLAGS.debug ?= -g
|
---|
75 | TOOL_VBoxXGccX86RedHatLinux_LDFLAGS.release ?= -s
|
---|
76 |
|
---|
77 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_C_OUTPUT =
|
---|
78 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_C_DEPEND =
|
---|
79 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_C_DEPORD =
|
---|
80 | define TOOL_VBoxXGccX86RedHatLinux_COMPILE_C_CMDS
|
---|
81 | $(QUIET)$(TOOL_VBoxXGccX86RedHatLinux_CC) -c \
|
---|
82 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs)) \
|
---|
83 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \
|
---|
84 | -o $(obj) \
|
---|
85 | $(abspath $(source))
|
---|
86 | endef
|
---|
87 |
|
---|
88 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_CXX_OUTPUT =
|
---|
89 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_CXX_DEPEND =
|
---|
90 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_CXX_DEPORD =
|
---|
91 | define TOOL_VBoxXGccX86RedHatLinux_COMPILE_CXX_CMDS
|
---|
92 | $(QUIET)$(TOOL_VBoxXGccX86RedHatLinux_CXX) -c \
|
---|
93 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs)) \
|
---|
94 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \
|
---|
95 | -o $(obj) \
|
---|
96 | $(abspath $(source))
|
---|
97 | endef
|
---|
98 |
|
---|
99 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_AS_OUTPUT =
|
---|
100 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_AS_DEPEND =
|
---|
101 | TOOL_VBoxXGccX86RedHatLinux_COMPILE_AS_DEPORD =
|
---|
102 | define TOOL_VBoxXGccX86RedHatLinux_COMPILE_AS_CMDS
|
---|
103 | $(QUIET)$(TOOL_VBoxXGccX86RedHatLinux_AS) -c \
|
---|
104 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs)) \
|
---|
105 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \
|
---|
106 | -o $(obj) \
|
---|
107 | $(abspath $(source))
|
---|
108 | endef
|
---|
109 |
|
---|
110 | TOOL_VBoxXGccX86RedHatLinux_LINK_LIBRARY_OUTPUT = $(out).ar-script
|
---|
111 | TOOL_VBoxXGccX86RedHatLinux_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
112 | TOOL_VBoxXGccX86RedHatLinux_LINK_LIBRARY_DEPORD =
|
---|
113 | define TOOL_VBoxXGccX86RedHatLinux_LINK_LIBRARY_CMDS
|
---|
114 | $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
|
---|
115 | $(QUIET)$(APPEND) -n $(out).ar-script \
|
---|
116 | $(foreach o,$(objs), 'ADDMOD $(o)') \
|
---|
117 | $(foreach o,$(othersrc), 'ADDLIB $(o)')
|
---|
118 | $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
|
---|
119 | $(QUIET)$(APPEND) $(out).ar-script 'END'
|
---|
120 | $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_VBoxXGccX86RedHatLinux_AR) -M
|
---|
121 | endef
|
---|
122 |
|
---|
123 | TOOL_VBoxXGccX86RedHatLinux_LINK_PROGRAM_OUTPUT = $(outbase).map
|
---|
124 | TOOL_VBoxXGccX86RedHatLinux_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
125 | TOOL_VBoxXGccX86RedHatLinux_LINK_PROGRAM_DEPORD =
|
---|
126 | define TOOL_VBoxXGccX86RedHatLinux_LINK_PROGRAM_CMDS
|
---|
127 | $(QUIET)$(TOOL_VBoxXGccX86RedHatLinux_LD) $(flags) -o $(out) $(objs) \
|
---|
128 | $(foreach p,$(libpath), -L$(p)) \
|
---|
129 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
|
---|
130 | $(call TOOL_VBoxXGccX86RedHatLinux_LD_MAP,$(outbase).map)
|
---|
131 | endef
|
---|
132 |
|
---|
133 | TOOL_VBoxXGccX86RedHatLinux_LINK_DLL_OUTPUT = $(outbase).map
|
---|
134 | TOOL_VBoxXGccX86RedHatLinux_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
135 | TOOL_VBoxXGccX86RedHatLinux_LINK_DLL_DEPORD =
|
---|
136 | define TOOL_VBoxXGccX86RedHatLinux_LINK_DLL_CMDS
|
---|
137 | $(QUIET)$(TOOL_VBoxXGccX86RedHatLinux_LD) $(TOOL_VBoxXGccX86RedHatLinux_LDFLAGS.dll) $(flags) -o $(out) \
|
---|
138 | $(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_VBoxXGccX86RedHatLinux_LD_SONAME,$(target),$(out))) \
|
---|
139 | $(objs) \
|
---|
140 | $(foreach p,$(libpath), -L$(p)) \
|
---|
141 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
|
---|
142 | $(call TOOL_VBoxXGccX86RedHatLinux_LD_MAP,$(outbase).map)
|
---|
143 | endef
|
---|
144 |
|
---|
145 | TOOL_VBoxXGccX86RedHatLinux_LINK_SYSMOD_OUTPUT = $(outbase).map
|
---|
146 | TOOL_VBoxXGccX86RedHatLinux_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
147 | TOOL_VBoxXGccX86RedHatLinux_LINK_SYSMOD_DEPORD =
|
---|
148 | define TOOL_VBoxXGccX86RedHatLinux_LINK_SYSMOD_CMDS
|
---|
149 | $(QUIET)$(TOOL_VBoxXGccX86RedHatLinux_LD_SYSMOD) $(TOOL_VBoxXGccX86RedHatLinux_LDFLAGS.sysmod) $(flags) -o $(out) $(objs) \
|
---|
150 | $(foreach p,$(libpath), -L$(p)) \
|
---|
151 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
|
---|
152 | $(call TOOL_VBoxXGccX86RedHatLinux_LD_SYSMOD_MAP,$(outbase).map)
|
---|
153 | endef
|
---|
154 |
|
---|