Makefile revision 7124
5340N/A#
5340N/A# CDDL HEADER START
5340N/A#
5340N/A# The contents of this file are subject to the terms of the
5340N/A# Common Development and Distribution License (the "License").
5340N/A# You may not use this file except in compliance with the License.
5340N/A#
5340N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5340N/A# or http://www.opensolaris.org/os/licensing.
5340N/A# See the License for the specific language governing permissions
5340N/A# and limitations under the License.
5340N/A#
5340N/A# When distributing Covered Code, include this CDDL HEADER in each
5340N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5340N/A# If applicable, add the following below this CDDL HEADER, with the
5340N/A# fields enclosed by brackets "[]" replaced with your own identifying
5340N/A# information: Portions Copyright [yyyy] [name of copyright owner]
5340N/A#
5340N/A# CDDL HEADER END
5340N/A#
5680N/A
5680N/A#
5340N/A# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
5340N/A#
5340N/Aexport PARFAIT_BUILD=no
5680N/ABUILD_BITS= 64
5680N/ACOMPILER= gcc
5340N/Ainclude ../../make-rules/shared-macros.mk
5340N/A
5340N/ACOMPONENT_NAME= gcc
6941N/ACOMPONENT_VERSION= 5.4.0
5340N/ACOMPONENT_PROJECT_URL= http://gcc.gnu.org/
5340N/ACOMPONENT_ARCHIVE_HASH= \
6941N/A sha256:37089e80c3f2e9a0663d7ccc51c2a6c7dbbf3275bc1e4ed1ed3b1460cd5b3030
5340N/ACOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
5340N/ACOMPONENT_BUGDB= utility/gnu-compiler
5340N/A
6941N/ATPNO= 29354
5340N/A
5680N/A# Use gcc's default flags instead of userland's.
5680N/ACFLAGS=
5680N/ACPPFLAGS=
5680N/ACXXFLAGS=
5680N/A
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
5340N/A
5340N/A# The GNU compiler wants the GNU utilities.
5680N/APATH=$(GNUBIN):$(USRBINDIR):$(USRDIR)/perl5/bin
5340N/A
7124N/APARCH = $(MACH:i386=x86_64-pc)
5340N/AGNU_ARCH = $(PARCH:sparc=sparcv9-sun)-solaris$(SOLARIS_VERSION)
5340N/A
5340N/APKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
5340N/A
5340N/AVERSION_NUMBERS = $(subst ., ,$(COMPONENT_VERSION))
5340N/AGCC_VERSION=$(word 1,$(VERSION_NUMBERS)).$(word 2,$(VERSION_NUMBERS))
6857N/AGCC_MAJOR_VERSION=$(word 1,$(VERSION_NUMBERS))
6857N/APKG_MACROS += GCC_MAJOR_VERSION=$(GCC_MAJOR_VERSION)
5340N/APKG_MACROS += GCC_VERSION=$(GCC_VERSION)
6857N/APKG_MACROS += GCC_BASEDIR=$(CONFIGURE_PREFIX)
5340N/A
5340N/A# direct binding causes various testsuite failures
5340N/ALD_B_DIRECT=
5340N/A
5340N/A# /usr/lib/ld/map.noexdata destroys Intel
5340N/ALD_MAP_NOEXDATA.i386=
5340N/A
5680N/A# /usr/lib/ld/map.noexbss destroys SPARC
5680N/ALD_MAP_NOEXBSS.sparc=
5340N/A
5340N/A# for some reason the fixincludes target fails with bash on Solaris.
5340N/ACONFIG_SHELL = /bin/sh
5340N/AMAKESHELL = /bin/sh
5340N/ACOMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
5340N/ACOMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
5340N/A
6857N/ACONFIGURE_PREFIX = /usr/gcc/$(GCC_MAJOR_VERSION)
5680N/ACONFIGURE_INFODIR = $(CONFIGURE_PREFIX)/share/info
5340N/A
5340N/A# We are going to build the 64-bit version of the compiler and tools, but we
5340N/A# want it to install in the normal .../{bin|lib}/... locations. GCC will
5340N/A# take care of building and putting 32/64 bit objects in the right place
5340N/A# under there.
5340N/ACONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
5340N/ACONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib
5340N/A
5680N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
5340N/ACONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
5340N/ACONFIGURE_OPTIONS += --enable-languages="c,c++,fortran,objc"
5340N/ACONFIGURE_OPTIONS += --enable-shared
5340N/ACONFIGURE_OPTIONS += --enable-initfini-array
5340N/ACONFIGURE_OPTIONS += --disable-rpath
5340N/ACONFIGURE_OPTIONS += --with-system-zlib
5340N/ACONFIGURE_OPTIONS += --with-build-config=no
5680N/ACONFIGURE_OPTIONS += --with-gmp-include=$(USRINCDIR)/gmp
5680N/ACONFIGURE_OPTIONS += --with-mpfr-include=$(USRINCDIR)/mpfr
5680N/ACONFIGURE_OPTIONS += --without-gnu-ld --with-ld=$(USRBINDIR)/ld
5680N/ACONFIGURE_OPTIONS += --with-gnu-as --with-as=$(GNUBIN)/as
5340N/A
5340N/A# If the compiler used to build matches the compiler being built, there is no
5340N/A# need for a 3 stage build.
5340N/Aifneq ($(shell $(CC) --version | grep $(COMPONENT_VERSION)),)
5340N/ACONFIGURE_OPTIONS += --disable-bootstrap
5340N/Aelse
5340N/ACOMPONENT_BUILD_TARGETS=bootstrap
5340N/Aendif
5340N/A
5340N/ACONFIGURE_OPTIONS += BOOT_CFLAGS='-g -O2'
5340N/A
5340N/A# This is the target and it must be last
5340N/ACONFIGURE_OPTIONS += $(GNU_ARCH)
5340N/A
5340N/A
5340N/ACONFIGURE_ENV += PYTHON="$(PYTHON)"
5340N/A
5340N/A# compile python modules
5340N/ACOMPONENT_POST_INSTALL_ACTION = \
5340N/A ( gfind $(PROTO_DIR)$(CONFIGURE_PREFIX) -name '*.py' | \
5340N/A xargs -n 1 dirname | sort -u | \
5340N/A xargs $(PYTHON) -m compileall )
5340N/A
5340N/A# To ensure that all tests that are expected to pass actually
5340N/A# pass, we have to increase the stacksize limit to at least
5340N/A# 16MB. Otherwise we'll get spurious failures in the test
5340N/A# harness (gcc.c-torture/compile/limits-exprparen.c and others).
5340N/A# With the soft stacksize limit set to 16384 we get reasonably good
5340N/A# test results.
5340N/ACOMPONENT_PRE_TEST_ACTION = ulimit -Ss 16384
5340N/ACOMPONENT_TEST_ARGS = -k -i
5340N/ACOMPONENT_TEST_TARGETS = check check-target
5340N/A
5680N/ACOMPONENT_TEST_ENV += TCL_LIBRARY="$(USRLIBDIR)/tcl8.5"
5340N/A
5340N/A# We don't have DejaGNU in S11.
5340N/Aifeq ($(OS_VERSION), 5.12)
5680N/A COMPONENT_TEST_ENV += DEJAGNULIBS="$(USRSHAREDIR)/dejagnu"
5340N/Aendif
5340N/A
5340N/ACOMPONENT_TEST_TRANSFORMS += \
5340N/A '-e "s|\(Test Run By\).*|\1|" ' \
5340N/A '-e "/\(Missing header fix: \).*/d" ' \
5340N/A '-e "/\(\\*\\*\\* complex.h\).*/d" ' \
5340N/A '-e "/\(\\*\\*\\* math.h\).*/d" ' \
5340N/A '-e "/\(\\*\\*\\* stdio.h\).*/d" '
5340N/A
5340N/A# Master test results are different between x86 and SPARC.
5340N/ACOMPONENT_TEST_MASTER = \
6941N/A $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
5340N/A
5340N/AREQUIRED_PACKAGES += developer/test/dejagnu
5340N/AREQUIRED_PACKAGES += library/gmp
5340N/AREQUIRED_PACKAGES += library/isl
5340N/AREQUIRED_PACKAGES += library/mpc
5340N/AREQUIRED_PACKAGES += library/mpfr
5340N/AREQUIRED_PACKAGES += library/zlib
5340N/AREQUIRED_PACKAGES += runtime/tcl-8
5340N/AREQUIRED_PACKAGES += shell/bash
5340N/AREQUIRED_PACKAGES += shell/ksh93
5340N/AREQUIRED_PACKAGES += system/library/math