configure.ac 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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_DEFINE([ERROR], [17], [log inverse of the error probability, default: 17.])
  41. AC_DEFINE([FB_BASE], [10], [log of precomputed base for group operation, default: 8.])
  42. AC_DEFINE([SS_BASE], [1], [log of secret shares representation, default: 1.])
  43. AC_OUTPUT([Makefile
  44. src/Makefile
  45. ])