annotate make/common/shared/Compiler-gcc.gmk @ 422:c51121419e30

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