Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require gcc-multilib-config.inc |
| 2 | require gcc-shared-source.inc |
| 3 | # |
| 4 | # Build the list of lanaguages to build. |
| 5 | # |
| 6 | # These can be overridden by the version specific .inc file. |
| 7 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran' |
| 9 | FORTRAN ?= ",f77" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 10 | LANGUAGES ?= "c,c++${FORTRAN}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | |
| 12 | EXTRA_OECONF_BASE ?= "" |
| 13 | EXTRA_OECONF_PATHS ?= "" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
| 15 | GCCMULTILIB ?= "--disable-multilib" |
| 16 | GCCTHREADS ?= "posix" |
| 17 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 18 | GCCPIE ??= "" |
| 19 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 20 | SYMVERS_CONF ?= "--enable-symvers=gnu" |
| 21 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 22 | EXTRA_OECONF = "\ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') != 'no']} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | --with-gnu-ld \ |
| 25 | --enable-shared \ |
| 26 | --enable-languages=${LANGUAGES} \ |
| 27 | --enable-threads=${GCCTHREADS} \ |
| 28 | ${GCCMULTILIB} \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 29 | ${GCCPIE} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | --enable-c99 \ |
| 31 | --enable-long-long \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 32 | ${SYMVERS_CONF} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | --enable-libstdcxx-pch \ |
| 34 | --program-prefix=${TARGET_PREFIX} \ |
| 35 | --without-local-prefix \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 36 | --disable-install-libiberty \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | ${EXTRA_OECONF_BASE} \ |
| 38 | ${EXTRA_OECONF_GCC_FLOAT} \ |
| 39 | ${EXTRA_OECONF_PATHS} \ |
| 40 | ${@get_gcc_mips_plt_setting(bb, d)} \ |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 41 | ${@get_gcc_ppc_plt_settings(bb, d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | ${@get_gcc_multiarch_setting(bb, d)} \ |
| 43 | " |
| 44 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 45 | # glibc version is a minimum controlling whether features are enabled. |
| 46 | # Doesn't need to track glibc exactly |
| 47 | EXTRA_OECONF_append_libc-glibc = " --with-glibc-version=2.28 " |
| 48 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 49 | # Set this here since GCC configure won't auto-detect and enable |
| 50 | # initfini-arry when cross compiling. |
| 51 | EXTRA_OECONF_append = " --enable-initfini-array" |
| 52 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | export gcc_cv_collect2_libs = 'none required' |
| 54 | # We need to set gcc_cv_collect2_libs else there is cross-compilation badness |
| 55 | # in the config.log files (which might not get generated until do_compile |
| 56 | # hence being missed by the insane do_configure check). |
| 57 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | EXTRA_OECONF_append_linux = " --enable-__cxa_atexit" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 59 | |
| 60 | EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" |
| 61 | EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" |
| 62 | EXTRA_OECONF_append_mips64n32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" |
| 63 | EXTRA_OECONF_append_mips64eln32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 64 | EXTRA_OECONF_append_mipsisa32r6el = " --with-abi=32 --with-arch=mips32r6" |
| 65 | EXTRA_OECONF_append_mipsisa32r6 = " --with-abi=32 --with-arch=mips32r6" |
| 66 | EXTRA_OECONF_append_mipsisa64r6el = " --with-abi=64 --with-arch-64=mips64r6" |
| 67 | EXTRA_OECONF_append_mipsisa64r6 = " --with-abi=64 --with-arch-64=mips64r6" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 68 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | EXTRA_OECONF_GCC_FLOAT ??= "" |
| 70 | CPPFLAGS = "" |
| 71 | |
| 72 | SYSTEMHEADERS = "${target_includedir}" |
| 73 | SYSTEMLIBS = "${target_base_libdir}/" |
| 74 | SYSTEMLIBS1 = "${target_libdir}/" |
| 75 | |
| 76 | do_configure_prepend () { |
| 77 | # teach gcc to find correct target includedir when checking libc ssp support |
| 78 | mkdir -p ${B}/gcc |
| 79 | echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe |
| 80 | cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new |
| 81 | cat >>${B}/gcc/defaults.h.new <<_EOF |
| 82 | #define NATIVE_SYSTEM_HEADER_DIR "${SYSTEMHEADERS}" |
| 83 | #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}" |
| 84 | #define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}" |
| 85 | #define SYSTEMLIBS_DIR "${SYSTEMLIBS}" |
| 86 | #endif /* ! GCC_DEFAULTS_H */ |
| 87 | _EOF |
| 88 | mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h |
| 89 | } |
| 90 | |
| 91 | do_configure () { |
| 92 | # Setup these vars for cross building only |
| 93 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the |
| 94 | # gcc build stuff when the build is producing a cross compiler - i.e. |
| 95 | # when the 'current' target is the 'host' system, and the host is not |
| 96 | # the target (because the build is actually making a cross compiler!) |
| 97 | if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then |
| 98 | export CC_FOR_TARGET="${CC}" |
| 99 | export GCC_FOR_TARGET="${CC}" |
| 100 | export CXX_FOR_TARGET="${CXX}" |
| 101 | export AS_FOR_TARGET="${HOST_PREFIX}as" |
| 102 | export LD_FOR_TARGET="${HOST_PREFIX}ld" |
| 103 | export NM_FOR_TARGET="${HOST_PREFIX}nm" |
| 104 | export AR_FOR_TARGET="${HOST_PREFIX}ar" |
| 105 | export GFORTRAN_FOR_TARGET="gfortran" |
| 106 | export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib" |
| 107 | fi |
| 108 | export CC_FOR_BUILD="${BUILD_CC}" |
| 109 | export CXX_FOR_BUILD="${BUILD_CXX}" |
| 110 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" |
| 111 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" |
| 112 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" |
| 113 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" |
| 114 | export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" |
| 115 | export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" |
| 116 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" |
| 117 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" |
| 118 | |
| 119 | |
| 120 | oe_runconf |
| 121 | } |
| 122 | |