Makefile revision 6057
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews#
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# CDDL HEADER START
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater#
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater# The contents of this file are subject to the terms of the
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# Common Development and Distribution License (the "License").
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# You may not use this file except in compliance with the License.
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater#
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0519188c8e1ae76978fc4e0f799620cd36eba07aAutomatic Updater# or http://www.opensolaris.org/os/licensing.
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews# See the License for the specific language governing permissions
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington#
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# If applicable, add the following below this CDDL HEADER, with the
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# fields enclosed by brackets "[]" replaced with your own identifying
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER END
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater#
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater#
831f79c4310a7d38fc3475ccfff531b2b2535641Automatic UpdaterBUILD_BITS= 32
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Build gcc with gcc
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterCOMPILER= gcc
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrewsinclude ../../make-rules/shared-macros.mk
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# build with itself until it's gone
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterGCC_ROOT = /usr/gcc/3.4
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonCOMPONENT_NAME= gcc
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterCOMPONENT_VERSION= 3.4.3
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterCOMPONENT_PROJECT_URL= http://gcc.gnu.org/
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# unfortunately we have our own "special" tarball and not the community version, so use that.
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan HuntCOMPONENT_ARCHIVE_HASH= \
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater sha256:3ab488fe2df01bf54a57acd70e745266e19232edacf77512f77655296748e7a0
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterCOMPONENT_ARCHIVE_URL= $(EXTERNAL_ARCHIVE_MIRROR)/$(SOURCE_ARCHIVE)
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan HuntCOMPONENT_BUGDB= utility/gnu-compiler
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterTPNO= 17028
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# Bootstrapping problems. To be obsoleted soon, so do not publish.
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updaterifeq ($(BUILD_TYPE), evaluation)
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic UpdaterBUILD_32=
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan HuntINSTALL_32=
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterPUBLISH_STAMP=
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterendif
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterINSTALL_TARGET=
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterinclude $(WS_MAKE_RULES)/gnu-component.mk
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic UpdaterPARCH = $(MACH:i386=i386-pc)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterGNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterPKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews# Make sure to pass -m32/64 any time the installed GCC is used
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark AndrewsCC += -m$(BITS)
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark AndrewsCXX += -m$(BITS)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# CC_BITS may get in the way
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCC_BITS=
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater
8e9f3b69914ee02a80b87c97b1f8093edb3e9ae0Automatic Updater# enabling this causes libstdc++ to break
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsLD_B_DIRECT=
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCFLAGS += -std=gnu89
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater
80faf1588895fd26490f82f95a7a1b771df1c324Automatic UpdaterCONFIGURE_PREFIX = /usr/gcc/3.4
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCONFIGURE_INFODIR = $(CONFIGURE_PREFIX)/share/info
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic UpdaterCONFIGURE_OPTIONS += --without-gnu-ld --with-ld=$(LD)
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic UpdaterCONFIGURE_OPTIONS += --enable-languages='c,c++,f77,objc'
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCONFIGURE_OPTIONS += --enable-shared
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# sparc and x86 use different assemblers
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonCONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=$(USRBINDIR)/as
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterCONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=$(GNUBIN)/as
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark AndrewsCOMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterCOMPONENT_BUILD_ENV += CFLAGS_FOR_TARGET="$(CFLAGS)"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonCOMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterCOMPONENT_BUILD_TARGETS = bootstrap
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# common targets
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterifneq ($(BUILD_TYPE), evaluation)
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater$(PROTO_DIR)/.sedded: $(INSTALL_32)
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater (cd $(@D) ; for file in libstdc++.la libsupc++.la ; do \
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews $(MV) usr/gcc/3.4/lib/$$file usr/gcc/3.4/lib/$$file.orig ; \
11af78f7dc35741bdab68dbab11b03daab005b28Automatic Updater 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 ; \
11af78f7dc35741bdab68dbab11b03daab005b28Automatic Updater $(MV) usr/gcc/3.4/lib/$(MACH64)/$$file usr/gcc/3.4/lib/$(MACH64)/$$file.orig ; \
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews 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 ; \
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont done)
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater $(TOUCH) $@
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater
2a31bd531072824ef252c18303859d6af7451b00Francis Dupontinstall: $(PROTO_DIR)/.sedded
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsendif
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsREQUIRED_PACKAGES += developer/assembler
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark AndrewsREQUIRED_PACKAGES += developer/gnu-binutils
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic UpdaterREQUIRED_PACKAGES += developer/lexer/flex
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic UpdaterREQUIRED_PACKAGES += developer/parser/bison
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark AndrewsREQUIRED_PACKAGES += shell/ksh93
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark AndrewsREQUIRED_PACKAGES += system/library/gcc-3-runtime
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic UpdaterREQUIRED_PACKAGES += system/library/math
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater