* Makefile.am: let guile-config depend on libguile/libpath.h,
[bpt/guile.git] / guile-config / guile.m4
1 dnl Automake macros for working with Guile.
2 dnl
3 dnl Copyright (C) 1998 Free Software Foundation, Inc.
4 dnl
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 2, or (at your option)
8 dnl any later version.
9 dnl
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 dnl GNU General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this software; see the file COPYING. If not, write to
17 dnl the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 dnl Boston, MA 02111-1307 USA
19 dnl
20 dnl As a special exception, the Free Software Foundation gives permission
21 dnl for additional uses of the text contained in its release of GUILE.
22 dnl
23 dnl The exception is that, if you link the GUILE library with other files
24 dnl to produce an executable, this does not by itself cause the
25 dnl resulting executable to be covered by the GNU General Public License.
26 dnl Your use of that executable is in no way restricted on account of
27 dnl linking the GUILE library code into it.
28 dnl
29 dnl This exception does not however invalidate any other reasons why
30 dnl the executable file might be covered by the GNU General Public License.
31 dnl
32 dnl This exception applies only to the code released by the
33 dnl Free Software Foundation under the name GUILE. If you copy
34 dnl code from other Free Software Foundation releases into a copy of
35 dnl GUILE, as the General Public License permits, the exception does
36 dnl not apply to the code that you add in this way. To avoid misleading
37 dnl anyone as to the status of such modified files, you must delete
38 dnl this exception notice from them.
39 dnl
40 dnl If you write modifications of your own for GUILE, it is your choice
41 dnl whether to permit this exception to apply to your modifications.
42 dnl If you do not wish that, delete this exception notice.
43
44
45 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
46 dnl
47 dnl This macro runs the `guile-config' script, installed with Guile,
48 dnl to find out where Guile's header files and libraries are
49 dnl installed. It sets two variables, marked for substitution, as
50 dnl by AC_SUBST.
51 dnl
52 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
53 dnl code that uses Guile header files. This is almost
54 dnl always just a -I flag.
55 dnl
56 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
57 dnl program against Guile. This includes `-lguile' for
58 dnl the Guile library itself, any libraries that Guile
59 dnl itself requires (like -lqthreads), and so on. It may
60 dnl also include a -L flag to tell the compiler where to
61 dnl find the libraries.
62
63 AC_DEFUN([GUILE_FLAGS],[
64 ## The GUILE_FLAGS macro.
65 ## First, let's just see if we can find Guile at all.
66 AC_MSG_CHECKING(for Guile)
67 guile-config link > /dev/null || {
68 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
69 exit 1
70 }
71 GUILE_CFLAGS="`guile-config compile`"
72 GUILE_LDFLAGS="`guile-config link`"
73 AC_SUBST(GUILE_CFLAGS)
74 AC_SUBST(GUILE_LDFLAGS)
75 AC_MSG_RESULT(yes)
76 ])