gcc-7: fix major version
[unleashed-userland.git] / components / developer / gcc-7 / Makefile
blob71e02482e550f524ccc7956b7c525576eb436e8a
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2013 Andrzej Szeszo. All rights reserved.
14 # Copyright 2016-2017 Aurelien Larcher. All rights reserved.
17 include ../../../make-rules/shared-macros.mk
19 COMPONENT_NAME= gcc
20 COMPONENT_VERSION= 7.3.0
21 COMPONENT_REVISION=1
22 COMPONENT_MAJOR_VERSION= 7
23 THIS_GCC_PKGVERSION= $(COMPONENT_VERSION)-OI-$(COMPONENT_REVISION)
24 COMPONENT_FMRI= developer/gcc-$(COMPONENT_MAJOR_VERSION)
25 COMPONENT_CLASSIFICATION= Development/C
26 COMPONENT_SUMMARY= GNU Compiler Collection
27 MPFR_NAME= mpfr
28 MPFR_VERSION=4.0.1
29 MPC_NAME=mpc
30 MPC_VERSION=1.1.0
31 GMP_NAME=gmp
32 GMP_VERSION=6.1.2
33 COMPONENT_SUMMARY= GNU Compiler Collection
34 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
35 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
36 COMPONENT_ARCHIVE_HASH= \
37 sha256:832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c
38 COMPONENT_ARCHIVE_URL= \
39 http://ftp.gnu.org/gnu/gcc/gcc-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
40 COMPONENT_PROJECT_URL = http://gcc.gnu.org/
41 PATCH_EACH_ARCHIVE=1
42 PATCHDIR_PATCHES = $(shell find $(PATCH_DIR) $(PARFAIT_PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \
43 2>/dev/null | sort) $(EXTRA_PATCHES)
45 COMPONENT_SRC_1= $(MPFR_NAME)-$(MPFR_VERSION)
46 COMPONENT_ARCHIVE_1= $(COMPONENT_SRC_1).tar.bz2
47 COMPONENT_ARCHIVE_URL_1= http://www.mpfr.org/$(COMPONENT_SRC_1)/$(COMPONENT_ARCHIVE_1)
48 COMPONENT_ARCHIVE_HASH_1= \
49 sha256:a4d97610ba8579d380b384b225187c250ef88cfe1d5e7226b89519374209b86b
50 CLEAN_PATHS += $(COMPONENT_SRC_1)
51 COMPONENT_POST_UNPACK_ACTION_1 += ( $(RM) -r $(COMPONENT_SRC)/$(MPFR_NAME) && $(CP) -r $(COMPONENT_SRC_1) $(COMPONENT_SRC)/$(MPFR_NAME) )
53 COMPONENT_SRC_2= $(MPC_NAME)-$(MPC_VERSION)
54 COMPONENT_ARCHIVE_2= $(COMPONENT_SRC_2).tar.gz
55 COMPONENT_ARCHIVE_URL_2= https://ftp.gnu.org/gnu/mpc/$(COMPONENT_ARCHIVE_2)
56 COMPONENT_ARCHIVE_HASH_2= \
57 sha256:6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
58 CLEAN_PATHS += $(COMPONENT_SRC_2)
59 COMPONENT_POST_UNPACK_ACTION_2 += ( $(RM) -r $(COMPONENT_SRC)/$(MPC_NAME) && $(CP) -r $(COMPONENT_SRC_2) $(COMPONENT_SRC)/$(MPC_NAME) )
61 COMPONENT_SRC_3= $(GMP_NAME)-$(GMP_VERSION)
62 COMPONENT_ARCHIVE_3= $(COMPONENT_SRC_3).tar.bz2
63 COMPONENT_ARCHIVE_URL_3= http://ftp.gnu.org/gnu/gmp/$(COMPONENT_ARCHIVE_3)
64 COMPONENT_ARCHIVE_HASH_3= \
65 sha256:5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2
66 CLEAN_PATHS += $(COMPONENT_SRC_3)
67 COMPONENT_POST_UNPACK_ACTION_3 += ( $(RM) -r $(COMPONENT_SRC)/$(GMP_NAME) && $(CP) -r $(COMPONENT_SRC_3) $(COMPONENT_SRC)/$(GMP_NAME) )
69 include $(WS_MAKE_RULES)/prep.mk
70 include $(WS_MAKE_RULES)/configure.mk
71 include $(WS_MAKE_RULES)/ips.mk
73 CC_BITS=
74 CFLAGS= -g -O2
76 CONFIGURE_PREFIX= /usr/gcc/$(COMPONENT_MAJOR_VERSION)
77 PATH=$(PATH.gnu)
79 PARCH = $(MACH:i386=i386-pc)
80 GNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
81 PKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
83 # Build recipe borrowed from OmniOS
84 COMMON_ENV= LD_OPTIONS="-zignore -zcombreloc -i"
85 COMMON_ENV+= LD_FOR_TARGET=/usr/bin/ld
86 COMMON_ENV+= LD_FOR_HOST=/usr/bin/ld
87 COMMON_ENV+= LD=/usr/bin/ld
89 CONFIGURE_ENV+= $(COMMON_ENV)
90 COMPONENT_BUILD_ENV+= $(COMMON_ENV)
91 COMPONENT_INSTALL_ENV+= $(COMMON_ENV)
93 CONFIGURE_OPTIONS+= --sbindir=$(CONFIGURE_BINDIR.$(BITS))
94 CONFIGURE_OPTIONS+= --libdir=$(CONFIGURE_LIBDIR.$(BITS))
95 CONFIGURE_OPTIONS+= --libexecdir=$(CONFIGURE_LIBDIR.$(BITS))
96 CONFIGURE_OPTIONS+= --host $(GNU_ARCH)
97 CONFIGURE_OPTIONS+= --build $(GNU_ARCH)
98 CONFIGURE_OPTIONS+= --target $(GNU_ARCH)
99 #CONFIGURE_OPTIONS+= --with-boot-ldflags=-R$(CONFIGURE_PREFIX)/lib
100 CONFIGURE_OPTIONS+= --with-pkgversion="OpenIndiana $(THIS_GCC_PKGVERSION)"
101 CONFIGURE_OPTIONS+= --with-bugurl="https://bugs.openindiana.org"
102 CONFIGURE_OPTIONS+= --enable-plugins
103 CONFIGURE_OPTIONS+= --enable-objc-gc
104 CONFIGURE_OPTIONS+= --enable-initfini-array
105 CONFIGURE_OPTIONS+= --enable-languages=c,c++,fortran,lto,objc
106 CONFIGURE_OPTIONS+= --without-gnu-ld
107 CONFIGURE_OPTIONS+= --with-ld=/usr/bin/ld
108 CONFIGURE_OPTIONS+= --with-build-time-tools=/usr/gnu/$(GNU_ARCH)/bin
109 CONFIGURE_OPTIONS+= --disable-libitm
111 # On SPARC systems, use Sun Assembler
112 CONFIGURE_OPTIONS.sparc+= --without-gnu-as --with-as=/usr/bin/as
113 CONFIGURE_OPTIONS.i386+= --with-gnu-as --with-as=/usr/bin/gas
114 CONFIGURE_OPTIONS+= $(CONFIGURE_OPTIONS.$(MACH))
116 CONFIGURE_OPTIONS+= LDFLAGS="-R$(CONFIGURE_PREFIX)/lib"
118 COMPONENT_POST_INSTALL_ACTION = \
119 $(RM) -r $(PROTO_DIR)$(CONFIGURE_PREFIX)/lib/gcc/$(GNU_ARCH)/$(COMPONENT_VERSION)/include-fixed
121 unexport SHELLOPTS
124 # Run the tests and generate a summary report, then output the summary
125 # report into the results file. Note that list of reported tests is sorted
126 # to allow parallel test run.
128 # To ensure that all tests that are expected to pass actually
129 # pass, we have to increase the stacksize limit to at least
130 # 16MB. Otherwise we'll get spurious failures in the test
131 # harness (gcc.c-torture/compile/limits-exprparen.c and others).
132 # With the soft stacksize limit set to 16384 we get reasonably good
133 # test results.
135 COMPONENT_PRE_TEST_ACTION += \
136 (cd $(COMPONENT_TEST_DIR) ; \
137 ulimit -Ss 16385 ; \
138 $(ENV) $(COMPONENT_PRE_TEST_ENV) \
139 $(GMAKE) -k -i $(JOBS:%=-j%) check check-target RUNTESTFLAGS="--target_board=unix/\{,-msave-args\}" ; \
140 $(FIND) . -name '*.sum' | while read f; do \
141 gsed -e '1,/^Running target unix/p' -e 'd' $f > $f.2; \
142 gsed -e '/^Running target unix/,/Summary ===$/p' -e 'd' $f | grep '^.*: ' | sort -k 2 >> $f.2; \
143 gsed -e '/Summary ===$/,$p' -e 'd' $f >> $f.2; \
144 mv $f.2 $f; done; \
145 $(GMAKE) mail-report.log)
147 COMPONENT_TEST_CMD = $(CAT)
148 COMPONENT_TEST_TARGETS = mail-report.log
150 # Master test results are different between x86 and SPARC.
151 COMPONENT_TEST_MASTER = \
152 $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
154 build: $(BUILD_32)
156 install: $(INSTALL_32)
158 test: $(TEST_32)
160 # Required by test suite
161 REQUIRED_PACKAGES += developer/test/dejagnu
162 REQUIRED_PACKAGES += developer/build/autoconf-archive
163 REQUIRED_PACKAGES += developer/build/autogen
164 REQUIRED_PACKAGES += system/extended-system-utilities
166 # Auto-generated dependencies
167 REQUIRED_PACKAGES += SUNWcs
168 REQUIRED_PACKAGES += library/gc
169 REQUIRED_PACKAGES += system/library
170 REQUIRED_PACKAGES += system/library/g++-7-runtime
171 REQUIRED_PACKAGES += system/library/gcc-7-runtime
172 REQUIRED_PACKAGES += system/library/gfortran-7-runtime
173 REQUIRED_PACKAGES += system/library/gobjc-7-runtime
174 REQUIRED_PACKAGES += system/library/math