generic wrapper for event libraries https://redmine.lighttpd.net/projects/evcon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

127 lines
4.2 KiB

  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.63])
  4. AC_INIT([evcon], [0.1.0], [lighttpd@stbuehler.de])
  5. AC_CONFIG_SRCDIR([src/core/evcon.c])
  6. AC_CONFIG_HEADERS([src/core/evcon-config-private.h])
  7. AC_CONFIG_HEADERS([src/core/evcon-config.h])
  8. AC_CONFIG_MACRO_DIR([m4])
  9. AM_INIT_AUTOMAKE([-Wall -Werror foreign])
  10. m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([pkg-config not installed])])
  11. m4_ifndef([AC_PROG_LIBTOOL], [m4_fatal([libtool not installed])])
  12. # Checks for programs.
  13. AC_PROG_CC
  14. AC_PROG_LIBTOOL
  15. AC_PROG_MAKE_SET
  16. # Checks for typedefs, structures, and compiler characteristics.
  17. AC_TYPE_PID_T
  18. AC_TYPE_SIZE_T
  19. # Checks for library functions.
  20. AC_FUNC_FORK
  21. AC_CHECK_FUNCS([dup2 pipe2])
  22. # Checks for libraries.
  23. AC_ARG_ENABLE([glib], AS_HELP_STRING([--disable-glib], [Disable building glib wrapper]), [build_glib=no], [build_glib=yes])
  24. AC_ARG_ENABLE([ev], AS_HELP_STRING([--disable-ev], [Disable building ev wrapper]), [build_ev=no], [build_ev=yes])
  25. AC_ARG_ENABLE([event], AS_HELP_STRING([--disable-event], [Disable building event wrapper]), [build_event=no], [build_event=yes])
  26. if test "x${build_glib}" != "xno" -o "x${build_ev}" != "xno" -o "x${build_event}" != "xno"; then
  27. AC_MSG_CHECKING([Enabled at least one backend. Requires glib.])
  28. # glib
  29. PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16.0], [],[AC_MSG_ERROR("glib-2.0 >= 2.16.0 not found")])
  30. fi
  31. AC_ARG_ENABLE(glib-compat,
  32. AC_HELP_STRING([--enable-glib-compat],[build for older glib versions even with new headers]),
  33. AC_DEFINE([EVCON_GLIB_COMPAT_API], [1], [build for older glib versions even with new headers]),[])
  34. LIBEV_CFLAGS=""
  35. LIBEV_LIBS=""
  36. if test "x${build_ev}" != "xno"; then
  37. AC_MSG_CHECKING([Enabled ev wrapper. Requires libev.])
  38. # libev
  39. AC_MSG_CHECKING([for libev support])
  40. AC_ARG_WITH([libev],
  41. [AS_HELP_STRING([--with-libev@<:@=PATH@:>@],[Search for libev in PATH/include and PATH/lib])],
  42. [WITH_LIBEV=$withval],[WITH_LIBEV=yes])
  43. PKG_CHECK_MODULES([LIBEV], [libev], [], [
  44. # no pkg-config for libev, searching manually:
  45. if test "$WITH_LIBEV" != "yes"; then
  46. LIBEV_CFLAGS="-I$WITH_LIBEV/include"
  47. LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
  48. else
  49. AC_CHECK_HEADERS([ev.h],[
  50. AC_CHECK_LIB([ev], [ev_time], [
  51. LIBEV_LIBS="-lev"
  52. ],[
  53. AC_MSG_ERROR([libev not found])
  54. ]
  55. )],[
  56. AC_MSG_ERROR([libev not found])
  57. ]
  58. )
  59. fi
  60. ])
  61. fi
  62. AC_SUBST([LIBEV_CFLAGS])
  63. AC_SUBST([LIBEV_LIBS])
  64. if test "x${build_event}" != "xno"; then
  65. AC_MSG_CHECKING([Enabled event wrapper. Requires libevent.])
  66. # event
  67. PKG_CHECK_MODULES([LIBEVENT], [libevent >= 2], [
  68. # we want event_core, not event
  69. LIBEVENT_LIBS=`echo "$LIBEVENT_LIBS" | sed 's#\(^\| \)-levent\($\| \)# -levent_core #'`
  70. ],[AC_MSG_ERROR("libevent >= 2 not found")])
  71. fi
  72. AM_CONDITIONAL([BUILD_GLIB], [test "x${build_glib}" != "xno"])
  73. AM_CONDITIONAL([BUILD_EV], [test "x${build_ev}" != "xno"])
  74. AM_CONDITIONAL([BUILD_EVENT], [test "x${build_event}" != "xno"])
  75. #AC_ARG_ENABLE([qt], AS_HELP_STRING([--disable-qt], [Disable building qt wrapper]), [build_qt=$withval], [build_qt=yes])
  76. #
  77. #if test "x${build_qt}" != "xno"; then
  78. # AC_MSG_CHECKING([Enabled qt wrapper. Requires c++ and qt4.])
  79. # AC_PROG_CXX
  80. # PKG_CHECK_MODULES([QT], [QtCore >= 4.0.0], [],[AC_MSG_ERROR("QtCore >= 4.0.0 not found")])
  81. #fi
  82. #AM_CONDITIONAL([BUILD_QT], [test "x${build_qt}" != "xno"])
  83. # check for extra compiler options (warning options)
  84. if test "${GCC}" = "yes"; then
  85. CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
  86. fi
  87. AC_ARG_ENABLE(extra-warnings,
  88. AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
  89. [case "${enableval}" in
  90. yes) extrawarnings=true ;;
  91. no) extrawarnings=false ;;
  92. *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
  93. esac],[extrawarnings=false])
  94. if test x$extrawarnings = xtrue; then
  95. CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
  96. fi
  97. AC_CONFIG_FILES([Makefile src/Makefile src/core/Makefile src/backend-glib/Makefile src/backend-ev/Makefile src/backend-event/Makefile src/tests/Makefile evcon.pc evcon-ev.pc evcon-glib.pc evcon-event.pc])
  98. AC_OUTPUT