diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-22 09:52:53 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-23 16:20:13 +0100 |
commit | 8b855ad32d92f574e5781b89a7653009181cf3da (patch) | |
tree | a37c5d69c4835797c1b56437b9f4ac6fdd380fe8 /meta/recipes-devtools/gcc/gcc-cross-canadian.inc | |
parent | aa77ec7eef910635a5882aa83bbd96f13676d8d0 (diff) | |
download | poky-8b855ad32d92f574e5781b89a7653009181cf3da.tar.gz |
gcc-cross-canadian: Fold configure-sdk and package-sdk into the main .inc
This also has the advantage of removing the confusing sdk naming which
has been purged everywhere else in favour of cross-canadian.
(From OE-Core rev: cbb63ca9e7e6d397198808e862f812f1012c74a7)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross-canadian.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 127 |
1 files changed, 125 insertions, 2 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc index 85c3166424..5908e72099 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc | |||
@@ -8,8 +8,131 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}binutils-crosssdk v | |||
8 | 8 | ||
9 | GCCMULTILIB = "--enable-multilib" | 9 | GCCMULTILIB = "--enable-multilib" |
10 | 10 | ||
11 | require gcc-configure-sdk.inc | 11 | require gcc-configure-common.inc |
12 | require gcc-package-sdk.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 | |||
18 | # | ||
19 | # gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky | ||
20 | # for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse. | ||
21 | # | ||
22 | export AR_FOR_TARGET = "${TARGET_PREFIX}ar" | ||
23 | export AS_FOR_TARGET = "${TARGET_PREFIX}as" | ||
24 | export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool" | ||
25 | export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" | ||
26 | export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" | ||
27 | export LD_FOR_TARGET = "${TARGET_PREFIX}ld" | ||
28 | export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo" | ||
29 | export NM_FOR_TARGET = "${TARGET_PREFIX}nm" | ||
30 | export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump" | ||
31 | export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" | ||
32 | export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip" | ||
33 | export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres" | ||
34 | |||
35 | # | ||
36 | # We need to override this and make sure the compiler can find staging | ||
37 | # | ||
38 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}" | ||
39 | |||
40 | do_configure () { | ||
41 | export CC_FOR_BUILD="${BUILD_CC}" | ||
42 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
43 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
44 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
45 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
46 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
47 | export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" | ||
48 | export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" | ||
49 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" | ||
50 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" | ||
51 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | ||
52 | oe_runconf | ||
53 | } | ||
54 | |||
55 | do_compile () { | ||
56 | oe_runmake all-host | ||
57 | } | ||
58 | |||
59 | INHIBIT_PACKAGE_STRIP = "1" | ||
60 | |||
61 | # Having anything auto depending on gcc-cross-sdk is a really bad idea... | ||
62 | EXCLUDE_FROM_SHLIBS = "1" | ||
63 | |||
64 | PACKAGES = "${PN} ${PN}-doc" | ||
65 | |||
66 | FILES_${PN} = "\ | ||
67 | ${bindir}/* \ | ||
68 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \ | ||
69 | ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \ | ||
70 | ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \ | ||
71 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \ | ||
72 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include \ | ||
73 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \ | ||
74 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \ | ||
75 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \ | ||
76 | ${includedir}/c++/${BINV} \ | ||
77 | ${prefix}/${TARGET_SYS}/bin/* \ | ||
78 | ${prefix}/${TARGET_SYS}/lib/* \ | ||
79 | ${prefix}/${TARGET_SYS}/usr/include/* \ | ||
80 | " | ||
81 | INSANE_SKIP_${PN} += "dev-so" | ||
82 | |||
83 | FILES_${PN}-doc = "\ | ||
84 | ${infodir} \ | ||
85 | ${mandir} \ | ||
86 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ | ||
87 | " | ||
88 | |||
89 | EXEEXT = "" | ||
90 | |||
91 | # Compute how to get from libexecdir to bindir in python (easier than shell) | ||
92 | BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}" | ||
93 | |||
94 | do_install () { | ||
95 | oe_runmake 'DESTDIR=${D}' install-host | ||
96 | |||
97 | # Cleanup some of the ${libdir}{,exec}/gcc stuff ... | ||
98 | rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
99 | rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
100 | |||
101 | # We care about g++ not c++ | ||
102 | rm -f ${D}${bindir}/*c++ | ||
103 | |||
104 | # We don't care about the gcc-<version> copies | ||
105 | rm -f ${D}${bindir}/*gcc-?.?* | ||
106 | |||
107 | # We use libiberty from binutils | ||
108 | rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a | ||
109 | # Not sure where the strange paths come from | ||
110 | rm -f ${D}${libdir}/../lib/libiberty.a | ||
111 | rm -f ${D}${libdir}/libiberty.a | ||
112 | |||
113 | # Cleanup empty directories which are not shipped | ||
114 | # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted | ||
115 | # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686 | ||
116 | local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}" | ||
117 | for i in $empty_dirs; do | ||
118 | [ -d $i ] && rmdir --ignore-fail-on-non-empty $i | ||
119 | done | ||
120 | |||
121 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are | ||
122 | # found. | ||
123 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ | ||
124 | install -d $dest | ||
125 | suffix=${EXEEXT} | ||
126 | for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do | ||
127 | if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then | ||
128 | continue | ||
129 | fi | ||
130 | |||
131 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix | ||
132 | done | ||
133 | |||
134 | chown -R root:root ${D} | ||
135 | } | ||
13 | 136 | ||
14 | ELFUTILS = "nativesdk-elfutils" | 137 | ELFUTILS = "nativesdk-elfutils" |
15 | DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" | 138 | DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" |