2012-07-03 12:56:25 +02:00
|
|
|
|
PWD = $(shell pwd)
|
|
|
|
|
|
2016-09-11 21:13:27 +02:00
|
|
|
|
PKG_DIR = $(call select_from_ports,gcc)/src/noux-pkg/gcc
|
|
|
|
|
|
|
|
|
|
CONFIGURE_ARGS = --program-prefix=$(PROGRAM_PREFIX) \
|
|
|
|
|
--target=$(GCC_TARGET) \
|
|
|
|
|
--enable-languages=c,c++ \
|
|
|
|
|
--disable-libgo \
|
2019-03-19 14:01:17 +01:00
|
|
|
|
--disable-gotools \
|
2016-09-11 21:13:27 +02:00
|
|
|
|
--disable-libssp \
|
|
|
|
|
--disable-libquadmath \
|
|
|
|
|
--disable-libffi \
|
2019-03-19 14:01:17 +01:00
|
|
|
|
--disable-libada \
|
2016-09-11 21:13:27 +02:00
|
|
|
|
--enable-targets=all \
|
|
|
|
|
--with-gnu-as \
|
|
|
|
|
--with-gnu-ld \
|
|
|
|
|
--disable-tls \
|
|
|
|
|
--disable-threads \
|
|
|
|
|
--disable-hosted-libstdcxx \
|
|
|
|
|
--enable-shared \
|
|
|
|
|
--enable-multiarch \
|
2019-03-19 14:01:17 +01:00
|
|
|
|
--disable-sjlj-exceptions \
|
|
|
|
|
--disable-nls
|
2016-09-11 21:13:27 +02:00
|
|
|
|
|
2019-03-04 02:24:10 +01:00
|
|
|
|
MKENV += host_configargs="$(HOST_CONFIG_ARGS)" \
|
2016-09-11 21:13:27 +02:00
|
|
|
|
target_configargs="$(TARGET_CONFIG_ARGS)"
|
|
|
|
|
|
2019-03-04 02:24:10 +01:00
|
|
|
|
MKENV += CC_FOR_TARGET=$(CC) CXX_FOR_TARGET=$(CXX) GCC_FOR_TARGET=$(CC) CPP_FOR_TARGET="$(CC) -E" \
|
2016-09-11 21:13:27 +02:00
|
|
|
|
LD_FOR_TARGET=$(LD) AS_FOR_TARGET=$(AS) AR_FOR_TARGET=$(AR)
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
2015-05-11 17:55:26 +02:00
|
|
|
|
# libgcc does not evaluate CPPFLAGS_FOR_TARGET, so everything is put into CFLAGS_FOR_TARGET here
|
2019-03-04 02:24:10 +01:00
|
|
|
|
MKENV += CFLAGS_FOR_TARGET='-I$(BASE_DIR)/../../tool -DUSE_PT_GNU_EH_FRAME -Dinhibit_libc -fPIC'
|
2015-05-11 17:55:26 +02:00
|
|
|
|
|
|
|
|
|
# libsupc++
|
2019-03-04 02:24:10 +01:00
|
|
|
|
MKENV += CXXFLAGS_FOR_TARGET='-fPIC'
|
2015-05-11 17:55:26 +02:00
|
|
|
|
|
2017-04-09 21:02:34 +02:00
|
|
|
|
MAKE_ENV += GENODE="yes"
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
2019-04-26 12:47:33 +02:00
|
|
|
|
# prevent "converting to ‘bool’ from ‘std::nullptr_t’" error
|
|
|
|
|
CXXFLAGS += -fpermissive
|
|
|
|
|
|
2012-07-03 12:56:25 +02:00
|
|
|
|
#
|
|
|
|
|
# We link libraries to the final binaries using the 'LIBS' variable. But
|
|
|
|
|
# unfortunately, the gcc build system has hardcoded some libs such as '-lc'.
|
|
|
|
|
# To satisfy the linker, we provide dummy archives.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
LIBS = gmp mpfr mpc
|
|
|
|
|
|
2016-09-11 21:13:27 +02:00
|
|
|
|
LDFLAGS += -L$(PWD)
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
|
|
|
|
.SECONDARY: dummy_libs
|
|
|
|
|
dummy_libs: libgmp.a libmpfr.a libmpc.a libc.a
|
|
|
|
|
|
|
|
|
|
libgmp.a libmpfr.a libmpc.a libc.a:
|
|
|
|
|
$(VERBOSE)$(AR) -rc $@
|
|
|
|
|
|
|
|
|
|
Makefile: dummy_libs
|
|
|
|
|
|
2019-08-13 14:38:39 +02:00
|
|
|
|
LIBS += libc libm posix stdcxx base
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
2017-05-14 21:59:34 +02:00
|
|
|
|
include $(call select_from_repositories,mk/noux.mk)
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# We have to specify 'LINK_ITEMS' twice to resolve inter-library dependencies.
|
|
|
|
|
# Unfortunately, the use of '--start-group' and '--end-group' does not suffice
|
|
|
|
|
# in all cases because 'libtool' strips those arguments from the 'LIBS' variable.
|
|
|
|
|
#
|
2016-12-29 18:27:45 +01:00
|
|
|
|
LDLIBS += -Wl,--start-group $(sort $(STATIC_LIBS)) $(sort $(STATIC_LIBS)) $(LIBGCC) -Wl,--end-group
|