conf/distro/jlime-donkey.conf : Added parted & Dialog to distro_rdepends
[vuplus_openembedded] / packages / gcc / gcc_3.3.4.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://arm-gotoff.dpatch;patch=1;pnum=0 \
62            file://arm-ldm.dpatch;patch=1;pnum=0 \
63            file://arm-tune.patch;patch=1;pnum=0 \
64            file://arm-ldm-peephole.patch;patch=1;pnum=0 \
65            file://libibery-crosstool.patch;patch=1;pnum=1 \
66            file://reverse-compare.patch;patch=1 \
67            file://gcc34-15089.patch;patch=1 \
68            file://gcc-uclibc-3.3-100-conf.patch;patch=1 \
69            file://gcc-uclibc-3.3-110-conf.patch;patch=1 \
70            file://gcc-uclibc-3.3-120-softfloat.patch;patch=1 \
71            file://gcc-uclibc-3.3-200-code.patch;patch=1 \
72            file://zecke-xgcc-cpp.patch;patch=1 \
73            file://gcc-com.patch;patch=1 \
74            file://bash3.patch;patch=1"
75
76 PREMIRRORS_prepend () {
77 ${GNU_MIRROR}/gcc/releases/     ftp://gcc.gnu.org/pub/gcc/releases/
78 ${GNU_MIRROR}/gcc/releases/     http://gcc.get-software.com/releases/
79 }
80
81 S = "${WORKDIR}/gcc-${PV}"
82 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
83
84 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
85                 --with-gnu-ld \
86                 --enable-shared \
87                 --enable-multilib \
88                 --enable-target-optspace \
89                 --enable-languages=c,c++,f77 \
90                 --enable-threads=posix \
91                 --enable-c99 \
92                 --enable-long-long \
93                 --enable-symvers=gnu \
94                 --program-prefix=${TARGET_PREFIX} \
95                 ${EXTRA_OECONF_PATHS} \
96                 ${EXTRA_OECONF_DEP}"
97
98 EXTRA_OECONF_PATHS = "--with-local-prefix=${prefix}/local \
99                       --with-gxx-include-dir=${includedir}/c++/${PV}"
100
101 EXTRA_OECONF_DEP = ""
102 EXTRA_OECONF_uclibc = "--disable-__cxa_atexit"
103 EXTRA_OECONF_glibc = "--enable-__cxa_atexit"
104 EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}"
105
106 require gcc-fpu.inc
107
108 python __anonymous () {
109     import bb, re
110     if (re.match('linux-uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None):
111         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_uclibc}', d)
112     elif (re.match('linux$', bb.data.getVar('TARGET_OS', d, 1)) != None):
113         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_glibc}', d)
114 }
115
116 do_configure () {
117         # Setup these vars for cross building only
118         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
119                 export CC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
120                 export GCC_FOR_TARGET="${CCACHE} ${HOST_PREFIX}gcc"
121                 export CXX_FOR_TARGET="${CCACHE} ${HOST_PREFIX}g++"
122                 export AS_FOR_TARGET="${HOST_PREFIX}as"
123                 export LD_FOR_TARGET="${HOST_PREFIX}ld"
124                 export NM_FOR_TARGET="${HOST_PREFIX}nm"
125                 export AR_FOR_TARGET="${HOST_PREFIX}ar"
126                 export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
127         fi
128         (cd ${S} && gnu-configize) || die "failure running gnu-configize"
129         oe_runconf
130 }
131
132 do_install () {
133         autotools_do_install
134
135         # Cleanup some of the gcc-lib stuff
136         rm -rf ${D}${libdir}/gcc-lib/${TARGET_SYS}/${PV}/install-tools
137
138         # Move libgcc_s into /lib
139         mkdir -p ${D}${base_libdir}
140         mv -f ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
141         rm -f ${D}${libdir}/libgcc_s.so
142         ln -sf `echo ${libdir}/gcc-lib/${TARGET_SYS}/${PV} | tr -s / |
143                 sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.? \
144                 ${D}${libdir}/gcc-lib/${TARGET_SYS}/${PV}/libgcc_s.so
145
146         # Cleanup manpages..
147         rm -rf ${D}${mandir}/man7
148         mv ${D}${mandir}/man1/cpp.1 \
149            ${D}${mandir}/man1/${TARGET_SYS}-cpp.1
150         mv ${D}${mandir}/man1/gcov.1 \
151            ${D}${mandir}/man1/${TARGET_SYS}-gcov.1
152
153         # We use libiberty from binutils
154         rm -f ${D}${libdir}/libiberty.a
155
156         cd ${D}${bindir}
157
158         # We care about g++ not c++
159         rm -f *c++
160
161         # We don't care about the gcc-<version> ones for this
162         rm -f *gcc-?.?*
163
164         # These sometimes show up, they are strange, we remove them
165         rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
166
167         # Symlinks so we can use these trivially on the target
168         ln -sf ${TARGET_SYS}-g77 g77
169         ln -sf ${TARGET_SYS}-g++ g++
170         ln -sf ${TARGET_SYS}-gcc gcc
171         ln -sf g77 f77
172         ln -sf g++ c++
173         ln -sf gcc cc
174 }