Hi Christopher, I am not sure if this is necessarily the right way to go for a library, esp if it can impact backwards compatibility for bufferevents. As for reducing the size of the library, do you really think that 30K make a difference these days?
Niels. On 9/26/07, Christopher Layne <[EMAIL PROTECTED]> wrote: > $ ./configure --help > [...] > Optional Features: > [...] > --enable-dns build with support for dns layer [default=yes] > --enable-http build with support for http layer [default=yes] > --enable-bevents build with support for buffer events [default=yes] > > Changes: > > 1. This required me to move buffer_* and evbuffer_* function declarations > that were in event.h to a new file, evbuffer.h. Also, it looks like > buffer.c contains ev_buffer_* functions and evbuffer.c contains > buffer_* functions. This was like this before so I just tried to keep > things consistent overall when creating a new header file and went with > evbuffer.h. The flip-flop can be changed later. Also added evbuffer.h include > to various http and bufferevents specific modules/headers that required them. > > 2. This required creating test/regress_buffer.c and moving bevents > regress specific code into that module. Calls to higher level regress > suite collection functions are conditionally ifdef'd via HAVE_EVENT_DNS, > HAVE_EVENT_HTTP, etc. (which configure takes care of). > > 3. In both cases of above, the actual conditional building of modules > is handled via ifdef's within Makefile.am that configure takes care of. > > 4. Modified configure.in to not bother doing Fortran, C++, or ObjC specific > tests. Libtool likes to try it's own checks as well, but I just redefined > those with simple null macros. > > 5. Throughout this all: substantially increased my derision for GNU auto* > tools. > > Pros: > > 1. Significantly smaller libevent library footprint but the ability to > include everything normally. > 2. Default, nothing changes, all API layers are enabled per normal. > 3. Couple of useful macros added to configure.in which should make adding > any other enable/disable and build checks quicker. > > Cons: > > 1. http code is highly dependent on bufferevents code. As such, one cannot > use "--enable-bufferevents=no" w/ "--enable-http=no". If bufferevent code > is disabled, http code must be disabled. > 2. rpc code (which AFAICT is regress testing specific) is tied with http > code and shares the same characteristics of above. > > Builds+size+make verify checks: > > $ set=( "--disable-none" \ > "--disable-dns" \ > "--disable-http" \ > "--disable-dns --disable-http" \ > "--disable-bevents --disable-http" \ > "--disable-bevents --disable-http --disable-dns" ); \ > a=${#set[*]}; i=0; while [[ $i -lt $a ]]; do f="${set[i++]}"; echo $f; \ > (./configure $f && make clean && make) 1>/tmp/error.out 2>&1 \ > || (cat /tmp/error.out && break); \ > size .libs/libevent.so; \ > make verify 2>&1 | egrep FAIL && break; \ > printf "\n"; done > > --disable-none > text data bss dec hex filename > 67115 1120 6904 75139 12583 .libs/libevent.so > > --disable-dns > text data bss dec hex filename > 48804 1040 6328 56172 db6c .libs/libevent.so > > --disable-http > text data bss dec hex filename > 45589 840 708 47137 b821 .libs/libevent.so > > --disable-dns --disable-http > text data bss dec hex filename > 26603 728 132 27463 6b47 .libs/libevent.so > > --disable-bevents --disable-http > text data bss dec hex filename > 37882 744 704 39330 99a2 .libs/libevent.so > > --disable-bevents --disable-http --disable-dns > text data bss dec hex filename > 18969 628 128 19725 4d0d .libs/libevent.so > > > This patch is 50k, but is mostly just -+ of moving buffer-specific code from > one file to another and the such. Attached as bzip2 here, and also raw at > this url: http://www.anodized.com/~clayne/libevent.2007092600.diff > > -cl > > _______________________________________________ > Libevent-users mailing list > Libevent-users@monkey.org > http://monkey.org/mailman/listinfo/libevent-users > > > _______________________________________________ Libevent-users mailing list Libevent-users@monkey.org http://monkey.org/mailman/listinfo/libevent-users