From: Manoj Kasichainula Date: Wed, 1 Dec 1999 01:16:23 +0000 (+0000) Subject: Eliminate ap_config.h's checks when using autoconf. Now, ap_ac_config.h X-Git-Tag: 1.3.10~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04c494c2b5175d094185f00304a17a837c44d810;p=apache Eliminate ap_config.h's checks when using autoconf. Now, ap_ac_config.h 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 --- diff --git a/acinclude.m4 b/acinclude.m4 index aa97f724ae..6ff8dcbfc7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 ], [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 diff --git a/configure.in b/configure.in index c6d9fda73f..7bf349d49c 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/include/ap_config.h b/include/ap_config.h index d4cf01e80a..39123af0c2 100644 --- a/include/ap_config.h +++ b/include/ap_config.h @@ -62,6 +62,11 @@ 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 } diff --git a/include/http_log.h b/include/http_log.h index 3dd10cc7ec..5837cb9c1c 100644 --- a/include/http_log.h +++ b/include/http_log.h @@ -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 diff --git a/os/unix/config.m4 b/os/unix/config.m4 index 86469135b6..b968a40bd1 100644 --- a/os/unix/config.m4 +++ b/os/unix/config.m4 @@ -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 diff --git a/server/config.m4 b/server/config.m4 index e37203db85..6cd5b9e559 100644 --- a/server/config.m4 +++ b/server/config.m4 @@ -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 #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], diff --git a/server/log.c b/server/log.c index fef740b452..aabf62bedd 100644 --- a/server/log.c +++ b/server/log.c @@ -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); diff --git a/server/main.c b/server/main.c index 99ed728903..7e05e43c97 100644 --- a/server/main.c +++ b/server/main.c @@ -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");