use real function names when looking for libraries to prevent breakage under Solaris...
[catagits/fcgi2.git] / configure.in
CommitLineData
6fb35433 1dnl $Id: configure.in,v 1.23 2001/12/07 21:08:38 robs Exp $
0198fd3c 2dnl
3dnl This file is an input file used by the GNU "autoconf" program to
4dnl generate the file "configure", which is run during the build
5dnl to configure the system for the local environment.
f802ee92 6
8bd181b5 7AC_INIT
27b2c28d 8AM_INIT_AUTOMAKE(fcgi, 2.2.3)
f802ee92 9
92079298 10AM_CONFIG_HEADER(fcgi_config.h)
8bd181b5 11
12AC_PROG_CC
13AC_PROG_CPP
14AC_PROG_INSTALL
ec728770 15AC_PROG_LIBTOOL
eb7bc90d 16
72cb9f19 17AC_PROG_CXX
18
fae4909b 19AC_LANG([C++])
20
6a149ad6 21dnl autoconf defaults CXX to 'g++', so its unclear whether it exists/works
22AC_MSG_CHECKING([whether $CXX works])
6a149ad6 23AC_TRY_COMPILE([#include <iostream.h>], [istream is(NULL);],
fae4909b 24 [LIBFCGIXX=libfcgi++.la
25 ECHO_CPP=echo-cpp${EXEEXT}
26 AC_MSG_RESULT(yes)
27 AC_MSG_CHECKING([whether cin has a streambuf assignment operator])
28 AC_TRY_COMPILE([#include <iostream.h>], [cin = static_cast<streambuf *>(0);],
29 [AC_DEFINE([HAVE_IOSTREAM_WITHASSIGN_STREAMBUF], [1],
30 [Define if cin/cout/cerr has a streambuf assignment operator])
31 AC_MSG_RESULT(yes)],
32 [AC_MSG_RESULT(no)])],
6a149ad6 33 [AC_MSG_RESULT(no)])
6a149ad6 34AC_SUBST(LIBFCGIXX)
35AC_SUBST(ECHO_CPP)
36
fae4909b 37AC_LANG([C])
38
6fb35433 39AC_CHECK_LIB([nsl], [gethostbyname])
40AC_CHECK_LIB([socket], [socket])
eb7bc90d 41
6fb35433 42dnl AC_CHECK_LIB([resolv], [main])
43dnl AC_CHECK_LIB([dnet_stub], [main])
44dnl AC_CHECK_LIB([ieee], [main])
45
46AC_CHECK_LIB([pthread], [pthread_create], [threaded=threaded${EXEEXT}])
fae4909b 47AC_SUBST([threaded])
eb7bc90d 48
7ef79c64 49FCGI_COMMON_CHECKS
eb7bc90d 50
51AC_REPLACE_FUNCS([strerror])
52
f802ee92 53AC_C_INLINE
54
0198fd3c 55#--------------------------------------------------------------------
f802ee92 56# This is a little hokie in that it avoids including config.guess
57# and config.sub in the distribution, but its been working so far.
58# Windows builds don't run configure so we should be safe fixing
59# this to 'unix' (at least for now).
0198fd3c 60#--------------------------------------------------------------------
f802ee92 61SYSTEM=unix
eb7bc90d 62AC_SUBST([SYSTEM])
f802ee92 63
f802ee92 64if test "$GCC"; then
fae4909b 65 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
f802ee92 66fi
67
fae4909b 68AC_CONFIG_FILES([Makefile
69 cgi-fcgi/Makefile
70 include/Makefile
71 libfcgi/Makefile
72 examples/Makefile])
f802ee92 73
8bd181b5 74AC_OUTPUT