conf/distro/jlime-donkey.conf : Added parted & Dialog to distro_rdepends
[vuplus_openembedded] / packages / gcc / gcc-package.inc
1 gcclibdir ?= "${libdir}/gcc"
2 BINV ?= "${PV}"
3
4 # libgcc libstdc++ libg2c are listed in our FILES_*, but are actually
5 # packaged in the respective cross packages.
6 PACKAGES = "${PN} ${PN}-symlinks \
7             g++ g++-symlinks \
8             cpp cpp-symlinks \
9             g77 g77-symlinks \
10             gcov gcov-symlinks \
11             libstdc++-dev libg2c-dev \
12             ${PN}-doc"
13
14 FILES_${PN} = "${bindir}/${TARGET_PREFIX}gcc \
15                ${bindir}/${TARGET_PREFIX}gccbug \
16                ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1 \
17                ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
18                ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
19                ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
20                ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \
21                ${gcclibdir}/${TARGET_SYS}/${BINV}/include"
22 FILES_${PN}-symlinks = "${bindir}/cc \
23                         ${bindir}/gcc \
24                         ${bindir}/gccbug"
25
26 FILES_g77 = "${bindir}/${TARGET_PREFIX}g77 \
27                    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771"
28 FILES_g77-symlinks = "${bindir}/g77 \
29                             ${bindir}/f77"
30
31 FILES_cpp = "${bindir}/${TARGET_PREFIX}cpp \
32              ${base_libdir}/cpp"
33 FILES_cpp-symlinks = "${bindir}/cpp"
34
35 FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
36 FILES_gcov-symlinks = "${bindir}/gcov"
37
38 PACKAGE_ARCH_libg2c-dev = "${TARGET_ARCH}"
39 # Called from within gcc-cross, so libdir is set wrong
40 FILES_libg2c-dev = "${libdir}/libg2c.so \
41                     ${libdir}/libg2c.a \
42                     ${libdir}/libfrtbegin.a"
43
44 FILES_g++ = "${bindir}/${TARGET_PREFIX}g++ \
45                    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus"
46 FILES_g++-symlinks = "${bindir}/c++ \
47                             ${bindir}/g++"
48
49 PACKAGE_ARCH_libstdc++-dev = "${TARGET_ARCH}"
50 FILES_libstdc++-dev = "${includedir}/c++/${BINV} \
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                    ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README"
60
61
62 do_install () {
63         autotools_do_install
64
65         # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
66         rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
67         rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
68
69         # Hack around specs file assumptions
70         test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
71
72         # Move libgcc_s into /lib
73         mkdir -p ${D}${base_libdir}
74         mv ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
75         rm -f ${D}${libdir}/libgcc_s.so
76         ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \
77                 | tr -s / \
78                 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \
79                       ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so
80
81         # We don't need libtool libraries
82         rm -f ${D}${libdir}/libg2c.la &>/dev/null || true
83
84         # Cleanup manpages..
85         rm -rf ${D}${mandir}/man7
86
87         # We use libiberty from binutils
88         rm -f ${D}${libdir}/libiberty.a
89
90         cd ${D}${bindir}
91
92         # We care about g++ not c++
93         rm -f *c++
94
95         # We don't care about the gcc-<version> ones for this
96         rm -f *gcc-?.?*
97
98         # These sometimes show up, they are strange, we remove them
99         rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
100
101         # Symlinks so we can use these trivially on the target
102         ln -sf ${TARGET_SYS}-g77 g77
103         ln -sf ${TARGET_SYS}-g++ g++
104         ln -sf ${TARGET_SYS}-gcc gcc
105         ln -sf g77 f77
106         ln -sf g++ c++
107         ln -sf gcc cc
108         ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${base_libdir}/cpp
109         ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${bindir}/cpp
110 }