configure.ac 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. # 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+=" -O3 --std=c99 -Wall --pedantic -march=native -DNDEBUG"
  28. # Shut up automake
  29. #AM_SILENT_RULES([yes])
  30. AC_SUBST([AM_MAKEFLAGS], [--no-print-directory])
  31. # Adding package options
  32. AC_ARG_ENABLE(debug,
  33. AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
  34. CFLAGS+=" -UNDEBUG -O0 -ggdb")
  35. AC_OUTPUT([Makefile
  36. src/Makefile
  37. ])