configure.ac 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.67])
  4. AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
  5. AC_CONFIG_SRCDIR([src/pycrypto_compat.h])
  6. AC_CONFIG_HEADERS([src/config.h])
  7. # Checks for programs.
  8. AC_PROG_CC
  9. # Checks for libraries.
  10. AC_ARG_WITH([gmp], AS_HELP_STRING([--without-gmp], [Build without gmp library (default: test)]))
  11. AS_IF([test "x$with_gmp" != "xno"], [
  12. AC_CHECK_LIB([gmp], [__gmpz_init])
  13. ])
  14. AC_ARG_WITH([mpir], AS_HELP_STRING([--without-mpir], [Build without mpir library (default: test)]))
  15. AS_IF([test "x$with_mpir" != "xno"], [
  16. AC_CHECK_LIB([mpir], [__gmpz_init])
  17. ])
  18. AC_CHECK_DECLS([mpz_powm], [], [], [
  19. [#if HAVE_LIBGMP
  20. # include <gmp.h>
  21. #elif HAVE_LIBMPIR
  22. # include <mpir.h>
  23. #endif
  24. ]])
  25. AC_CHECK_DECLS([mpz_powm_sec], [], [], [
  26. [#if HAVE_LIBGMP
  27. # include <gmp.h>
  28. #elif HAVE_LIBMPIR
  29. # include <mpir.h>
  30. #endif
  31. ]])
  32. # Checks for header files.
  33. AC_CHECK_HEADERS([inttypes.h limits.h stddef.h stdint.h stdlib.h string.h wchar.h])
  34. # Checks for typedefs, structures, and compiler characteristics.
  35. AC_C_INLINE
  36. AC_TYPE_INT16_T
  37. AC_TYPE_INT32_T
  38. AC_TYPE_INT64_T
  39. AC_TYPE_INT8_T
  40. AC_TYPE_SIZE_T
  41. AC_TYPE_UINT16_T
  42. AC_TYPE_UINT32_T
  43. AC_TYPE_UINT64_T
  44. AC_TYPE_UINT8_T
  45. # Checks for library functions.
  46. AC_FUNC_MALLOC
  47. AC_CHECK_FUNCS([memmove memset])
  48. AC_OUTPUT