Post-quantum cryptography tool
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.

configure.ac 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. AC_PREREQ([2.69])
  2. AC_INIT([codecrypt], [1.8])
  3. AC_CONFIG_AUX_DIR([build-aux]) dnl because of libtoolize
  4. AC_CONFIG_MACRO_DIR([m4])
  5. AM_INIT_AUTOMAKE()
  6. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  7. LT_INIT
  8. AC_PROG_CXX
  9. dnl check for compilable GMP presence
  10. AC_CHECK_HEADERS([gmp.h], [], [AC_MSG_ERROR([Codecrypt requires gmp.h])])
  11. AC_SEARCH_LIBS([__gmpz_init], [gmp], [], [AC_MSG_ERROR([Codecrypt requires libgmp])])
  12. dnl check for FFTW library presence
  13. PKG_CHECK_MODULES([FFTW3], [fftw3])
  14. dnl check whether to build with crypto++
  15. AC_ARG_WITH([cryptopp],
  16. [AS_HELP_STRING([--with-cryptopp], [Build algorithms that need Crypto++ support])])
  17. dnl and check crypto++
  18. AS_IF([test "x$with_cryptopp" != "xno"], [
  19. PKG_PROG_PKG_CONFIG([0.25])
  20. PKG_CHECK_MODULES([CRYPTOPP], [libcrypto++], [], [
  21. AC_MSG_CHECKING([for libcrypto++ using known flags])
  22. AC_LANG_PUSH([C++])
  23. saved_LIBS="$LIBS"
  24. LIBS+=" -lcrypto++"
  25. AC_LINK_IFELSE([
  26. AC_LANG_PROGRAM([#include <crypto++/cryptlib.h>], [CryptoPP::NullRNG])], [
  27. CRYPTOPP_LIBS="-lcrypto++"
  28. AC_MSG_RESULT([${CRYPTOPP_LIBS}])
  29. ], [
  30. AC_MSG_ERROR([Cannot find crypto++])
  31. ])
  32. LIBS="$saved_LIBS"
  33. AC_LANG_POP([C++])
  34. ])
  35. AC_DEFINE([HAVE_CRYPTOPP], [1], [Enable support for crypto++ routines])
  36. ], [
  37. AC_DEFINE([HAVE_CRYPTOPP], [0], [Enable support for crypto++ routines])
  38. ])
  39. dnl check for readpassphrase. If none is found, we use getpass (with a warning)
  40. AC_CHECK_HEADER([readpassphrase.h],
  41. [READPASSPHRASE=native],
  42. AC_CHECK_HEADER([bsd/readpassphrase.h],
  43. [READPASSPHRASE=bsd],
  44. [AC_MSG_WARN([falling back to obsoleted getpass(3)])]))
  45. AS_IF([test "x$READPASSPHRASE" = "xnative"],[
  46. AC_DEFINE([HAVE_READPASSPHRASE], [1], [Enable readpassphrase])])
  47. AS_IF([test "x$READPASSPHRASE" = "xbsd"],[
  48. AC_DEFINE([HAVE_BSDREADPASSPHRASE], [1], [Enable bsdreadpassphrase])
  49. AC_SEARCH_LIBS([readpassphrase], [bsd], [], [AC_MSG_ERROR([library for bsd/readpassphrase.h not found])])])
  50. dnl check for standard functions
  51. AC_CHECK_FUNCS([memset mkdir], [], [AC_MSG_ERROR([Required function missing])])
  52. dnl POSIX headers
  53. AC_CHECK_HEADERS([fcntl.h inttypes.h stddef.h stdlib.h string.h sys/file.h unistd.h], [], [AC_MSG_ERROR([Required header file missing])])
  54. dnl other used stuff
  55. AC_TYPE_SIZE_T
  56. AC_TYPE_SSIZE_T
  57. AC_TYPE_UINT32_T
  58. AC_TYPE_UINT64_T
  59. AC_TYPE_UINT8_T
  60. AC_CONFIG_FILES([Makefile])
  61. AC_OUTPUT