1 include $(TOP)/config/make.cfg
9 ICU_PKGVERSION=$(subst .,_,$(ICU_VERSION))
12 --bindir=$(CROSSTOOLSDIR) \
13 --sbindir=$(CROSSTOOLSDIR) \
20 --with-data-packaging=static
22 BINUTILS_VERSION = $(TARGET_BINUTILS_VER)
24 BINUTILS_EXTRA_OPTS := --target=$(AROS_TARGET_CPU)-aros
25 BINUTILS_EXTRA_OPTS += -bindir=$(CROSSTOOLSDIR)
26 BINUTILS_EXTRA_OPTS += --libdir=$(CROSSTOOLSDIR)/lib
27 BINUTILS_EXTRA_OPTS += --with-sysroot=$(AROS_DEVELOPMENT)
28 BINUTILS_EXTRA_OPTS += --disable-werror
30 GCC_VERSION = $(TARGET_GCC_VER)
33 ifneq (no-objc,$(OBJC_TARGET))
34 GCC_LANGUAGES:=$(GCC_LANGUAGES),objc
36 ifneq (no-java,$(JAVA_TARGET))
37 GCC_LANGUAGES:=$(GCC_LANGUAGES),java
40 GCC_EXTRA_OPTS := --target=$(AROS_TARGET_CPU)-aros
42 # ARM requires additional flags to determine CPU type and FP model
43 ifneq (,$(findstring $(AROS_TARGET_CPU),arm))
44 GCC_EXTRA_OPTS += --with-arch=$(GCC_DEFAULT_CPU)
45 GCC_EXTRA_OPTS += --with-float=$(GCC_DEFAULT_FLOAT_ABI)
46 GCC_EXTRA_OPTS += --with-fpu=$(GCC_DEFAULT_FPU)
47 GCC_EXTRA_OPTS += --with-mode=arm
48 GCC_EXTRA_OPTS += --disable-libunwind-exceptions
50 GCC_EXTRA_OPTS += --with-dwarf2
53 GCC_EXTRA_OPTS += --with-sysroot=$(AROS_DEVELOPMENT)
54 GCC_EXTRA_OPTS += --with-native-system-header-dir=/include
55 GCC_EXTRA_OPTS += --bindir=$(CROSSTOOLSDIR)
56 GCC_EXTRA_OPTS += --libdir=$(CROSSTOOLSDIR)/lib
57 GCC_EXTRA_OPTS += --enable-languages=$(strip $(GCC_LANGUAGES))
58 GCC_EXTRA_OPTS += --enable-long-long
59 GCC_EXTRA_OPTS += --enable-version-specific-runtime-libs
60 GCC_EXTRA_OPTS += --enable-frame-pointer
61 GCC_EXTRA_OPTS += --with-isl=$(CROSSTOOLSDIR)
62 GCC_EXTRA_OPTS += --disable-isl-version-check
63 GCC_EXTRA_OPTS += --disable-bootstrap
64 GCC_EXTRA_OPTS += --disable-sjlj-exceptions
65 GCC_EXTRA_OPTS += --disable-tls
66 GCC_EXTRA_OPTS += --disable-plugins
67 GCC_EXTRA_OPTS += --disable-libssp
68 GCC_EXTRA_OPTS += --disable-libstdcxx-pch
69 GCC_EXTRA_OPTS += --disable-build-with-cxx
70 GCC_EXTRA_OPTS += --disable-build-poststage1-with-cxx
72 GCC_PATH = `LANG=en_US $(CROSSTOOLSDIR)/$(AROS_TARGET_CPU)-aros-gcc -print-search-dirs | grep "programs: =" | cut -c 12-`
73 GCC_UNUSED_BUT_SET_VARIABLE := -Wno-unused-but-set-variable
74 GCC_ARRAY_BOUNDS := -Wno-array-bounds
75 GCC_ENUM_COMPARE := -Wno-enum-compare
77 GNU_REPOSITORY := gnu://
78 ISL_REPOSITORY := ftp://gcc.gnu.org/pub/gcc/infrastructure
79 MPC_REPOSITORY := http://www.multiprecision.org/mpc/download http://ftp.osuosl.org/pub/lfs/lfs-packages/7.3
80 ICU_REPOSITORY := http://download.icu-project.org/files/$(ICU_PKGNAME)/$(ICU_VERSION)
82 binutils-installflag := $(CROSSTOOLSDIR)/.installflag-binutils-$(BINUTILS_VERSION)-$(AROS_TARGET_CPU)
83 gmp-installflag := $(CROSSTOOLSDIR)/.installflag-gmp-$(GMP_VERSION)
84 isl-installflag := $(CROSSTOOLSDIR)/.installflag-isl-$(ISL_VERSION)
85 mpfr-installflag := $(CROSSTOOLSDIR)/.installflag-mpfr-$(MPFR_VERSION)
86 mpc-installflag := $(CROSSTOOLSDIR)/.installflag-mpc-$(MPC_VERSION)
87 gcc-installflag := $(CROSSTOOLSDIR)/.installflag-gcc-$(GCC_VERSION)-$(AROS_TARGET_CPU)
88 icu-installflag := $(CROSSTOOLSDIR)/.installflag-icu-$(ICU_VERSION)
90 #MM- tools-crosstools : tools-crosstools-$(AROS_TARGET_CPU)
92 #MM- tools-crosstools-m68k : tools-crosstools-gcc crosstools-gcc
93 #MM- tools-crosstools-i386 : tools-crosstools-gcc crosstools-gcc
94 #MM- tools-crosstools-x86_64 : tools-crosstools-gcc crosstools-gcc
95 #MM- tools-crosstools-ppc : tools-crosstools-gcc crosstools-gcc
96 #MM- tools-crosstools-arm : tools-crosstools-gcc crosstools-gcc
98 #MM- crosstools-gcc: core-linklibs
100 #MM tools-crosstools-gcc : tools-crosstools-binutils tools-crosstools-collect-aros \
101 #MM compiler-includes compiler-clib-includes \
102 #MM tools-crosstools-gmp \
103 #MM tools-crosstools-isl \
104 #MM tools-crosstools-mpfr \
105 #MM tools-crosstools-mpc
107 # We intentionally bypass the usual fetch_and_build macro below and call mmakefile and gcc makefile
108 # targets directly. This is in order to not build the core-linklibs target during binutils and gcc
109 # builds because we want these static linker libraries be generated by the cross tool chain we are building
110 # right here. Additionally, we also want to maintain our own install flag files inside the directory
111 # specified by --with-aros-toolchain-install. This directory may even reside outside of the usual aros
112 # build directory and can be reused between complete rebuilds.
115 tools-crosstools-gmp :
116 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
117 || ! $(TEST) -f $(gmp-installflag) ; then \
118 $(RM) $(HOSTGENDIR)/$(CURDIR)/gmp/.files-touched \
119 && $(MAKE) -f ./mmakefile crosstools-gmp--fetch \
120 && $(MAKE) -f ./mmakefile crosstools-gmp--build_and_install-quick \
121 && $(TOUCH) $(gmp-installflag) ; \
124 %fetch_and_build mmake=crosstools-gmp package=gmp version=$(GMP_VERSION) compiler=host \
125 package_repo="$(GNU_REPOSITORY)/gmp" \
126 srcdir=gmp-6.0.0 patch=no \
127 prefix="$(CROSSTOOLSDIR)" \
128 extraoptions="--bindir=$(CROSSTOOLSDIR) --libdir=$(CROSSTOOLSDIR)/lib --disable-shared"
131 tools-crosstools-isl :
132 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
133 || ! $(TEST) -f $(isl-installflag) ; then \
134 $(RM) $(HOSTGENDIR)/$(CURDIR)/isl/.files-touched \
135 && $(MAKE) -f ./mmakefile crosstools-isl--fetch \
136 && $(MAKE) -f ./mmakefile crosstools-isl--build_and_install-quick \
137 && $(TOUCH) $(isl-installflag) ; \
140 %fetch_and_build mmake=crosstools-isl package=isl version=$(ISL_VERSION) compiler=host \
141 package_repo="$(ISL_REPOSITORY)" \
143 prefix="$(CROSSTOOLSDIR)" \
144 extraoptions="--bindir=$(CROSSTOOLSDIR) --libdir=$(CROSSTOOLSDIR)/lib --without-piplib --disable-shared"
147 tools-crosstools-mpfr :
148 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
149 || ! $(TEST) -f $(mpfr-installflag) ; then \
150 $(RM) $(HOSTGENDIR)/$(CURDIR)/mpfr/.files-touched \
151 && $(MAKE) -f ./mmakefile crosstools-mpfr--fetch \
152 && $(MAKE) -f ./mmakefile crosstools-mpfr--build_and_install-quick \
153 && $(TOUCH) $(mpfr-installflag) ; \
156 %fetch_and_build mmake=crosstools-mpfr package=mpfr version=$(MPFR_VERSION) compiler=host \
157 package_repo="$(GNU_REPOSITORY)/mpfr" \
159 prefix="$(CROSSTOOLSDIR)" \
160 extraoptions="--bindir=$(CROSSTOOLSDIR) --libdir=$(CROSSTOOLSDIR)/lib --disable-shared"
163 tools-crosstools-mpc :
164 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
165 || ! $(TEST) -f $(mpc-installflag) ; then \
166 $(RM) $(HOSTGENDIR)/$(CURDIR)/mpc/.files-touched \
167 && $(MAKE) -f ./mmakefile crosstools-mpc--fetch \
168 && $(MAKE) -f ./mmakefile crosstools-mpc--build_and_install-quick \
169 && $(TOUCH) $(mpc-installflag) ; \
172 %fetch_and_build mmake=crosstools-mpc package=mpc version=$(MPC_VERSION) compiler=host \
173 package_repo="$(MPC_REPOSITORY)" suffixes="tar.gz" \
175 prefix="$(CROSSTOOLSDIR)" \
176 extraoptions="--bindir=$(CROSSTOOLSDIR) --libdir=$(CROSSTOOLSDIR)/lib --disable-shared"
179 tools-crosstools-binutils :
180 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
181 || ! $(TEST) -f $(binutils-installflag) ; then \
182 $(RM) $(HOSTGENDIR)/$(CURDIR)/binutils/.files-touched \
183 && $(MAKE) -f ./mmakefile crosstools-binutils--fetch \
184 && $(MAKE) -f ./mmakefile crosstools-binutils--build_and_install-quick \
185 && $(TOUCH) $(binutils-installflag) ; \
188 %fetch_and_build mmake=crosstools-binutils package=binutils version=$(BINUTILS_VERSION) compiler=host \
189 package_repo="$(GNU_REPOSITORY)/binutils" \
191 prefix="$(CROSSTOOLSDIR)" \
192 extraoptions="$(BINUTILS_EXTRA_OPTS)"
194 HOST_CFLAGS := $(HOST_CFLAGS) $(HOST_GNU89_INLINE)
197 tools-crosstools-gcc :
198 @$(IF) ! $(TEST) -f $(gcc-installflag) ; then \
199 $(RM) $(HOSTGENDIR)/$(CURDIR)/gcc/.files-touched \
200 && $(MAKE) -f ./mmakefile crosstools-gcc--fetch \
201 && $(MAKE) -f ./mmakefile crosstools-gcc--configure \
202 && $(MAKE) -C $(HOSTGENDIR)/$(CURDIR)/gcc all-gcc \
203 && $(MAKE) -j1 -C $(HOSTGENDIR)/$(CURDIR)/gcc install-gcc \
204 && $(TOUCH) $(gcc-installflag) ; \
206 @$(IF) $(TEST) -f $(gcc-installflag); then \
207 $(SED) -i -e "s|@aros_target_cc_path@|$(GCC_PATH)|g" $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-ld ; \
208 $(SED) -i -e "s|@aros_cflags_unused_but_set_variable@|$(GCC_UNUSED_BUT_SET_VARIABLE)|g" $(GENDIR)/config/target.cfg ; \
209 $(SED) -i -e "s|@aros_cflags_array_bounds@|$(GCC_ARRAY_BOUNDS)|g" $(GENDIR)/config/target.cfg ; \
210 $(SED) -i -e "s|@aros_cflags_enum_compare@|$(GCC_ENUM_COMPARE)|g" $(GENDIR)/config/target.cfg ; \
211 $(SED) -i -e "s|@aros_cflags_format_security@|-Wno-format-security|g" $(GENDIR)/config/target.cfg ; \
212 $(SED) -i -e "s|@aros_cflags_strict_overflow@|-Wno-strict-overflow|g" $(GENDIR)/config/target.cfg ; \
215 %fetch_and_build mmake=crosstools-gcc package=gcc version=$(GCC_VERSION) compiler=host \
216 package_repo="$(GNU_REPOSITORY)/gcc/gcc-$(GCC_VERSION)" \
218 prefix="$(CROSSTOOLSDIR)" \
219 extraoptions="$(GCC_EXTRA_OPTS)"
222 tools-crosstools-icu :
223 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
224 || ! $(TEST) -f $(icu-installflag) ; then \
225 $(RM) $(HOSTGENDIR)/$(CURDIR)/icu/.files-touched \
226 && $(MAKE) -f ./mmakefile crosstools-icu--fetch \
227 && $(MAKE) -f ./mmakefile crosstools-icu--build_and_install-quick \
228 && $(TOUCH) $(icu-installflag) ; \
231 HOST_CXXFLAGS := $(subst -Wno-pointer-sign,, $(subst -Werror-implicit-function-declaration,, $(HOST_CXXFLAGS)))
233 # specify the gendir for icu to be in the crosstools directory so it can be reused
234 %fetch_and_build mmake=crosstools-icu package=icu4c version=$(ICU_PKGVERSION)-src compiler=host \
235 package_repo="$(ICU_REPOSITORY)" suffixes="tgz" \
236 patch=yes srcdir=icu builddir=source gendir=$(CROSSTOOLSDIR) \
237 prefix="$(CROSSTOOLSDIR)" \
238 extraoptions="$(ICU_EXTRA_OPTS)"