306N/A# Copyright (c) 1998, 2011, Oracle
and/or its affiliates. All rights reserved.
306N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
306N/A# This code is free software; you can redistribute it
and/or modify it
306N/A# under the terms of the GNU General Public License version 2 only, as
306N/A# published by the Free Software Foundation.
306N/A# This code is distributed in the hope that it will be useful, but WITHOUT
306N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
306N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
306N/A# version 2 for more details (a copy is included in the LICENSE file that
306N/A# accompanied this code).
306N/A# You should have received a copy of the GNU General Public License version
306N/A# 2 along with this work; if not, write to the Free Software Foundation,
306N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
306N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
306N/A#------------------------------------------------------------------------
306N/A# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
306N/ACC_VER_MAJOR := $(shell $(CC) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f1)
306N/ACC_VER_MINOR := $(shell $(CC) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f2)
306N/A# Check for the versions of C++ and C compilers ($CXX and $CC) used.
306N/A# Get the last thing on the line that looks like
x.x+ (x is a digit).
306N/A$(shell $(CXX) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f1)
306N/A$(shell $(CC) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f2)
306N/A# check for precompiled headers support
306N/Aifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
306N/A# Allow the user to turn off precompiled headers from the command line.
306N/Aifneq ($(USE_PRECOMPILED_HEADER),0)
306N/APRECOMPILED_HEADER_DIR=.
306N/A#------------------------------------------------------------------------
306N/A# position-independent code
306N/AVM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
306N/ACFLAGS += -fno-exceptions
306N/AARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
306N/A# Optional sub-directory in
/usr/lib where BUILDARCH libraries are kept.
306N/AISA_DIR=$(ISA_DIR/$(BUILDARCH))
306N/AAOUT_FLAGS += $(ARCHFLAG)
306N/Aifeq ($(BUILDARCH), amd64)
306N/AASFLAGS += -march=k8 -march=amd64
306N/A# Keep temporary files (.ii, .s)
306N/A# Compiler warnings are treated as errors
306N/AWARNINGS_ARE_ERRORS = -Werror
306N/A# Enable these warnings. See 'info gcc' about details on these options
306N/AADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
306N/A# The flags to use for an Optimized g++ build
306N/A# Hotspot uses very unstrict aliasing turn this optimization off
306N/AOPT_CFLAGS += -fno-strict-aliasing
306N/A# if we use expensive-optimizations
306N/A# Note: all ia64 setting reflect the ones for linux
306N/A# No actial testing was performed: there is no Solaris on ia64 presently
306N/Aifeq ($(BUILDARCH), ia64)
306N/A# Flags for generating make dependency flags.
308N/Aifneq ("${CC_VER_MAJOR}", "2")
306N/ADEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
306N/Aifeq ($(USE_PRECOMPILED_HEADER),0)
306N/ACFLAGS += -DDONT_USE_PRECOMPILED_HEADER
306N/A#------------------------------------------------------------------------
306N/A# statically link libstdc++.so, work with gcc but ignored by g++
306N/ASTATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
306N/Aifneq ("${CC_VER_MAJOR}", "2")
306N/ASTATIC_LIBGCC += -static-libgcc
306N/Aifeq ($(BUILDARCH), ia64)
306N/A# Note: all ia64 setting reflect the ones for linux
306N/A# No actial testing was performed: there is no Solaris on ia64 presently
306N/A# Enable linker optimization
308N/A# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
306N/AMAPFLAG = -Xlinker --version-script=FILENAME
306N/AMAPFLAG = -Xlinker -M -Xlinker FILENAME
306N/A# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
306N/ASONAMEFLAG = -Xlinker -soname=SONAME
306N/A#------------------------------------------------------------------------
306N/A# Use the stabs format for debugging information (this is the default
306N/A# on gcc-2.91). It's good enough, has all the information about line
306N/A# Change this back to "-g" if you want the most expressive format.
306N/A# Note: The Itanium gcc compiler crashes when using -gstabs.
306N/ADEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
306N/Aifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)