2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell#
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# CDDL HEADER START
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell#
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# The contents of this file are subject to the terms of the
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# Common Development and Distribution License (the "License").
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# You may not use this file except in compliance with the License.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell#
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# or http://www.opensolaris.org/os/licensing.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# See the License for the specific language governing permissions
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# and limitations under the License.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell#
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# When distributing Covered Code, include this CDDL HEADER in each
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# If applicable, add the following below this CDDL HEADER, with the
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# fields enclosed by brackets "[]" replaced with your own identifying
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# information: Portions Copyright [yyyy] [name of copyright owner]
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell#
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# CDDL HEADER END
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni#
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell#
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell#
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniBUILD_BITS= 32
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
6a2ae9c7fb4d2c40d75cab0edaf940f22c18224fDiego Colantoniexport PARFAIT_BUILD=no
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# Build gcc with gcc
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnellCOMPILER= gcc
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnellinclude ../../make-rules/shared-macros.mk
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# build with itself until it's gone
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert WapshottGCC_ROOT = /usr/gcc/3.4
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert WapshottCOMPONENT_NAME= gcc
6a2ae9c7fb4d2c40d75cab0edaf940f22c18224fDiego ColantoniCOMPONENT_VERSION= 3.4.3
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCOMPONENT_PROJECT_URL= http://gcc.gnu.org/
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoni# unfortunately we have our own "special" tarball and not the community version, so use that.
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_ARCHIVE_HASH= \
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoni sha256:3ab488fe2df01bf54a57acd70e745266e19232edacf77512f77655296748e7a0
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_ARCHIVE_URL= $(EXTERNAL_ARCHIVE_MIRROR)/$(SOURCE_ARCHIVE)
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_BUGDB= utility/gnu-compiler
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnellTPNO= 17028
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# Bootstrapping problems. To be obsoleted soon, so do not publish.
6a2ae9c7fb4d2c40d75cab0edaf940f22c18224fDiego Colantoniifeq ($(BUILD_TYPE), evaluation)
6a2ae9c7fb4d2c40d75cab0edaf940f22c18224fDiego ColantoniBUILD_32=
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellINSTALL_32=
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellPUBLISH_STAMP=
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellendif
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellINSTALL_TARGET=
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoniinclude $(WS_MAKE_RULES)/gnu-component.mk
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoni
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniPARCH = $(MACH:i386=i386-pc)
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellGNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnellPKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott# Make sure to pass -m32/64 any time the installed GCC is used
6a2ae9c7fb4d2c40d75cab0edaf940f22c18224fDiego ColantoniCC += -m$(BITS)
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnellCXX += -m$(BITS)
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# CC_BITS may get in the way
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCC_BITS=
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# enabling this causes libstdc++ to break
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellLD_B_DIRECT=
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCFLAGS += -std=gnu89
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# gcc3 doesn't support -mincoming-stack-boundary, but doesn't need it either.
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantonigcc_STACK_ALIGN.i386.32 =
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCONFIGURE_PREFIX = /usr/gcc/3.4
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert WapshottCONFIGURE_INFODIR = $(CONFIGURE_PREFIX)/share/info
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert WapshottCONFIGURE_OPTIONS += --without-gnu-ld --with-ld=$(LD)
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCONFIGURE_OPTIONS += --enable-languages='c,c++,f77,objc'
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCONFIGURE_OPTIONS += --enable-shared
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# sparc and x86 use different assemblers
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=$(USRBINDIR)/as
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellCONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=$(GNUBIN)/as
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert WapshottCOMPONENT_BUILD_ENV += CFLAGS_FOR_TARGET="$(CFLAGS)"
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_BUILD_TARGETS = bootstrap
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# common targets
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshottifneq ($(BUILD_TYPE), evaluation)
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell$(PROTO_DIR)/.sedded: $(INSTALL_32)
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell (cd $(@D) ; for file in libstdc++.la libsupc++.la ; do \
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott $(MV) usr/gcc/3.4/lib/$$file usr/gcc/3.4/lib/$$file.orig ; \
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell sed -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/gcc/3.4/lib -lgcc_s -lm';" usr/gcc/3.4/lib/$$file.orig >usr/gcc/3.4/lib/$$file ; \
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott $(MV) usr/gcc/3.4/lib/$(MACH64)/$$file usr/gcc/3.4/lib/$(MACH64)/$$file.orig ; \
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell sed -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/gcc/3.4/lib/$(MACH64) -lgcc_s -lm';" usr/gcc/3.4/lib/$(MACH64)/$$file.orig >usr/gcc/3.4/lib/$(MACH64)/$$file ; \
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell done)
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell $(TOUCH) $@
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoniinstall: $(PROTO_DIR)/.sedded
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshottendif
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoni
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellREQUIRED_PACKAGES += developer/assembler
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniREQUIRED_PACKAGES += developer/gnu-binutils
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellREQUIRED_PACKAGES += developer/lexer/flex
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellREQUIRED_PACKAGES += developer/parser/bison
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert WapshottREQUIRED_PACKAGES += shell/ksh93
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellREQUIRED_PACKAGES += system/library/gcc-3-runtime
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellREQUIRED_PACKAGES += system/library/math
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott