1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/common/shared/Compiler-gcc.gmk Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,125 @@ 1.4 +# 1.5 +# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. Sun designates this 1.11 +# particular file as subject to the "Classpath" exception as provided 1.12 +# by Sun in the LICENSE file that accompanied this code. 1.13 +# 1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 +# version 2 for more details (a copy is included in the LICENSE file that 1.18 +# accompanied this code). 1.19 +# 1.20 +# You should have received a copy of the GNU General Public License version 1.21 +# 2 along with this work; if not, write to the Free Software Foundation, 1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 +# 1.24 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.25 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.26 +# have any questions. 1.27 +# 1.28 + 1.29 +# 1.30 +# GCC Compiler settings 1.31 +# 1.32 + 1.33 +COMPILER_NAME=GCC 1.34 + 1.35 +ifeq ($(PLATFORM), windows) 1.36 + 1.37 + # Settings specific to Windows, pretty stale, hasn't been used 1.38 + CC = $(COMPILER_PATH)gcc 1.39 + CPP = $(COMPILER_PATH)gcc -E 1.40 + CXX = $(COMPILER_PATH)g++ 1.41 + CCC = $(COMPILER_PATH)g++ 1.42 + LIBEXE = $(COMPILER_PATH)lib 1.43 + LINK = $(COMPILER_PATH)link 1.44 + RC = $(MSDEVTOOLS_PATH)link 1.45 + LINK32 = $(LINK) 1.46 + RSC = $(RC) 1.47 + # unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake 1.48 + NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo 1.49 + ifeq ($(ARCH_DATA_MODEL), 32) 1.50 + CC_VER = UNKNOWN 1.51 + CC_TYPE = UNKNOWN 1.52 + else 1.53 + CC_VER = UNKNOWN 1.54 + CC_TYPE = UNKNOWN 1.55 + endif 1.56 + _LINK_VER :=$(shell $(LINK) 2>&1 | $(HEAD) -n 1) 1.57 + LINK_VER :=$(call GetVersion,"$(_LINK_VER)") 1.58 + 1.59 +endif 1.60 + 1.61 +ifeq ($(PLATFORM), linux) 1.62 + 1.63 + # Settings specific to Linux 1.64 + CC = $(COMPILER_PATH)gcc 1.65 + CPP = $(COMPILER_PATH)gcc -E 1.66 + # statically link libstdc++ before C++ ABI is stablized on Linux 1.67 + STATIC_CXX = true 1.68 + ifeq ($(STATIC_CXX),true) 1.69 + # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++" 1.70 + # We need to use gcc to statically link the C++ runtime. gcc and g++ use 1.71 + # the same subprocess to compile C++ files, so it is OK to build using gcc. 1.72 + CXX = $(COMPILER_PATH)gcc 1.73 + else 1.74 + CXX = $(COMPILER_PATH)g++ 1.75 + endif 1.76 + ifneq ("$(findstring sparc,$(ARCH))", "") 1.77 + # sparc or sparcv9 1.78 + REQUIRED_CC_VER = 4.0 1.79 + REQUIRED_GCC_VER = 4.0.* 1.80 + else 1.81 + ifeq ($(ARCH_DATA_MODEL), 32) 1.82 + # i586 1.83 + REQUIRED_CC_VER = 3.2 1.84 + REQUIRED_GCC_VER = 3.2.1* 1.85 + REQUIRED_GCC_VER_INT = 3.2.1-7a 1.86 + else 1.87 + ifeq ($(ARCH), amd64) 1.88 + # amd64 1.89 + REQUIRED_CC_VER = 3.2 1.90 + REQUIRED_GCC_VER = 3.2.* 1.91 + endif 1.92 + ifeq ($(ARCH), ia64) 1.93 + # ia64 1.94 + REQUIRED_CC_VER = 3.2 1.95 + REQUIRED_GCC_VER = 2.9[56789].* 1.96 + endif 1.97 + endif 1.98 + endif 1.99 + # Option used to create a shared library 1.100 + SHARED_LIBRARY_FLAG = -shared -mimpure-text 1.101 + SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 ) 1.102 + 1.103 +endif 1.104 + 1.105 +ifeq ($(PLATFORM), solaris) 1.106 + 1.107 + # Settings specific to Solaris 1.108 + CC = $(COMPILER_PATH)gcc 1.109 + CPP = $(COMPILER_PATH)gcc -E 1.110 + CXX = $(COMPILER_PATH)g++ 1.111 + REQUIRED_CC_VER = 3.2 1.112 + 1.113 + # Option used to create a shared library 1.114 + SHARED_LIBRARY_FLAG = -G 1.115 + # But gcc is still needed no matter what on 32bit 1.116 + ifeq ($(ARCH_DATA_MODEL), 32) 1.117 + REQUIRED_GCC_VER = 2.95 1.118 + GCC =$(GCC_COMPILER_PATH)gcc 1.119 + _GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 ) 1.120 + GCC_VER :=$(call GetVersion,"$(_GCC_VER)") 1.121 + endif 1.122 + 1.123 +endif 1.124 + 1.125 +# Get gcc version 1.126 +_CC_VER :=$(shell $(CC) -dumpversion 2>&1 ) 1.127 +CC_VER :=$(call GetVersion,"$(_CC_VER)") 1.128 +