diff options
25 files changed, 83 insertions, 230 deletions
diff --git a/Makefile.in b/Makefile.in index f0034cb..aa27d61 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,6 +81,7 @@ export LIBS := @LIBS@ export INTL_LIBS := @INTL_LIBS@ export curses_hdr := @ac_ct_curses_hdr@ export gettext := @gettext@ +export CPU_COUNT := @CPU_COUNT@ # config options to push down to kconfig KCONFIG:= @kconfig_options@ @@ -192,6 +193,7 @@ define sed_it -e 's,@@CT_awk@@,$(awk),g;' \ -e 's,@@CT_wget@@,$(wget),g;' \ -e 's,@@CT_curl@@,$(curl),g;' \ + -e 's,@@CT_cpucount@@,$(CPU_COUNT),g;' \ $< >$@ endef diff --git a/configure.ac b/configure.ac index 3c94392..d80a5cd 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,15 @@ ACX_SET_KCONFIG_OPTION([stat_flavor_BSD]) test "$acx_cv_stat_flavor" = "GNU" && stat_flavor_GNU=y ACX_SET_KCONFIG_OPTION([stat_flavor_GNU]) +#Find out how to count CPUs +AC_CACHE_CHECK([whether to use getconf or sysctl to count CPUs], + [acx_cv_cpu_count], + [getconf _NPROCESSORS_ONLN >/dev/null 2>&1 && \ + acx_cv_cpu_count="getconf _NPROCESSORS_ONLN" + sysctl -n hw.ncpu >/dev/null 2>&1 && \ + acx_cv_cpu_count="sysctl -n hw.ncpu"]) +AC_SUBST(CPU_COUNT, "$acx_cv_cpu_count") + #-------------------------------------------------------------------- # Still boring, but remember the path, now... #-------------------------------------------------------------------- diff --git a/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.22/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.22/110-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.22/110-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.23/100-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.23/100-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.23/100-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.24/100-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.24/100-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.24/100-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/patches/glibc/2.25/100-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.25/100-Cygwin-doesnt-have-stat64.patch deleted file mode 100644 index 9097628..0000000 --- a/patches/glibc/2.25/100-Cygwin-doesnt-have-stat64.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100 -+++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100 -@@ -51,6 +51,10 @@ - #include "rpc_scan.h" - #include "proto.h" - -+#if defined(__CYGWIN__) -+#define stat64 stat -+#endif -+ - #include "../version.h" - #define PACKAGE _libc_intl_domainname - diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 4dc7a69..56517d3 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -340,6 +340,7 @@ do_gcc_core_backend() { local complibs local lang_list local cflags + local cflags_for_build local ldflags local build_step local log_txt @@ -579,17 +580,30 @@ do_gcc_core_backend() { CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" + # We may need to modify host/build CFLAGS separately below + cflags_for_build="${cflags}" + # Clang's default bracket-depth is 256, and building GCC # requires somewhere between 257 and 512. - if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then - cflags="$cflags "-fbracket-depth=512 + if [ "${host}" = "${CT_BUILD}" ]; then + if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then + cflags="$cflags "-fbracket-depth=512 + cflags_for_build="$cflags_for_build "-fbracket-depth=512 + fi + else + # FIXME we currently don't support clang as host compiler, only as build + if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then + cflags_for_build="$cflags_for_build "-fbracket-depth=512 + fi fi # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532) CT_DoExecLog CFG \ CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${cflags}" \ + CFLAGS_FOR_BUILD="${cflags_for_build}" \ CXXFLAGS="${cflags}" \ + CXXFLAGS_FOR_BUILD="${cflags_for_build}" \ LDFLAGS="${core_LDFLAGS[*]}" \ CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ @@ -867,6 +881,7 @@ do_gcc_backend() { local complibs local lang_list local cflags + local cflags_for_build local ldflags local build_manuals local -a host_libstdcxx_flags @@ -1102,16 +1117,29 @@ do_gcc_backend() { CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" + # We may need to modify host/build CFLAGS separately below + cflags_for_build="${cflags}" + # Clang's default bracket-depth is 256, and building GCC # requires somewhere between 257 and 512. - if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then - cflags="$cflags "-fbracket-depth=512 + if [ "${host}" = "${CT_BUILD}" ]; then + if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then + cflags="$cflags "-fbracket-depth=512 + cflags_for_build="$cflags_for_build "-fbracket-depth=512 + fi + else + # FIXME we currently don't support clang as host compiler, only as build + if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then + cflags_for_build="$cflags_for_build "-fbracket-depth=512 + fi fi CT_DoExecLog CFG \ CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${cflags}" \ + CFLAGS_FOR_BUILD="${cflags_for_build}" \ CXXFLAGS="${cflags}" \ + CXXFLAGS_FOR_BUILD="${cflags_for_build}" \ LDFLAGS="${final_LDFLAGS[*]}" \ CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ diff --git a/scripts/build/companion_libs/050-zlib.sh b/scripts/build/companion_libs/050-zlib.sh index 6e17819..10779af 100644 --- a/scripts/build/companion_libs/050-zlib.sh +++ b/scripts/build/companion_libs/050-zlib.sh @@ -86,7 +86,7 @@ do_zlib_backend() { CT_DoExecLog CFG \ CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ - CROSS_PREFIX="${host}-" \ + CHOST="${host}" \ ${CONFIG_SHELL} \ "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/configure" \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh index c81874a..e6a4875 100644 --- a/scripts/build/companion_libs/100-gmp.sh +++ b/scripts/build/companion_libs/100-gmp.sh @@ -88,7 +88,10 @@ do_gmp_backend() { extra_config+=("--enable-mpbsd") fi + # FIXME: GMP's configure script doesn't respect the host parameter + # when not cross-compiling, ie when build == host. CT_DoExecLog CFG \ + CC="${host}-gcc" \ CFLAGS="${cflags} -fexceptions" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index 18ada66..95fb72b 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -17,6 +17,9 @@ do_finish() { *darwin*) strip_args="" ;; + *freebsd*) + strip_args="--strip-all" + ;; *) strip_args="--strip-all -v" ;; diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh index 9cfc433..cd4a456 100644 --- a/scripts/build/kernel/linux.sh +++ b/scripts/build/kernel/linux.sh @@ -103,24 +103,28 @@ do_kernel_headers() { esac CT_DoLog EXTRA "Installing kernel headers" - CT_DoExecLog ALL \ - make -C "${kernel_path}" \ - CROSS_COMPILE="${CT_TARGET}-" \ - O="${CT_BUILD_DIR}/build-kernel-headers" \ - ARCH=${kernel_arch} \ - INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ - ${V_OPT} \ + CT_DoExecLog ALL \ + make -C "${kernel_path}" \ + BASH="$(which bash)" \ + HOSTCC="${CT_BUILD}-gcc" \ + CROSS_COMPILE="${CT_TARGET}-" \ + O="${CT_BUILD_DIR}/build-kernel-headers" \ + ARCH=${kernel_arch} \ + INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ + ${V_OPT} \ headers_install if [ "${CT_KERNEL_LINUX_INSTALL_CHECK}" = "y" ]; then CT_DoLog EXTRA "Checking installed headers" - CT_DoExecLog ALL \ - make -C "${kernel_path}" \ - CROSS_COMPILE="${CT_TARGET}-" \ - O="${CT_BUILD_DIR}/build-kernel-headers" \ - ARCH=${kernel_arch} \ - INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ - ${V_OPT} \ + CT_DoExecLog ALL \ + make -C "${kernel_path}" \ + BASH="$(which bash)" \ + HOSTCC="${CT_BUILD}-gcc" \ + CROSS_COMPILE="${CT_TARGET}-" \ + O="${CT_BUILD_DIR}/build-kernel-headers" \ + ARCH=${kernel_arch} \ + INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ + ${V_OPT} \ headers_check fi diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 5a6a8fc..569183a 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -247,6 +247,10 @@ do_libc_backend_once() { [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") touch config.cache + + # Hide host C++ binary from configure + echo "ac_cv_prog_ac_ct_CXX=${CT_TARGET}-g++" >>config.cache + if [ "${CT_LIBC_GLIBC_FORCE_UNWIND}" = "y" ]; then echo "libc_cv_forced_unwind=yes" >>config.cache echo "libc_cv_c_cleanup=yes" >>config.cache @@ -346,13 +350,21 @@ do_libc_backend_once() { build_ldflags="${CT_LDFLAGS_FOR_BUILD}" case "$CT_BUILD" in - *mingw*|*cygwin*|*msys*|*darwin*) + *mingw*|*cygwin*|*msys*|*darwin*|*freebsd*) # When installing headers on Cygwin, Darwin, MSYS2 and MinGW-w64 sunrpc needs # gettext for building cross-rpcgen. build_cppflags="${build_cppflags} -I${CT_BUILDTOOLS_PREFIX_DIR}/include/" build_ldflags="${build_ldflags} -lintl -liconv" + case "$CT_BUILD" in + *cygwin*|*freebsd*) + # Additionally, stat in FreeBSD, Cygwin, and possibly others + # is always 64bit, so replace struct stat64 with stat. + build_cppflags="${build_cppflags} -Dstat64=stat" + ;; + esac ;; esac + extra_make_args+=( "BUILD_CFLAGS=${build_cflags}" ) extra_make_args+=( "BUILD_CPPFLAGS=${build_cppflags}" ) extra_make_args+=( "BUILD_LDFLAGS=${build_ldflags}" ) diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 793c56f..368f9d2 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -227,7 +227,7 @@ CT_SYS_REVISION=$(uname -r) CT_SYS_OS=$(uname -s) CT_SYS_MACHINE=$(uname -m) CT_SYS_PROCESSOR=$(uname -p) -CT_SYS_GCC=$(gcc -dumpversion) +CT_SYS_GCC=$(${CT_BUILD_PREFIX}gcc${CT_BUILD_SUFFIX} -dumpversion) CT_SYS_TARGET=$(CT_DoConfigGuess) CT_TOOLCHAIN_ID="crosstool-${CT_VERSION} build ${CT_STAR_DATE_HUMAN} by ${CT_SYS_USER}@${CT_SYS_HOSTNAME}" @@ -536,7 +536,7 @@ if [ -z "${CT_RESTART}" ]; then fi # Use the number of processors+1 when automatically setting the number of # parallel jobs. Fall back to 1 if the host doesn't use GLIBC. - AUTO_JOBS=$((`getconf _NPROCESSORS_ONLN 2> /dev/null || echo 0` + 1)) + AUTO_JOBS=$((`@@CT_cpucount@@ 2>/dev/null || echo 0` + 1)) [ ${CT_PARALLEL_JOBS} -eq 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${AUTO_JOBS}" [ ${CT_PARALLEL_JOBS} -gt 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${CT_PARALLEL_JOBS}" JOBSFLAGS="${JOBSFLAGS} -l${CT_LOAD}" |