configure.ac 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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([config.h])
  8. # Checks for programs.
  9. AC_PROG_CC([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. # Checks for typedefs, structures, and compiler characteristics.
  20. AC_TYPE_SIZE_T
  21. # Checks for library functions.
  22. AC_FUNC_ERROR_AT_LINE
  23. AC_FUNC_MALLOC
  24. #AC_CHECK_FUNCS([dup2 setlocale strdup])
  25. # Add compiler/linker flags
  26. CFLAGS="$CFLAGS --std=c99 -I$(pwd)/src/include -Wall"
  27. # Adding package options
  28. AC_ARG_ENABLE(debug,
  29. AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
  30. CFLAGS+=" -DDEBUG -ggdb")
  31. AC_OUTPUT([Makefile
  32. src/Makefile src/questions/Makefile
  33. src/apps/Makefile
  34. src/tests/Makefile src/questions/tests/Makefile
  35. ])