author | ohair |
Sun, 27 Jul 2008 18:42:57 -0700 | |
changeset 849 | be386e469547 |
parent 715 | f16baef3a20e |
child 2158 | 68869a085470 |
permissions | -rw-r--r-- |
2 | 1 |
# |
715 | 2 |
# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. |
2 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Sun designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Sun in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
# have any questions. |
|
24 |
# |
|
25 |
||
26 |
# |
|
27 |
# GCC Compiler settings |
|
28 |
# |
|
29 |
||
30 |
COMPILER_NAME=GCC |
|
31 |
||
32 |
ifeq ($(PLATFORM), windows) |
|
33 |
||
34 |
# Settings specific to Windows, pretty stale, hasn't been used |
|
35 |
CC = $(COMPILER_PATH)gcc |
|
36 |
CPP = $(COMPILER_PATH)gcc -E |
|
37 |
CXX = $(COMPILER_PATH)g++ |
|
38 |
CCC = $(COMPILER_PATH)g++ |
|
39 |
LIBEXE = $(COMPILER_PATH)lib |
|
40 |
LINK = $(COMPILER_PATH)link |
|
41 |
RC = $(MSDEVTOOLS_PATH)link |
|
42 |
LINK32 = $(LINK) |
|
43 |
RSC = $(RC) |
|
44 |
# unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake |
|
45 |
NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo |
|
46 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
47 |
CC_VER = UNKNOWN |
|
48 |
else |
|
49 |
CC_VER = UNKNOWN |
|
50 |
endif |
|
51 |
_LINK_VER :=$(shell $(LINK) 2>&1 | $(HEAD) -n 1) |
|
52 |
LINK_VER :=$(call GetVersion,"$(_LINK_VER)") |
|
53 |
||
54 |
endif |
|
55 |
||
56 |
ifeq ($(PLATFORM), linux) |
|
57 |
||
58 |
# Settings specific to Linux |
|
59 |
CC = $(COMPILER_PATH)gcc |
|
60 |
CPP = $(COMPILER_PATH)gcc -E |
|
61 |
# statically link libstdc++ before C++ ABI is stablized on Linux |
|
62 |
STATIC_CXX = true |
|
63 |
ifeq ($(STATIC_CXX),true) |
|
64 |
# g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++" |
|
65 |
# We need to use gcc to statically link the C++ runtime. gcc and g++ use |
|
66 |
# the same subprocess to compile C++ files, so it is OK to build using gcc. |
|
67 |
CXX = $(COMPILER_PATH)gcc |
|
68 |
else |
|
69 |
CXX = $(COMPILER_PATH)g++ |
|
70 |
endif |
|
71 |
ifneq ("$(findstring sparc,$(ARCH))", "") |
|
72 |
# sparc or sparcv9 |
|
73 |
REQUIRED_CC_VER = 4.0 |
|
74 |
REQUIRED_GCC_VER = 4.0.* |
|
75 |
else |
|
76 |
REQUIRED_CC_VER = 3.2 |
|
849
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
77 |
ifeq ($(ARCH_DATA_MODEL), 32) |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
78 |
REQUIRED_GCC_VER = 3.2.1* |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
79 |
REQUIRED_GCC_VER_INT = 3.2.1-7a |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
80 |
else |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
81 |
ifeq ($(ARCH), amd64) |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
82 |
REQUIRED_GCC_VER = 3.2.* |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
83 |
endif |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
84 |
ifeq ($(ARCH), ia64) |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
85 |
REQUIRED_GCC_VER = 2.9[56789].* |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
86 |
endif |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
715
diff
changeset
|
87 |
endif |
2 | 88 |
endif |
89 |
# Option used to create a shared library |
|
90 |
SHARED_LIBRARY_FLAG = -shared -mimpure-text |
|
91 |
SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 ) |
|
92 |
||
93 |
endif |
|
94 |
||
95 |
ifeq ($(PLATFORM), solaris) |
|
96 |
||
97 |
# Settings specific to Solaris |
|
98 |
CC = $(COMPILER_PATH)gcc |
|
99 |
CPP = $(COMPILER_PATH)gcc -E |
|
100 |
CXX = $(COMPILER_PATH)g++ |
|
101 |
REQUIRED_CC_VER = 3.2 |
|
102 |
||
103 |
# Option used to create a shared library |
|
104 |
SHARED_LIBRARY_FLAG = -G |
|
105 |
# But gcc is still needed no matter what on 32bit |
|
106 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
107 |
REQUIRED_GCC_VER = 2.95 |
|
108 |
GCC =$(GCC_COMPILER_PATH)gcc |
|
109 |
_GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 ) |
|
110 |
GCC_VER :=$(call GetVersion,"$(_GCC_VER)") |
|
111 |
endif |
|
112 |
||
113 |
endif |
|
114 |
||
115 |
# Get gcc version |
|
116 |
_CC_VER :=$(shell $(CC) -dumpversion 2>&1 ) |
|
117 |
CC_VER :=$(call GetVersion,"$(_CC_VER)") |
|
118 |