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