1472N/A# Copyright (c) 1998, 2008, Oracle
and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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
0N/A# published by the Free Software Foundation.
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# 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.
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A#------------------------------------------------------------------------
0N/A# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
0N/A# prints the numbers (
e.g. "2.95", "3.2.1")
0N/ACC_VER_MAJOR := $(shell $(CC) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f1)
0N/ACC_VER_MINOR := $(shell $(CC) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f2)
0N/A# Check for the versions of C++ and C compilers ($CPP and $CC) used.
0N/A# Get the last thing on the line that looks like
x.x+ (x is a digit).
0N/A$(shell $(CPP) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f1)
0N/A$(shell $(CC) -dumpversion | sed '
s/egcs-//' | cut -d'.' -f2)
0N/A# check for precompiled headers support
0N/Aifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
0N/AUSE_PRECOMPILED_HEADER=1
0N/APRECOMPILED_HEADER_DIR=.
0N/A#------------------------------------------------------------------------
0N/A# position-independent code
0N/AVM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
0N/ACFLAGS += $(VM_PICFLAG)
0N/ACFLAGS += -fno-exceptions
0N/ACFLAGS += -D_REENTRANT
0N/ACFLAGS += -fcheck-new
0N/AARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
0N/A# Optional sub-directory in
/usr/lib where BUILDARCH libraries are kept.
0N/AISA_DIR=$(ISA_DIR/$(BUILDARCH))
0N/ACFLAGS += $(ARCHFLAG)
0N/AAOUT_FLAGS += $(ARCHFLAG)
0N/ALFLAGS += $(ARCHFLAG)
0N/AASFLAGS += $(ARCHFLAG)
0N/Aifeq ($(BUILDARCH), amd64)
0N/AASFLAGS += -march=k8 -march=amd64
0N/A# Use C++ Interpreter
0N/A CFLAGS += -DCC_INTERP
0N/A# Keep temporary files (.ii, .s)
0N/A CFLAGS += -save-temps
0N/A# Compiler warnings are treated as errors
0N/AWARNINGS_ARE_ERRORS = -Werror
0N/A# Enable these warnings. See 'info gcc' about details on these options
0N/AADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
0N/A# The flags to use for an Optimized g++ build
0N/A# Hotspot uses very unstrict aliasing turn this optimization off
0N/AOPT_CFLAGS += -fno-strict-aliasing
0N/A# if we use expensive-optimizations
0N/A# Note: all ia64 setting reflect the ones for linux
0N/A# No actial testing was performed: there is no Solaris on ia64 presently
0N/Aifeq ($(BUILDARCH), ia64)
0N/A#------------------------------------------------------------------------
0N/A# statically link libstdc++.so, work with gcc but ignored by g++
0N/ASTATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
0N/Aifneq ("${CC_VER_MAJOR}", "2")
0N/ASTATIC_LIBGCC += -static-libgcc
0N/Aifeq ($(BUILDARCH), ia64)
0N/A# Note: all ia64 setting reflect the ones for linux
0N/A# No actial testing was performed: there is no Solaris on ia64 presently
0N/A# Enable linker optimization
0N/ALFLAGS += -Xlinker -O1
0N/A# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
0N/AMAPFLAG = -Xlinker --version-script=FILENAME
0N/AMAPFLAG = -Xlinker -M -Xlinker FILENAME
0N/A# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
0N/ASONAMEFLAG = -Xlinker -soname=SONAME
0N/A# Build shared library
0N/ASHARED_FLAG = -shared
0N/A#------------------------------------------------------------------------
0N/A# Use the stabs format for debugging information (this is the default
0N/A# on gcc-2.91). It's good enough, has all the information about line
0N/A# Change this back to "-g" if you want the most expressive format.
0N/A# Note: The Itanium gcc compiler crashes when using -gstabs.
0N/ADEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
0N/Aifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
0N/ADEBUG_CFLAGS += -gstabs