configure.ac 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. dnl Process this file with autoconf to produce a configure script.
  2. # Copyright (C) 2000-2012, 2016, 2019 Free Software Foundation, Inc.
  3. # Copyright (C) 2020 Maxime Devos
  4. #
  5. # Author (GnuTLS): Nikos Mavrogiannopoulos, Simon Josefsson
  6. # Author (rehash): Maxime Devos
  7. #
  8. # This file is part of rehash
  9. #
  10. # rehash is free software; you can redistribute it and/or modify it
  11. # under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 3 of the License, or (at
  13. # your option) any later version.
  14. #
  15. # rehash is distributed in the hope that it will be useful, but
  16. # WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with rehash. If not, see <http://www.gnu.org/licenses/>.
  22. # This file is partially based upon the Autoconf script of GnuTLS.
  23. AC_PREREQ([2.61])
  24. AC_INIT([rehash], [0], [])
  25. AC_CONFIG_AUX_DIR([build-aux])
  26. AC_CONFIG_MACRO_DIRS([m4 m4/gl])
  27. AM_INIT_AUTOMAKE([foreign subdir-objects])
  28. AC_CONFIG_HEADERS([rehash_config.h])
  29. AC_MSG_RESULT([***
  30. *** Checking for compilation programs...
  31. ])
  32. dnl Checks for programs.
  33. PKG_PROG_PKG_CONFIG
  34. AC_PROG_CC
  35. dnl GNU Guile support
  36. AC_MSG_CHECKING([whether building rehash bindings])
  37. AC_ARG_ENABLE(guile,
  38. AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
  39. [opt_guile_bindings=$enableval], [opt_guile_bindings=yes])
  40. AC_MSG_RESULT($opt_guile_bindings)
  41. AC_ARG_WITH([guile-site-dir], AS_HELP_STRING([--with-guile-site-dir=DIR],
  42. [guile site directory for rehash, default is guile system settings]),
  43. [guilesitedir="${withval}"], [guilesitedir='$(GUILE_SITE)'])
  44. AC_ARG_WITH([guile-site-ccache-dir], AS_HELP_STRING([--with-guile-site-ccache-dir=DIR],
  45. [guile ccache directory for rehash, default is guile system settings]),
  46. [guilesiteccachedir="${withval}"], [guilesiteccachedir='$(GUILE_SITE_CCACHE)'])
  47. AC_SUBST([guilesitedir])
  48. AC_SUBST([guilesiteccachedir])
  49. if test "$opt_guile_bindings" = "yes"; then
  50. AC_MSG_RESULT([***
  51. *** Detecting GNU Guile...
  52. ])
  53. dnl Check for 'guild', which can be used to compile Scheme code
  54. dnl on Guile 2.x and 3.x.
  55. AC_PATH_PROG([GUILD], [guild])
  56. AC_SUBST([GUILD])
  57. dnl TODO check if 2.x works
  58. GUILE_PKG([3.0 2.2 2.0])
  59. GUILE_PROGS
  60. GUILE_SITE_DIR
  61. GUILE_FLAGS
  62. fi
  63. AM_CONDITIONAL([HAVE_GUILE], [test "$opt_guile_bindings" = "yes"])
  64. AM_CONDITIONAL([HAVE_GUILD], [test "x$GUILD" != "x"])
  65. # Dynamic library support
  66. # TODO: doesn't pick up system libtool automatically
  67. LT_INIT
  68. # Check for GNUnet libraries
  69. PKG_CHECK_MODULES([GNUNETDHT], [gnunetdht])
  70. PKG_CHECK_MODULES([GNUNETUTIL], [gnunetutil])
  71. PKG_CHECK_MODULES([GNUNETDATASTORE], [gnunetdatastore])
  72. # TODO perhaps include gnunetcrypto as well
  73. # And some GNUnet dependencies
  74. PKG_CHECK_MODULES([LIBEXTRACTOR], [libextractor])
  75. # TODO perhaps implement some language bindings:
  76. # [ ] haskell
  77. # [ ] guile (+ other schemes) (<-- priority)
  78. # [ ] common lisp
  79. # [ ] emacs
  80. # [ ] rust
  81. GNUNETUTIL_LIBDIR="`$PKG_CONFIG --variable libdir gnunetutil`"
  82. AC_SUBST([GNUNETUTIL_LIBDIR])
  83. AC_CONFIG_FILES([scheme-binding/rehash/config.scm])
  84. AC_OUTPUT([Makefile])
  85. AC_MSG_NOTICE([Language bindings:
  86. Guile wrappers: $opt_guile_bindings
  87. C library: yes
  88. ])