2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# CDDL HEADER START
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# 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# 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]
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# CDDL HEADER END
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# Build gcc with gcc
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# build with itself until it's gone
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoni# unfortunately we have our own "special" tarball and not the community version, so use that.
f877f6ca2428244a6d0954a1dbef471577b32c60Diego Colantoni sha256:3ab488fe2df01bf54a57acd70e745266e19232edacf77512f77655296748e7a0
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_ARCHIVE_URL= $(EXTERNAL_ARCHIVE_MIRROR)/$(SOURCE_ARCHIVE)
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# Bootstrapping problems. To be obsoleted soon, so do not publish.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellGNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott# Make sure to pass -m32/64 any time the installed GCC is used
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell# CC_BITS may get in the way
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# enabling this causes libstdc++ to break
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# gcc3 doesn't support -mincoming-stack-boundary, but doesn't need it either.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert WapshottCONFIGURE_INFODIR = $(CONFIGURE_PREFIX)/share/info
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 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
f877f6ca2428244a6d0954a1dbef471577b32c60Diego ColantoniCOMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert WapshottCOMPONENT_BUILD_ENV += CFLAGS_FOR_TARGET="$(CFLAGS)"
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell# common targets
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 ; \