3 inherit autotools gettext
5 DESCRIPTION = "The GNU cc and gcc C compilers."
6 HOMEPAGE = "http://www.gnu.org/software/gcc/"
8 MAINTAINER = "Gerald Britton <gbritton@doomcom.org>"
10 # libgcc libstdc++ libg2c are listed in our FILES_*, but are actually
11 # packaged in the respective cross packages.
12 PACKAGES = "${PN} ${PN}-symlinks \
13 ${PN}-c++ ${PN}-c++-symlinks \
14 ${PN}-f77 ${PN}-f77-symlinks \
15 libstdc++-dev libg2c-dev \
18 FILES_${PN} = "${bindir}/${TARGET_PREFIX}gcc \
19 ${bindir}/${TARGET_PREFIX}cpp \
20 ${bindir}/${TARGET_PREFIX}gcov \
21 ${bindir}/${TARGET_PREFIX}gccbug \
22 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/cc1 \
23 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/collect2 \
24 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/crt* \
25 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/specs \
26 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/lib* \
27 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/include"
29 FILES_${PN}-symlinks = "${bindir}/cc \
35 FILES_${PN}-c++ = "${bindir}/${TARGET_PREFIX}g++ \
36 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/cc1plus"
38 FILES_${PN}-c++-symlinks = "${bindir}/c++ \
41 PACKAGE_ARCH_libgcc = "${TARGET_ARCH}"
42 FILES_libgcc = "/lib/libgcc_s.so.*"
44 PACKAGE_ARCH_libstdc++ = "${TARGET_ARCH}"
45 PACKAGE_ARCH_libstdc++-dev = "${TARGET_ARCH}"
46 # Called from within gcc-cross, so libdir is set wrong
47 #FILES_libstdc++ = "${libdir}/libstdc++.so.*"
48 FILES_libstdc++ = "/usr/lib/libstdc++.so.*"
50 FILES_libstdc++-dev = "${includedir}/c++/${PV} \
51 ${libdir}/libstdc++.so \
52 ${libdir}/libstdc++.la \
53 ${libdir}/libstdc++.a \
54 ${libdir}/libsupc++.la \
55 ${libdir}/libsupc++.a"
57 FILES_${PN}-doc = "${infodir} \
59 ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/include/README"
61 SRC_URI = "${GNU_MIRROR}/gcc/releases/gcc-${PV}/gcc-${PV}.tar.bz2 \
62 file://config.sub.patch;patch=1 \
63 file://empty6.patch;patch=1 \
64 file://pr10392-1-test.patch;patch=1 \
65 file://pr10412-1-test.patch;patch=1 \
66 file://pr10589-1-test.patch;patch=1 \
67 file://pr11162-1-test.patch;patch=1 \
68 file://pr11587-1-test.patch;patch=1 \
69 file://pr11608.patch;patch=1 \
70 file://pr11736-1-test.patch;patch=1 \
71 file://pr11864-1-test.patch;patch=1 \
72 file://pr12009.patch;patch=1 \
73 file://pr12010.patch;patch=1 \
74 file://pr13260-test.patch;patch=1 \
75 file://pr9365-1-test.patch;patch=1 \
76 file://sh-lib1funcs_sizeAndType.patch;patch=1 \
77 file://sh-pic-set_fpscr-gcc-3.3.2.patch;patch=1 \
78 file://thunk3.patch;patch=1 \
79 file://arm-10730.dpatch;patch=1;pnum=0 \
80 file://arm-12527.dpatch;patch=1;pnum=0 \
81 file://arm-14558.dpatch;patch=1;pnum=0 \
82 file://arm-common.dpatch;patch=1;pnum=0 \
83 file://arm-gotoff.dpatch;patch=1;pnum=0 \
84 file://arm-ldm.dpatch;patch=1;pnum=0 \
85 file://arm-tune.patch;patch=1;pnum=0 \
86 file://arm-xscale.patch;patch=1;pnum=0 \
87 file://arm-14302.patch;patch=1;pnum=0 \
88 file://arm-ldm-peephole.patch;patch=1;pnum=0 \
89 file://libibery-crosstool.patch;patch=1;pnum=1 \
90 file://reverse-compare.patch;patch=1 \
91 file://gcc34-15089.patch;patch=1 \
92 file://gcc-uclibc-3.3-100-conf.patch;patch=1 \
93 file://gcc-uclibc-3.3-110-conf.patch;patch=1 \
94 file://gcc-uclibc-3.3-120-softfloat.patch;patch=1 \
95 file://gcc-uclibc-3.3-200-code.patch;patch=1"
98 ${GNU_MIRROR}/gcc/releases/ http://gcc.get-software.com/releases/
101 S = "${WORKDIR}/gcc-${PV}"
102 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
104 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
108 --enable-target-optspace \
109 --enable-languages=c,c++,f77 \
110 --enable-threads=posix \
113 --enable-symvers=gnu \
114 --program-prefix=${TARGET_PREFIX} \
115 ${EXTRA_OECONF_PATHS} \
118 EXTRA_OECONF_PATHS = "--with-local-prefix=${prefix}/local \
119 --with-gxx-include-dir=${includedir}/c++/${PV}"
121 EXTRA_OECONF_DEP = ""
122 EXTRA_OECONF_uclibc = "--disable-__cxa_atexit"
123 EXTRA_OECONF_glibc = "--enable-__cxa_atexit"
124 EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}"
126 def get_gcc_fpu_setting(bb, d):
127 if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
128 return "--with-float=soft"
131 python __anonymous () {
133 if (re.match('linux-uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None):
134 bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_uclibc}', d)
135 elif (re.match('linux$', bb.data.getVar('TARGET_OS', d, 1)) != None):
136 bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_glibc}', d)
140 # Setup these vars for cross building only
141 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
142 export CC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
143 export GCC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
144 export CXX_FOR_TARGET="${CCACHE} ${HOST_PREFIX}g++"
145 export AS_FOR_TARGET="${HOST_PREFIX}as"
146 export LD_FOR_TARGET="${HOST_PREFIX}ld"
147 export NM_FOR_TARGET="${HOST_PREFIX}nm"
148 export AR_FOR_TARGET="${HOST_PREFIX}ar"
149 export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
151 (cd ${S} && gnu-configize) || die "failure running gnu-configize"
158 # Cleanup some of the gcc-lib stuff
159 rm -rf ${D}/${libdir}/gcc-lib/${TARGET_SYS}/${PV}/install-tools
161 # Move libgcc_s into /lib
163 mv -f ${D}/${libdir}/libgcc_s.so.* ${D}/lib
164 rm -f ${D}/${libdir}/libgcc_s.so
165 ln -sf `echo ${libdir}/gcc-lib/${TARGET_SYS}/${PV} | tr -s / |
166 sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.? \
167 ${D}/${libdir}/gcc-lib/${TARGET_SYS}/${PV}/libgcc_s.so
170 rm -rf ${D}/${mandir}/man7
171 mv ${D}/${mandir}/man1/cpp.1 \
172 ${D}/${mandir}/man1/${TARGET_SYS}-cpp.1
173 mv ${D}/${mandir}/man1/gcov.1 \
174 ${D}/${mandir}/man1/${TARGET_SYS}-gcov.1
176 # We use libiberty from binutils
177 rm -f ${D}/${libdir}/libiberty.a
181 # We care about g++ not c++
184 # We don't care about the gcc-<version> ones for this
187 # These sometimes show up, they are strange, we remove them
188 rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
190 # Symlinks so we can use these trivially on the target
191 ln -sf ${TARGET_SYS}-g77 g77
192 ln -sf ${TARGET_SYS}-g++ g++
193 ln -sf ${TARGET_SYS}-gcc gcc