jdk/make/common/shared/Compiler-gcc.gmk
changeset 2 90ce3da70b43
child 308 33a1639d64a5
equal deleted inserted replaced
0:fd16c54261b3 2:90ce3da70b43
       
     1 #
       
     2 # Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
       
     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     CC_TYPE = UNKNOWN
       
    49   else
       
    50     CC_VER  = UNKNOWN
       
    51     CC_TYPE = UNKNOWN
       
    52   endif
       
    53   _LINK_VER :=$(shell $(LINK) 2>&1 | $(HEAD) -n 1)
       
    54   LINK_VER  :=$(call GetVersion,"$(_LINK_VER)")
       
    55 
       
    56 endif
       
    57 
       
    58 ifeq ($(PLATFORM), linux)
       
    59 
       
    60   # Settings specific to Linux
       
    61   CC             = $(COMPILER_PATH)gcc
       
    62   CPP            = $(COMPILER_PATH)gcc -E
       
    63   # statically link libstdc++ before C++ ABI is stablized on Linux
       
    64   STATIC_CXX     = true
       
    65   ifeq ($(STATIC_CXX),true)
       
    66     # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
       
    67     # We need to use gcc to statically link the C++ runtime. gcc and g++ use
       
    68     # the same subprocess to compile C++ files, so it is OK to build using gcc.
       
    69     CXX            = $(COMPILER_PATH)gcc
       
    70   else
       
    71     CXX            = $(COMPILER_PATH)g++
       
    72   endif
       
    73   ifneq ("$(findstring sparc,$(ARCH))", "")
       
    74     # sparc or sparcv9
       
    75     REQUIRED_CC_VER = 4.0
       
    76     REQUIRED_GCC_VER = 4.0.*
       
    77   else
       
    78   ifeq ($(ARCH_DATA_MODEL), 32)
       
    79     # i586
       
    80     REQUIRED_CC_VER = 3.2
       
    81     REQUIRED_GCC_VER = 3.2.1*
       
    82     REQUIRED_GCC_VER_INT = 3.2.1-7a
       
    83   else
       
    84   ifeq ($(ARCH), amd64)
       
    85     # amd64
       
    86     REQUIRED_CC_VER = 3.2
       
    87     REQUIRED_GCC_VER = 3.2.*
       
    88   endif
       
    89   ifeq ($(ARCH), ia64)
       
    90     # ia64
       
    91     REQUIRED_CC_VER = 3.2
       
    92     REQUIRED_GCC_VER = 2.9[56789].*
       
    93   endif
       
    94   endif
       
    95   endif
       
    96   # Option used to create a shared library
       
    97   SHARED_LIBRARY_FLAG = -shared -mimpure-text
       
    98   SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )
       
    99 
       
   100 endif
       
   101 
       
   102 ifeq ($(PLATFORM), solaris)
       
   103 
       
   104   # Settings specific to Solaris
       
   105   CC             = $(COMPILER_PATH)gcc
       
   106   CPP            = $(COMPILER_PATH)gcc -E
       
   107   CXX            = $(COMPILER_PATH)g++
       
   108   REQUIRED_CC_VER = 3.2
       
   109 
       
   110   # Option used to create a shared library
       
   111   SHARED_LIBRARY_FLAG = -G
       
   112   # But gcc is still needed no matter what on 32bit
       
   113   ifeq ($(ARCH_DATA_MODEL), 32)
       
   114     REQUIRED_GCC_VER = 2.95
       
   115     GCC =$(GCC_COMPILER_PATH)gcc
       
   116     _GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
       
   117     GCC_VER  :=$(call GetVersion,"$(_GCC_VER)")
       
   118   endif
       
   119 
       
   120 endif
       
   121 
       
   122 # Get gcc version
       
   123 _CC_VER :=$(shell $(CC) -dumpversion 2>&1 )
       
   124 CC_VER  :=$(call GetVersion,"$(_CC_VER)")
       
   125