bump version to 0.82 and prepare for release
[catagits/fcgi2.git] / configure.in
1 dnl     $Id: configure.in,v 1.27 2003/06/22 02:15:10 robs Exp $
2 dnl
3 dnl     This file is an input file used by the GNU "autoconf" program to
4 dnl     generate the file "configure", which is run during the build
5 dnl     to configure the system for the local environment.
6
7 AC_INIT
8 AM_INIT_AUTOMAKE(fcgi, 2.4.1)
9
10 AM_CONFIG_HEADER(fcgi_config.h)
11
12 AC_PROG_CC
13 AC_PROG_CPP 
14 AC_PROG_INSTALL 
15 AC_PROG_LIBTOOL
16
17 AC_PROG_CXX
18
19 AC_LANG([C++])
20
21 dnl autoconf defaults CXX to 'g++', so its unclear whether it exists/works
22 AC_MSG_CHECKING([whether $CXX works])
23 AC_TRY_COMPILE([#include <iostream>], 
24                [std::cout << "ok";], 
25                [AC_MSG_RESULT(yes)
26                 LIBFCGIXX=libfcgi++.la
27                 ECHO_CPP=echo-cpp${EXEEXT}
28                 AC_MSG_CHECKING([whether cin has a streambuf assignment operator])
29                 AC_TRY_COMPILE([#include <iostream>], 
30                                [cin = static_cast<streambuf *>(0);], 
31                                [AC_MSG_RESULT(yes)
32                                 AC_DEFINE([HAVE_IOSTREAM_WITHASSIGN_STREAMBUF],  [1], 
33                                           [Define if cin/cout/cerr has a streambuf assignment operator])],
34                                [AC_MSG_RESULT(no)]) 
35                 AC_MSG_CHECKING([whether char_type is defined in the context of streambuf])
36                 AC_TRY_COMPILE([#include <iostream>],
37                                [class fcgi_streambuf : public std::streambuf { char_type ct; }],
38                                [AC_MSG_RESULT(yes)
39                                 AC_DEFINE([HAVE_STREAMBUF_CHAR_TYPE], [1], 
40                                           [Define if char_type is defined in the context of streambuf])],
41                                [AC_MSG_RESULT(no)])],
42                [AC_MSG_RESULT(no)])
43 AC_SUBST(LIBFCGIXX)
44 AC_SUBST(ECHO_CPP)
45
46 AC_LANG([C])
47
48 AC_CHECK_LIB([nsl],       [gethostbyname])
49 AC_CHECK_LIB([socket],    [socket]) 
50
51 ACX_PTHREAD([THREADED=threaded${EXEEXT}])
52 AC_SUBST([THREADED])
53
54 FCGI_COMMON_CHECKS
55
56 AC_REPLACE_FUNCS([strerror])
57
58 AC_C_INLINE
59
60 #--------------------------------------------------------------------
61 #  This is a little hokie in that it avoids including config.guess
62 #  and config.sub in the distribution, but its been working so far.
63 #  Windows builds don't run configure so we should be safe fixing
64 #  this to 'unix' (at least for now).
65 #--------------------------------------------------------------------
66 SYSTEM=unix
67 AC_SUBST([SYSTEM])
68
69 AC_PROG_CC_WARNINGS
70
71 AC_CONFIG_FILES([Makefile
72                  cgi-fcgi/Makefile
73                  include/Makefile
74                  libfcgi/Makefile
75                  examples/Makefile])
76
77 AC_OUTPUT