You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

102 lines
3.0 KiB

  1. dnl -*- Autoconf -*- fragment for the C++ daemon.
  2. AC_MSG_CHECKING([whether to build daemon])
  3. AC_MSG_RESULT([$guix_build_daemon])
  4. dnl C++ environment. This macro must be used unconditionnaly.
  5. AC_PROG_CXX
  6. if test "x$guix_build_daemon" = "xyes"; then
  7. AC_PROG_RANLIB
  8. AC_CONFIG_HEADER([nix/config.h])
  9. dnl Use 64-bit file system calls so that we can support files > 2 GiB.
  10. AC_SYS_LARGEFILE
  11. dnl Look for libbz2, a required dependency.
  12. AC_CHECK_LIB([bz2], [BZ2_bzWriteOpen], [true],
  13. [AC_MSG_ERROR([Guix requires libbz2, which is part of bzip2. See http://www.bzip.org/.])])
  14. AC_CHECK_HEADERS([bzlib.h], [true],
  15. [AC_MSG_ERROR([Guix requires libbz2, which is part of bzip2. See http://www.bzip.org/.])])
  16. dnl Look for SQLite, a required dependency.
  17. PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.6.19])
  18. AC_DEFINE([NIX_VERSION], ["0.0.0"], [Fake Nix version number.])
  19. AC_DEFINE_UNQUOTED([SYSTEM], ["$guix_system"],
  20. [Guix host system type--i.e., platform and OS kernel tuple.])
  21. case "$LIBGCRYPT_PREFIX" in
  22. no)
  23. LIBGCRYPT_CFLAGS=""
  24. LIBGCRYPT_LIBS=""
  25. ;;
  26. *)
  27. LIBGCRYPT_CFLAGS="-I$LIBGCRYPT_PREFIX/include"
  28. LIBGCRYPT_LIBS="-L$LIBGCRYPT_PREFIX/lib -lgcrypt"
  29. ;;
  30. esac
  31. AC_SUBST([LIBGCRYPT_CFLAGS])
  32. AC_SUBST([LIBGCRYPT_LIBS])
  33. save_CFLAGS="$CFLAGS"
  34. save_LDFLAGS="$LDFLAGS"
  35. CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
  36. LDFLAGS="$LDFLAGS $LIBGCRYPT_LDFLAGS"
  37. have_gcrypt=yes
  38. AC_CHECK_LIB([gcrypt], [gcry_md_open], [:], [have_gcrypt=no])
  39. AC_CHECK_HEADER([gcrypt.h], [:], [have_gcrypt=no])
  40. if test "x$have_gcrypt" != "xyes"; then
  41. AC_MSG_ERROR([GNU libgcrypt not found; please install it.])
  42. fi
  43. CFLAGS="$save_CFLAGS"
  44. LDFLAGS="$save_LDFLAGS"
  45. dnl Chroot support.
  46. AC_CHECK_FUNCS([chroot unshare])
  47. AC_CHECK_HEADERS([sched.h sys/param.h sys/mount.h])
  48. dnl Check for lutimes, optionally used for changing the mtime of
  49. dnl symlinks.
  50. AC_CHECK_FUNCS([lutimes])
  51. dnl Check whether the store optimiser can optimise symlinks.
  52. AC_MSG_CHECKING([whether it is possible to create a link to a symlink])
  53. ln -s bla tmp_link
  54. if ln tmp_link tmp_link2 2> /dev/null; then
  55. AC_MSG_RESULT(yes)
  56. AC_DEFINE(CAN_LINK_SYMLINK, 1, [Whether link() works on symlinks.])
  57. else
  58. AC_MSG_RESULT(no)
  59. fi
  60. rm -f tmp_link tmp_link2
  61. dnl Check for <locale>.
  62. AC_LANG_PUSH(C++)
  63. AC_CHECK_HEADERS([locale])
  64. AC_LANG_POP(C++)
  65. dnl Check whether we have the `personality' syscall, which allows us
  66. dnl to do i686-linux builds on x86_64-linux machines.
  67. AC_CHECK_HEADERS([sys/personality.h])
  68. dnl Check for <linux/fs.h> (for immutable file support).
  69. AC_CHECK_HEADERS([linux/fs.h])
  70. dnl Temporary directory used to store the daemon's data.
  71. AC_MSG_CHECKING([for unit test root])
  72. GUIX_TEST_ROOT="`pwd`/test-tmp"
  73. AC_MSG_RESULT([$GUIX_TEST_ROOT])
  74. AC_SUBST([GUIX_TEST_ROOT])
  75. AC_CONFIG_FILES([nix/scripts/list-runtime-roots
  76. nix/scripts/substitute-binary],
  77. [chmod +x nix/scripts/list-runtime-roots nix/scripts/substitute-binary])
  78. fi
  79. AM_CONDITIONAL([BUILD_DAEMON], [test "x$guix_build_daemon" = "xyes"])