Changelog and bump versions for 0.70
[catagits/fcgi2.git] / configure.in
index 8c1a15f..211af56 100755 (executable)
-dnl     $Id: configure.in,v 1.2 1999/08/02 15:51:05 skimo Exp $
+dnl     $Id: configure.in,v 1.27 2003/06/22 02:15:10 robs Exp $
 dnl
 dnl     This file is an input file used by the GNU "autoconf" program to
 dnl     generate the file "configure", which is run during the build
 dnl     to configure the system for the local environment.
-dnl
 
-AC_INIT(libfcgi/fcgiapp.c)
-#--------------------------------------------------------------------
-#  Perform common OMI configuration. This will include:
-#      1) Choosing compiler and associated build options.
-#      2) Checking for various common build associated programs.
-#      3) Determining the best build options for this platform.
-#      4) Checking for certain common header files.
-#      5) Checking for exports/global switch.
-#      6) Importing OMI dependencies (header files, libraries, and binaries).
-#       7) Checking for existence of various system libraries and routines.
-#--------------------------------------------------------------------
-OMI_CONFIG
+AC_INIT
+AM_INIT_AUTOMAKE(fcgi, 2.4.1)
 
-AC_CONFIG_HEADER(include/fcgi_config.h)
-AC_MSG_CHECKING(for sun_len in sys/un.h)
-AC_EGREP_HEADER(sun_len,
-   sys/un.h,
-   AC_MSG_RESULT(yes)
-   AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN),
-   AC_MSG_RESULT(no))
+AM_CONFIG_HEADER(fcgi_config.h)
 
-#--------------------------------------------------------------------
-#  What extra libraries do we need for this platform?
-#--------------------------------------------------------------------
+AC_PROG_CC
+AC_PROG_CPP 
+AC_PROG_INSTALL 
+AC_PROG_LIBTOOL
 
-AC_CHECK_FUNCS(strerror strtol)
+AC_PROG_CXX
 
-AC_REPLACE_FUNCS(strerror strtol)
+AC_LANG([C++])
 
-#--------------------------------------------------------------------
-#       Include sys/select.h if it exists and if it supplies things
-#       that appear to be useful and aren't already in sys/types.h.
-#       This appears to be true only on the RS/6000 under AIX.  Some
-#       systems like OSF/1 have a sys/select.h that's of no use, and
-#       other systems like SCO UNIX have a sys/select.h that's
-#       pernicious.  If "fd_set" isn't defined anywhere then set a
-#       special flag.
-#--------------------------------------------------------------------
+dnl autoconf defaults CXX to 'g++', so its unclear whether it exists/works
+AC_MSG_CHECKING([whether $CXX works])
+AC_TRY_COMPILE([#include <iostream>], 
+               [std::cout << "ok";], 
+               [AC_MSG_RESULT(yes)
+                LIBFCGIXX=libfcgi++.la
+                ECHO_CPP=echo-cpp${EXEEXT}
+                AC_MSG_CHECKING([whether cin has a streambuf assignment operator])
+                AC_TRY_COMPILE([#include <iostream>], 
+                               [cin = static_cast<streambuf *>(0);], 
+                               [AC_MSG_RESULT(yes)
+                                AC_DEFINE([HAVE_IOSTREAM_WITHASSIGN_STREAMBUF],  [1], 
+                                          [Define if cin/cout/cerr has a streambuf assignment operator])],
+                               [AC_MSG_RESULT(no)]) 
+                AC_MSG_CHECKING([whether char_type is defined in the context of streambuf])
+                AC_TRY_COMPILE([#include <iostream>],
+                               [class fcgi_streambuf : public std::streambuf { char_type ct; }],
+                               [AC_MSG_RESULT(yes)
+                                AC_DEFINE([HAVE_STREAMBUF_CHAR_TYPE], [1], 
+                                          [Define if char_type is defined in the context of streambuf])],
+                               [AC_MSG_RESULT(no)])],
+               [AC_MSG_RESULT(no)])
+AC_SUBST(LIBFCGIXX)
+AC_SUBST(ECHO_CPP)
 
-AC_MSG_CHECKING(for fd_set in in sys/types.h)
-AC_TRY_LINK([#include <sys/types.h>],
-   [fd_set readMask, writeMask;],
-   AC_MSG_RESULT(yes),
-   AC_MSG_RESULT(no)
-   AC_MSG_CHECKING(for fd_mask in in sys/select.h)
-   AC_HEADER_EGREP(fd_mask,
-      sys/select.h,
-      AC_MSG_RESULT(yes)
-      AC_DEFINE(HAVE_SYS_SELECT_H),
-      AC_MSG_RESULT(no)
-      AC_DEFINE(NO_FD_SET)))
-
-AC_MSG_CHECKING(for fpos in stdio.h)
-AC_EGREP_HEADER(fpos_t,
-   stdio.h,
-   AC_MSG_RESULT(yes)
-   AC_DEFINE(HAVE_FPOS),
-   AC_MSG_RESULT(no))
-
-AC_HAVE_HEADERS(windows.h)
-AC_HAVE_HEADERS(sys/socket.h, [have_sys_socket=yes])
-AC_HAVE_HEADERS(winsock.h)
-AC_HAVE_HEADERS(netdb.h)
-AC_HAVE_HEADERS(netinet/in.h)
-AC_HAVE_HEADERS(arpa/inet.h)
-AC_HAVE_HEADERS(strings.h)
-AC_HAVE_HEADERS(sys/time.h)
-
-if test "x$have_sys_socket" = "xyes"; then
-    AC_MSG_CHECKING(for socklen_t in sys/socket.h)
-    AC_EGREP_HEADER(socklen_t,
-       sys/socket.h,
-       AC_MSG_RESULT(yes)
-       AC_DEFINE(HAVE_SOCKLEN),
-       AC_MSG_RESULT(no))
-fi
+AC_LANG([C])
 
-#--------------------------------------------------------------------
-#  Do we need cross-process locking on this platform?
-#--------------------------------------------------------------------
-AC_MSG_CHECKING("if this machine needs cross-process locking")
-case "`uname -sr`" in
-    IRIX\ 5.*) 
-       AC_DEFINE(USE_LOCKING)
-       AC_MSG_RESULT(yes)
-    ;;
-    SunOS\ 5.*)        
-       AC_DEFINE(USE_LOCKING)
-       AC_MSG_RESULT(yes)
-    ;;
-    UNIX_System_V\ 4.0)
-       AC_DEFINE(USE_LOCKING)
-       AC_MSG_RESULT(yes)
-    ;;
-    *)
-       AC_MSG_RESULT(no)
-    ;;
-esac
+AC_CHECK_LIB([nsl],       [gethostbyname])
+AC_CHECK_LIB([socket],    [socket]) 
 
-#--------------------------------------------------------------------
-#  Does va_arg(arg, long double) crash the compiler?
-#  hpux 9.04 compiler does and so does Stratus FTX (uses HP's compiler)
-#--------------------------------------------------------------------
-AC_MSG_CHECKING(if va_arg(arg, long double) crashes the compiler)
-AC_TRY_COMPILE([#include <stdarg.h>],
-   [long double lDblArg; va_list arg; lDblArg = va_arg(arg, long double);],
-   AC_MSG_RESULT(no),
-   AC_DEFINE(HAVE_VA_ARG_LONG_DOUBLE_BUG)
-   AC_MSG_RESULT(yes))
+ACX_PTHREAD([THREADED=threaded${EXEEXT}])
+AC_SUBST([THREADED])
+
+FCGI_COMMON_CHECKS
+
+AC_REPLACE_FUNCS([strerror])
+
+AC_C_INLINE
 
 #--------------------------------------------------------------------
-#  What's the target system?
+#  This is a little hokie in that it avoids including config.guess
+#  and config.sub in the distribution, but its been working so far.
+#  Windows builds don't run configure so we should be safe fixing
+#  this to 'unix' (at least for now).
 #--------------------------------------------------------------------
-case "$PLATFORM_CLASS" in
-    WINDOWS)   
-       SYSTEM="win32"
-    ;;
-    UNIX)      
-       SYSTEM="unix"
-    ;;
-esac
-
-AC_SUBST(SYSTEM)
-AC_OUTPUT(Makefile FastCGI.mak
-         libfcgi/Makefile libfcgi/libfcgi.mak
-         cgi-fcgi/Makefile cgi-fcgi/cgi-fcgi.mak
-         examples/Makefile )
+SYSTEM=unix
+AC_SUBST([SYSTEM])
+
+AC_PROG_CC_WARNINGS
+
+AC_CONFIG_FILES([Makefile
+                 cgi-fcgi/Makefile
+                 include/Makefile
+                 libfcgi/Makefile
+                 examples/Makefile])
 
+AC_OUTPUT