This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix binutils/gold build on NetBSD
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: Arnaud Lacombe <lacombar at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Sun, 5 Dec 2010 21:04:10 +0100
- Subject: Re: [PATCH] Fix binutils/gold build on NetBSD
- References: <1291438024-7921-1-git-send-email-lacombar@gmail.com>
Hello Arnaud,
* Arnaud Lacombe wrote on Sat, Dec 04, 2010 at 05:47:04AM CET:
> --- a/gold/configure.ac
> +++ b/gold/configure.ac
> @@ -395,6 +395,17 @@ AC_SUBST(LFS_CFLAGS)
> AC_CHECK_FUNCS(chsize)
> AC_REPLACE_FUNCS(pread ftruncate mremap ffsll)
>
> +AC_COMPILE_IFELSE([
> +AC_LANG_PROGRAM([[
> +#include <sys/mman.h>
> +#ifndef MREMAP_MAYMOVE
> +#error "MREMAP_MAYMOVE not defined."
It's actually more portable to write
choke me
or
MREMAP_MAYMOVE not defined.
as some compilers only warn over #error, see 'info Autoconf "C
Compiler"'.
> +#endif
> +]])],
If you wrap the whole testing part above in AC_CACHE_CHECK
with a suitable cache variable, and do the actions below:
> +[AC_DEFINE(HAVE_MREMAP_MAYMOVE, 1,
> +[Define to 1 if mremap(2) support the MREMAP_MAYMOVE flag.])],
> +[AC_LIBOBJ(mremap)])
only if that variable has the desired result, then both reruns of
configure are faster, and users can override the result of your test on
systems where it might fail (due to, e.g., portability issues like
above).
Cheers,
Ralf