manoj 99/11/29 15:33:25
Modified: src/include ap_config.h
src/main util.c
src/modules/mpm/dexter dexter.c
src/modules/mpm/mpmt_beos mpmt_beos.c
src/modules/mpm/mpmt_pthread mpmt_pthread.c scoreboard.h
src/modules/mpm/prefork prefork.c scoreboard.h
src/modules/mpm/spmt_os2 scoreboard.h spmt_os2.c
src/modules/standard mod_unique_id.c mod_usertrack.c
src/os/beos beosd.h
src/os/unix unixd.c unixd.h
src/os/win32 os.h
Log:
The first part of the big autoconf patch. This replaces a bunch of
NEED_* macros with HAVE_* macros to be more consistent with autoconf.
Revision Changes Path
1.10 +59 -8 apache-2.0/src/include/ap_config.h
Index: ap_config.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/ap_config.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -u -r1.9 -r1.10
--- ap_config.h 1999/09/13 14:07:19 1.9
+++ ap_config.h 1999/11/29 23:32:37 1.10
@@ -118,7 +118,7 @@
#endif
#if !defined(QNX) && !defined(MPE) && !defined(WIN32) && !defined(TPF)
-#include <sys/param.h>
+/* #include <sys/param.h> */
#endif
/* Define one of these according to your system. */
@@ -1352,29 +1352,80 @@
#endif /* SUNOS_LIB_PROTOTYPES */
+/*
+ * Transition macros from old-style configuration to autoconf
+ */
+#ifndef HAVE_CONFIG_H
+
+#if !defined(NO_KILLPG) && !defined(HAVE_KILLPG)
+#define HAVE_KILLPG
+#endif
+
+#if !defined(NEED_STRDUP) && !defined(HAVE_STRDUP)
+#define HAVE_STRDUP
+#endif
+
+#if !defined(NEED_STRCASECMP) && !defined(HAVE_STRCASECMP)
+#define HAVE_STRCASECMP
+#endif
+
+#if !defined(NEED_STRNCASECMP) && !defined(HAVE_STRNCASECMP)
+#define HAVE_STRNCASECMP
+#endif
+
+#if !defined(NEED_STRSTR) && !defined(HAVE_STRSTR)
+#define HAVE_STRSTR
+#endif
+
+#if !defined(NEED_INITGROUPS) && !defined(HAVE_INITGROUPS)
+#define HAVE_INITGROUPS
+#endif
+
+#if !defined(NEED_WAITPID) && !defined(HAVE_WAITPID)
+#define HAVE_WAITPID
+#endif
+
+#if !defined(NEED_STRERROR) && !defined(HAVE_STRERROR)
+#define HAVE_STRERROR
+#endif
+
+#if !defined(NEED_DIFFTIME) && !defined(HAVE_DIFFTIME)
+#define HAVE_DIFFTIME
+#endif
+
+#if !defined(NEED_GETTIMEOFDAY) && !defined(HAVE_GETTIMEOFDAY)
+#define HAVE_GETTIMEOFDAY
+#endif
+
+#if !defined(NEED_SETSID) && !defined(HAVE_SETSID)
+#define HAVE_SETSID
+#endif
+
+#endif /* HAVE_CONFIG_H */
+
/* The assumption is that when the functions are missing,
* then there's no matching prototype available either.
* Declare what is needed exactly as the replacement routines implement it.
*/
-#ifdef NEED_STRDUP
+#ifndef HAVE_STRDUP
extern char *strdup (const char *str);
#endif
-#ifdef NEED_STRCASECMP
+#ifndef HAVE_STRCASECMP
extern int strcasecmp (const char *a, const char *b);
#endif
-#ifdef NEED_STRNCASECMP
+#ifndef HAVE_STRNCASECMP
extern int strncasecmp (const char *a, const char *b, int n);
#endif
-#ifdef NEED_INITGROUPS
+#ifndef HAVE_INITGROUPS
extern int initgroups(const char *name, gid_t basegid);
#endif
-#ifdef NEED_WAITPID
+#ifndef HAVE_WAITPID
extern int waitpid(pid_t pid, int *statusp, int options);
#endif
-#ifdef NEED_STRERROR
+#ifndef HAVE_STRERROR
extern char *strerror (int err);
#endif
-#ifdef NEED_DIFFTIME
+#ifndef HAVE_DIFFTIME
extern double difftime(time_t time1, time_t time0);
#endif
1.19 +8 -8 apache-2.0/src/main/util.c
Index: util.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/util.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -u -r1.18 -r1.19
--- util.c 1999/11/18 23:07:24 1.18
+++ util.c 1999/11/29 23:32:38 1.19
@@ -1700,7 +1700,7 @@
return (x ? 1 : 0); /* If the first character is ':', it's
broken, too */
}
-#ifdef NEED_STRDUP
+#ifndef HAVE_STRDUP
char *strdup(const char *str)
{
char *sdup;
@@ -1716,7 +1716,7 @@
#endif
/* The following two routines were donated for SVR4 by Andreas Vogel */
-#ifdef NEED_STRCASECMP
+#ifndef HAVE_STRCASECMP
int strcasecmp(const char *a, const char *b)
{
const char *p = a;
@@ -1735,7 +1735,7 @@
#endif
-#ifdef NEED_STRNCASECMP
+#ifndef HAVE_STRNCASECMP
int strncasecmp(const char *a, const char *b, int n)
{
const char *p = a;
@@ -1756,7 +1756,7 @@
#endif
/* The following routine was donated for UTS21 by [EMAIL PROTECTED] */
-#ifdef NEED_STRSTR
+#ifndef HAVE_STRSTR
char *strstr(char *s1, char *s2)
{
char *p1, *p2;
@@ -1785,7 +1785,7 @@
}
#endif
-#ifdef NEED_INITGROUPS
+#ifndef HAVE_INITGROUPS
int initgroups(const char *name, gid_t basegid)
{
#if defined(QNX) || defined(MPE) || defined(BEOS) || defined(_OSD_POSIX) ||
defined(TPF) || defined(__TANDEM)
@@ -1816,7 +1816,7 @@
}
#endif /* def NEED_INITGROUPS */
-#ifdef NEED_WAITPID
+#ifndef HAVE_WAITPID
/* From [EMAIL PROTECTED]
* this is not ideal but it works for SVR3 variants
* Modified by [EMAIL PROTECTED] to call wait3 instead of wait because
@@ -2094,7 +2094,7 @@
#endif
-#ifdef NEED_STRERROR
+#ifndef HAVE_STRERROR
char *
strerror(int err)
{
@@ -2107,7 +2107,7 @@
}
#endif
-#if defined(NEED_DIFFTIME)
+#ifndef HAVE_DIFFTIME
double difftime(time_t time1, time_t time0)
{
return (time1 - time0);
1.59 +2 -2 apache-2.0/src/modules/mpm/dexter/dexter.c
Index: dexter.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -u -r1.58 -r1.59
--- dexter.c 1999/11/19 20:27:01 1.58
+++ dexter.c 1999/11/29 23:32:41 1.59
@@ -1392,7 +1392,7 @@
/* Time to gracefully shut down:
* Kill child processes, tell them to call child_exit, etc...
*/
- if (ap_killpg(getpgrp(), SIGTERM) < 0) {
+ if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
"killpg SIGTERM");
}
@@ -1453,7 +1453,7 @@
* and a SIGHUP, we may as well use the same signal, because some user
* pthreads are stealing signals from us left and right.
*/
- if (ap_killpg(getpgrp(), SIGTERM) < 0) {
+ if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
"killpg SIGTERM");
}
1.12 +2 -2 apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c
Index: mpmt_beos.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -u -r1.11 -r1.12
--- mpmt_beos.c 1999/11/19 20:27:10 1.11
+++ mpmt_beos.c 1999/11/29 23:32:50 1.12
@@ -1119,7 +1119,7 @@
/* Time to gracefully shut down:
* Kill child processes, tell them to call child_exit, etc...
*/
- if (ap_killpg(getpgrp(), SIGTERM) < 0) {
+ if (beosd_killpg(getpgrp(), SIGTERM) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
"killpg SIGTERM");
}
@@ -1175,7 +1175,7 @@
* and a SIGHUP, we may as well use the same signal, because some user
* pthreads are stealing signals from us left and right.
*/
- if (ap_killpg(getpgrp(), SIGTERM) < 0) {
+ if (beosd_killpg(getpgrp(), SIGTERM) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
"killpg SIGTERM");
}
1.49 +2 -2 apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
Index: mpmt_pthread.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -u -r1.48 -r1.49
--- mpmt_pthread.c 1999/11/19 20:27:18 1.48
+++ mpmt_pthread.c 1999/11/29 23:32:53 1.49
@@ -1406,7 +1406,7 @@
/* Time to gracefully shut down:
* Kill child processes, tell them to call child_exit, etc...
*/
- if (ap_killpg(getpgrp(), SIGTERM) < 0) {
+ if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
"killpg SIGTERM");
}
reclaim_child_processes(1); /* Start with SIGTERM */
@@ -1477,7 +1477,7 @@
* and a SIGHUP, we may as well use the same signal, because some user
* pthreads are stealing signals from us left and right.
*/
- if (ap_killpg(getpgrp(), SIGTERM) < 0) {
+ if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, "killpg
SIGTERM");
}
reclaim_child_processes(1); /* Start with SIGTERM */
1.6 +1 -1 apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.h
Index: scoreboard.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -u -r1.5 -r1.6
--- scoreboard.h 1999/08/31 05:33:23 1.5
+++ scoreboard.h 1999/11/29 23:32:54 1.6
@@ -147,7 +147,7 @@
unsigned long my_bytes_served;
unsigned long conn_bytes;
unsigned short conn_count;
-#if defined(NO_GETTIMEOFDAY)
+#ifndef HAVE_GETTIMEOFDAY
clock_t start_time;
clock_t stop_time;
#else
1.55 +6 -6 apache-2.0/src/modules/mpm/prefork/prefork.c
Index: prefork.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -u -r1.54 -r1.55
--- prefork.c 1999/11/19 20:27:26 1.54
+++ prefork.c 1999/11/29 23:32:56 1.55
@@ -1474,7 +1474,7 @@
void ap_time_process_request(int child_num, int status)
{
short_score *ss;
-#if defined(NO_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
struct tms tms_blk;
#endif
@@ -1485,7 +1485,7 @@
ss = &ap_scoreboard_image->servers[child_num];
if (status == START_PREQUEST) {
-#if defined(NO_GETTIMEOFDAY)
+#if !defined(HAVE_GETTIMEOFDAY)
#ifndef NO_TIMES
if ((ss->start_time = times(&tms_blk)) == -1)
#endif /* NO_TIMES */
@@ -1497,7 +1497,7 @@
#endif
}
else if (status == STOP_PREQUEST) {
-#if defined(NO_GETTIMEOFDAY)
+#if !defined(HAVE_GETTIMEOFDAY)
#ifndef NO_TIMES
if ((ss->stop_time = times(&tms_blk)) == -1)
#endif
@@ -2702,7 +2702,7 @@
/* Time to gracefully shut down:
* Kill child processes, tell them to call child_exit, etc...
*/
- if (ap_killpg(getpgrp(), SIGTERM) < 0) {
+ if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, "killpg
SIGTERM");
}
reclaim_child_processes(1); /* Start with SIGTERM */
@@ -2748,7 +2748,7 @@
"SIGUSR1 received. Doing graceful restart");
/* kill off the idle ones */
- if (ap_killpg(getpgrp(), SIGUSR1) < 0) {
+ if (unixd_killpg(getpgrp(), SIGUSR1) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, "killpg
SIGUSR1");
}
#ifndef SCOREBOARD_FILE
@@ -2767,7 +2767,7 @@
}
else {
/* Kill 'em off */
- if (ap_killpg(getpgrp(), SIGHUP) < 0) {
+ if (unixd_killpg(getpgrp(), SIGHUP) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, "killpg
SIGHUP");
}
reclaim_child_processes(0); /* Not when just starting up */
1.2 +1 -1 apache-2.0/src/modules/mpm/prefork/scoreboard.h
Index: scoreboard.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/scoreboard.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -u -r1.1 -r1.2
--- scoreboard.h 1999/06/18 18:39:29 1.1
+++ scoreboard.h 1999/11/29 23:32:58 1.2
@@ -142,7 +142,7 @@
unsigned long my_bytes_served;
unsigned long conn_bytes;
unsigned short conn_count;
-#if defined(NO_GETTIMEOFDAY)
+#if !defined(HAVE_GETTIMEOFDAY)
clock_t start_time;
clock_t stop_time;
#else
1.3 +1 -1 apache-2.0/src/modules/mpm/spmt_os2/scoreboard.h
Index: scoreboard.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/scoreboard.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -u -r1.2 -r1.3
--- scoreboard.h 1999/07/13 09:31:59 1.2
+++ scoreboard.h 1999/11/29 23:33:01 1.3
@@ -136,7 +136,7 @@
unsigned long my_bytes_served;
unsigned long conn_bytes;
unsigned short conn_count;
-#if defined(NO_GETTIMEOFDAY)
+#if !defined(HAVE_GETTIMEOFDAY)
clock_t start_time;
clock_t stop_time;
#else
1.25 +3 -3 apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c
Index: spmt_os2.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -u -r1.24 -r1.25
--- spmt_os2.c 1999/11/19 20:27:32 1.24
+++ spmt_os2.c 1999/11/29 23:33:02 1.25
@@ -429,7 +429,7 @@
void ap_time_process_request(int child_num, int status)
{
short_score *ss;
-#if defined(NO_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
struct tms tms_blk;
#endif
@@ -439,7 +439,7 @@
ss = &ap_scoreboard_image->servers[child_num];
if (status == START_PREQUEST) {
-#if defined(NO_GETTIMEOFDAY)
+#if !defined(HAVE_GETTIMEOFDAY)
#ifndef NO_TIMES
if ((ss->start_time = times(&tms_blk)) == -1)
#endif /* NO_TIMES */
@@ -451,7 +451,7 @@
#endif
}
else if (status == STOP_PREQUEST) {
-#if defined(NO_GETTIMEOFDAY)
+#if !defined(HAVE_GETTIMEOFDAY)
#ifndef NO_TIMES
if ((ss->stop_time = times(&tms_blk)) == -1)
#endif
1.4 +4 -4 apache-2.0/src/modules/standard/mod_unique_id.c
Index: mod_unique_id.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_unique_id.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -u -r1.3 -r1.4
--- mod_unique_id.c 1999/08/31 05:34:04 1.3
+++ mod_unique_id.c 1999/11/29 23:33:06 1.4
@@ -168,7 +168,7 @@
#endif
char str[MAXHOSTNAMELEN + 1];
struct hostent *hent;
-#ifndef NO_GETTIMEOFDAY
+#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
#endif
@@ -231,7 +231,7 @@
* But protecting against it is relatively cheap. We just sleep into the
* next second.
*/
-#ifdef NO_GETTIMEOFDAY
+#ifndef HAVE_GETTIMEOFDAY
sleep(1);
#else
if (gettimeofday(&tv, NULL) == -1) {
@@ -248,7 +248,7 @@
static void unique_id_child_init(server_rec *s, ap_context_t *p)
{
pid_t pid;
-#ifndef NO_GETTIMEOFDAY
+#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
#endif
@@ -282,7 +282,7 @@
* against restart problems, and a little less protection against a clock
* going backwards in time.
*/
-#ifndef NO_GETTIMEOFDAY
+#ifdef HAVE_GETTIMEOFDAY
if (gettimeofday(&tv, NULL) == -1) {
cur_unique_id.counter = 0;
}
1.4 +2 -2 apache-2.0/src/modules/standard/mod_usertrack.c
Index: mod_usertrack.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_usertrack.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -u -r1.3 -r1.4
--- mod_usertrack.c 1999/08/31 05:34:05 1.3
+++ mod_usertrack.c 1999/11/29 23:33:06 1.4
@@ -132,7 +132,7 @@
{
cookie_log_state *cls = ap_get_module_config(r->server->module_config,
&usertrack_module);
-#if defined(NO_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
clock_t mpe_times;
struct tms mpe_tms;
#elif !defined(WIN32)
@@ -148,7 +148,7 @@
dcfg = ap_get_module_config(r->per_dir_config, &usertrack_module);
-#if defined(NO_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
/* We lack gettimeofday(), so we must use time() to obtain the epoch
seconds, and then times() to obtain CPU clock ticks (milliseconds).
Combine this together to obtain a hopefully unique cookie ID. */
1.3 +2 -0 apache-2.0/src/os/beos/beosd.h
Index: beosd.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/beos/beosd.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -u -r1.2 -r1.3
--- beosd.h 1999/09/07 22:31:02 1.2
+++ beosd.h 1999/11/29 23:33:13 1.3
@@ -85,6 +85,8 @@
#define INIT_SIGLIST() /* nothing */
+#define beosd_killpg(x, y) (kill (-(x), (y)))
+
#define UNIX_DAEMON_COMMANDS \
{ "User", beosd_set_user, NULL, RSRC_CONF, TAKE1, \
"Effective user id for this server"}, \
1.7 +1 -1 apache-2.0/src/os/unix/unixd.c
Index: unixd.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/unix/unixd.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -u -r1.6 -r1.7
--- unixd.c 1999/11/19 18:49:20 1.6
+++ unixd.c 1999/11/29 23:33:16 1.7
@@ -82,7 +82,7 @@
}
RAISE_SIGSTOP(DETACH);
#endif
-#ifndef NO_SETSID
+#ifdef HAVE_SETSID
if ((pgrp = setsid()) == -1) {
perror("setsid");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
1.3 +10 -1 apache-2.0/src/os/unix/unixd.h
Index: unixd.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/unix/unixd.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -u -r1.2 -r1.3
--- unixd.h 1999/08/13 21:54:06 1.2
+++ unixd.h 1999/11/29 23:33:21 1.3
@@ -89,13 +89,22 @@
#ifdef SYS_SIGLIST /* platform has sys_siglist[] */
#define INIT_SIGLIST() /* nothing */
-#else /* platform has no sys_siglist[], define our own */
+#elif defined(SYS_SIGLIST_DECLARED) /* from autoconf */
+#define INIT_SIGLIST() /* nothing */
+#define SYS_SIGLIST sys_siglist
+#else
#define NEED_AP_SYS_SIGLIST
extern const char *ap_sys_siglist[NumSIG];
#define SYS_SIGLIST ap_sys_siglist
void unixd_siglist_init(void);
#define INIT_SIGLIST() unixd_siglist_init();
#endif /* platform has sys_siglist[] */
+
+#ifdef HAVE_KILLPG
+#define unixd_killpg(x, y) (killpg ((x), (y)))
+#else /* HAVE_KILLPG */
+#define unixd_killpg(x, y) (kill (-(x), (y)))
+#endif /* HAVE_KILLPG */
#define UNIX_DAEMON_COMMANDS \
{ "User", unixd_set_user, NULL, RSRC_CONF, TAKE1, \
1.9 +1 -2 apache-2.0/src/os/win32/os.h
Index: os.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/win32/os.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -u -r1.8 -r1.9
--- os.h 1999/11/02 14:30:23 1.8
+++ os.h 1999/11/29 23:33:24 1.9
@@ -98,10 +98,9 @@
#endif
#define CASE_BLIND_FILESYSTEM
#define NO_WRITEV
-#define NO_SETSID
#define NO_USE_SIGACTION
#define NO_TIMES
-#define NO_GETTIMEOFDAY
+/* #undef HAVE_GETTIMEOFDAY */
#define USE_LONGJMP
#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD