guile.m4 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
  44. dnl
  45. dnl This macro runs the `guile-config' script, installed with Guile,
  46. dnl to find out where Guile's header files and libraries are
  47. dnl installed. It sets two variables, marked for substitution, as
  48. dnl by AC_SUBST.
  49. dnl
  50. dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
  51. dnl code that uses Guile header files. This is almost
  52. dnl always just a -I flag.
  53. dnl
  54. dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
  55. dnl program against Guile. This includes `-lguile' for
  56. dnl the Guile library itself, any libraries that Guile
  57. dnl itself requires (like -lqthreads), and so on. It may
  58. dnl also include a -L flag to tell the compiler where to
  59. dnl find the libraries.
  60. AC_DEFUN([GUILE_FLAGS],[
  61. ## The GUILE_FLAGS macro.
  62. ## First, let's just see if we can find Guile at all.
  63. AC_MSG_CHECKING(for Guile)
  64. guile-config link > /dev/null || {
  65. echo "configure: cannot find guile-config; is Guile installed?" 1>&2
  66. exit 1
  67. }
  68. GUILE_CFLAGS="`guile-config compile`"
  69. GUILE_LDFLAGS="`guile-config link`"
  70. AC_SUBST(GUILE_CFLAGS)
  71. AC_SUBST(GUILE_LDFLAGS)
  72. AC_MSG_RESULT(yes)
  73. ])