Update to autoconf 2.52.
[catagits/fcgi2.git] / perl / configure.in
1 dnl     $Id: configure.in,v 1.4 2001/08/29 18:49:18 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 dnl
7
8 AC_INIT
9 AC_CONFIG_SRCDIR([fcgiapp.c])
10 #--------------------------------------------------------------------
11 #  Perform common OMI configuration. This will include:
12 #       1) Choosing compiler and associated build options.
13 #       2) Checking for various common build associated programs.
14 #       3) Determining the best build options for this platform.
15 #       4) Checking for certain common header files.
16 #       5) Checking for exports/global switch.
17 #       6) Importing OMI dependencies (header files, libraries, and binaries).
18 #       7) Checking for existence of various system libraries and routines.
19 #--------------------------------------------------------------------
20
21 AC_PROG_CC
22 AC_CONFIG_HEADER(fcgi_config.h)
23 AC_MSG_CHECKING(for sun_len in sys/un.h)
24 AC_EGREP_HEADER(sun_len,
25    sys/un.h,
26    AC_MSG_RESULT(yes)
27    AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN),
28    AC_MSG_RESULT(no))
29
30 #--------------------------------------------------------------------
31 #  What extra libraries do we need for this platform?
32 #--------------------------------------------------------------------
33
34 AC_CHECK_FUNCS(strerror strtol)
35
36 AC_REPLACE_FUNCS(strerror strtol)
37
38 #--------------------------------------------------------------------
39 #       Include sys/select.h if it exists and if it supplies things
40 #       that appear to be useful and aren't already in sys/types.h.
41 #       This appears to be true only on the RS/6000 under AIX.  Some
42 #       systems like OSF/1 have a sys/select.h that's of no use, and
43 #       other systems like SCO UNIX have a sys/select.h that's
44 #       pernicious.  If "fd_set" isn't defined anywhere then set a
45 #       special flag.
46 #--------------------------------------------------------------------
47
48 AC_MSG_CHECKING(for fd_set in in sys/types.h)
49 AC_TRY_LINK([#include <sys/types.h>],
50    [fd_set readMask, writeMask;],
51    AC_MSG_RESULT(yes),
52    AC_MSG_RESULT(no)
53    AC_MSG_CHECKING(for fd_mask in in sys/select.h)
54    AC_EGREP_HEADER([fd_mask],[sys/select.h],[AC_MSG_RESULT(yes)
55       AC_DEFINE(HAVE_SYS_SELECT_H)],[AC_MSG_RESULT(no)
56       AC_DEFINE(NO_FD_SET)]))
57
58 AC_MSG_CHECKING(for fpos in stdio.h)
59 AC_EGREP_HEADER(fpos_t,
60    stdio.h,
61    AC_MSG_RESULT(yes)
62    AC_DEFINE(HAVE_FPOS),
63    AC_MSG_RESULT(no))
64
65 AC_CHECK_HEADERS([windows.h])
66 AC_CHECK_HEADERS([sys/socket.h],[have_sys_socket=yes])
67 AC_CHECK_HEADERS([winsock.h])
68 AC_CHECK_HEADERS([netdb.h])
69 AC_CHECK_HEADERS([netinet/in.h])
70 AC_CHECK_HEADERS([arpa/inet.h])
71 AC_CHECK_HEADERS([strings.h])
72 AC_CHECK_HEADERS([sys/time.h])
73 AC_CHECK_HEADERS([limits.h])
74
75 if test "x$have_sys_socket" = "xyes"; then
76     AC_MSG_CHECKING(for socklen_t in sys/socket.h)
77     AC_EGREP_HEADER(socklen_t,
78        sys/socket.h,
79        AC_MSG_RESULT(yes)
80        AC_DEFINE(HAVE_SOCKLEN),
81        AC_MSG_RESULT(no))
82 fi
83
84 #--------------------------------------------------------------------
85 #  Do we need cross-process locking on this platform?
86 #--------------------------------------------------------------------
87 AC_MSG_CHECKING("if this machine needs cross-process locking")
88 case "`uname -sr`" in
89     IRIX\ 5.*)  
90         AC_DEFINE(USE_LOCKING)
91         AC_MSG_RESULT(yes)
92     ;;
93     SunOS\ 5.*) 
94         AC_DEFINE(USE_LOCKING)
95         AC_MSG_RESULT(yes)
96     ;;
97     UNIX_System_V\ 4.0)
98         AC_DEFINE(USE_LOCKING)
99         AC_MSG_RESULT(yes)
100     ;;
101     *)
102         AC_MSG_RESULT(no)
103     ;;
104 esac
105
106 #--------------------------------------------------------------------
107 #  Does va_arg(arg, long double) crash the compiler?
108 #  hpux 9.04 compiler does and so does Stratus FTX (uses HP's compiler)
109 #--------------------------------------------------------------------
110 AC_MSG_CHECKING(if va_arg(arg, long double) crashes the compiler)
111 AC_TRY_COMPILE([#include <stdarg.h>],
112    [long double lDblArg; va_list arg; lDblArg = va_arg(arg, long double);],
113    AC_MSG_RESULT(no),
114    AC_DEFINE(HAVE_VA_ARG_LONG_DOUBLE_BUG)
115    AC_MSG_RESULT(yes))
116
117 #--------------------------------------------------------------------
118 #  What's the target system?
119 #--------------------------------------------------------------------
120 case "$PLATFORM_CLASS" in
121     WINDOWS)    
122         SYSTEM="win32"
123     ;;
124     UNIX)       
125         SYSTEM="unix"
126     ;;
127 esac
128
129 AC_SUBST(SYSTEM)
130 AC_OUTPUT