update changelog
[catagits/fcgi2.git] / configure.in
CommitLineData
ec728770 1dnl $Id: configure.in,v 1.7 2001/09/21 16:13:46 skimo 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
7# This file and the script it generates is used by both the devkit
8# and the Perl FCGI module. Although each has slightly different
9# requirements, this allows the build environment to maintained by one
10# file set. The FCGI build is idendified by the presence of the
11# file FCGI.XL. If its not found, its consider a devkit build.
0198fd3c 12
8bd181b5 13AC_INIT
af1181af 14AM_INIT_AUTOMAKE(fcgi, 2.2.1)
f802ee92 15
16if test -f "FCGI.XL"; then
17 FCGI_BUILD='true'
18fi
19
20if test "$FCGI_BUILD"; then
af1181af 21 AM_CONFIG_HEADER([fcgi_config.h])
f802ee92 22else
af1181af 23 AM_CONFIG_HEADER([include/fcgi_config.h])
f802ee92 24fi
8bd181b5 25
26AC_PROG_CC
27AC_PROG_CPP
28AC_PROG_INSTALL
ec728770 29AC_PROG_LIBTOOL
8bd181b5 30AC_PROG_RANLIB
eb7bc90d 31AC_CHECK_TOOL([AR], [ar], [ar])
32
33AC_CHECK_LIB([nsl], [main]) ac_cv_lib_nsl=ac_cv_lib_nsl_main
34AC_CHECK_LIB([resolv], [main]) ac_cv_lib_resolv=ac_cv_lib_resolv_main
35AC_CHECK_LIB([socket], [main]) ac_cv_lib_socket=ac_cv_lib_socket_main
36AC_CHECK_LIB([dnet_stub], [main]) ac_cv_lib_dnet_stub=ac_cv_lib_dnet_stub_main
37AC_CHECK_LIB([ieee], [main]) ac_cv_lib_ieee=ac_cv_lib_ieee_main
38
39AC_CHECK_LIB([pthread], [main],
40 [AC_DEFINE([HAVE_LIBPTHREAD], [1],
41 [Define if you have the pthread library])
42 AC_SUBST([HAVE_LIBPTHREAD])])
43ac_cv_lib_pthread=ac_cv_lib_pthread_main
44
45AC_CHECK_TYPE([ssize_t], [int])
46
47AC_MSG_CHECKING([for sun_len in sys/un.h])
48AC_EGREP_HEADER([sun_len], [sys/un.h],
49 [AC_MSG_RESULT([yes])
50 AC_DEFINE([HAVE_SOCKADDR_UN_SUN_LEN], [1],
51 [Define if sockaddr_un in sys/un.h contains a sun_len component])],
52 AC_MSG_RESULT([no]))
53
54AC_REPLACE_FUNCS([strerror])
55
56AC_MSG_CHECKING([for fpos_t in stdio.h])
57AC_EGREP_HEADER([fpos_t], [stdio.h],
58 [AC_MSG_RESULT([yes])
59 AC_DEFINE([HAVE_FPOS], [1], [Define if the fpos_t typedef is in stdio.h])],
60 AC_MSG_RESULT([no]))
61
62AC_CHECK_HEADERS([sys/socket.h netdb.h netinet/in.h arpa/inet.h sys/time.h limits.h sys/param.h unistd.h])
63
64AC_MSG_CHECKING([for a fileno() prototype in stdio.h])
65AC_EGREP_HEADER([fileno], [stdio.h],
66 [AC_MSG_RESULT([yes])
67 AC_DEFINE([HAVE_FILENO_PROTO], [1],
68 [Define if there's a fileno() prototype in stdio.h])],
69 AC_MSG_RESULT([no]))
70
71if test "$HAVE_SYS_SOCKET_H"; then
72 AC_MSG_CHECKING([for socklen_t in sys/socket.h])
73 AC_EGREP_HEADER([socklen_t], [sys/socket.h],
74 [AC_MSG_RESULT([yes])
75 AC_DEFINE([HAVE_SOCKLEN], [1],
76 [Define if the socklen_t typedef is in sys/socket.h])],
77 AC_MSG_RESULT([no]))
3361128b 78fi
79
0198fd3c 80#--------------------------------------------------------------------
81# Do we need cross-process locking on this platform?
82#--------------------------------------------------------------------
eb7bc90d 83AC_MSG_CHECKING([whether cross-process locking is required by accept()])
0198fd3c 84case "`uname -sr`" in
eb7bc90d 85 IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
86 AC_MSG_RESULT([yes])
87 AC_DEFINE([USE_LOCKING], [1],
88 [Define if cross-process locking is required by accept()])
89 ;;
0198fd3c 90 *)
eb7bc90d 91 AC_MSG_RESULT([no])
92 ;;
0198fd3c 93esac
94
95#--------------------------------------------------------------------
96# Does va_arg(arg, long double) crash the compiler?
97# hpux 9.04 compiler does and so does Stratus FTX (uses HP's compiler)
98#--------------------------------------------------------------------
eb7bc90d 99AC_MSG_CHECKING([whether va_arg(arg, long double) crashes the compiler])
0198fd3c 100AC_TRY_COMPILE([#include <stdarg.h>],
101 [long double lDblArg; va_list arg; lDblArg = va_arg(arg, long double);],
eb7bc90d 102 AC_MSG_RESULT([no]),
103 [AC_MSG_RESULT([yes])
104 AC_DEFINE([HAVE_VA_ARG_LONG_DOUBLE_BUG], [1],
105 [Define if va_arg(arg, long double) crashes the compiler])])
0198fd3c 106
f802ee92 107AC_C_CONST
108AC_C_INLINE
109
0198fd3c 110#--------------------------------------------------------------------
f802ee92 111# This is a little hokie in that it avoids including config.guess
112# and config.sub in the distribution, but its been working so far.
113# Windows builds don't run configure so we should be safe fixing
114# this to 'unix' (at least for now).
0198fd3c 115#--------------------------------------------------------------------
f802ee92 116SYSTEM=unix
eb7bc90d 117AC_SUBST([SYSTEM])
f802ee92 118
119L=a
eb7bc90d 120AC_SUBST([L])
f802ee92 121
122if test "$GCC"; then
eb7bc90d 123 CCDEFS="$CCDEFS -Wall -Wmissing-prototypes"
f802ee92 124fi
125
eb7bc90d 126AC_SUBST([CCDEFS])
f802ee92 127
eb7bc90d 128AC_OBJEXT
129AC_SUBST([EXEEXT])
f802ee92 130
131if test -z "$FCGI_BUILD"; then
132 AC_CONFIG_FILES([Makefile
133 libfcgi/Makefile
134 cgi-fcgi/Makefile
135 examples/Makefile])
136fi
137
8bd181b5 138AC_OUTPUT
0198fd3c 139