configure.ac 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Disarchive
  2. # Copyright © 2019 Timothy Sample <samplet@ngyro.com>
  3. #
  4. # This file is part of Disarchive.
  5. #
  6. # Disarchive is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # Disarchive is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Disarchive. If not, see <https://www.gnu.org/licenses/>.
  18. AC_INIT([Disarchive],
  19. m4_esyscmd([build-aux/git-version-gen .tarball-version]),
  20. [samplet@ngyro.com],
  21. [disarchive])
  22. AC_CONFIG_SRCDIR([disarchive/git-hash.scm])
  23. AC_CONFIG_AUX_DIR([build-aux])
  24. AM_INIT_AUTOMAKE([color-tests silent-rules subdir-objects
  25. -Wall -Werror foreign])
  26. AM_SILENT_RULES([yes])
  27. AC_PROG_CC
  28. PKG_CHECK_MODULES([ZLIB], [zlib])
  29. GUILE_PKG([3.0])
  30. GUILE_PROGS
  31. AC_ARG_VAR([GUILD], [guild (Guile compiler) command])
  32. AS_IF([test "x$GUILD" = "x"],
  33. [PKG_CHECK_VAR([GUILD], [guile-$GUILE_EFFECTIVE_VERSION], [guild], [],
  34. [AC_MSG_ERROR(m4_normalize([
  35. 'guild' binary not found; please check your Guile installation.]))])])
  36. dnl This argument is passed to guild; it ensures cross-compiling uses
  37. dnl the right target.
  38. if test -n "$host_alias"; then
  39. AC_SUBST([GUILD_TARGET_OPTION], [--target=$host_alias])
  40. fi
  41. GUILE_MODULE_REQUIRED(gcrypt hash)
  42. GUILE_MODULE_REQUIRED(lzma)
  43. GUILE_MODULE_REQUIRED(bzip2)
  44. dnl Older versions of Guile are missing O_NOFOLLOW. We compute it here
  45. dnl so that we can make a shim if we need to.
  46. AC_ARG_VAR([O_NOFOLLOW], [value to use for O_NOFOLLOW (cf. <fcntl.h>)])
  47. AS_IF([test "x$O_NOFOLLOW" = "x"],
  48. [AC_MSG_CHECKING([the value of O_NOFOLLOW])]
  49. [AC_COMPUTE_INT([O_NOFOLLOW],
  50. [O_NOFOLLOW],
  51. [[
  52. #include <fcntl.h>
  53. #include <stdio.h>
  54. ]],
  55. [AC_MSG_FAILURE([could find value for O_NOFOLLOW])])]
  56. [AC_MSG_RESULT([$O_NOFOLLOW])])
  57. AC_ARG_VAR([TAR], [tar utility])
  58. AS_IF([test "x$TAR" = "x"], [AC_PATH_PROG([TAR], [tar])])
  59. AS_IF([test "x$TAR" = "x"], [AC_MSG_ERROR(['tar' binary not found])])
  60. AC_ARG_VAR([GZIP], [gzip utility])
  61. AS_IF([test "x$GZIP" = "x"], [AC_PATH_PROG([GZIP], [gzip])])
  62. AS_IF([test "x$GZIP" = "x"], [AC_MSG_ERROR(['gzip' binary not found])])
  63. AC_ARG_VAR([XZ], [xz utility])
  64. AS_IF([test "x$XZ" = "x"], [AC_PATH_PROG([XZ], [xz])])
  65. AS_IF([test "x$XZ" = "x"], [AC_MSG_ERROR(['xz' binary not found])])
  66. AC_ARG_VAR([BZIP2], [bzip2 utility])
  67. AS_IF([test "x$BZIP2" = "x"], [AC_PATH_PROG([BZIP2], [bzip2])])
  68. AS_IF([test "x$BZIP2" = "x"], [AC_MSG_ERROR(['bzip2' binary not found])])
  69. AC_CONFIG_FILES([Makefile])
  70. AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  71. [chmod +x pre-inst-env])
  72. AC_CONFIG_FILES([build-aux/tests-env])
  73. AC_OUTPUT