1
0

configure.ac 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. AC_PREREQ(2.59)
  2. AC_INIT(tang, 7)
  3. AC_CANONICAL_SYSTEM
  4. AC_PROG_CC_C99
  5. AC_PROG_SED
  6. AM_INIT_AUTOMAKE([subdir-objects foreign no-dist-gzip dist-bzip2 parallel-tests])
  7. AM_SILENT_RULES([yes])
  8. AM_PROG_CC_C_O
  9. PKG_PROG_PKG_CONFIG([0.25])
  10. AC_CHECK_LIB([dl], [dlopen], [AC_SUBST([dl_LIBS], [-ldl])],
  11. [AC_CHECK_LIB([dl], [dlopen], [AC_SUBST([dl_LIBS], [-ldl])],
  12. [AC_MSG_ERROR([unable to find dlopen])])])
  13. AC_CHECK_HEADER([http_parser.h], [],
  14. [AC_MSG_ERROR([http-parser required!])], [
  15. #include <http_parser.h>
  16. #ifndef HTTP_STATUS_MAP
  17. #error HTTP_STATUS_MAP not defined!
  18. #endif
  19. ])
  20. AC_CHECK_LIB([http_parser], [http_parser_execute],
  21. [AC_SUBST(http_parser_LIBS, [-lhttp_parser])],
  22. [AC_MSG_ERROR([http-parser required!])])
  23. PKG_CHECK_MODULES([jose], [jose >= 8])
  24. PKG_CHECK_MODULES([systemd], [systemd])
  25. AC_ARG_WITH([systemdsystemunitdir],
  26. [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],
  27. [],
  28. [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
  29. AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
  30. for ac_prog in systemd-socket-activate systemd-activate; do
  31. AC_CHECK_PROG([SD_ACTIVATE], [$ac_prog], [$as_dir/$ac_prog], [],
  32. [$PATH$PATH_SEPARATOR$($PKG_CONFIG --variable=systemdutildir systemd)])
  33. test -n "$SD_ACTIVATE" && break
  34. done
  35. test -n "$SD_ACTIVATE" || AC_MSG_ERROR([systemd-socket-activate required!])
  36. AC_MSG_CHECKING([systemd-socket-activate inetd flag])
  37. if $SD_ACTIVATE --help | grep -q inetd; then
  38. SD_ACTIVATE="$SD_ACTIVATE --inetd"
  39. AC_MSG_RESULT([--inetd])
  40. else
  41. AC_MSG_RESULT([(default)])
  42. fi
  43. AC_SUBST(SD_ACTIVATE)
  44. TANG_CFLAGS="\
  45. -Wall \
  46. -Wextra \
  47. -Werror \
  48. -Wstrict-aliasing \
  49. -Wchar-subscripts \
  50. -Wformat-security \
  51. -Wmissing-declarations \
  52. -Wmissing-prototypes \
  53. -Wnested-externs \
  54. -Wpointer-arith \
  55. -Wshadow \
  56. -Wsign-compare \
  57. -Wstrict-prototypes \
  58. -Wtype-limits \
  59. -Wunused-function \
  60. -Wno-missing-field-initializers \
  61. -Wno-unused-parameter \
  62. "
  63. AC_SUBST([TANG_CFLAGS])
  64. AC_CHECK_PROGS(A2X, [a2x])
  65. if test "x$A2X" = "x"; then
  66. AC_MSG_WARN([asciidoc / a2x not found -- man pages will not be generated and installed])
  67. fi
  68. AM_CONDITIONAL(HAVE_A2X, [test -n "$A2X"])
  69. AC_CONFIG_FILES([Makefile])
  70. AC_OUTPUT