summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-target.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-target.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-target.inc162
1 files changed, 162 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
new file mode 100644
index 0000000000..639b970a57
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,162 @@
1GCCMULTILIB = "--enable-multilib"
2require gcc-configure-common.inc
3
4EXTRA_OECONF_PATHS = " \
5 --with-sysroot=/ \
6 --with-build-sysroot=${STAGING_DIR_TARGET} \
7 --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
8 --with-gxx-include-dir=${includedir}/c++/"
9
10ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ "
11
12PACKAGES = "\
13 ${PN} ${PN}-plugins ${PN}-symlinks \
14 g++ g++-symlinks \
15 cpp cpp-symlinks \
16 g77 g77-symlinks \
17 gfortran gfortran-symlinks \
18 gcov gcov-symlinks \
19 ${PN}-plugin-dev \
20 ${PN}-doc \
21 ${PN}-dev \
22 ${PN}-dbg \
23"
24
25FILES_${PN} = "\
26 ${bindir}/${TARGET_PREFIX}gcc* \
27 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
28 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
29 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
30 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
31 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
32 ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
33 ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
34 ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
35 ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
36 ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
37"
38INSANE_SKIP_${PN} += "dev-so"
39
40FILES_${PN}-dbg += "\
41 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug/ \
42 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug/ \
43"
44FILES_${PN}-dev = "\
45 ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
46 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
47"
48FILES_${PN}-plugin-dev = "\
49 ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
50 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
51 ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
52"
53FILES_${PN}-symlinks = "\
54 ${bindir}/cc \
55 ${bindir}/gcc \
56 ${bindir}/gccbug \
57"
58
59FILES_${PN}-plugins = "\
60 ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
61"
62ALLOW_EMPTY_${PN}-plugins = "1"
63
64FILES_g77 = "\
65 ${bindir}/${TARGET_PREFIX}g77 \
66 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
67"
68FILES_g77-symlinks = "\
69 ${bindir}/g77 \
70 ${bindir}/f77 \
71"
72FILES_gfortran = "\
73 ${bindir}/${TARGET_PREFIX}gfortran \
74 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
75"
76FILES_gfortran-symlinks = "\
77 ${bindir}/gfortran \
78 ${bindir}/f95"
79
80FILES_cpp = "\
81 ${bindir}/${TARGET_PREFIX}cpp \
82 ${base_libdir}/cpp \
83 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
84FILES_cpp-symlinks = "${bindir}/cpp"
85
86FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
87FILES_gcov-symlinks = "${bindir}/gcov"
88
89FILES_g++ = "\
90 ${bindir}/${TARGET_PREFIX}g++ \
91 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
92"
93FILES_g++-symlinks = "\
94 ${bindir}/c++ \
95 ${bindir}/g++ \
96"
97
98
99FILES_${PN}-doc = "\
100 ${infodir} \
101 ${mandir} \
102 ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
103"
104
105FILES_${PN} += "\
106 /usr/lib/gcc/ptest \
107"
108
109do_install () {
110 oe_runmake 'DESTDIR=${D}' install-host
111 # Info dir listing isn't interesting at this point so remove it if it exists.
112 if [ -e "${D}${infodir}/dir" ]; then
113 rm -f ${D}${infodir}/dir
114 fi
115
116 # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
117 rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
118 rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
119 rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
120 rmdir ${D}${includedir}
121 rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
122
123 # Hack around specs file assumptions
124 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
125
126 # Cleanup manpages..
127 rm -rf ${D}${mandir}/man7
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 # We use libiberty from binutils
138 find ${D}${libdir} -name libiberty.a | xargs rm -f
139 find ${D}${libdir} -name libiberty.h | xargs rm -f
140
141 # Not sure why we end up with these but we don't want them...
142 rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
143
144 # Symlinks so we can use these trivially on the target
145 if [ -e ${TARGET_PREFIX}g77 ]; then
146 ln -sf ${TARGET_PREFIX}g77 g77 || true
147 ln -sf g77 f77 || true
148 fi
149 if [ -e ${TARGET_PREFIX}gfortran ]; then
150 ln -sf ${TARGET_PREFIX}gfortran gfortran || true
151 ln -sf gfortran f95 || true
152 fi
153 ln -sf ${TARGET_PREFIX}g++ g++
154 ln -sf ${TARGET_PREFIX}gcc gcc
155 ln -sf ${TARGET_PREFIX}cpp cpp
156 install -d ${D}${base_libdir}
157 ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
158 ln -sf g++ c++
159 ln -sf gcc cc
160
161 chown -R root:root ${D}
162}