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.
 
 
 
 
 
 

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