configure.ac 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.65])
  4. AC_INIT([hss], [0.1], [michele.orru@ens.fr])
  5. AC_CONFIG_SRCDIR([src/rms.c])
  6. AC_CONFIG_HEADERS([src/config.h])
  7. # Checks for programs.
  8. AC_CHECK_TARGET_TOOL([latexmk], [latexmk], [no])
  9. #AS_IF([test "x$latexmk" = "xno"], [AC_MSG_ERROR([cannot find pdflatex.])])
  10. AC_PROG_CC([gcc clang cc])
  11. AC_PROG_CC_C99
  12. AC_PROG_RANLIB
  13. # Checks for libraries.
  14. AC_CHECK_LIB(gmp, __gmpz_init, ,
  15. [AC_MSG_ERROR([GNU MP not found, see https://gmplib.org/])])
  16. # have _GNU_SOURCE defined aroud.
  17. AC_GNU_SOURCE
  18. # Checks for header files.
  19. AC_CHECK_HEADERS([limits.h stdint.h stdlib.h string.h unistd.h])
  20. AC_CHECK_SIZEOF(mp_limb_t, 8, [#include <gmp.h>])
  21. AC_CHECK_SIZEOF(uint32_t, 4, [#include <stdint.h>])
  22. AC_CHECK_SIZEOF(unsigned long long, 8, [])
  23. # Checks for typedefs, structures, and compiler characteristics.
  24. AC_TYPE_SIZE_T
  25. # Checks for library functions.
  26. AC_FUNC_ERROR_AT_LINE
  27. AC_FUNC_MALLOC
  28. #AC_CHECK_FUNCS([dup2 setlocale strdup])
  29. AM_INIT_AUTOMAKE
  30. # Clear out compiler/linker flags
  31. CFLAGS+=" -pedantic -Wall "
  32. # Shut up automake
  33. AM_SILENT_RULES([yes])
  34. AC_SUBST([AM_MAKEFLAGS], [--no-print-directory])
  35. # Adding package options
  36. AC_ARG_ENABLE(debug,
  37. AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
  38. CFLAGS+=" -UNDEBUG -O0 -ggdb -fbounds-check -D_FORTIFY_SOURCE=1",
  39. CFLAGS+=" -DNDEBUG -O3 -march=native")
  40. AC_ARG_VAR([failure], [failure prob.])
  41. AS_IF([test "x$failure" = x], [failure="17"])
  42. AC_ARG_VAR([failure], [failure prob.])
  43. AS_IF([test "x$failure" = x], [failure="17"])
  44. AC_DEFINE_UNQUOTED([FAILURE], [$failure], [log inverse of the failure probability, default: 17.])
  45. AC_ARG_VAR([fb_base], [fixed base])
  46. AS_IF([test "x$fb_base" = x], [fb_base="8"])
  47. AC_DEFINE_UNQUOTED([FB_BASE], [$fb_base], [log of precomputed base for group operation, default: 8.])
  48. AC_ARG_VAR([ss_base], [ss base])
  49. AS_IF([test "x$ss_base" = x], [ss_base="1"])
  50. AC_DEFINE_UNQUOTED([SS_BASE], [$ss_base], [log of secret shares representation, default: 1.])
  51. AC_OUTPUT([Makefile
  52. src/Makefile
  53. ])