merge of '178eac00dc5aa8338d42e8e203633bec7817bbf6'
[vuplus_openembedded] / packages / gcc / gcc-package-target.inc
1 PACKAGES = "\
2   libgcc ${PN} ${PN}-symlinks \
3   g++ g++-symlinks \
4   cpp cpp-symlinks \
5   g77 g77-symlinks \
6   gfortran gfortran-symlinks \
7   gcov gcov-symlinks \
8   libmudflap libmudflap-dev \
9   libstdc++ libg2c \
10   libstdc++-dev libg2c-dev \
11   ${PN}-doc \
12 "
13
14 FILES_${PN} = "\
15   ${bindir}/${TARGET_PREFIX}gcc \
16   ${bindir}/${TARGET_PREFIX}gccbug \
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 "
23 FILES_${PN}-symlinks = "\
24   ${bindir}/cc \
25   ${bindir}/gcc \
26   ${bindir}/gccbug \
27 "
28
29 FILES_g77 = "\
30   ${bindir}/${TARGET_PREFIX}g77 \
31   ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
32 "
33 FILES_g77-symlinks = "\
34   ${bindir}/g77 \
35   ${bindir}/f77 \
36 "
37 FILES_gfortran = "\
38   ${bindir}/${TARGET_PREFIX}gfortran \
39   ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
40 "
41 FILES_gfortran-symlinks = "\
42   ${bindir}/gfortran \
43   ${bindir}/f95"
44
45 FILES_cpp = "\
46   ${bindir}/${TARGET_PREFIX}cpp \
47   ${base_libdir}/cpp \
48   ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
49 FILES_cpp-symlinks = "${bindir}/cpp"
50
51 FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
52 FILES_gcov-symlinks = "${bindir}/gcov"
53
54 FILES_libgcc = "${base_libdir}/libgcc*.so.*"
55 FILES_libgcc-dev = "${base_libdir}/libgcc*.so"
56
57 # Called from within gcc-cross, so libdir is set wrong
58 FILES_libg2c = "${target_libdir}/libg2c.so.*"
59 FILES_libg2c-dev = "\
60   ${libdir}/libg2c.so \
61   ${libdir}/libg2c.a \
62   ${libdir}/libfrtbegin.a \
63 "
64
65 FILES_g++ = "\
66   ${bindir}/${TARGET_PREFIX}g++ \
67   ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
68 "
69 FILES_g++-symlinks = "\
70   ${bindir}/c++ \
71   ${bindir}/g++ \
72 "
73
74 FILES_libstdc++ = "${libdir}/libstdc++.so.*"
75 FILES_libstdc++-dev = "\
76   ${includedir}/c++/${BINV} \
77   ${libdir}/libstdc++.so \
78   ${libdir}/libstdc++.la \
79   ${libdir}/libstdc++.a \
80   ${libdir}/libsupc++.la \
81   ${libdir}/libsupc++.a \
82 "
83
84 FILES_libmudflap = "${libdir}/libmudflap*.so.*"
85 FILES_libmudflap-dev = "\
86   ${libdir}/libmudflap*.so \
87   ${libdir}/libmudflap*.a \
88   ${libdir}/libmudflap*.a \
89 "
90
91 FILES_${PN}-doc = "\
92   ${infodir} \
93   ${mandir} \
94   ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
95 "
96
97 do_install () {
98         autotools_do_install
99
100         # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
101         rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
102         rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
103
104         # Hack around specs file assumptions
105         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
106
107         # Move libgcc_s into /lib
108         mkdir -p ${D}${base_libdir}
109         if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
110                 mv ${D}${libdir}/nof/libgcc_s.so.* ${D}${base_libdir}
111         else
112                 mv ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
113         fi
114         rm -f ${D}${libdir}/libgcc_s.so
115         ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \
116                 | tr -s / \
117                 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \
118                       ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so
119
120         # We don't need libtool libraries
121         rm -f ${D}${libdir}/libg2c.la &>/dev/null || true
122
123         # Cleanup manpages..
124         rm -rf ${D}${mandir}/man7
125
126         # We use libiberty from binutils
127         rm -f ${D}${libdir}/libiberty.a
128
129         cd ${D}${bindir}
130
131         # We care about g++ not c++
132         rm -f *c++
133
134         # We don't care about the gcc-<version> ones for this
135         rm -f *gcc-?.?*
136
137         # These sometimes show up, they are strange, we remove them
138         rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
139
140         # Symlinks so we can use these trivially on the target
141         ln -sf ${TARGET_SYS}-g77 g77 || true
142         ln -sf ${TARGET_SYS}-gfortran gfortran || true
143         ln -sf ${TARGET_SYS}-g++ g++
144         ln -sf ${TARGET_SYS}-gcc gcc
145         ln -sf g77 f77 || true
146         ln -sf gfortran f95 || true
147         ln -sf g++ c++
148         ln -sf gcc cc
149         ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${base_libdir}/cpp
150         ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${bindir}/cpp
151 }