configure.ac 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. dnl Guile defines a handful of values from <fcntl.h>, but it is
  44. dnl missing O_NOFOLLOW.
  45. AC_ARG_VAR([O_NOFOLLOW], [value to use for O_NOFOLLOW (cf. <fcntl.h>)])
  46. AS_IF([test "x$O_NOFOLLOW" = "x"],
  47. [AC_MSG_CHECKING([the value of O_NOFOLLOW])]
  48. [AC_COMPUTE_INT([O_NOFOLLOW],
  49. [O_NOFOLLOW],
  50. [[
  51. #include <fcntl.h>
  52. #include <stdio.h>
  53. ]],
  54. [AC_MSG_FAILURE([could find value for O_NOFOLLOW])])]
  55. [AC_MSG_RESULT([$O_NOFOLLOW])])
  56. AC_ARG_VAR([TAR], [tar utility])
  57. AS_IF([test "x$TAR" = "x"], [AC_PATH_PROG([TAR], [tar])])
  58. AS_IF([test "x$TAR" = "x"], [AC_MSG_ERROR(['tar' binary not found])])
  59. AC_ARG_VAR([GZIP], [gzip utility])
  60. AS_IF([test "x$GZIP" = "x"], [AC_PATH_PROG([GZIP], [gzip])])
  61. AS_IF([test "x$GZIP" = "x"], [AC_MSG_ERROR(['gzip' binary not found])])
  62. AC_ARG_VAR([XZ], [xz utility])
  63. AS_IF([test "x$XZ" = "x"], [AC_PATH_PROG([XZ], [xz])])
  64. AS_IF([test "x$XZ" = "x"], [AC_MSG_ERROR(['xz' binary not found])])
  65. AC_CONFIG_FILES([Makefile])
  66. AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  67. [chmod +x pre-inst-env])
  68. AC_CONFIG_FILES([build-aux/tests-env])
  69. AC_OUTPUT