])
])
+dnl
+dnl AC_CHECK_DEFINE(macro, headerfile)
+dnl
+dnl checks for the macro in the header file
+dnl
+AC_DEFUN(AC_CHECK_DEFINE,[
+ AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
+ AC_EGREP_CPP([YES_IS_DEFINED], [
+ #include <$2>
+ #ifdef $1
+ YES_IS_DEFINED
+ #endif
+ ], ac_cv_define_$1=yes, ac_cv_define_$1=no))
+ if test "$ac_cv_define_$1" = "yes" ; then
+ AC_DEFINE(HAVE_$1)
+ fi
+])
+
+dnl
+dnl AC_TYPE_RLIM_T
+dnl
+dnl If rlim_t is not defined, define it to int
+dnl
+AC_DEFUN(AC_TYPE_RLIM_T, [
+ AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
+ AC_TRY_COMPILE([#include <sys/resource.h>], [rlim_t spoon;], [
+ ac_cv_type_rlim_t=yes
+ ],[ac_cv_type_rlim_t=no
+ AC_DEFINE(rlim_t, int)
+ ])
+ ])
+])
+
dnl
dnl APACHE_ONCE(namespace, variable, code)
dnl
APACHE_VERSION=$VERSION
AC_SUBST(APACHE_VERSION)
-dnl XXX - doesn't actually work, because of the APACHE_OUTPUT_FILES error
+dnl XXX - make will sometimes die as annoyingly as automake with this option
+dnl just remake and continue
AM_MAINTAINER_MODE
dnl We want this one before the checks, so the checks can modify CFLAGS
dnl them at the base of the tree. If some are specific to a single
dnl directory, they should be moved (Comment #Spoon)
+AC_HEADER_STDC
AC_CHECK_HEADERS( \
unistd.h \
+sys/stat.h \
sys/time.h \
+sys/types.h \
+sys/socket.h \
+netinet/in.h \
+arpa/inet.h \
+netdb.h \
+pwd.h \
+grp.h \
)
+AC_HEADER_SYS_WAIT
+
+dnl ## Check for C preprocessor symbols
+
+AC_CHECK_DEFINE(EAGAIN, errno.h)
dnl ## Check for typedefs, structures, and compiler characteristics.
+AC_C_CONST
AC_C_INLINE
+AC_TYPE_PID_T
dnl ## Check for library functions
difftime \
gettimeofday \
memmove \
+bzero \
)
+AC_CHECK_FUNCS(inet_addr inet_network, break, [
+ AC_MSG_ERROR(inet_addr function not found)
+])
+
+AC_FUNC_SELECT_ARGTYPES
+
+dnl Check if we'll actually need to cast select args all the time
+if test "$ac_cv_func_select_arg1" != "int" \
+ -o "$ac_cv_func_select_arg234" != "fd_set *" \
+ -o "$ac_cv_func_select_arg5" != "struct timeval *" ; then
+
+ AC_DEFINE(SELECT_NEEDS_CAST)
+fi
+
AM_PROG_LIBTOOL
dnl ## Checking command-line options
extern "C" {
#endif
+#ifdef HAVE_CONFIG_H
+#include "ap_ac_config.h" /* If we're using autoconf, go to the new
+ ap_config.h replacement */
+#else /* HAVE_CONFIG_H */
+
/*
* ap_config.h: system-dependant #defines and includes...
* See PORTING for a listing of what they mean
#define HAVE_SYS_TIMES_H
#endif
+#if !defined(NO_RELIABLE_PIPED_LOGS)
+#define HAVE_RELIABLE_PIPED_LOGS
+#endif
+
#endif /* HAVE_CONFIG_H */
/* The assumption is that when the functions are missing,
#undef USE_SYSVSEM_SERIALIZED_ACCEPT
#undef USE_PTHREAD_SERIALIZED_ACCEPT
#endif
+#endif /* HAVE_CONFIG_H */
#ifdef __cplusplus
}
typedef struct piped_log {
ap_context_t *p;
-#ifndef NO_RELIABLE_PIPED_LOGS
+#ifdef HAVE_RELIABLE_PIPED_LOGS
char *program;
ap_proc_t *pid;
ap_file_t *fds[2];
API_EXPORT(piped_log *) ap_open_piped_log (ap_context_t *p, const char *program);
API_EXPORT(void) ap_close_piped_log (piped_log *);
-#ifndef NO_RELIABLE_PIPED_LOGS
+#ifdef HAVE_RELIABLE_PIPED_LOGS
#define ap_piped_log_read_fd(pl) ((pl)->fds[0])
#define ap_piped_log_write_fd(pl) ((pl)->fds[1])
#else
-AC_CHECK_FUNCS( \
-setsid \
-killpg \
-)
-
-dnl XXX - This doesn't deal with _sys_siglist. Probably have to roll our own
-AC_DECL_SYS_SIGLIST
+if test "$OS" = "unix" ; then
+ AC_CHECK_FUNCS( \
+ setsid \
+ killpg \
+ )
+
+ dnl XXX - This doesn't deal with _sys_siglist. Maybe have to roll our own
+ AC_DECL_SYS_SIGLIST
+fi
dnl ## Check for typedefs, structures, and compiler characteristics.
+AC_TYPE_RLIM_T
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
/* piped log support */
-#ifndef NO_RELIABLE_PIPED_LOGS
+#ifdef HAVE_RELIABLE_PIPED_LOGS
/* forward declaration */
static void piped_log_maintenance(int reason, void *data, ap_wait_t status);
#ifdef HAS_OTHER_CHILD
printf(" -D HAS_OTHER_CHILD\n");
#endif
-#ifdef NO_RELIABLE_PIPED_LOGS
- printf(" -D NO_RELIABLE_PIPED_LOGS\n");
+#ifdef HAVE_RELIABLE_PIPED_LOGS
+ printf(" -D HAVE_RELIABLE_PIPED_LOGS\n");
#endif
#ifdef BUFFERED_LOGS
printf(" -D BUFFERED_LOGS\n");