summaryrefslogtreecommitdiffstats
path: root/toolchain/gcc/Makefile.in
blob: 58f38fa2b14847ee5f8fd5cfcaaf17033e067859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# gcc has a bunch of options that need to be shared with
# both gcc-uclibc-2.95.mk and gcc-uclibc-3.x.mk, and are
# use by other packages... So include them in this file
# and arrange to include it soon after invoking make from
# the top level.

GCC_VERSION:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
#"))
TARGET_OPTIMIZATION:=$(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
#"))
EXTRA_GCC_CONFIG_OPTIONS:=$(strip $(subst ",, $(BR2_EXTRA_GCC_CONFIG_OPTIONS)))
#"))

ifeq ($(strip $(subst ",, $(BR2_GCC_IS_SNAP))),y)
#"))
GCC_SNAP_DATE:=$(strip $(subst ",, $(BR2_GCC_SNAP_DATE)))
#"))
else
GCC_SNAP_DATE:=
endif
#")))

ifeq ($(strip $(BR2_GCC_USE_SJLJ_EXCEPTIONS)),y)
GCC_USE_SJLJ_EXCEPTIONS:=--enable-sjlj-exceptions
endif

ifeq ($(BR2_SOFT_FLOAT),y)
# gcc 3.4.x soft float configuration is different than previous versions.
ifeq ($(findstring x3.4.,x$(GCC_VERSION)),x3.4.)
ifneq ($(BR2_nios2),y)
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
endif
else
SOFT_FLOAT_CONFIG_OPTION:=--without-float
endif

# again... there must be a better way
ifeq ($(findstring x4.,x$(GCC_VERSION)),x4.)
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
ifeq ($(BR2_SOFT_FLOAT_FP),y)
TARGET_SOFT_FLOAT:=-mfloat-abi=softfp
else # no fp at all
ifeq ($(BR2_arm),y) # only set float-abi for arm
TARGET_SOFT_FLOAT:=-mfloat-abi=soft
else
TARGET_SOFT_FLOAT:=-msoft-float
endif
endif
else # not gcc-4.x
TARGET_SOFT_FLOAT:=-msoft-float
endif
ARCH_FPU_SUFFIX:=_nofpu
else # no softfloat support
SOFT_FLOAT_CONFIG_OPTION:=
TARGET_SOFT_FLOAT:=
ARCH_FPU_SUFFIX:=
endif

# some additional defaults
ifneq ($(strip $(subst ",,$(BR2_GCC_TARGET_ARCH))),)
# ")))
GCC_WITH_ARCH:=--with-arch=$(BR2_GCC_TARGET_ARCH)
endif
ifneq ($(strip $(subst ",,$(BR2_GCC_TARGET_TUNE))),)
# ")))
GCC_WITH_TUNE:=--with-tune=$(BR2_GCC_TARGET_TUNE)
endif
ifneq ($(strip $(subst ",,$(BR2_GCC_TARGET_ABI))),)
# ")))
GCC_WITH_ABI:=--with-abi=$(BR2_GCC_TARGET_ABI)
endif

# AVR32 GCC configuration
ifeq ($(strip $(BR2_avr32)),y)
EXTRA_GCC_CONFIG_OPTIONS+=--disable-libmudflap
SOFT_FLOAT_CONFIG_OPTION:=
EXTRA_GCC_CONFIG_OPTIONS+=--disable-libssp
EXTRA_GCC_CONFIG_OPTIONS+=--with-build-time-tools=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin \
#EXTRA_GCC_CONFIG_OPTIONS+=--with-as=$(TARGET_CROSS)as
endif

TARGET_GCC_FLAGS= CFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
	CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
	CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
	BOOT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)"

ifeq ($(strip $(BR2_PACKAGE_GCC_TARGET)),y)
EXTRA_TARGET_GCC_CONFIG_OPTIONS:=

# AVR32 target GCC configuration
ifeq ($(strip $(BR2_avr32)),y)
EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--disable-libmudflap
EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--disable-libssp
EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--with-build-time-tools=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin \
EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--with-as=$(TARGET_CROSS)as
endif


# and finally pull in config opts from the user
EXTRA_TARGET_GCC_CONFIG_OPTIONS+=$(strip $(subst ",, $(BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS)))
#"))

ifeq ($(BR2_PREFER_IMA),y)
# >= 4.x
ifneq ($(findstring x3.,x$(GCC_VERSION)),x3.)
EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--enable-intermodule
endif
endif # BR2_PREFER_IMA=y

TARGETS+=gcc_target
endif