hotspot/make/bsd/makefiles/defs.make
changeset 33957 39113ae98993
parent 30113 3f6beb804b02
child 33980 cbd63978deb5
equal deleted inserted replaced
30850:56166ce66037 33957:39113ae98993
     1 #
     1 #
     2 # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.
     7 # published by the Free Software Foundation.
   142   endif
   142   endif
   143 endif
   143 endif
   144 
   144 
   145 OS_VENDOR:=$(shell uname -s)
   145 OS_VENDOR:=$(shell uname -s)
   146 
   146 
   147 # determine if HotSpot is being built in JDK6 or earlier version
   147 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
   148 JDK6_OR_EARLIER=0
   148 # builds is enabled with debug info files ZIP'ed to save space. For
   149 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
   149 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
   150   # if the longer variable names (newer build style) are set, then check those
   150 # debug build without debug info isn't very useful.
   151   ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
   151 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
   152     JDK6_OR_EARLIER=1
   152 #
   153   endif
   153 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
   154 else
   154 # disabled for a BUILD_FLAVOR == product build.
   155   # the longer variables aren't set so check the shorter variable names
   155 #
   156   ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
   156 # Note: Use of a different variable name for the FDS override option
   157     JDK6_OR_EARLIER=1
   157 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
   158   endif
   158 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
   159 endif
   159 # in options via environment variables, use of distinct variables
   160 
   160 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
   161 ifeq ($(JDK6_OR_EARLIER),0)
   161 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
   162   # Full Debug Symbols is supported on JDK7 or newer.
   162 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
   163   # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
   163 # the same variable name is used, then different values can be picked
   164   # builds is enabled with debug info files ZIP'ed to save space. For
   164 # up by different parts of the build. Just to be clear, we only need
   165   # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
   165 # two variable names because the incoming option value can be
   166   # debug build without debug info isn't very useful.
   166 # overridden in some situations, e.g., a BUILD_FLAVOR != product
   167   # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
   167 # build.
   168   #
   168 
   169   # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
   169 # Due to the multiple sub-make processes that occur this logic gets
   170   # disabled for a BUILD_FLAVOR == product build.
   170 # executed multiple times. We reduce the noise by at least checking that
   171   #
   171 # BUILD_FLAVOR has been set.
   172   # Note: Use of a different variable name for the FDS override option
   172 ifneq ($(BUILD_FLAVOR),)
   173   # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
   173   ifeq ($(BUILD_FLAVOR), product)
   174   # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
   174     FULL_DEBUG_SYMBOLS ?= 1
   175   # in options via environment variables, use of distinct variables
   175     ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
   176   # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
   176   else
   177   # product build, the FULL_DEBUG_SYMBOLS environment variable will be
   177     # debug variants always get Full Debug Symbols (if available)
   178   # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
   178     ENABLE_FULL_DEBUG_SYMBOLS = 1
   179   # the same variable name is used, then different values can be picked
   179   endif
   180   # up by different parts of the build. Just to be clear, we only need
   180   $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
   181   # two variable names because the incoming option value can be
   181   # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
   182   # overridden in some situations, e.g., a BUILD_FLAVOR != product
   182 
   183   # build.
   183   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   184 
   184     ifeq ($(OS_VENDOR), Darwin)
   185   # Due to the multiple sub-make processes that occur this logic gets
   185         # MacOS X doesn't use OBJCOPY or STRIP_POLICY
   186   # executed multiple times. We reduce the noise by at least checking that
   186         OBJCOPY=
   187   # BUILD_FLAVOR has been set.
   187         STRIP_POLICY=
   188   ifneq ($(BUILD_FLAVOR),)
   188         ZIP_DEBUGINFO_FILES ?= 1
   189     ifeq ($(BUILD_FLAVOR), product)
   189     else
   190       FULL_DEBUG_SYMBOLS ?= 1
   190       # Default OBJCOPY comes from GNU Binutils on BSD
   191       ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
   191       ifeq ($(CROSS_COMPILE_ARCH),)
   192     else
   192         DEF_OBJCOPY=/usr/bin/objcopy
   193       # debug variants always get Full Debug Symbols (if available)
   193       else
   194       ENABLE_FULL_DEBUG_SYMBOLS = 1
   194         # Assume objcopy is part of the cross-compilation toolset
   195     endif
   195         ifneq ($(ALT_COMPILER_PATH),)
   196     $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
   196           DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
   197     # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
       
   198 
       
   199     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
       
   200       ifeq ($(OS_VENDOR), Darwin)
       
   201           # MacOS X doesn't use OBJCOPY or STRIP_POLICY
       
   202           OBJCOPY=
       
   203           STRIP_POLICY=
       
   204           ZIP_DEBUGINFO_FILES ?= 1
       
   205       else
       
   206         # Default OBJCOPY comes from GNU Binutils on BSD
       
   207         ifeq ($(CROSS_COMPILE_ARCH),)
       
   208           DEF_OBJCOPY=/usr/bin/objcopy
       
   209         else
       
   210           # Assume objcopy is part of the cross-compilation toolset
       
   211           ifneq ($(ALT_COMPILER_PATH),)
       
   212             DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
       
   213           endif
       
   214         endif
   197         endif
   215         OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
   198       endif
   216         ifneq ($(ALT_OBJCOPY),)
   199       OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
   217           $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)"))
   200       ifneq ($(ALT_OBJCOPY),)
   218           OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   201         $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)"))
   219         endif
   202         OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   220 
   203       endif
   221         ifeq ($(OBJCOPY),)
   204 
   222           $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo" \
   205       ifeq ($(OBJCOPY),)
   223               "files. You may need to set ALT_OBJCOPY."))
   206         $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo" \
   224           ENABLE_FULL_DEBUG_SYMBOLS=0
   207             "files. You may need to set ALT_OBJCOPY."))
   225           $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
   208         ENABLE_FULL_DEBUG_SYMBOLS=0
   226         else
   209         $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
   227           $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo" \
   210       else
   228               "files."))
   211         $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo" \
   229 
   212             "files."))
   230           # Library stripping policies for .debuginfo configs:
   213 
   231           #   all_strip - strips everything from the library
   214         # Library stripping policies for .debuginfo configs:
   232           #   min_strip - strips most stuff from the library; leaves
   215         #   all_strip - strips everything from the library
   233           #               minimum symbols
   216         #   min_strip - strips most stuff from the library; leaves
   234           #   no_strip  - does not strip the library at all
   217         #               minimum symbols
   235           #
   218         #   no_strip  - does not strip the library at all
   236           # Oracle security policy requires "all_strip". A waiver was
   219         #
   237           # granted on 2011.09.01 that permits using "min_strip" in the
   220         # Oracle security policy requires "all_strip". A waiver was
   238           # Java JDK and Java JRE.
   221         # granted on 2011.09.01 that permits using "min_strip" in the
   239           #
   222         # Java JDK and Java JRE.
   240           # Currently, STRIP_POLICY is only used when Full Debug Symbols
   223         #
   241           # is enabled.
   224         # Currently, STRIP_POLICY is only used when Full Debug Symbols
   242           #
   225         # is enabled.
   243           STRIP_POLICY ?= min_strip
   226         #
   244 
   227         STRIP_POLICY ?= min_strip
   245           $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)"))
   228 
   246 
   229         $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)"))
   247           ZIP_DEBUGINFO_FILES ?= 1
   230 
   248         endif
   231         ZIP_DEBUGINFO_FILES ?= 1
   249 
   232       endif
   250         $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)"))
   233 
   251       endif
   234       $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)"))
   252     endif # ENABLE_FULL_DEBUG_SYMBOLS=1
   235     endif
   253   endif # BUILD_FLAVOR
   236   endif # ENABLE_FULL_DEBUG_SYMBOLS=1
   254 endif # JDK_6_OR_EARLIER
   237 endif # BUILD_FLAVOR
   255 
   238 
   256 JDK_INCLUDE_SUBDIR=bsd
   239 JDK_INCLUDE_SUBDIR=bsd
   257 
   240 
   258 # Library suffix
   241 # Library suffix
   259 ifeq ($(OS_VENDOR),Darwin)
   242 ifeq ($(OS_VENDOR),Darwin)