conf/distro/jlime-donkey.conf : Added parted & Dialog to distro_rdepends
[vuplus_openembedded] / 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
9 # libgcc libstdc++ libg2c are listed in our FILES_*, but are actually
10 # packaged in the respective cross packages.
11 PACKAGES = "${PN} ${PN}-symlinks \
12             ${PN}-c++ ${PN}-c++-symlinks \
13             ${PN}-f77 ${PN}-f77-symlinks \
14             libstdc++-dev libg2c-dev \
15             ${PN}-doc"
16
17 FILES_${PN} = "${bindir}/${TARGET_PREFIX}gcc \
18                ${bindir}/${TARGET_PREFIX}cpp \
19                ${bindir}/${TARGET_PREFIX}gcov \
20                ${bindir}/${TARGET_PREFIX}gccbug \
21                ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/cc1 \
22                ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/collect2 \
23                ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/crt* \
24                ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/specs \
25                ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/lib* \
26                ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/include"
27
28 FILES_${PN}-symlinks = "${bindir}/cc \
29                         ${bindir}/gcc \
30                         ${bindir}/cpp \
31                         ${bindir}/gcov \
32                         ${bindir}/gccbug"
33
34 FILES_${PN}-c++ = "${bindir}/${TARGET_PREFIX}g++ \
35                    ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/cc1plus"
36
37 FILES_${PN}-c++-symlinks = "${bindir}/c++ \
38                             ${bindir}/g++"
39
40 PACKAGE_ARCH_libgcc = "${TARGET_ARCH}"
41 FILES_libgcc = "/lib/libgcc_s.so.*"
42
43 PACKAGE_ARCH_libstdc++ = "${TARGET_ARCH}"
44 PACKAGE_ARCH_libstdc++-dev = "${TARGET_ARCH}"
45 # Called from within gcc-cross, so libdir is set wrong
46 #FILES_libstdc++ = "${libdir}/libstdc++.so.*"
47 FILES_libstdc++ = "${libdir}/libstdc++.so.*"
48
49 FILES_libstdc++-dev = "${includedir}/c++/${PV} \
50                        ${libdir}/libstdc++.so \
51                        ${libdir}/libstdc++.la \
52                        ${libdir}/libstdc++.a \
53                        ${libdir}/libsupc++.la \
54                        ${libdir}/libsupc++.a"
55
56 FILES_${PN}-doc = "${infodir} \
57                    ${mandir} \
58                    ${libdir}/gcc-lib/${TARGET_SYS}/${PV}/include/README"
59
60 SRC_URI = "${GNU_MIRROR}/gcc/releases/gcc-${PV}/gcc-${PV}.tar.bz2 \
61            file://config.sub.patch;patch=1 \
62            file://empty6.patch;patch=1 \
63            file://pr10392-1-test.patch;patch=1 \
64            file://pr10412-1-test.patch;patch=1 \
65            file://pr10589-1-test.patch;patch=1 \
66            file://pr11162-1-test.patch;patch=1 \
67            file://pr11587-1-test.patch;patch=1 \
68            file://pr11608.patch;patch=1 \
69            file://pr11736-1-test.patch;patch=1 \
70            file://pr11864-1-test.patch;patch=1 \
71            file://pr12009.patch;patch=1 \
72            file://pr12010.patch;patch=1 \
73            file://pr13260-test.patch;patch=1 \
74            file://pr9365-1-test.patch;patch=1 \
75            file://sh-lib1funcs_sizeAndType.patch;patch=1 \
76            file://sh-pic-set_fpscr-gcc-3.3.2.patch;patch=1 \
77            file://thunk3.patch;patch=1 \
78            file://arm-10730.dpatch;patch=1;pnum=0 \
79            file://arm-12527.dpatch;patch=1;pnum=0 \
80            file://arm-14558.dpatch;patch=1;pnum=0 \
81            file://arm-common.dpatch;patch=1;pnum=0 \
82            file://arm-gotoff.dpatch;patch=1;pnum=0 \
83            file://arm-ldm.dpatch;patch=1;pnum=0 \
84            file://arm-tune.patch;patch=1;pnum=0 \
85            file://arm-xscale.patch;patch=1;pnum=0 \
86            file://arm-14302.patch;patch=1;pnum=0 \
87            file://arm-ldm-peephole.patch;patch=1;pnum=0 \
88            file://libibery-crosstool.patch;patch=1;pnum=1 \
89            file://reverse-compare.patch;patch=1 \
90            file://gcc34-15089.patch;patch=1 \
91         file://gcc-uclibc-3.3-100-conf.patch;patch=1 \
92         file://gcc-uclibc-3.3-110-conf.patch;patch=1 \
93         file://gcc-uclibc-3.3-120-softfloat.patch;patch=1 \
94         file://gcc-uclibc-3.3-200-code.patch;patch=1 \
95         file://zecke-xgcc-cpp.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 require gcc-fpu.inc
128
129 python __anonymous () {
130     import bb, re
131     if (re.match('linux-uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None):
132         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_uclibc}', d)
133     elif (re.match('linux$', bb.data.getVar('TARGET_OS', d, 1)) != None):
134         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_glibc}', d)
135 }
136
137 do_configure () {
138         # Setup these vars for cross building only
139         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
140                 export CC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
141                 export GCC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
142                 export CXX_FOR_TARGET="${CCACHE} ${HOST_PREFIX}g++"
143                 export AS_FOR_TARGET="${HOST_PREFIX}as"
144                 export LD_FOR_TARGET="${HOST_PREFIX}ld"
145                 export NM_FOR_TARGET="${HOST_PREFIX}nm"
146                 export AR_FOR_TARGET="${HOST_PREFIX}ar"
147                 export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
148         fi
149         (cd ${S} && gnu-configize) || die "failure running gnu-configize"
150         oe_runconf
151 }
152
153 do_install () {
154         autotools_do_install
155
156         # Cleanup some of the gcc-lib stuff
157         rm -rf ${D}${libdir}/gcc-lib/${TARGET_SYS}/${PV}/install-tools
158
159         # Move libgcc_s into /lib
160         mkdir -p ${D}${base_libdir}
161         mv -f ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
162         rm -f ${D}${libdir}/libgcc_s.so
163         ln -sf `echo ${libdir}/gcc-lib/${TARGET_SYS}/${PV} | tr -s / |
164                 sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.? \
165                 ${D}${libdir}/gcc-lib/${TARGET_SYS}/${PV}/libgcc_s.so
166
167         # Cleanup manpages..
168         rm -rf ${D}${mandir}/man7
169         mv ${D}${mandir}/man1/cpp.1 \
170            ${D}${mandir}/man1/${TARGET_SYS}-cpp.1
171         mv ${D}${mandir}/man1/gcov.1 \
172            ${D}${mandir}/man1/${TARGET_SYS}-gcov.1
173
174         # We use libiberty from binutils
175         rm -f ${D}${libdir}/libiberty.a
176
177         cd ${D}${bindir}
178
179         # We care about g++ not c++
180         rm -f *c++
181
182         # We don't care about the gcc-<version> ones for this
183         rm -f *gcc-?.?*
184
185         # These sometimes show up, they are strange, we remove them
186         rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
187
188         # Symlinks so we can use these trivially on the target
189         ln -sf ${TARGET_SYS}-g77 g77
190         ln -sf ${TARGET_SYS}-g++ g++
191         ln -sf ${TARGET_SYS}-gcc gcc
192         ln -sf g77 f77
193         ln -sf g++ c++
194         ln -sf gcc cc
195 }