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