diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-configure-common.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-configure-common.inc | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc index f7b5836c4f..9f5ba335c0 100644 --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc | |||
@@ -61,6 +61,34 @@ SYSTEMHEADERS = "${target_includedir}" | |||
61 | SYSTEMLIBS = "${target_base_libdir}/" | 61 | SYSTEMLIBS = "${target_base_libdir}/" |
62 | SYSTEMLIBS1 = "${target_libdir}/" | 62 | SYSTEMLIBS1 = "${target_libdir}/" |
63 | 63 | ||
64 | do_configure_prepend () { | ||
65 | # Change the default dynamic linker path, only useful for SDK, other's value | ||
66 | # are not changed according to the SYSTEMLIBS_DIR | ||
67 | sed -i ${S}/gcc/config/*/linux*.h -e \ | ||
68 | 's#\(GLIBC_DYNAMIC_LINKER[^ ]*\)\( *"/lib.*\)#\1 SYSTEMLIBS_DIR\2#' | ||
69 | |||
70 | SYSTEMLIBS_DIR=`dirname ${SYSTEMLIBS}` | ||
71 | [ "$SYSTEMLIBS_DIR" = "/" ] && SYSTEMLIBS_DIR="" | ||
72 | # teach gcc to find correct target includedir when checking libc ssp support | ||
73 | mkdir -p ${B}/gcc | ||
74 | echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe | ||
75 | cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new | ||
76 | cat >>${B}/gcc/defaults.h.new <<_EOF | ||
77 | #ifndef STANDARD_INCLUDE_DIR | ||
78 | #define STANDARD_INCLUDE_DIR "${SYSTEMHEADERS}" | ||
79 | #endif | ||
80 | #ifndef STANDARD_STARTFILE_PREFIX_1 | ||
81 | #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}" | ||
82 | #endif | ||
83 | #ifndef STANDARD_STARTFILE_PREFIX_2 | ||
84 | #define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}" | ||
85 | #endif | ||
86 | #define SYSTEMLIBS_DIR "$SYSTEMLIBS_DIR" | ||
87 | #endif /* ! GCC_DEFAULTS_H */ | ||
88 | _EOF | ||
89 | mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h | ||
90 | } | ||
91 | |||
64 | do_configure () { | 92 | do_configure () { |
65 | # Setup these vars for cross building only | 93 | # Setup these vars for cross building only |
66 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the | 94 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the |
@@ -86,27 +114,7 @@ do_configure () { | |||
86 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | 114 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" |
87 | export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" | 115 | export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" |
88 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | 116 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" |
89 | |||
90 | # teach gcc to find correct target includedir when checking libc ssp support | ||
91 | sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure.ac | ||
92 | sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure | ||
93 | 117 | ||
94 | # splice our idea of where the headers live into gcc's world | ||
95 | echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe | ||
96 | sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new | ||
97 | mv ${S}/gcc/Makefile.in.new ${S}/gcc/Makefile.in | ||
98 | cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${S}/gcc/defaults.h.new | ||
99 | echo "#ifndef STANDARD_INCLUDE_DIR" >> ${S}/gcc/defaults.h.new | ||
100 | echo "#define STANDARD_INCLUDE_DIR \"${SYSTEMHEADERS}\"" >> ${S}/gcc/defaults.h.new | ||
101 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
102 | echo "#ifndef STANDARD_STARTFILE_PREFIX_1" >> ${S}/gcc/defaults.h.new | ||
103 | echo "#define STANDARD_STARTFILE_PREFIX_1 \"${SYSTEMLIBS}\"" >> ${S}/gcc/defaults.h.new | ||
104 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
105 | echo "#ifndef STANDARD_STARTFILE_PREFIX_2" >> ${S}/gcc/defaults.h.new | ||
106 | echo "#define STANDARD_STARTFILE_PREFIX_2 \"${SYSTEMLIBS1}\"" >> ${S}/gcc/defaults.h.new | ||
107 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
108 | echo "#endif /* ! GCC_DEFAULTS_H */" >> ${S}/gcc/defaults.h.new | ||
109 | mv ${S}/gcc/defaults.h.new ${S}/gcc/defaults.h | ||
110 | oe_runconf | 118 | oe_runconf |
111 | } | 119 | } |
112 | 120 | ||