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