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.inc154
1 files changed, 154 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..e1179ac292
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,154 @@
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
105do_install () {
106 oe_runmake 'DESTDIR=${D}' install-host
107
108 # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
109 rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
110 rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
111 rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
112 rmdir ${D}${includedir}
113 rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
114
115 # Hack around specs file assumptions
116 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
117
118 # Cleanup manpages..
119 rm -rf ${D}${mandir}/man7
120
121 cd ${D}${bindir}
122
123 # We care about g++ not c++
124 rm -f *c++
125
126 # We don't care about the gcc-<version> ones for this
127 rm -f *gcc-?.?*
128
129 # We use libiberty from binutils
130 find ${D}${libdir} -name libiberty.a | xargs rm -f
131 find ${D}${libdir} -name libiberty.h | xargs rm -f
132
133 # Not sure why we end up with these but we don't want them...
134 rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
135
136 # Symlinks so we can use these trivially on the target
137 if [ -e ${TARGET_PREFIX}g77 ]; then
138 ln -sf ${TARGET_PREFIX}g77 g77 || true
139 ln -sf g77 f77 || true
140 fi
141 if [ -e ${TARGET_PREFIX}gfortran ]; then
142 ln -sf ${TARGET_PREFIX}gfortran gfortran || true
143 ln -sf gfortran f95 || true
144 fi
145 ln -sf ${TARGET_PREFIX}g++ g++
146 ln -sf ${TARGET_PREFIX}gcc gcc
147 ln -sf ${TARGET_PREFIX}cpp cpp
148 install -d ${D}${base_libdir}
149 ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
150 ln -sf g++ c++
151 ln -sf gcc cc
152
153 chown -R root:root ${D}
154}