4632N/A#
4632N/A# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
4632N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4632N/A#
4632N/A# This code is free software; you can redistribute it and/or modify it
4632N/A# under the terms of the GNU General Public License version 2 only, as
4632N/A# published by the Free Software Foundation. Oracle designates this
4632N/A# particular file as subject to the "Classpath" exception as provided
4632N/A# by Oracle in the LICENSE file that accompanied this code.
4632N/A#
4632N/A# This code is distributed in the hope that it will be useful, but WITHOUT
4632N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4632N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4632N/A# version 2 for more details (a copy is included in the LICENSE file that
4632N/A# accompanied this code).
4632N/A#
4632N/A# You should have received a copy of the GNU General Public License version
4632N/A# 2 along with this work; if not, write to the Free Software Foundation,
4632N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4632N/A#
4632N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4632N/A# or visit www.oracle.com if you need additional information or have any
4632N/A# questions.
4632N/A#
4632N/A
4632N/A#
4632N/A# Definitions for Bsd.
4632N/A#
4632N/A
4632N/A# Default for COMPILER_WARNINGS_FATAL on Bsd (C & C++ compiler warnings)
4632N/Aifndef COMPILER_WARNINGS_FATAL
4632N/A COMPILER_WARNINGS_FATAL=false
4632N/Aendif
4632N/A
4632N/A# Bsd should use parallel compilation for best build times
4632N/Aifndef COMPILE_APPROACH
4632N/A COMPILE_APPROACH = parallel
4632N/Aendif
4632N/A
4632N/A# Indication that we are doing an incremental build.
4632N/A# This may trigger the creation of make depend files.
4632N/Aifndef INCREMENTAL_BUILD
4632N/A INCREMENTAL_BUILD = false
4632N/Aendif
4632N/A
4632N/A# FullPath just makes sure it never ends with a / and no duplicates
4632N/Adefine FullPath
4632N/A$(shell cd $1 2> $(DEV_NULL) && pwd)
4632N/Aendef
4632N/A
4632N/A# OptFullPath: Absolute path name of a dir that might not initially exist.
4632N/Adefine OptFullPath
4632N/A$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
4632N/Aendef
4632N/A
4632N/A# Location on system where jdk installs might be
4632N/AUSRJDKINSTANCES_PATH = $(PACKAGE_PATH)
4632N/A
4632N/A# UNIXCOMMAND_PATH: path to where the most common Unix commands are.
4632N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
4632N/Aifneq "$(origin ALT_UNIXCOMMAND_PATH)" "undefined"
4632N/A UNIXCOMMAND_PATH :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH))
4632N/Aelse
4632N/A UNIXCOMMAND_PATH = /bin/
4632N/Aendif
4632N/A
4632N/A# USRBIN_PATH: path to where the most common Unix commands are.
4632N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
4632N/Aifneq "$(origin ALT_USRBIN_PATH)" "undefined"
4632N/A USRBIN_PATH :=$(call PrefixPath,$(ALT_USRBIN_PATH))
4632N/Aelse
4632N/A USRBIN_PATH = /usr/bin/
4632N/Aendif
4632N/A
4632N/A# UNIXCCS_PATH: path to where the Solaris ported UNIX commands can be found
4632N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
4632N/Aifneq "$(origin ALT_UNIXCCS_PATH)" "undefined"
4632N/A UNIXCCS_PATH :=$(call PrefixPath,$(ALT_UNIXCCS_PATH))
4632N/Aelse
4632N/A UNIXCCS_PATH = /usr/ccs/bin/
4632N/Aendif
4632N/A
4632N/A# SLASH_JAVA: location of all network accessable files
4632N/Aifdef ALT_SLASH_JAVA
4632N/A SLASH_JAVA :=$(ALT_SLASH_JAVA)
4632N/Aelse
4632N/A SLASH_JAVA := $(call DirExists,/java,/java,/NOT-SET)
4632N/Aendif
4632N/A
4632N/A# JDK_DEVTOOLS_DIR: common path for all the java devtools
4632N/Aifdef ALT_JDK_DEVTOOLS_DIR
4632N/A JDK_DEVTOOLS_DIR =$(ALT_JDK_DEVTOOLS_DIR)
4632N/Aelse
4632N/A JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools
4632N/Aendif
4632N/A
4632N/A# COMPILER_PATH: path to where the compiler and tools are installed.
4632N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
4632N/Aifneq "$(origin ALT_COMPILER_PATH)" "undefined"
4632N/A COMPILER_PATH :=$(call PrefixPath,$(ALT_COMPILER_PATH))
4632N/Aelse
4632N/A ifeq ($(OS_VENDOR), Apple)
4632N/A ifndef DEVELOPER_DIR
4632N/A DEVELOPER_DIR = $(shell /usr/bin/xcode-select -print-path)/usr/bin/
4632N/A endif
4632N/A
4632N/A COMPILER_PATH := $(call DirExists,$(DEVELOPER_DIR),/usr/bin/,/NOT-SET)
4632N/A else
4632N/A COMPILER_PATH =/usr/bin/
4632N/A endif
4632N/Aendif
4632N/A
4632N/A# OPENWIN_HOME: path to where the X11 environment is installed.
4632N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
4632N/Aifneq ($(ALT_OPENWIN_HOME),)
4632N/A OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME))
4632N/Aelse
4632N/A OPENWIN_HOME =$(X11_PATH)
4632N/Aendif
4632N/A
4632N/A# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
4632N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
4632N/Aifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
4632N/A DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH))
4632N/Aelse
4632N/A DEVTOOLS_PATH =$(PACKAGE_PATH)/bin/
4632N/Aendif
4632N/A
4632N/A# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
4632N/A# _BOOTDIR2: Second choice
4632N/Aifndef ALT_BOOTDIR
4632N/A _BOOTDIR1 =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
4632N/A _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
4632N/Aendif
4632N/A
4632N/A# Always build headless on Bsd
4632N/ABUILD_HEADLESS = true
4632N/ALIBM=-lm
4632N/A
4632N/Aifeq ($(OS_VENDOR), Apple)
4632N/A _CUPS_HEADERS_PATH=/usr/include
4632N/Aelse
4632N/A _CUPS_HEADERS_PATH=$(PACKAGE_PATH)/include
4632N/Aendif
4632N/A
5353N/A# Set ZLIB_LIBS if not already set
5353N/Aifeq ("$(ZLIB_LIBS)", "")
5353N/A ZLIB_LIBS=-lz
5353N/Aendif
5353N/A
4632N/A# Import JDK images allow for partial builds, components not built are
4632N/A# imported (or copied from) these import areas when needed.
4632N/A
4632N/A# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for
4632N/A# multiple platforms, e.g. windows-i586, solaris-sparc, bsd-586, etc.
4632N/Aifdef ALT_BUILD_JDK_IMPORT_PATH
4632N/A BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH))
4632N/Aelse
4632N/A BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES)
4632N/Aendif
4632N/ABUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH)
4632N/A
4632N/A# JDK_IMPORT_PATH: location of JDK install tree (this version) to import
4632N/Aifdef ALT_JDK_IMPORT_PATH
4632N/A JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH))
4632N/Aelse
4632N/A JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT)
4632N/Aendif
4632N/AJDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)
4632N/A
4632N/A# HOTSPOT_IMPORT_PATH: location of hotspot pre-built files
4632N/Aifdef ALT_HOTSPOT_IMPORT_PATH
4632N/A HOTSPOT_IMPORT_PATH :=$(call FullPath,$(ALT_HOTSPOT_IMPORT_PATH))
4632N/Aelse
4632N/A HOTSPOT_IMPORT_PATH =$(JDK_IMPORT_PATH)
4632N/Aendif
4632N/AHOTSPOT_IMPORT_PATH:=$(call AltCheckValue,HOTSPOT_IMPORT_PATH)
4632N/A
4632N/A# HOTSPOT_CLIENT_PATH: location of client jvm library file.
4632N/Aifeq ($(ARCH_DATA_MODEL), 32)
4632N/A ifdef ALT_HOTSPOT_CLIENT_PATH
4632N/A HOTSPOT_CLIENT_PATH :=$(call FullPath,$(ALT_HOTSPOT_CLIENT_PATH))
4632N/A else
4632N/A HOTSPOT_CLIENT_PATH =$(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/client
4632N/A endif
4632N/A HOTSPOT_CLIENT_PATH:=$(call AltCheckValue,HOTSPOT_CLIENT_PATH)
4632N/Aendif
4632N/A
4632N/A# HOTSPOT_SERVER_PATH: location of server jvm library file.
4632N/Aifdef ALT_HOTSPOT_SERVER_PATH
4632N/A HOTSPOT_SERVER_PATH :=$(call FullPath,$(ALT_HOTSPOT_SERVER_PATH))
4632N/Aelse
4632N/A HOTSPOT_SERVER_PATH =$(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/server
4632N/Aendif
4632N/AHOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
4632N/A
4632N/A# Special define for checking the binaries
4632N/A
4632N/A# Debug builds should downgrade warnings to just info
4632N/AMAPFILE_WARNING-DBG=INFO
4632N/AMAPFILE_WARNING-OPT=WARNING
4632N/AMAPFILE_WARNING-=WARNING
4632N/AMAPFILE_WARNING=$(MAPFILE_WARNING-$(VARIANT))
4632N/A
4632N/A# Macro to check it's input file for banned dependencies and verify the
4632N/A# binary built properly. Relies on process exit code.
4632N/Aifndef CROSS_COMPILE_ARCH
4632N/Aifeq ($(OS_VENDOR), Apple)
4632N/Adefine binary_file_verification # binary_file
4632N/A( \
4632N/A $(ECHO) "Checking for mapfile use in: $1" && \
4632N/A if [ "`$(NM) -g $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
4632N/A $(ECHO) "WARNING: File was not built with a mapfile: $1"; \
4632N/A fi && \
4632N/A $(ECHO) "Library loads for: $1" && \
4632N/A $(OTOOL) -L $1 && \
4632N/A $(ECHO) "RUNPATH for: $1" && \
4632N/A ( $(OTOOL) -l $1 | $(EGREP) 'path ' ) \
4632N/A) || true
4632N/Aendef
4632N/Aelse
4632N/Aifeq ($(OS_VENDOR), OpenBSD)
4632N/Adefine binary_file_verification # binary_file
4632N/A( \
4632N/A $(ECHO) "Checking for mapfile use in: $1" && \
4632N/A if [ "`$(OBJDUMP) -T $1 | $(EGREP) '[0-9a-f]* g *DF \.text.*SUNWprivate'`" = "" ] ; then \
4632N/A $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
4632N/A fi && \
4632N/A $(ECHO) "Library loads for: $1" && \
4632N/A $(LDD) $1 && \
4632N/A $(ECHO) "RUNPATH for: $1" && \
4632N/A ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
4632N/A) || true
4632N/Aendef
4632N/Aelse
4632N/Adefine binary_file_verification # binary_file
4632N/A( \
4632N/A $(ECHO) "Checking for mapfile use in: $1" && \
4632N/A if [ "`$(NM) -D -g --defined-only $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
4632N/A $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
4632N/A fi && \
4632N/A $(ECHO) "Library loads for: $1" && \
4632N/A $(LDD) $1 && \
4632N/A $(ECHO) "RUNPATH for: $1" && \
4632N/A ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
4632N/A)
4632N/Aendef
4632N/Aendif # OS_VENDOR == OpenBSD
4632N/Aendif # OS_VENDOR == Apple
4632N/Aelse
4632N/Adefine binary_file_verification
4632N/A( \
4632N/A $(ECHO) "Skipping binary file verification for cross-compile build" \
4632N/A)
4632N/Aendef
4632N/Aendif
4632N/A