]> granicus.if.org Git - apache/commitdiff
Eliminate ap_config.h's checks when using autoconf. Now, ap_ac_config.h
authorManoj Kasichainula <manoj@apache.org>
Wed, 1 Dec 1999 01:16:23 +0000 (01:16 +0000)
committerManoj Kasichainula <manoj@apache.org>
Wed, 1 Dec 1999 01:16:23 +0000 (01:16 +0000)
is used instead, and autoconf's configure script will check for
everything else.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84200 13f79535-47bb-0310-9956-ffa450edef68

acinclude.m4
configure.in
include/ap_config.h
include/http_log.h
os/unix/config.m4
server/config.m4
server/log.c
server/main.c

index aa97f724ae445a87e9dda545f295a305a3eee660..6ff8dcbfc7ebbf76c64ac6f4ed2d1b31331bda15 100644 (file)
@@ -43,6 +43,39 @@ AC_DEFUN(AC_ADD_LIBRARY,[
   ])
 ])
 
+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
index c6d9fda73ff8d81d7ac51dcb8929fd76d5ac538d..7bf349d49c5ed76bc47da3ed3d5766ce9fda29cb 100644 (file)
@@ -12,7 +12,8 @@ dnl ## This is the central place where Apache's version should be kept.
 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
@@ -43,14 +44,30 @@ dnl I think these are just used all over the place, so just check for
 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
 
@@ -67,8 +84,23 @@ waitpid \
 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
index d4cf01e80a359c90ed1c655b028995635aa26be7..39123af0c2d8e35df24b459a6964232b6235b7f3 100644 (file)
 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
@@ -1406,6 +1411,10 @@ long vfprintf(FILE *, const char *, va_list);
 #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,
@@ -1462,6 +1471,7 @@ extern double difftime(time_t time1, time_t time0);
 #undef USE_SYSVSEM_SERIALIZED_ACCEPT
 #undef USE_PTHREAD_SERIALIZED_ACCEPT
 #endif
+#endif /* HAVE_CONFIG_H */
 
 #ifdef __cplusplus
 }
index 3dd10cc7ec7909e746e86acdbf5d374004f61da0..5837cb9c1c7959ac50bc3e9276f74b6269d21980 100644 (file)
@@ -143,7 +143,7 @@ API_EXPORT(void) ap_log_reason(const char *reason, const char *fname,
 
 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];
@@ -154,7 +154,7 @@ typedef struct piped_log {
 
 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
index 86469135b606deeb475897ca381a30d731a376f8..b968a40bd109fc53fd574cd40194dff4fc47914c 100644 (file)
@@ -1,7 +1,9 @@
-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
index e37203db85a87095384cfcbb33d0ec616873c250..6cd5b9e5593141114b9864593f458ee7e4644daf 100644 (file)
@@ -30,6 +30,7 @@ sys/processor.h \
 
 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;],
index fef740b45235e6214cb85764129ca0d82db026a8..aabf62bedd682580648ae794ad815ace9b77300d 100644 (file)
@@ -618,7 +618,7 @@ API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
 
 /* 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);
 
index 99ed728903406320bfe8b1e7bfda983f557f443b..7e05e43c97d5f5975dfee6882ba021271860931e 100644 (file)
@@ -136,8 +136,8 @@ static void show_compile_settings(void)
 #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");