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.
 
 
 
 
 

69 lines
1.8 KiB

  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. """
  4. * weighttp - a lightweight and simple webserver benchmarking tool
  5. *
  6. * Author:
  7. * Copyright (c) 2009-2011 Thomas Porzelt
  8. *
  9. * License:
  10. * MIT, see COPYING file
  11. """
  12. import Options
  13. # the following two variables are used by the target "waf dist"
  14. VERSION='0.4'
  15. APPNAME='weighttp'
  16. # these variables are mandatory ('/' are converted automatically)
  17. srcdir = '.'
  18. blddir = 'build'
  19. def set_options(opt):
  20. opt.tool_options('compiler_cc')
  21. # ./waf configure options
  22. #opt.add_option('--with-xyz', action='store_true', help='with xyz', dest = 'xyz', default = False)
  23. def configure(conf):
  24. conf.env['CCFLAGS'] += [
  25. '-std=gnu99', '-Wall', '-Wshadow', '-W', '-pedantic', '-g', '-g2', '-O2', '-Wmissing-declarations',
  26. '-Wdeclaration-after-statement', '-Wno-pointer-sign', '-Wcast-align', '-Winline', '-Wsign-compare',
  27. '-Wnested-externs', '-Wpointer-arith', '-Wbad-function-cast', '-Wmissing-prototypes',
  28. '-fPIC', '-fno-strict-aliasing',
  29. ]
  30. conf.check_tool('compiler_cc')
  31. # check for libev
  32. conf.check(lib='ev', uselib_store='ev', mandatory=True)
  33. conf.check(header_name='ev.h', uselib='ev', mandatory=True)
  34. # check for libpthread
  35. conf.check(lib='pthread', uselib_store='pthread', mandatory=True)
  36. conf.check(header_name='pthread.h', uselib='pthread', mandatory=True)
  37. # check for needed headers
  38. conf.check(header_name='unistd.h')
  39. conf.check(header_name='stdint.h')
  40. conf.check(header_name='fcntl.h')
  41. conf.check(header_name='inttypes.h')
  42. # check for needed functions
  43. #conf.check(function_name='writev', header_name='sys/uio.h', define_name='HAVE_WRITEV')
  44. def build(bld):
  45. bld.new_task_gen(
  46. features = 'cc cprogram',
  47. source = ['src/client.c', 'src/weighttp.c', 'src/worker.c'],
  48. defines = ['PACKAGE_VERSION="' + VERSION + '"'],
  49. includes = '.',
  50. uselib = 'ev pthread',
  51. target = 'weighttp'
  52. )