From f2f782dd1cf2b4ccb6f28f6113e7fedb23f078d6 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Thu, 17 Nov 2016 18:57:28 -0600 Subject: Bring in FreeBSD support Check for FreeBSD specific issues, it is mostly the same as Darwin. Signed-off-by: Dan McGregor --- scripts/build/libc/glibc.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts/build/libc') diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index c12a5530..25687ce9 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -346,13 +346,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}" ) -- cgit v1.2.3 From c88621f74005dcbbc9787c1cae33c5751ec5ef81 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Wed, 1 Mar 2017 04:10:37 -0600 Subject: glibc: hide native c++ executable from build If glibc's configure finds the host c++ executable it assumes that c++ should be enabled for the build. In case we don't have cross g++ built yet (ie, for headers), this causes the build to fail creating C++ headers. So hide C++ from the build. Signed-off-by: Dan McGregor --- scripts/build/libc/glibc.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/build/libc') diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 25687ce9..52074579 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 -- cgit v1.2.3