]> arthur.barton.de Git - netatalk.git/blob - libevent/configure.in
Add libevent
[netatalk.git] / libevent / configure.in
1 dnl configure.in for libevent
2 dnl Dug Song <dugsong@monkey.org>
3 AC_PREREQ(2.59c)
4 AC_INIT(event.c)
5
6 AC_CONFIG_MACRO_DIR([m4])
7
8 AM_INIT_AUTOMAKE(libevent,2.0.10-stable)
9 AM_CONFIG_HEADER(config.h)
10 AC_DEFINE(NUMERIC_VERSION, 0x02000a00, [Numeric representation of the version])
11
12 dnl Initialize prefix.
13 if test "$prefix" = "NONE"; then
14    prefix="/usr/local"
15 fi
16
17 dnl Checks for programs.
18 AC_PROG_CC
19 AC_PROG_INSTALL
20 AC_PROG_LN_S
21 AC_PROG_MKDIR_P
22
23 AC_PROG_GCC_TRADITIONAL
24
25 if test "$GCC" = "yes" ; then
26         # Enable many gcc warnings by default...
27         CFLAGS="$CFLAGS -Wall"
28         # And disable the strict-aliasing optimization, since it breaks
29         # our sockaddr-handling code in strange ways.
30         CFLAGS="$CFLAGS -fno-strict-aliasing"
31 fi
32
33 AC_ARG_ENABLE(gcc-warnings,
34      AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings with GCC))
35 AC_ARG_ENABLE(thread-support,
36      AS_HELP_STRING(--disable-thread-support, disable support for threading),
37         [], [enable_thread_support=yes])
38 AC_ARG_ENABLE(malloc-replacement,
39      AS_HELP_STRING(--disable-malloc-replacement, disable support for replacing the memory mgt functions),
40         [], [enable_malloc_replacement=yes])
41 AC_ARG_ENABLE(openssl,
42      AS_HELP_STRING(--disable-openssl, disable support for openssl encryption),
43         [], [enable_openssl=yes])
44 AC_ARG_ENABLE(debug-mode,
45      AS_HELP_STRING(--disable-debug-mode, disable support for running in debug mode),
46         [], [enable_debug_mode=yes])
47
48 AC_PROG_LIBTOOL
49
50 dnl   Uncomment "AC_DISABLE_SHARED" to make shared librraries not get
51 dnl   built by default.  You can also turn shared libs on and off from
52 dnl   the command line with --enable-shared and --disable-shared.
53 dnl AC_DISABLE_SHARED
54 AC_SUBST(LIBTOOL_DEPS)
55
56 dnl Checks for libraries.
57 AC_SEARCH_LIBS([inet_ntoa], [nsl])
58 AC_SEARCH_LIBS([socket], [socket])
59 AC_SEARCH_LIBS([inet_aton], [resolv])
60 AC_SEARCH_LIBS([clock_gettime], [rt])
61 AC_SEARCH_LIBS([sendfile], [sendfile])
62
63 dnl Determine if we have zlib for regression tests
64 dnl Don't put this one in LIBS
65 save_LIBS="$LIBS"
66 LIBS=""
67 ZLIB_LIBS=""
68 have_zlib=no
69 AC_SEARCH_LIBS([inflateEnd], [z],
70         [have_zlib=yes
71         ZLIB_LIBS="$LIBS"
72         AC_DEFINE(HAVE_LIBZ, 1, [Define if the system has zlib])])
73 LIBS="$save_LIBS"
74 AC_SUBST(ZLIB_LIBS)
75 AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"])
76
77 dnl See if we have openssl.  This doesn't go in LIBS either.
78 if test "$enable_openssl" = "yes"; then
79 save_LIBS="$LIBS"
80 LIBS=""
81 OPENSSL_LIBS=""
82 have_openssl=no
83 AC_SEARCH_LIBS([SSL_new], [ssl],
84                 [have_openssl=yes
85                 OPENSSL_LIBS="$LIBS"
86                 AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])])
87 LIBS="$save_LIBS"
88 AC_SUBST(OPENSSL_LIBS)
89 fi
90
91 dnl Checks for header files.
92 AC_HEADER_STDC
93 AC_CHECK_HEADERS(fcntl.h stdarg.h inttypes.h stdint.h stddef.h poll.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in.h netinet/in6.h sys/socket.h sys/uio.h arpa/inet.h sys/eventfd.h sys/mman.h sys/sendfile.h sys/wait.h netdb.h)
94 AC_CHECK_HEADERS(sys/sysctl.h, [], [], [
95 #ifdef HAVE_SYS_PARAM_H
96 #include <sys/param.h>
97 #endif
98 ])
99 if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
100         AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
101         AC_EGREP_CPP(yes,
102 [
103 #include <sys/queue.h>
104 #ifdef TAILQ_FOREACH
105  yes
106 #endif
107 ],      [AC_MSG_RESULT(yes)
108          AC_DEFINE(HAVE_TAILQFOREACH, 1,
109                 [Define if TAILQ_FOREACH is defined in <sys/queue.h>])],
110         AC_MSG_RESULT(no)
111         )
112 fi
113
114 if test "x$ac_cv_header_sys_time_h" = "xyes"; then
115         AC_MSG_CHECKING(for timeradd in sys/time.h)
116         AC_EGREP_CPP(yes,
117 [
118 #include <sys/time.h>
119 #ifdef timeradd
120  yes
121 #endif
122 ],      [ AC_DEFINE(HAVE_TIMERADD, 1,
123                 [Define if timeradd is defined in <sys/time.h>])
124           AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
125 )
126 fi
127
128 if test "x$ac_cv_header_sys_time_h" = "xyes"; then
129         AC_MSG_CHECKING(for timercmp in sys/time.h)
130         AC_EGREP_CPP(yes,
131 [
132 #include <sys/time.h>
133 #ifdef timercmp
134  yes
135 #endif
136 ],      [ AC_DEFINE(HAVE_TIMERCMP, 1,
137                 [Define if timercmp is defined in <sys/time.h>])
138           AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
139 )
140 fi
141
142 if test "x$ac_cv_header_sys_time_h" = "xyes"; then
143         AC_MSG_CHECKING(for timerclear in sys/time.h)
144         AC_EGREP_CPP(yes,
145 [
146 #include <sys/time.h>
147 #ifdef timerclear
148  yes
149 #endif
150 ],      [ AC_DEFINE(HAVE_TIMERCLEAR, 1,
151                 [Define if timerclear is defined in <sys/time.h>])
152           AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
153 )
154 fi
155
156 if test "x$ac_cv_header_sys_time_h" = "xyes"; then
157         AC_MSG_CHECKING(for timerisset in sys/time.h)
158         AC_EGREP_CPP(yes,
159 [
160 #include <sys/time.h>
161 #ifdef timerisset
162  yes
163 #endif
164 ],      [ AC_DEFINE(HAVE_TIMERISSET, 1,
165                 [Define if timerisset is defined in <sys/time.h>])
166           AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
167 )
168 fi
169
170 if test "x$ac_cv_header_sys_sysctl_h" = "xyes"; then
171         AC_CHECK_DECLS([CTL_KERN, KERN_RANDOM, RANDOM_UUID, KERN_ARND], [], [],
172            [[#include <sys/types.h>
173              #include <sys/sysctl.h>]]
174         )
175 fi
176
177 dnl - check if the macro WIN32 is defined on this compiler.
178 dnl - (this is how we check for a windows version of GCC)
179 AC_MSG_CHECKING(for WIN32)
180 AC_TRY_COMPILE(,
181         [
182 #ifndef WIN32
183 die horribly
184 #endif
185         ],
186         bwin32=true; AC_MSG_RESULT(yes),
187         bwin32=false; AC_MSG_RESULT(no),
188 )
189
190 AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
191
192 if test x$bwin32 = xtrue; then
193    AC_SEARCH_LIBS([getservbyname],[ws2_32])
194 fi
195
196 dnl Checks for typedefs, structures, and compiler characteristics.
197 AC_C_CONST
198 AC_C_INLINE
199 AC_HEADER_TIME
200
201 dnl Checks for library functions.
202 AC_CHECK_FUNCS(gettimeofday vasprintf fcntl clock_gettime strtok_r strsep getaddrinfo getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getservbyname getprotobynumber setenv unsetenv putenv)
203
204 # Check for gethostbyname_r in all its glorious incompatible versions.
205 #   (This is cut-and-pasted from Tor, which based its logic on
206 #   Python's configure.in.)
207 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
208   [Define this if you have any gethostbyname_r()])
209
210 AC_CHECK_FUNC(gethostbyname_r, [
211   AC_MSG_CHECKING([how many arguments gethostbyname_r() wants])
212   OLD_CFLAGS=$CFLAGS
213   CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
214   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
215 #include <netdb.h>
216   ], [[
217     char *cp1, *cp2;
218     struct hostent *h1, *h2;
219     int i1, i2;
220     (void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
221   ]]),[
222     AC_DEFINE(HAVE_GETHOSTBYNAME_R)
223     AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
224      [Define this if gethostbyname_r takes 6 arguments])
225     AC_MSG_RESULT(6)
226   ], [
227     AC_TRY_COMPILE([
228 #include <netdb.h>
229     ], [
230       char *cp1, *cp2;
231       struct hostent *h1;
232       int i1, i2;
233       (void)gethostbyname_r(cp1,h1,cp2,i1,&i2);
234     ], [
235       AC_DEFINE(HAVE_GETHOSTBYNAME_R)
236       AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
237         [Define this if gethostbyname_r takes 5 arguments])
238       AC_MSG_RESULT(5)
239    ], [
240       AC_TRY_COMPILE([
241 #include <netdb.h>
242      ], [
243        char *cp1;
244        struct hostent *h1;
245        struct hostent_data hd;
246        (void) gethostbyname_r(cp1,h1,&hd);
247      ], [
248        AC_DEFINE(HAVE_GETHOSTBYNAME_R)
249        AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
250          [Define this if gethostbyname_r takes 3 arguments])
251        AC_MSG_RESULT(3)
252      ], [
253        AC_MSG_RESULT(0)
254      ])
255   ])
256  ])
257  CFLAGS=$OLD_CFLAGS
258 ])
259
260
261 AC_CHECK_SIZEOF(long)
262
263 AC_MSG_CHECKING(for F_SETFD in fcntl.h)
264 AC_EGREP_CPP(yes,
265 [
266 #define _GNU_SOURCE
267 #include <fcntl.h>
268 #ifdef F_SETFD
269 yes
270 #endif
271 ],      [ AC_DEFINE(HAVE_SETFD, 1,
272               [Define if F_SETFD is defined in <fcntl.h>])
273           AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no))
274
275 needsignal=no
276 haveselect=no
277 if test x$bwin32 != xtrue; then
278     AC_CHECK_FUNCS(select, [haveselect=yes], )
279     if test "x$haveselect" = "xyes" ; then
280         needsignal=yes
281     fi
282 fi
283 AM_CONDITIONAL(SELECT_BACKEND, [test "x$haveselect" = "xyes"])
284
285 havepoll=no
286 AC_CHECK_FUNCS(poll, [havepoll=yes], )
287 if test "x$havepoll" = "xyes" ; then
288         needsignal=yes
289 fi
290 AM_CONDITIONAL(POLL_BACKEND, [test "x$havepoll" = "xyes"])
291
292 havedevpoll=no
293 if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
294         AC_DEFINE(HAVE_DEVPOLL, 1,
295                     [Define if /dev/poll is available])
296 fi
297 AM_CONDITIONAL(DEVPOLL_BACKEND, [test "x$ac_cv_header_sys_devpoll_h" = "xyes"])
298
299 havekqueue=no
300 if test "x$ac_cv_header_sys_event_h" = "xyes"; then
301         AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
302         if test "x$havekqueue" = "xyes" ; then
303                 AC_MSG_CHECKING(for working kqueue)
304                 AC_TRY_RUN(
305 #include <sys/types.h>
306 #include <sys/time.h>
307 #include <sys/event.h>
308 #include <stdio.h>
309 #include <unistd.h>
310 #include <fcntl.h>
311
312 int
313 main(int argc, char **argv)
314 {
315         int kq;
316         int n;
317         int fd[[2]];
318         struct kevent ev;
319         struct timespec ts;
320         char buf[[8000]];
321
322         if (pipe(fd) == -1)
323                 exit(1);
324         if (fcntl(fd[[1]], F_SETFL, O_NONBLOCK) == -1)
325                 exit(1);
326
327         while ((n = write(fd[[1]], buf, sizeof(buf))) == sizeof(buf))
328                 ;
329
330         if ((kq = kqueue()) == -1)
331                 exit(1);
332
333         memset(&ev, 0, sizeof(ev));
334         ev.ident = fd[[1]];
335         ev.filter = EVFILT_WRITE;
336         ev.flags = EV_ADD | EV_ENABLE;
337         n = kevent(kq, &ev, 1, NULL, 0, NULL);
338         if (n == -1)
339                 exit(1);
340
341         read(fd[[0]], buf, sizeof(buf));
342
343         ts.tv_sec = 0;
344         ts.tv_nsec = 0;
345         n = kevent(kq, NULL, 0, &ev, 1, &ts);
346         if (n == -1 || n == 0)
347                 exit(1);
348
349         exit(0);
350 }, [AC_MSG_RESULT(yes)
351     AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
352                 [Define if kqueue works correctly with pipes])
353     havekqueue=yes
354     ], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
355         fi
356 fi
357 AM_CONDITIONAL(KQUEUE_BACKEND, [test "x$havekqueue" = "xyes"])
358
359 haveepollsyscall=no
360 haveepoll=no
361 AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
362 if test "x$haveepoll" = "xyes" ; then
363         AC_DEFINE(HAVE_EPOLL, 1,
364                 [Define if your system supports the epoll system calls])
365         needsignal=yes
366 fi
367 if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
368         if test "x$haveepoll" = "xno" ; then
369                 AC_MSG_CHECKING(for epoll system call)
370                 AC_TRY_RUN(
371 #include <stdint.h>
372 #include <sys/param.h>
373 #include <sys/types.h>
374 #include <sys/syscall.h>
375 #include <sys/epoll.h>
376 #include <unistd.h>
377
378 int
379 epoll_create(int size)
380 {
381         return (syscall(__NR_epoll_create, size));
382 }
383
384 int
385 main(int argc, char **argv)
386 {
387         int epfd;
388
389         epfd = epoll_create(256);
390         exit (epfd == -1 ? 1 : 0);
391 }, [AC_MSG_RESULT(yes)
392     AC_DEFINE(HAVE_EPOLL, 1,
393         [Define if your system supports the epoll system calls])
394     needsignal=yes
395     have_epoll=yes
396     AC_LIBOBJ(epoll_sub)
397     ], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
398         fi
399 fi
400 AM_CONDITIONAL(EPOLL_BACKEND, [test "x$haveepoll" = "xyes"])
401
402 haveeventports=no
403 AC_CHECK_FUNCS(port_create, [haveeventports=yes], )
404 if test "x$haveeventports" = "xyes" ; then
405         AC_DEFINE(HAVE_EVENT_PORTS, 1,
406                 [Define if your system supports event ports])
407         needsignal=yes
408 fi
409 AM_CONDITIONAL(EVPORT_BACKEND, [test "x$haveeventports" = "xyes"])
410
411 if test "x$bwin32" = "xtrue"; then
412         needsignal=yes
413 fi
414
415 AM_CONDITIONAL(SIGNAL_SUPPORT, [test "x$needsignal" = "xyes"])
416
417 AC_TYPE_PID_T
418 AC_TYPE_SIZE_T
419 AC_TYPE_SSIZE_T
420
421 AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t, uintptr_t], , ,
422 [#ifdef HAVE_STDINT_H
423 #include <stdint.h>
424 #elif defined(HAVE_INTTYPES_H)
425 #include <inttypes.h>
426 #endif
427 #ifdef HAVE_SYS_TYPES_H
428 #include <sys/types.h>
429 #endif])
430
431 AC_CHECK_TYPES([fd_mask], , ,
432 [#ifdef HAVE_SYS_TYPES_H
433 #include <sys/types.h>
434 #endif
435 #ifdef HAVE_SYS_SELECT_H
436 #include <sys/select.h>
437 #endif])
438
439 AC_CHECK_SIZEOF(long long)
440 AC_CHECK_SIZEOF(long)
441 AC_CHECK_SIZEOF(int)
442 AC_CHECK_SIZEOF(short)
443 AC_CHECK_SIZEOF(size_t)
444 AC_CHECK_SIZEOF(void *)
445
446 AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo], , ,
447 [#define _GNU_SOURCE
448 #include <sys/types.h>
449 #ifdef HAVE_NETINET_IN_H
450 #include <netinet/in.h>
451 #endif
452 #ifdef HAVE_NETINET_IN6_H
453 #include <netinet/in6.h>
454 #endif
455 #ifdef HAVE_SYS_SOCKET_H
456 #include <sys/socket.h>
457 #endif
458 #ifdef HAVE_NETDB_H
459 #include <netdb.h>
460 #endif
461 #ifdef WIN32
462 #define WIN32_WINNT 0x400
463 #define _WIN32_WINNT 0x400
464 #define WIN32_LEAN_AND_MEAN
465 #if defined(_MSC_VER) && (_MSC_VER < 1300)
466 #include <winsock.h>
467 #else
468 #include <winsock2.h>
469 #include <ws2tcpip.h>
470 #endif
471 #endif
472 ])
473 AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct sockaddr_in.sin_len, struct sockaddr_in6.sin6_len, struct sockaddr_storage.ss_family, struct sockaddr_storage.__ss_family], , ,
474 [#include <sys/types.h>
475 #ifdef HAVE_NETINET_IN_H
476 #include <netinet/in.h>
477 #endif
478 #ifdef HAVE_NETINET_IN6_H
479 #include <netinet/in6.h>
480 #endif
481 #ifdef HAVE_SYS_SOCKET_H
482 #include <sys/socket.h>
483 #endif
484 #ifdef WIN32
485 #define WIN32_WINNT 0x400
486 #define _WIN32_WINNT 0x400
487 #define WIN32_LEAN_AND_MEAN
488 #if defined(_MSC_VER) && (_MSC_VER < 1300)
489 #include <winsock.h>
490 #else
491 #include <winsock2.h>
492 #include <ws2tcpip.h>
493 #endif
494 #endif
495 ])
496
497 AC_MSG_CHECKING([for socklen_t])
498 AC_TRY_COMPILE([
499  #include <sys/types.h>
500  #include <sys/socket.h>],
501   [socklen_t x;],
502   AC_MSG_RESULT([yes]),
503   [AC_MSG_RESULT([no])
504   AC_DEFINE(socklen_t, unsigned int,
505         [Define to unsigned int if you dont have it])]
506 )
507
508 AC_MSG_CHECKING([whether our compiler supports __func__])
509 AC_TRY_COMPILE([],
510  [ const char *cp = __func__; ],
511  AC_MSG_RESULT([yes]),
512  AC_MSG_RESULT([no])
513  AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
514  AC_TRY_COMPILE([],
515    [ const char *cp = __FUNCTION__; ],
516    AC_MSG_RESULT([yes])
517    AC_DEFINE(__func__, __FUNCTION__,
518          [Define to appropriate substitue if compiler doesnt have __func__]),
519    AC_MSG_RESULT([no])
520    AC_DEFINE(__func__, __FILE__,
521          [Define to appropriate substitue if compiler doesnt have __func__])))
522
523
524 # check if we can compile with pthreads
525 have_pthreads=no
526 if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then
527   ACX_PTHREAD([
528         AC_DEFINE(HAVE_PTHREADS, 1,
529                 [Define if we have pthreads on this system])
530         have_pthreads=yes])
531   CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
532   AC_CHECK_SIZEOF(pthread_t, ,
533      [AC_INCLUDES_DEFAULT()
534       #include <pthread.h> ]
535   )
536 fi
537 AM_CONDITIONAL(PTHREADS, [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"])
538
539 # check if we should compile locking into the library
540 if test x$enable_thread_support = xno; then
541    AC_DEFINE(DISABLE_THREAD_SUPPORT, 1,
542         [Define if libevent should not be compiled with thread support])
543 fi
544
545 # check if we should hard-code the mm functions.
546 if test x$enable_malloc_replacement = xno; then
547   AC_DEFINE(DISABLE_MM_REPLACEMENT, 1,
548         [Define if libevent should not allow replacing the mm functions])
549 fi
550
551 # check if we should hard-code debugging out
552 if test x$enable_debug_mode = xno; then
553   AC_DEFINE(DISABLE_DEBUG_MODE, 1,
554         [Define if libevent should build without support for a debug mode])
555 fi
556
557 # check if we have and should use openssl
558 AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
559
560 # Add some more warnings which we use in development but not in the
561 # released versions.  (Some relevant gcc versions can't handle these.)
562 if test x$enable_gcc_warnings = xyes; then
563
564   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [
565 #if !defined(__GNUC__) || (__GNUC__ < 4)
566 #error
567 #endif]), have_gcc4=yes, have_gcc4=no)
568
569   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [
570 #if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
571 #error
572 #endif]), have_gcc42=yes, have_gcc42=no)
573
574   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [
575 #if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
576 #error
577 #endif]), have_gcc45=yes, have_gcc45=no)
578
579   CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror"
580   CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing"
581
582   if test x$have_gcc4 = xyes ; then
583     # These warnings break gcc 3.3.5 and work on gcc 4.0.2
584     CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement"
585     #CFLAGS="$CFLAGS -Wold-style-definition"
586   fi
587
588   if test x$have_gcc42 = xyes ; then
589     # These warnings break gcc 4.0.2 and work on gcc 4.2
590     CFLAGS="$CFLAGS -Waddress -Wnormalized=id -Woverride-init"
591   fi
592
593   if test x$have_gcc45 = xyes ; then
594     # These warnings work on gcc 4.5
595     CFLAGS="$CFLAGS -Wlogical-op"
596   fi
597 ##This will break the world on some 64-bit architectures
598 # CFLAGS="$CFLAGS -Winline"
599
600 fi
601
602 AC_CONFIG_FILES( [libevent.pc libevent_openssl.pc libevent_pthreads.pc] )
603 AC_OUTPUT(Makefile include/Makefile test/Makefile sample/Makefile)