72N/A#
72N/A# CDDL HEADER START
72N/A#
72N/A# The contents of this file are subject to the terms of the
72N/A# Common Development and Distribution License (the "License").
72N/A# You may not use this file except in compliance with the License.
72N/A#
72N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
72N/A# or http://www.opensolaris.org/os/licensing.
72N/A# See the License for the specific language governing permissions
72N/A# and limitations under the License.
72N/A#
72N/A# When distributing Covered Code, include this CDDL HEADER in each
72N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
72N/A# If applicable, add the following below this CDDL HEADER, with the
72N/A# fields enclosed by brackets "[]" replaced with your own identifying
72N/A# information: Portions Copyright [yyyy] [name of copyright owner]
72N/A#
72N/A# CDDL HEADER END
72N/A#
3996N/A# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
72N/A#
72N/A
72N/ACOMPILER = gcc
72N/A
2540N/Ainclude ../../make-rules/shared-macros.mk
618N/A
72N/ACOMPONENT_NAME= gcc
72N/ACOMPONENT_VERSION= 3.4.3
844N/ACOMPONENT_PROJECT_URL= http://gcc.gnu.org/
2540N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
72N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
1273N/A# unfortunately we have our own "special" tarball and not the community version, so use that.
72N/ACOMPONENT_ARCHIVE_HASH= \
3661N/A sha256:3ab488fe2df01bf54a57acd70e745266e19232edacf77512f77655296748e7a0
3661N/ACOMPONENT_ARCHIVE_URL= $(EXTERNAL_ARCHIVE_MIRROR)/$(SOURCE_ARCHIVE)
3996N/ACOMPONENT_BUGDB= utility/gnu-compiler
3996N/A
3996N/ATPNO= 17028
72N/A
72N/Ainclude $(WS_MAKE_RULES)/prep.mk
72N/Ainclude $(WS_MAKE_RULES)/configure.mk
72N/Ainclude $(WS_MAKE_RULES)/ips.mk
2540N/A
2540N/APARCH = $(MACH:i386=i386-pc)
2540N/AGNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
574N/A
574N/APKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
574N/A
72N/A# CC_BITS may get in the way
72N/ACC_BITS=
72N/A
72N/A# enabling this causes libstdc++ to break
75N/ALD_B_DIRECT=
72N/A
2540N/ACONFIGURE_PREFIX = /usr/sfw
2540N/A
2540N/A# we need to override CONFIGURE_OPTIONS because GCC uses a configure that
72N/A# can't deal with CC as an argument
2540N/ACONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
72N/ACONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
2540N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_PREFIX)/share/info
83N/ACONFIGURE_OPTIONS += --without-gnu-ld --with-ld=/usr/bin/ld
72N/ACONFIGURE_OPTIONS += --enable-languages='c,c++,f77,objc'
3996N/ACONFIGURE_OPTIONS += --enable-shared
3996N/A# sparc and x86 use different assemblers
3996N/ACONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=/usr/bin/as
4176N/ACONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=/usr/gnu/bin/as
3996N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
3996N/A
CONFIGURE_ENV += CC="$(CC)"
CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
COMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
COMPONENT_BUILD_ENV += CFLAGS_FOR_TARGET="$(CFLAGS)"
COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
COMPONENT_BUILD_TARGETS = bootstrap
# common targets
build: $(BUILD_32)
$(PROTO_DIR)/.sedded: $(INSTALL_32)
(cd $(@D) ; for file in libstdc++.la libsupc++.la ; do \
$(MV) usr/sfw/lib/$$file usr/sfw/lib/$$file.orig ; \
sed -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/sfw/lib -lgcc_s -lm';" usr/sfw/lib/$$file.orig >usr/sfw/lib/$$file ; \
$(MV) usr/sfw/lib/$(MACH64)/$$file usr/sfw/lib/$(MACH64)/$$file.orig ; \
sed -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/sfw/lib/$(MACH64) -lgcc_s -lm';" usr/sfw/lib/$(MACH64)/$$file.orig >usr/sfw/lib/$(MACH64)/$$file ; \
done)
$(TOUCH) $@
install: $(PROTO_DIR)/.sedded
test: $(TEST_32)
REQUIRED_PACKAGES += developer/assembler
REQUIRED_PACKAGES += developer/gnu-binutils
REQUIRED_PACKAGES += shell/ksh93
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/gcc-3-runtime
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += system/linker