configure.ac 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.65])
  4. AC_INIT([ccs], [0.1], [michele.orru@ens.fr])
  5. AM_INIT_AUTOMAKE
  6. AC_CONFIG_SRCDIR([src/rms.c])
  7. AC_CONFIG_HEADERS([src/config.h])
  8. # Checks for programs.
  9. AC_PROG_CC([gcc clang cc])
  10. AC_PROG_CC_C99
  11. AC_PROG_RANLIB
  12. # Checks for libraries.
  13. # have _GNU_SOURCE defined aroud.
  14. AC_GNU_SOURCE
  15. # Checks for header files.
  16. AC_CHECK_HEADERS([limits.h stdint.h stdlib.h string.h unistd.h])
  17. AC_CHECK_LIB(gmp, __gmpz_init, ,
  18. [AC_MSG_ERROR([GNU MP not found, see https://gmplib.org/])])
  19. AC_CHECK_SIZEOF(mp_limb_t, 8, [#include <gmp.h>])
  20. # Checks for typedefs, structures, and compiler characteristics.
  21. AC_TYPE_SIZE_T
  22. # Checks for library functions.
  23. AC_FUNC_ERROR_AT_LINE
  24. AC_FUNC_MALLOC
  25. #AC_CHECK_FUNCS([dup2 setlocale strdup])
  26. # Add compiler/linker flags
  27. CFLAGS="--std=c99 -Wall -march=native"
  28. # Adding package options
  29. AC_ARG_ENABLE(debug,
  30. AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
  31. CFLAGS+=" -DDEBUG -DBN_DEBUG -O0 -ggdb")
  32. AC_OUTPUT([Makefile
  33. src/Makefile
  34. ])