[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to write a 'configure.ac' for an* optional* support of libguile.
From: |
Ludovic Courtès |
Subject: |
Re: how to write a 'configure.ac' for an* optional* support of libguile. |
Date: |
Fri, 15 Dec 2017 23:51:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
Pierre Lindenbaum <address@hidden> skribis:
> AC_MSG_CHECKING(for Guile)
> guile-config link > /dev/null || {
> echo "configure: cannot find guile-config; is Guile installed?" 1>&2
> exit 1
> }
> CFLAGS="$CFLAGS `guile-config compile`"
> LDFLAGS="$LDFLAGS `guile-config link`"
> AC_DEFINE([HAVE_GUILE],[1],[Guile supported])
>
> #PKG_CHECK_MODULES([GUILE],[guile-2.0])
> #AC_CHECK_HEADERS([libguile.h], [], [AC_MSG_ERROR([guile include files
> not found])])
> #AC_CHECK_LIB([guile], [scm_with_guile], [AC_MSG_ERROR([guile library
> files not found])])
‘guile-config’ is deprecated. ‘PKG_CHECK_MODULES’ works, but the
recommended approach is to use the ‘GUILE_PKG’ Autoconf macro, as in:
dnl Try Guile 2.2, then 2.0.
dnl https://www.gnu.org/software/guile/manual/html_node/Autoconf-Macros.html
GUILE_PKG([2.2 2.0])
When you do that you can omit ‘AC_CHECK_HEADERS’ and ‘AC_CHECK_LIB’.
For more details I’d suggest looking at existing code such as
guile-ncurses, GnuTLS, etc.
HTH!
Ludo’.