merge of 425cf1b391611c169a1c3b78f1fe86df088902b9
[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 # Called from within gcc-cross, so libdir is set wrong
39 FILES_libg2c-dev = "${libdir}/libg2c.so \
40                     ${libdir}/libg2c.a \
41                     ${libdir}/libfrtbegin.a"
42
43 FILES_g++ = "${bindir}/${TARGET_PREFIX}g++ \
44                    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus"
45 FILES_g++-symlinks = "${bindir}/c++ \
46                             ${bindir}/g++"
47
48 FILES_libstdc++-dev = "${includedir}/c++/${BINV} \
49                        ${libdir}/libstdc++.so \
50                        ${libdir}/libstdc++.la \
51                        ${libdir}/libstdc++.a \
52                        ${libdir}/libsupc++.la \
53                        ${libdir}/libsupc++.a"
54
55 FILES_${PN}-doc = "${infodir} \
56                    ${mandir} \
57                    ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README"
58
59
60 do_install () {
61         autotools_do_install
62
63         # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
64         rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
65         rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
66
67         # Hack around specs file assumptions
68         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
69
70         # Move libgcc_s into /lib
71         mkdir -p ${D}${base_libdir}
72         mv ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
73         rm -f ${D}${libdir}/libgcc_s.so
74         ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \
75                 | tr -s / \
76                 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \
77                       ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so
78
79         # We don't need libtool libraries
80         rm -f ${D}${libdir}/libg2c.la &>/dev/null || true
81
82         # Cleanup manpages..
83         rm -rf ${D}${mandir}/man7
84
85         # We use libiberty from binutils
86         rm -f ${D}${libdir}/libiberty.a
87
88         cd ${D}${bindir}
89
90         # We care about g++ not c++
91         rm -f *c++
92
93         # We don't care about the gcc-<version> ones for this
94         rm -f *gcc-?.?*
95
96         # These sometimes show up, they are strange, we remove them
97         rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
98
99         # Symlinks so we can use these trivially on the target
100         ln -sf ${TARGET_SYS}-g77 g77
101         ln -sf ${TARGET_SYS}-g++ g++
102         ln -sf ${TARGET_SYS}-gcc gcc
103         ln -sf g77 f77
104         ln -sf g++ c++
105         ln -sf gcc cc
106         ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${base_libdir}/cpp
107         ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${bindir}/cpp
108 }