[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: Macros for libs
From: |
Kevin Ryde |
Subject: |
Re: RFC: Macros for libs |
Date: |
22 Sep 2001 09:09:42 +1000 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.5 |
Akim Demaille <address@hidden> writes:
>
> m4_define([_AC_LIB_GMP],
> [AC_ARG_WITH(gmp,
> [ --without-gmp don't use GNU multiple precision arithmetic
> library],
> [use_gmp=$withval], [use_gmp=yes])
One possibility would be "detect" as well as "yes" or "no". "yes"
could give a fatal error if it didn't find its prerequisites, "detect"
could just use it if it can find it. The default of course can still
be whichever of the three makes most sense.
"Gary V. Vaughan" <address@hidden> writes:
>
> On Fri, Sep 21, 2001 at 06:48:05PM +0200, Akim Demaille wrote:
>
> > AC_DEFUN([AC_LIB_GMP],
> > [AC_CHECK_HEADERS([gmp.h])
> > AC_CHECK_LIB([gmp], [mpq_init], [GMP_LIB=-lgmp])
>
> This always fails on my machine, because the test program must be
> linked with gmp.h to resolve the mpq_init macro to _gmpq_init.
Yep, __gmpq_init actually. There'll be a note about this in the
manual for the next release.
> Hence, I changed it to:
>
> gmp_save_LIBS="$LIBS"
> LIBS="$LIBS -lgmp"
> AC_TRY_LINK([#if HAVE_GMP_H
> # include <gmp.h>
> #endif],
> [mpq_t n; mpq_init (n);],
> [LIBADD_GMP=-lgmp])
> LIBS="$gmp_save_LIBS"
It'd be nice if AC_CHECK_LIB let you specify some headers.