1 # Copyright © 2004-2017, The AROS Development Team. All rights reserved.
4 include $(SRCDIR)/config/aros-contrib.cfg
6 #MM- contrib-gnu : contrib-gnu-gcc
7 #MM- contrib-gnu-gcc : development-collect-aros development-gcc
8 #MM- development-gcc : development-gmp development-mpfr development-mpc contrib-development-libs-gc
10 GCC_VERSION = $(TARGET_GCC_VER)
13 ifneq (no-objc,$(OBJC_TARGET))
14 GCC_LANGUAGES:=$(GCC_LANGUAGES),objc
16 ifneq (no-java,$(JAVA_TARGET))
17 GCC_LANGUAGES:=$(GCC_LANGUAGES),java
21 # ARM requires additional flags to determine CPU type and FP model
23 ifneq (,$(findstring $(AROS_TARGET_CPU),arm))
24 GCC_EXTRA_OPTS += --with-arch=$(GCC_DEFAULT_CPU)
25 GCC_EXTRA_OPTS += --with-float=$(GCC_DEFAULT_FLOAT_ABI)
26 GCC_EXTRA_OPTS += --with-fpu=$(GCC_DEFAULT_FPU)
27 GCC_EXTRA_OPTS += --with-mode=$(GCC_DEFAULT_MODE)
28 GCC_EXTRA_OPTS += --disable-libunwind-exceptions
31 GCC_EXTRA_OPTS += --with-sysroot=/$(AROS_DIR_DEVELOPER)
32 GCC_EXTRA_OPTS += --with-build-sysroot=$(AROS_DEVELOPER)
33 GCC_EXTRA_OPTS += --with-native-system-header-dir=/include
34 GCC_EXTRA_OPTS += --enable-languages=$(strip $(GCC_LANGUAGES))
35 GCC_EXTRA_OPTS += --enable-long-long
36 GCC_EXTRA_OPTS += --enable-version-specific-runtime-libs
37 GCC_EXTRA_OPTS += --enable-frame-pointer
38 GCC_EXTRA_OPTS += --with-dwarf2
39 GCC_EXTRA_OPTS += --disable-sjlj-exceptions
40 GCC_EXTRA_OPTS += --disable-tls
41 GCC_EXTRA_OPTS += --disable-objc-gc
42 GCC_EXTRA_OPTS += --disable-plugins
43 GCC_EXTRA_OPTS += --disable-libssp
44 GCC_EXTRA_OPTS += --disable-libstdcxx-pch
45 GCC_EXTRA_OPTS += --disable-build-with-cxx
46 GCC_EXTRA_OPTS += --disable-build-poststage1-with-cxx
51 ac_cv_header_iconv_h=no \
54 # GCC will fail to build if iconv is found, so check and generate an error if it
58 # Check if iconv is incorrectly installed in the Dev env..
59 if [ -a $(AROS_INCLUDE)/iconv.h ] ; \
61 INVALID_ICONV=true ; \
63 if [ -a $(AROS_LIB)/libiconv.a ] ; \
65 INVALID_ICONV=true ; \
67 ifneq (false,$(INVALID_ICONV))
68 $(error iconv incorrect installed - please remove it from the developer environement)
72 # Rules to build the native GCC compiler.
74 %fetch_and_build_gnu_development package=gcc version=$(GCC_VERSION) crossbuild=yes patch=yes \
75 package_repo="$(GNU_REPOSITORY)/gcc/gcc-$(GCC_VERSION)" \
76 config_env_extra=$(GCC_HOST_VARS) extraoptions=$(GCC_EXTRA_OPTS) \
77 postinstall=contrib-gnu-gcc-deletefixed
80 contrib-gnu-gcc-deletefixed:
81 FIXED_INCLUDES=`grep -lr "DO NOT EDIT THIS FILE" $(AROS_LIB)/gcc/$(AROS_TARGET_CPU)-aros/$(GCC_VERSION)/include`; \
82 $(IF) $(TEST) -n "$$FIXED_INCLUDES"; then \
83 $(ECHO) "Removing fixed includes: " $$FIXED_INCLUDES; \
84 $(RM) $$FIXED_INCLUDES; \
86 $(ECHO) "No fixed includes to remove."; \