configure.ac 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. AC_PREREQ(2.59)
  2. AC_INIT(clevis, 10)
  3. AC_CANONICAL_SYSTEM
  4. AC_PROG_CC_C99
  5. AC_PROG_RANLIB
  6. AC_PROG_SED
  7. AM_INIT_AUTOMAKE([subdir-objects foreign no-dist-gzip dist-bzip2 parallel-tests])
  8. AM_SILENT_RULES([yes])
  9. AM_PROG_CC_C_O
  10. PKG_PROG_PKG_CONFIG([0.25])
  11. PKG_CHECK_MODULES([luksmeta], [luksmeta >= 8])
  12. PKG_CHECK_MODULES([libcrypto], [libcrypto])
  13. PKG_CHECK_MODULES([jansson], [jansson >= 2.10])
  14. PKG_CHECK_MODULES([udisks2], [udisks2])
  15. PKG_CHECK_MODULES([jose], [jose >= 8])
  16. PKG_CHECK_MODULES([systemd], [systemd])
  17. PKG_CHECK_MODULES([dracut], [dracut])
  18. PKG_CHECK_MODULES([audit], [audit >= 2.7.8])
  19. AC_CHECK_PROG([PWMAKE], [pwmake], [yes])
  20. test -n "$PWMAKE" || AC_MSG_ERROR([pwmake required!])
  21. AC_ARG_WITH([dracutmodulesdir],
  22. [AS_HELP_STRING([--with-dracutmodulesdir=DIR], [Directory for dracut modules])],
  23. [],
  24. [with_dracutmodulesdir=$($PKG_CONFIG --variable=dracutmodulesdir dracut)])
  25. AC_SUBST([dracutmodulesdir], [$with_dracutmodulesdir])
  26. AC_ARG_WITH([systemdsystemunitdir],
  27. [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd unit files])],
  28. [],
  29. [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
  30. AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
  31. for ac_prog in systemd-socket-activate systemd-activate; do
  32. AC_CHECK_PROG([SD_ACTIVATE], [$ac_prog], [$as_dir/$ac_prog], [],
  33. [$PATH$PATH_SEPARATOR$($PKG_CONFIG --variable=systemdutildir systemd)])
  34. test -n "$SD_ACTIVATE" && break
  35. done
  36. test -n "$SD_ACTIVATE" || AC_MSG_ERROR([systemd-socket-activate required!])
  37. AC_MSG_CHECKING([systemd-socket-activate inetd flag])
  38. if $SD_ACTIVATE --help | grep -q inetd; then
  39. SD_ACTIVATE="$SD_ACTIVATE --inetd"
  40. AC_MSG_RESULT([--inetd])
  41. else
  42. AC_MSG_RESULT([(default)])
  43. fi
  44. AC_SUBST(SD_ACTIVATE)
  45. for ac_prog in createprimary pcrlist createpolicy create load unseal; do
  46. unset TPM2_TOOLS
  47. unset ac_cv_prog_TPM2_TOOLS
  48. AC_CHECK_PROG([TPM2_TOOLS], [tpm2_$ac_prog], [yes])
  49. test -z "$TPM2_TOOLS" && break
  50. done
  51. test -n "$TPM2_TOOLS" || AC_MSG_WARN([tpm2_$ac_prog not found, tpm2 pin won't be installed])
  52. AM_CONDITIONAL([HAVE_TPM2_TOOLS], [test -n "$TPM2_TOOLS"])
  53. AC_ARG_ENABLE([user],
  54. AS_HELP_STRING([--enable-user=USER],
  55. [Set unprivileged user (default: root)]),
  56. [CLEVIS_USER="${enableval}"],
  57. [CLEVIS_USER="root"])
  58. AC_ARG_ENABLE([group],
  59. AS_HELP_STRING([--enable-group=GROUP],
  60. [Set unprivileged group (default: root)]),
  61. [CLEVIS_GROUP="${enableval}"],
  62. [CLEVIS_GROUP="root"])
  63. AC_SUBST([CLEVIS_USER])
  64. AC_SUBST([CLEVIS_GROUP])
  65. CLEVIS_CFLAGS="\
  66. -Wall \
  67. -Wextra \
  68. -Werror \
  69. -Wstrict-aliasing \
  70. -Wchar-subscripts \
  71. -Wformat-security \
  72. -Wmissing-declarations \
  73. -Wmissing-prototypes \
  74. -Wnested-externs \
  75. -Wpointer-arith \
  76. -Wshadow \
  77. -Wsign-compare \
  78. -Wstrict-prototypes \
  79. -Wtype-limits \
  80. -Wno-missing-field-initializers \
  81. -Wno-unused-parameter \
  82. "
  83. AC_SUBST([CLEVIS_CFLAGS])
  84. AC_CONFIG_FILES([
  85. src/systemd/Makefile
  86. src/udisks2/Makefile
  87. src/dracut/Makefile
  88. tests/Makefile
  89. src/Makefile
  90. Makefile
  91. ])
  92. AC_OUTPUT