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.inc180
1 files changed, 180 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..4a76d02cb1
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,180 @@
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++/${BINV} \
9"
10
11EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
12
13EXTRA_OECONF_GCC_FLOAT = "${@get_gcc_float_setting(bb, d)}"
14
15PACKAGES = "\
16 ${PN} ${PN}-plugins ${PN}-symlinks \
17 g++ g++-symlinks \
18 cpp cpp-symlinks \
19 g77 g77-symlinks \
20 gfortran gfortran-symlinks \
21 gcov gcov-symlinks \
22 ${PN}-plugin-dev \
23 ${PN}-doc \
24 ${PN}-dev \
25 ${PN}-dbg \
26"
27
28FILES_${PN} = "\
29 ${bindir}/${TARGET_PREFIX}gcc* \
30 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
31 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
32 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
33 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
34 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
35 ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
36 ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
37 ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
38 ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
39 ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
40"
41INSANE_SKIP_${PN} += "dev-so"
42
43FILES_${PN}-dbg += "\
44 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug/ \
45 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug/ \
46"
47FILES_${PN}-dev = "\
48 ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
49 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
50"
51FILES_${PN}-plugin-dev = "\
52 ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
53 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
54 ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
55"
56FILES_${PN}-symlinks = "\
57 ${bindir}/cc \
58 ${bindir}/gcc \
59 ${bindir}/gccbug \
60"
61
62FILES_${PN}-plugins = "\
63 ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
64"
65ALLOW_EMPTY_${PN}-plugins = "1"
66
67FILES_g77 = "\
68 ${bindir}/${TARGET_PREFIX}g77 \
69 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
70"
71FILES_g77-symlinks = "\
72 ${bindir}/g77 \
73 ${bindir}/f77 \
74"
75FILES_gfortran = "\
76 ${bindir}/${TARGET_PREFIX}gfortran \
77 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
78"
79FILES_gfortran-symlinks = "\
80 ${bindir}/gfortran \
81 ${bindir}/f95"
82
83FILES_cpp = "\
84 ${bindir}/${TARGET_PREFIX}cpp \
85 ${base_libdir}/cpp \
86 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
87FILES_cpp-symlinks = "${bindir}/cpp"
88
89FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
90FILES_gcov-symlinks = "${bindir}/gcov"
91
92FILES_g++ = "\
93 ${bindir}/${TARGET_PREFIX}g++ \
94 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
95"
96FILES_g++-symlinks = "\
97 ${bindir}/c++ \
98 ${bindir}/g++ \
99"
100
101FILES_${PN}-doc = "\
102 ${infodir} \
103 ${mandir} \
104 ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
105"
106
107FILES_${PN} += "\
108 /usr/lib/gcc/ptest \
109"
110do_compile () {
111 oe_runmake all-host
112}
113
114do_install () {
115 oe_runmake 'DESTDIR=${D}' install-host
116
117 # Add unwind.h, it comes from libgcc which we don't want to build again
118 install ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
119
120 # Info dir listing isn't interesting at this point so remove it if it exists.
121 if [ -e "${D}${infodir}/dir" ]; then
122 rm -f ${D}${infodir}/dir
123 fi
124
125 # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
126 rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
127 rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
128 rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
129 rmdir ${D}${includedir}
130 rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
131
132 # Hack around specs file assumptions
133 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
134
135 # Cleanup manpages..
136 rm -rf ${D}${mandir}/man7
137
138 cd ${D}${bindir}
139
140 # We care about g++ not c++
141 rm -f *c++
142
143 # We don't care about the gcc-<version> ones for this
144 rm -f *gcc-?.?*
145
146 # We use libiberty from binutils
147 find ${D}${libdir} -name libiberty.a | xargs rm -f
148 find ${D}${libdir} -name libiberty.h | xargs rm -f
149
150 # Not sure why we end up with these but we don't want them...
151 rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
152
153 # Symlinks so we can use these trivially on the target
154 if [ -e ${TARGET_PREFIX}g77 ]; then
155 ln -sf ${TARGET_PREFIX}g77 g77 || true
156 ln -sf g77 f77 || true
157 fi
158 if [ -e ${TARGET_PREFIX}gfortran ]; then
159 ln -sf ${TARGET_PREFIX}gfortran gfortran || true
160 ln -sf gfortran f95 || true
161 fi
162 ln -sf ${TARGET_PREFIX}g++ g++
163 ln -sf ${TARGET_PREFIX}gcc gcc
164 ln -sf ${TARGET_PREFIX}cpp cpp
165 install -d ${D}${base_libdir}
166 ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
167 ln -sf g++ c++
168 ln -sf gcc cc
169
170 chown -R root:root ${D}
171}
172
173# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross
174# and one from here. These can confuse gcc cross where includes use #include_next
175# and builds track file dependencies (e.g. perl and its makedepends code).
176# For determinism we don't install this ever and rely on the copy from gcc-cross.
177# [YOCTO #7287]
178sysroot_stage_dirs_append () {
179 rm -rf $to${libdir}/gcc
180}