Commit | Line | Data |
f802ee92 |
1 | dnl $Id: configure.in,v 1.4 2001/08/30 22:13:01 robs Exp $ |
0198fd3c |
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. |
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 |
13 | AC_INIT |
f802ee92 |
14 | |
15 | if test -f "FCGI.XL"; then |
16 | FCGI_BUILD='true' |
17 | fi |
18 | |
19 | if test "$FCGI_BUILD"; then |
20 | AC_CONFIG_HEADER(fcgi_config.h) |
21 | else |
22 | AC_CONFIG_HEADER(include/fcgi_config.h) |
23 | fi |
8bd181b5 |
24 | |
25 | AC_PROG_CC |
26 | AC_PROG_CPP |
27 | AC_PROG_INSTALL |
28 | AC_PROG_RANLIB |
29 | AC_CHECK_TOOL(AR, ar, ar) |
30 | |
31 | AC_CHECK_LIB([nsl],[main],[],[],[])ac_cv_lib_nsl=ac_cv_lib_nsl_main |
32 | |
33 | AC_CHECK_LIB([resolv],[main],[],[],[])ac_cv_lib_resolv=ac_cv_lib_resolv_main |
34 | |
35 | AC_CHECK_LIB([socket],[main],[],[],[])ac_cv_lib_socket=ac_cv_lib_socket_main |
36 | |
37 | AC_CHECK_LIB([dnet_stub],[main],[],[],[])ac_cv_lib_dnet_stub=ac_cv_lib_dnet_stub_main |
38 | |
39 | AC_CHECK_LIB([ieee],[main],[],[],[])ac_cv_lib_ieee=ac_cv_lib_ieee_main |
40 | |
f802ee92 |
41 | AC_CHECK_TYPE(ssize_t, int) |
42 | |
0198fd3c |
43 | AC_MSG_CHECKING(for sun_len in sys/un.h) |
44 | AC_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 |
50 | AC_CHECK_FUNCS(strerror) |
51 | AC_REPLACE_FUNCS(strerror) |
0198fd3c |
52 | |
53 | AC_MSG_CHECKING(for fpos in stdio.h) |
54 | AC_EGREP_HEADER(fpos_t, |
55 | stdio.h, |
56 | AC_MSG_RESULT(yes) |
57 | AC_DEFINE(HAVE_FPOS), |
58 | AC_MSG_RESULT(no)) |
59 | |
8bd181b5 |
60 | AC_CHECK_HEADERS([sys/socket.h],[have_sys_socket=yes]) |
61 | AC_CHECK_HEADERS([netdb.h]) |
62 | AC_CHECK_HEADERS([netinet/in.h]) |
63 | AC_CHECK_HEADERS([arpa/inet.h]) |
64 | AC_CHECK_HEADERS([sys/time.h]) |
65 | AC_CHECK_HEADERS([limits.h]) |
0198fd3c |
66 | |
3361128b |
67 | if 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)) |
74 | fi |
75 | |
0198fd3c |
76 | #-------------------------------------------------------------------- |
77 | # Do we need cross-process locking on this platform? |
78 | #-------------------------------------------------------------------- |
79 | AC_MSG_CHECKING("if this machine needs cross-process locking") |
80 | case "`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 | ;; |
96 | esac |
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 | #-------------------------------------------------------------------- |
102 | AC_MSG_CHECKING(if va_arg(arg, long double) crashes the compiler) |
103 | AC_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 |
109 | AC_C_CONST |
110 | AC_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 |
119 | SYSTEM=unix |
0198fd3c |
120 | AC_SUBST(SYSTEM) |
f802ee92 |
121 | |
122 | L=a |
123 | AC_SUBST(L) |
124 | |
125 | if test "$GCC"; then |
126 | CCDEFS="$CCDEFS -ansi -pedantic -Wall -Wmissing-prototypes" |
127 | fi |
128 | |
129 | AC_SUBST(CCDEFS) |
130 | |
131 | AC_OBJEXT |
132 | |
133 | if test -z "$FCGI_BUILD"; then |
134 | AC_CONFIG_FILES([Makefile |
135 | libfcgi/Makefile |
136 | cgi-fcgi/Makefile |
137 | examples/Makefile]) |
138 | fi |
139 | |
8bd181b5 |
140 | AC_OUTPUT |
0198fd3c |
141 | |