]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/gcc/gcc_3.3.3.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / gcc / gcc_3.3.3.bb
1 SECTION = "devel"
2 PR = "r2"
3 inherit autotools gettext
4
5 DESCRIPTION = "The GNU cc and gcc C compilers."
6 HOMEPAGE = "http://www.gnu.org/software/gcc/"
7 LICENSE = "GPL"
8 MAINTAINER = "Gerald Britton <gbritton@doomcom.org>"
9
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 \
16             ${PN}-doc"
17
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"
28
29 FILES_${PN}-symlinks = "${bindir}/cc \
30                         ${bindir}/gcc \
31                         ${bindir}/cpp \
32                         ${bindir}/gcov \
33                         ${bindir}/gccbug"
34
35 FILES_${PN}-c++ = "${bindir}/${TARGET_PREFIX}g++ \
36                    ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/cc1plus"
37
38 FILES_${PN}-c++-symlinks = "${bindir}/c++ \
39                             ${bindir}/g++"
40
41 PACKAGE_ARCH_libgcc = "${TARGET_ARCH}"
42 FILES_libgcc = "/lib/libgcc_s.so.*"
43
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++ = "${libdir}/libstdc++.so.*"
49
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"
56
57 FILES_${PN}-doc = "${infodir} \
58                    ${mandir} \
59                    ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/include/README"
60
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 \
96         file://bash3.patch;patch=1"
97
98 MIRRORS_prepend () {
99 ${GNU_MIRROR}/gcc/releases/     http://gcc.get-software.com/releases/
100 }
101
102 S = "${WORKDIR}/gcc-${PV}"
103 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
104
105 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
106                 --with-gnu-ld \
107                 --enable-shared \
108                 --enable-multilib \
109                 --enable-target-optspace \
110                 --enable-languages=c,c++,f77 \
111                 --enable-threads=posix \
112                 --enable-c99 \
113                 --enable-long-long \
114                 --enable-symvers=gnu \
115                 --program-prefix=${TARGET_PREFIX} \
116                 ${EXTRA_OECONF_PATHS} \
117                 ${EXTRA_OECONF_DEP}"
118
119 EXTRA_OECONF_PATHS = "--with-local-prefix=${prefix}/local \
120                       --with-gxx-include-dir=${includedir}/c++/${PV}"
121
122 EXTRA_OECONF_DEP = ""
123 EXTRA_OECONF_uclibc = "--disable-__cxa_atexit"
124 EXTRA_OECONF_glibc = "--enable-__cxa_atexit"
125 EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}"
126
127 def get_gcc_fpu_setting(bb, d):
128         if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
129                 return "--with-float=soft"
130         return ""
131
132 python __anonymous () {
133     import bb, re
134     if (re.match('linux-uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None):
135         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_uclibc}', d)
136     elif (re.match('linux$', bb.data.getVar('TARGET_OS', d, 1)) != None):
137         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_glibc}', d)
138 }
139
140 do_configure () {
141         # Setup these vars for cross building only
142         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
143                 export CC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
144                 export GCC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
145                 export CXX_FOR_TARGET="${CCACHE} ${HOST_PREFIX}g++"
146                 export AS_FOR_TARGET="${HOST_PREFIX}as"
147                 export LD_FOR_TARGET="${HOST_PREFIX}ld"
148                 export NM_FOR_TARGET="${HOST_PREFIX}nm"
149                 export AR_FOR_TARGET="${HOST_PREFIX}ar"
150                 export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
151         fi
152         (cd ${S} && gnu-configize) || die "failure running gnu-configize"
153         oe_runconf
154 }
155
156 do_install () {
157         autotools_do_install
158
159         # Cleanup some of the gcc-lib stuff
160         rm -rf ${D}${libdir}/gcc-lib/${TARGET_SYS}/${PV}/install-tools
161
162         # Move libgcc_s into /lib
163         mkdir -p ${D}${base_libdir}
164         mv -f ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
165         rm -f ${D}${libdir}/libgcc_s.so
166         ln -sf `echo ${libdir}/gcc-lib/${TARGET_SYS}/${PV} | tr -s / |
167                 sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.? \
168                 ${D}${libdir}/gcc-lib/${TARGET_SYS}/${PV}/libgcc_s.so
169
170         # Cleanup manpages..
171         rm -rf ${D}${mandir}/man7
172         mv ${D}${mandir}/man1/cpp.1 \
173            ${D}${mandir}/man1/${TARGET_SYS}-cpp.1
174         mv ${D}${mandir}/man1/gcov.1 \
175            ${D}${mandir}/man1/${TARGET_SYS}-gcov.1
176
177         # We use libiberty from binutils
178         rm -f ${D}${libdir}/libiberty.a
179
180         cd ${D}${bindir}
181
182         # We care about g++ not c++
183         rm -f *c++
184
185         # We don't care about the gcc-<version> ones for this
186         rm -f *gcc-?.?*
187
188         # These sometimes show up, they are strange, we remove them
189         rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
190
191         # Symlinks so we can use these trivially on the target
192         ln -sf ${TARGET_SYS}-g77 g77
193         ln -sf ${TARGET_SYS}-g++ g++
194         ln -sf ${TARGET_SYS}-gcc gcc
195         ln -sf g77 f77
196         ln -sf g++ c++
197         ln -sf gcc cc
198 }