configure.ac 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.65])
  4. AC_INIT([question_authority], [0.1], [maker@tumbolandia.net])
  5. AM_INIT_AUTOMAKE
  6. AC_CONFIG_SRCDIR([src/qa.c])
  7. AC_CONFIG_HEADERS([src/include/config.h])
  8. # Checks for programs.
  9. AC_PROG_CC([mpicc clang gcc cc])
  10. AC_PROG_CC_C99
  11. AC_PROG_RANLIB
  12. # Checks for libraries.
  13. # Checks for header files.
  14. AC_CHECK_HEADERS([limits.h stdint.h stdlib.h string.h unistd.h])
  15. AC_CHECK_HEADER(bsd/sys/queue.h, [:],
  16. [AC_MSG_ERROR([Could not find or include bsd queues. Please install libbsd-dev.])])
  17. AC_CHECK_HEADERS([openssl/ssl.h openssl/bn.h openssl/x509.h openssl/rsa.h], [:],
  18. AC_MSG_ERROR([Could not find or include openssl headers. Please install libssl-dev.]))
  19. AC_CHECK_HEADERS(mpi/mpi.h, [:],
  20. AC_MSG_WARN([OpenMPI shall be installed to enable MPI support.]))
  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. # Add compiler/linker flags
  28. CFLAGS="$CFLAGS --std=c99 -I$(pwd)/src/include -Wall"
  29. # Adding package options
  30. AC_ARG_ENABLE(debug,
  31. AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
  32. CFLAGS+=" -DDEBUG -DBN_DEBUG -O0 -ggdb")
  33. AC_ARG_ENABLE(mpi,
  34. AS_HELP_STRING([--enable-mpi], [enable mpi library, default:no]),
  35. [mpi=true])
  36. AS_IF([test x$mpi = xtrue], AC_DEFINE([HAVE_OPENMPI], [1], [OpenMPI support]))
  37. AM_CONDITIONAL([CLUSTER], [test x$mpi = xtrue])
  38. AC_OUTPUT([Makefile
  39. src/Makefile src/questions/Makefile
  40. src/apps/Makefile
  41. src/tests/Makefile src/questions/tests/Makefile
  42. book/Makefile
  43. ])