Break out the clean target and establish a dependency on fcgi_config.h
[catagits/fcgi2.git] / configure.in
CommitLineData
f802ee92 1dnl $Id: configure.in,v 1.4 2001/08/30 22:13:01 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
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
f802ee92 14
15if test -f "FCGI.XL"; then
16 FCGI_BUILD='true'
17fi
18
19if test "$FCGI_BUILD"; then
20 AC_CONFIG_HEADER(fcgi_config.h)
21else
22 AC_CONFIG_HEADER(include/fcgi_config.h)
23fi
8bd181b5 24
25AC_PROG_CC
26AC_PROG_CPP
27AC_PROG_INSTALL
28AC_PROG_RANLIB
29AC_CHECK_TOOL(AR, ar, ar)
30
31AC_CHECK_LIB([nsl],[main],[],[],[])ac_cv_lib_nsl=ac_cv_lib_nsl_main
32
33AC_CHECK_LIB([resolv],[main],[],[],[])ac_cv_lib_resolv=ac_cv_lib_resolv_main
34
35AC_CHECK_LIB([socket],[main],[],[],[])ac_cv_lib_socket=ac_cv_lib_socket_main
36
37AC_CHECK_LIB([dnet_stub],[main],[],[],[])ac_cv_lib_dnet_stub=ac_cv_lib_dnet_stub_main
38
39AC_CHECK_LIB([ieee],[main],[],[],[])ac_cv_lib_ieee=ac_cv_lib_ieee_main
40
f802ee92 41AC_CHECK_TYPE(ssize_t, int)
42
0198fd3c 43AC_MSG_CHECKING(for sun_len in sys/un.h)
44AC_EGREP_HEADER(sun_len,
45 sys/un.h,
46 AC_MSG_RESULT(yes)
47 AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN),
48 AC_MSG_RESULT(no))
49
8bd181b5 50AC_CHECK_FUNCS(strerror)
51AC_REPLACE_FUNCS(strerror)
0198fd3c 52
53AC_MSG_CHECKING(for fpos in stdio.h)
54AC_EGREP_HEADER(fpos_t,
55 stdio.h,
56 AC_MSG_RESULT(yes)
57 AC_DEFINE(HAVE_FPOS),
58 AC_MSG_RESULT(no))
59
8bd181b5 60AC_CHECK_HEADERS([sys/socket.h],[have_sys_socket=yes])
61AC_CHECK_HEADERS([netdb.h])
62AC_CHECK_HEADERS([netinet/in.h])
63AC_CHECK_HEADERS([arpa/inet.h])
64AC_CHECK_HEADERS([sys/time.h])
65AC_CHECK_HEADERS([limits.h])
0198fd3c 66
3361128b 67if test "x$have_sys_socket" = "xyes"; then
68 AC_MSG_CHECKING(for socklen_t in sys/socket.h)
69 AC_EGREP_HEADER(socklen_t,
70 sys/socket.h,
71 AC_MSG_RESULT(yes)
72 AC_DEFINE(HAVE_SOCKLEN),
73 AC_MSG_RESULT(no))
74fi
75
0198fd3c 76#--------------------------------------------------------------------
77# Do we need cross-process locking on this platform?
78#--------------------------------------------------------------------
79AC_MSG_CHECKING("if this machine needs cross-process locking")
80case "`uname -sr`" in
81 IRIX\ 5.*)
82 AC_DEFINE(USE_LOCKING)
83 AC_MSG_RESULT(yes)
84 ;;
85 SunOS\ 5.*)
86 AC_DEFINE(USE_LOCKING)
87 AC_MSG_RESULT(yes)
88 ;;
89 UNIX_System_V\ 4.0)
90 AC_DEFINE(USE_LOCKING)
91 AC_MSG_RESULT(yes)
92 ;;
93 *)
94 AC_MSG_RESULT(no)
95 ;;
96esac
97
98#--------------------------------------------------------------------
99# Does va_arg(arg, long double) crash the compiler?
100# hpux 9.04 compiler does and so does Stratus FTX (uses HP's compiler)
101#--------------------------------------------------------------------
102AC_MSG_CHECKING(if va_arg(arg, long double) crashes the compiler)
103AC_TRY_COMPILE([#include <stdarg.h>],
104 [long double lDblArg; va_list arg; lDblArg = va_arg(arg, long double);],
105 AC_MSG_RESULT(no),
106 AC_DEFINE(HAVE_VA_ARG_LONG_DOUBLE_BUG)
107 AC_MSG_RESULT(yes))
108
f802ee92 109AC_C_CONST
110AC_C_INLINE
111
0198fd3c 112#--------------------------------------------------------------------
f802ee92 113# This is a little hokie in that it avoids including config.guess
114# and config.sub in the distribution, but its been working so far.
115# Windows builds don't run configure so we should be safe fixing
116# this to 'unix' (at least for now).
0198fd3c 117#--------------------------------------------------------------------
0198fd3c 118
f802ee92 119SYSTEM=unix
0198fd3c 120AC_SUBST(SYSTEM)
f802ee92 121
122L=a
123AC_SUBST(L)
124
125if test "$GCC"; then
126 CCDEFS="$CCDEFS -ansi -pedantic -Wall -Wmissing-prototypes"
127fi
128
129AC_SUBST(CCDEFS)
130
131AC_OBJEXT
132
133if test -z "$FCGI_BUILD"; then
134 AC_CONFIG_FILES([Makefile
135 libfcgi/Makefile
136 cgi-fcgi/Makefile
137 examples/Makefile])
138fi
139
8bd181b5 140AC_OUTPUT
0198fd3c 141