configure.ac 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. AC_CHECK_LIB(gmp, __gmpz_init, ,
  14. [AC_MSG_ERROR([GNU MP not found, see https://gmplib.org/])])
  15. # have _GNU_SOURCE defined aroud.
  16. AC_GNU_SOURCE
  17. # Checks for header files.
  18. AC_CHECK_HEADERS([limits.h stdint.h stdlib.h string.h unistd.h])
  19. AC_CHECK_SIZEOF(mp_limb_t, 8, [#include <gmp.h>])
  20. AC_CHECK_SIZEOF(uint32_t, 4, [#include <stdint.h>])
  21. # Checks for typedefs, structures, and compiler characteristics.
  22. AC_TYPE_SIZE_T
  23. # Checks for library functions.
  24. AC_FUNC_ERROR_AT_LINE
  25. AC_FUNC_MALLOC
  26. #AC_CHECK_FUNCS([dup2 setlocale strdup])
  27. # Clear out compiler/linker flags
  28. CFLAGS+=" -pedantic -Wall "
  29. # Shut up automake
  30. #AM_SILENT_RULES([yes])
  31. AC_SUBST([AM_MAKEFLAGS], [--no-print-directory])
  32. # Adding package options
  33. AC_ARG_ENABLE(debug,
  34. AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
  35. CFLAGS+=" -UNDEBUG -O3 -ggdb -fbounds-check -D_FORTIFY_SOURCE=1",
  36. CFLAGS+=" -DNDEBUG -O3 -march=native")
  37. AC_OUTPUT([Makefile
  38. src/Makefile
  39. ])