Small tool to benchmark webservers https://redmine.lighttpd.net/projects/weighttp/wiki
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.
 
 
 
 
 

102 lines
2.7 KiB

  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.61)
  4. AC_INIT([weighttp],[0.4])
  5. AC_CONFIG_SRCDIR([src/weighttp.c])
  6. AC_CONFIG_HEADER([src/config.h])
  7. AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-xz no-dist-gzip])
  8. # Checks for programs.
  9. AC_PROG_CC
  10. dnl @synopsis TRY_CFLAGS [compiler flags]
  11. dnl @summary check whether C compiler supports given flags and adds them to CFLAGS
  12. AC_DEFUN([TRY_CFLAGS],
  13. [dnl
  14. AC_MSG_CHECKING([if $CC supports $1])
  15. AC_LANG_PUSH([C])
  16. ac_try_cflags_saved_cflags="${CFLAGS}"
  17. CFLAGS="${CFLAGS} $1"
  18. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
  19. [AC_MSG_RESULT([yes])],
  20. [
  21. AC_MSG_ERROR([no])
  22. # options not supported, remove them:
  23. CFLAGS="${ac_try_cflags_saved_cflags}"
  24. ]
  25. )
  26. AC_LANG_POP([C])
  27. ])
  28. ## solaris needs -lsocket
  29. AC_SEARCH_LIBS([socket],[socket])
  30. ## pthread
  31. AC_MSG_CHECKING([for pthread support])
  32. AC_SEARCH_LIBS([pthread_create], [pthread], [
  33. CFLAGS="-pthread ${CFLAGS}"
  34. LDFLAGS="-pthread ${LDFLAGS}"
  35. ])
  36. ## libev
  37. AC_MSG_CHECKING([for libev support])
  38. AC_ARG_WITH([libev],
  39. [AS_HELP_STRING([--with-libev@<:@=PATH@:>@],[Search for libev in PATH/include and PATH/lib])],
  40. [WITH_LIBEV=$withval],[WITH_LIBEV=yes])
  41. LIBEV_CFLAGS=""
  42. LIBEV_LIBS=""
  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. AC_SUBST([LIBEV_CFLAGS])
  62. AC_SUBST([LIBEV_LIBS])
  63. # libev has (compiler warning) problems with strict aliasing... - just disable it
  64. TRY_CFLAGS([-fno-strict-aliasing])
  65. TRY_CFLAGS([-fPIC])
  66. # check for extra compiler options (warning options)
  67. if test "${GCC}" = "yes"; then
  68. TRY_CFLAGS([-Wall -W -Wshadow -pedantic])
  69. TRY_CFLAGS([-std=gnu99])
  70. fi
  71. AC_ARG_ENABLE(extra-warnings,
  72. AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
  73. [case "${enableval}" in
  74. yes) extrawarnings=true ;;
  75. no) extrawarnings=false ;;
  76. *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
  77. esac],[extrawarnings=false])
  78. if test x$extrawarnings = xtrue; then
  79. TRY_CFLAGS([-g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security])
  80. fi
  81. AC_CONFIG_FILES([Makefile src/Makefile])
  82. AC_OUTPUT