diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 14:36:22 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 15:32:53 +0200 |
commit | f4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch) | |
tree | 487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-devtools/gcc/gcc-cross-canadian.inc | |
download | poky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz |
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross-canadian.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc new file mode 100644 index 0000000000..89f8dc53e5 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc | |||
@@ -0,0 +1,157 @@ | |||
1 | inherit cross-canadian | ||
2 | |||
3 | SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)" | ||
4 | PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" | ||
5 | BPN = "gcc" | ||
6 | |||
7 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext" | ||
8 | |||
9 | GCCMULTILIB = "--enable-multilib" | ||
10 | |||
11 | require gcc-configure-common.inc | ||
12 | |||
13 | EXTRA_OECONF_PATHS = "--with-gxx-include-dir=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}${target_includedir}/c++ \ | ||
14 | --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \ | ||
15 | --with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \ | ||
16 | --with-build-sysroot=${STAGING_DIR_TARGET}" | ||
17 | # We have to point gcc at a sysroot but we don't need to rebuild if this changes | ||
18 | # e.g. we switch between different machines with different tunes. | ||
19 | EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH" | ||
20 | TARGET_ARCH[vardepsexclude] = "TUNE_ARCH" | ||
21 | get_gcc_fpu_setting[vardepvalue] = "" | ||
22 | |||
23 | # | ||
24 | # gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky | ||
25 | # for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse. | ||
26 | # | ||
27 | export AR_FOR_TARGET = "${TARGET_PREFIX}ar" | ||
28 | export AS_FOR_TARGET = "${TARGET_PREFIX}as" | ||
29 | export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool" | ||
30 | export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" | ||
31 | export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" | ||
32 | export LD_FOR_TARGET = "${TARGET_PREFIX}ld" | ||
33 | export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo" | ||
34 | export NM_FOR_TARGET = "${TARGET_PREFIX}nm" | ||
35 | export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump" | ||
36 | export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" | ||
37 | export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip" | ||
38 | export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres" | ||
39 | |||
40 | # | ||
41 | # We need to override this and make sure the compiler can find staging | ||
42 | # | ||
43 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}" | ||
44 | |||
45 | do_configure () { | ||
46 | export CC_FOR_BUILD="${BUILD_CC}" | ||
47 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
48 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
49 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
50 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
51 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
52 | export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" | ||
53 | export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" | ||
54 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" | ||
55 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" | ||
56 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | ||
57 | oe_runconf | ||
58 | } | ||
59 | |||
60 | do_compile () { | ||
61 | oe_runmake all-host | ||
62 | } | ||
63 | |||
64 | INHIBIT_PACKAGE_STRIP = "1" | ||
65 | |||
66 | # Having anything auto depending on gcc-cross-sdk is a really bad idea... | ||
67 | EXCLUDE_FROM_SHLIBS = "1" | ||
68 | |||
69 | PACKAGES = "${PN} ${PN}-doc" | ||
70 | |||
71 | FILES_${PN} = "\ | ||
72 | ${bindir}/* \ | ||
73 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \ | ||
74 | ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \ | ||
75 | ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \ | ||
76 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \ | ||
77 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include \ | ||
78 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \ | ||
79 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \ | ||
80 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \ | ||
81 | ${includedir}/c++/${BINV} \ | ||
82 | ${prefix}/${TARGET_SYS}/bin/* \ | ||
83 | ${prefix}/${TARGET_SYS}/lib/* \ | ||
84 | ${prefix}/${TARGET_SYS}/usr/include/* \ | ||
85 | " | ||
86 | INSANE_SKIP_${PN} += "dev-so" | ||
87 | |||
88 | FILES_${PN}-doc = "\ | ||
89 | ${infodir} \ | ||
90 | ${mandir} \ | ||
91 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ | ||
92 | " | ||
93 | |||
94 | EXEEXT = "" | ||
95 | |||
96 | # Compute how to get from libexecdir to bindir in python (easier than shell) | ||
97 | BINRELPATH = "${@os.path.relpath(d.expand("${bindir}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}" | ||
98 | |||
99 | do_install () { | ||
100 | oe_runmake 'DESTDIR=${D}' install-host | ||
101 | |||
102 | # Cleanup some of the ${libdir}{,exec}/gcc stuff ... | ||
103 | rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
104 | rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
105 | rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude | ||
106 | |||
107 | # We care about g++ not c++ | ||
108 | rm -f ${D}${bindir}/*c++ | ||
109 | |||
110 | # We don't care about the gcc-<version> copies | ||
111 | rm -f ${D}${bindir}/*gcc-?.?* | ||
112 | |||
113 | # We use libiberty from binutils | ||
114 | rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a | ||
115 | # Not sure where the strange paths come from | ||
116 | rm -f ${D}${libdir}/../lib/libiberty.a | ||
117 | rm -f ${D}${libdir}/libiberty.a | ||
118 | |||
119 | # Cleanup empty directories which are not shipped | ||
120 | # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted | ||
121 | # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686 | ||
122 | local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}" | ||
123 | for i in $empty_dirs; do | ||
124 | [ -d $i ] && rmdir --ignore-fail-on-non-empty $i | ||
125 | done | ||
126 | |||
127 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are | ||
128 | # found. | ||
129 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ | ||
130 | install -d $dest | ||
131 | suffix=${EXEEXT} | ||
132 | for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do | ||
133 | if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then | ||
134 | continue | ||
135 | fi | ||
136 | |||
137 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix | ||
138 | done | ||
139 | |||
140 | chown -R root:root ${D} | ||
141 | } | ||
142 | |||
143 | ELFUTILS = "nativesdk-elfutils" | ||
144 | DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" | ||
145 | RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" | ||
146 | |||
147 | SYSTEMHEADERS = "/usr/include" | ||
148 | SYSTEMLIBS = "${target_base_libdir}/" | ||
149 | SYSTEMLIBS1 = "${target_libdir}/" | ||
150 | |||
151 | EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ | ||
152 | --disable-libgomp --disable-libmudflap \ | ||
153 | --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \ | ||
154 | --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}" | ||
155 | |||
156 | # gcc 4.7 needs -isystem | ||
157 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}" | ||