Fixes for Cygwin (see ChangeLog)
authorNathan Bryant <loanshark@uncensored.citadel.org>
Wed, 3 Feb 1999 04:10:37 +0000 (04:10 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Wed, 3 Feb 1999 04:10:37 +0000 (04:10 +0000)
29 files changed:
citadel/ChangeLog
citadel/Makefile.in
citadel/citadel.c
citadel/citserver.c
citadel/client_chat.c
citadel/commands.c
citadel/configure.in
citadel/control.c
citadel/database.c
citadel/dynloader.c
citadel/file_ops.c
citadel/housekeeping.c
citadel/ipc_c_tcp.c
citadel/locate_host.c
citadel/logging.c
citadel/messages.c
citadel/mime_parser.c
citadel/msgbase.c
citadel/policy.c
citadel/room_ops.c
citadel/rooms.c
citadel/routines2.c
citadel/serv_chat.c
citadel/serv_expire.c
citadel/serv_test.c
citadel/serv_upgrade.c
citadel/support.c
citadel/sysdep.c
citadel/user_ops.c

index afcac1905b48bdc3e49a7adf674a1c24c9e997cb..096fad2bfaae09f7f44fd595f70258b41440ecd6 100644 (file)
@@ -1,3 +1,11 @@
+1998-02-02 Nathan Bryant <bryant@cs.usm.maine.edu>
+       * Fixes for Cygwin:
+         - ifdef out file download methods that require named pipes (client)
+         - include pthread.h and gdbm.h only if they are present (fixes
+           auto dependency generation)
+         - include snprintf.h where needed
+         - handle .exe suffixes for "make install"
+
 Tue Feb  2 22:15:08 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Overhauled the express messaging system (again)
 
index be239d27c25614b5ada9464d3f0e268615565649..9fc262fda973bb439a965f549f9886eac0cb7546 100644 (file)
@@ -18,7 +18,9 @@ all: $(TARGETS)
 
 .SUFFIXES: .ro .mo .d
 
-CLIENT_TARGETS=citadel whobbs
+SUFFIX=@SUFFIX@
+
+CLIENT_TARGETS=citadel$(SUFFIX) whobbs$(SUFFIX)
 SERVER_TARGETS=citserver setup
 SERV_MODULES=modules/serv_chat.so \
        modules/serv_upgrade.so modules/serv_expire.so
@@ -73,7 +75,7 @@ serv_modules: $(SERV_MODULES)
 #
 #
 
-citadel: ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
+citadel$(SUFFIX): ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
        commands.o client_chat.o serv_info.o tools.o $(SNPRINTF)
        $(CC) ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
        commands.o client_chat.o serv_info.o tools.o $(SNPRINTF) $(LDFLAGS) \
@@ -154,7 +156,7 @@ netsetup: netsetup.o config.o
 proxy: proxy.o ipc_c_tcp.o
        $(CC) proxy.o ipc_c_tcp.o $(LDFLAGS) -o proxy
 
-whobbs: whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF)
+whobbs$(SUFFIX): whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF)
        $(CC) whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF) $(LDFLAGS) -o whobbs
 
 sendcommand: sendcommand.o ipc_c_tcp.o tools.o config.o $(SNPRINTF)
index 6d63f177b0b9535caf41768cda2c83fde79f548e..cb20e18c4594046d086004303320db515c559080 100644 (file)
@@ -20,6 +20,7 @@
 #include <signal.h>
 #include <pwd.h>
 #include <setjmp.h>
+#include <stdarg.h>
 
 #include "citadel.h"
 #include "axdefs.h"
@@ -33,6 +34,9 @@
 #include "client_chat.h"
 #include "citadel_decls.h"
 #include "tools.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 struct march {
        struct march *next;
index 9501ddbd4b434c90e77d9afd7a05cf3c6e71f3d6..99aa31e1a969c9600fdda5feeee222d7e9962c49 100644 (file)
@@ -1,4 +1,5 @@
 /* $Id$ */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -9,7 +10,9 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include <syslog.h>
 #include <dlfcn.h>
 #include "citadel.h"
index 69996df9c18a1a37e0fdf3406a7646b2f97fb571..e76f25766476954ade6e6a76cfc5dbfaaafbae84 100644 (file)
@@ -22,6 +22,7 @@
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#include <stdarg.h>
 #include "citadel.h"
 #include "client_chat.h"
 #include "commands.h"
@@ -29,6 +30,9 @@
 #include "ipc.h"
 #include "citadel_decls.h"
 #include "tools.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 
index 0a23f4bd62f19700e364eafc2e873fa3f0e641c9..e68c4436ca43c47f831b7e7f824b50410dcc685c 100644 (file)
 
 #include <signal.h>
 #include <errno.h>
+#include <stdarg.h>
 #include "citadel.h"
 #include "commands.h"
 #include "messages.h"
 #include "citadel_decls.h"
 #include "routines.h"
 #include "routines2.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 struct citcmd {
        struct citcmd *next;
index cfec538fe8c5c98fa8fd63c2665326b3564b9755..7033a63774c6e9cf737a33c6049f1d9649ecce06 100644 (file)
@@ -26,6 +26,9 @@ case "$host" in
                SERVER_LDFLAGS=-pthread
                TARGETS="client server utils serv_modules"
        ;;
+       i?86-pc-cygwin32)
+               SUFFIX=.exe
+       ;;
 esac
 
 dnl Checks for programs.
@@ -92,7 +95,7 @@ dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(curses.h fcntl.h limits.h termios.h strings.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h)
+AC_CHECK_HEADERS(curses.h fcntl.h limits.h termios.h strings.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h pthread.h gdbm.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -106,7 +109,7 @@ AC_FUNC_GETPGRP
 AC_PROG_GCC_TRADITIONAL
 AC_TYPE_SIGNAL
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(snprintf mkdir mktime rmdir select socket strerror)
+AC_CHECK_FUNCS(snprintf mkdir mkfifo mktime rmdir select socket strerror)
 
 dnl Tell the Makefile whether we need to use our snprintf() replacement.
 if test "$ac_cv_func_snprintf" = no; then
@@ -119,5 +122,6 @@ AC_SUBST(TARGETS)
 AC_SUBST(SERVER_LDFLAGS)
 AC_SUBST(SNPRINTF)
 AC_SUBST(PICFLAGS)
+AC_SUBST(SUFFIX)
 AC_CONFIG_HEADER(sysdep.h)
 AC_OUTPUT(Makefile weekly)
index e69b42a413e48d22258eff681aac96d86b4905b7..2f8f37bc38df2b505e3ebfca72c8fe37d1172c76 100644 (file)
@@ -7,6 +7,7 @@
  *
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -17,7 +18,9 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include <syslog.h>
 #include "citadel.h"
 #include "server.h"
index e67c6d37373028ae0cf4c16862adc9b43fd80bf5..1945f36631cc7e1dafe2d19e6a4922645ce55cf6 100644 (file)
@@ -15,6 +15,7 @@
  * conditions to occur.  (Deadlock is bad.  Eliminate.)
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
+#ifdef HAVE_GDBM_H
 #include <gdbm.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "database.h"
index e860fba37e10fbf9791cfc2a817184b7fd9e3c5b..dcfa4b8a0fc0b8384f2b3fd59f679a268714029d 100644 (file)
@@ -9,6 +9,7 @@
  ******************************************************/
 
 
+#include "sysdep.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <dlfcn.h>
@@ -16,7 +17,9 @@
 #include <dirent.h>
 #include <strings.h>
 #include <syslog.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include <limits.h>
 #include "dynloader.h"
 #include "citadel.h"
index e808766696e6f1eca7bcb63a37854b72cffd60e9..d38d4f27294f06672d074f245162b6ad7ede812a 100644 (file)
@@ -1,4 +1,5 @@
 /* $Id$ */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -9,7 +10,9 @@
 #include <sys/stat.h>
 #include <time.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "config.h"
index 84f4bea9c01f487cb34b3c8969072a56216c4230..a97ea47799e35c7c7ee824da1ca1dc40397aae44 100644 (file)
@@ -5,6 +5,7 @@
  * $Id$
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -13,7 +14,9 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "citserver.h"
index 7f98a833c9afaba4bdb4fe8080de2db51145c7af..7f99b246403079c016b87eef6da67a440b16cf27 100644 (file)
 #include <string.h>
 #include <pwd.h>
 #include <errno.h>
+#include <stdarg.h>
 #include "citadel.h"
 #include "citadel_decls.h"
 #include "ipc.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 /*
  * If server_is_local is set to nonzero, the client assumes that it is running
index 9ca4e0e8ca2a0a1ab94bfddbbb2501127ab56645..9160c2d9a62b5e2f35d3ea9134ce9b23f047535a 100644 (file)
@@ -3,6 +3,7 @@
  * $Id$
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -13,8 +14,9 @@
 #include <limits.h>
 #include <netdb.h>
 #include <string.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
-#include "sysdep.h"
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "locate_host.h"
index f485d82fadcfbdad4fcdd496876ffb226af2e26b..a9022876557211d92559bad7c81b17e1b71ecb36 100644 (file)
@@ -3,6 +3,7 @@
  * $Id$
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -12,7 +13,9 @@
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include <syslog.h>
 #include "citadel.h"
 #include "server.h"
index 7fd56a945c6a34609105fff8538e0d127dbb6b75..5d8e7c7456ddf120d7331e0297e951f0ed7ee740 100644 (file)
@@ -4,6 +4,7 @@
  * $Id$
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
+#include <stdarg.h>
 #include "citadel.h"
 #include "messages.h"
 #include "commands.h"
 #include "rooms.h"
 #include "tools.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 #define MAXWORDBUF 256
 #define MAXMSGS 512
index bbed98eef56a756faf2447e87e77c8d5478de279..9b35dc0822588e1cbbdadeb59f3937ec09193134 100644 (file)
@@ -9,6 +9,7 @@
  *
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -17,7 +18,9 @@
 #include <ctype.h>
 #include <string.h>
 #include <sys/stat.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "mime_parser.h"
 #include "sysdep_decls.h"
index 07a4b6d4b1820ff23f9e06bb9a21377318c82677..30bef3025ca24c8416a57fd7152e3bb6f5f6393d 100644 (file)
@@ -1,4 +1,5 @@
 /* $Id$ */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -7,7 +8,9 @@
 #include <ctype.h>
 #include <string.h>
 #include <syslog.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include <errno.h>
index 2b29ffe35481e0f772d4834cbefe7d577de25d7a..ad4aaf7d3fb86f210359529d9f95164fdac5d57c 100644 (file)
@@ -1,10 +1,13 @@
 /* $Id$ */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/stat.h>
 #include <string.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include <time.h>
 #include <limits.h>
 #include "citadel.h"
index 137e60db3fe353066f988fd757e2ecf9007b68c0..b1237e68ad0e7b9e365f40c140402623601ec947 100644 (file)
@@ -1,10 +1,13 @@
 /* $Id$ */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/stat.h>
 #include <string.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include <time.h>
 #include <limits.h>
 #include <errno.h>
index 551add113d7792bf08fc952bf0f9cb4942d27d2f..cee1650132929beaa548d5939075f4811944bb42 100644 (file)
@@ -1,6 +1,7 @@
 /* Citadel/UX room-oriented routines */
 /* $Id$ */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <errno.h>
+#include <stdarg.h>
 #include "citadel.h"
 #include "rooms.h"
 #include "commands.h"
 #include "tools.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
 
@@ -595,9 +600,10 @@ void download_to_local_disk(char *filename, long total_bytes)
 void download(int proto)
 {
        char buf[256];
-       char dbuf[4096];
        char filename[256];
        long total_bytes = 0L;
+#ifdef HAVE_MKFIFO
+       char dbuf[4096];
        long transmitted_bytes = 0L;
        long aa,bb;
        int a,b;
@@ -605,6 +611,7 @@ void download(int proto)
        FILE *tpipe = NULL;
        int proto_pid;
        int broken = 0;
+#endif
 
        if ((room_flags & QR_DOWNLOAD) == 0) {
                printf("*** You cannot download from this room.\n");
@@ -628,6 +635,7 @@ void download(int proto)
                return;
                }
 
+#ifdef HAVE_MKFIFO
        /* Meta-download for public clients */
        mkdir(tempdir,0700);
        snprintf(buf,sizeof buf,"%s/%s",tempdir,filename);
@@ -708,6 +716,7 @@ void download(int proto)
 
        putc(7,stdout);
        exit(0);        /* transfer control back to the main program */
+#endif
        }
 
 
index 8519a918ddd319787d0b05c31a619df118460644..f9eec92508652ba36eb73af94231e3ff56c2ea88 100644 (file)
@@ -3,6 +3,7 @@
  * $Id$
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <pwd.h>
 #include <setjmp.h>
 #include <errno.h>
+#include <stdarg.h>
 #include "citadel.h"
 #include "routines2.h"
 #include "routines.h"
 #include "commands.h"
 #include "tools.h"
 #include "messages.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 void interr(int errnum);
 void strprompt(char *prompt, char *str, int len);
index 539bdc0ec5e853e2c8be51744f59df50f9b03133..6f3c41efbdc10bb6aaf4446ebc32e9bc0be5ab52 100644 (file)
@@ -6,6 +6,7 @@
  *
  * $Id$
  */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -18,7 +19,9 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include <syslog.h>
index f098db9bc92b76dc040519206b295d0dc0a08af9..e1293d6c44764ba0f85e4ba4f5a5b4a3ba033337 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -35,7 +36,9 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include <syslog.h>
index a9706e76c3804fcb14ce49fa578253d0dc06d4a3..ec20e4d395f75a1432f2bf8d2c03c1e1ae1b41b3 100644 (file)
@@ -1,4 +1,5 @@
 /* $Id$ */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -11,7 +12,9 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include <syslog.h>
index 3f7f5e957f87650752b12a15626814fa2c3d99c5..6deda77247733a3321f1f7721dfd54bc77b2a884 100644 (file)
@@ -7,6 +7,7 @@
  * $Id$
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -19,7 +20,9 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include <syslog.h>
index 2ff3ba7fbc45b9e3342d51769f7a267d8549c572..e9d04a078f842617b4ead0ac21ef18c8f32ee08f 100644 (file)
@@ -1,10 +1,13 @@
 /* $Id$ */
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "support.h"
index 0a0b185788d043a5f4c1e23751b9a5e720dc9233..00e38735b8bf36e29f894663f6fd11856726e722 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -32,7 +33,9 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <syslog.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "sysdep_decls.h"
index a308d80106cd1f842f5f82bf1f520b7fab951730..8f3357f419a30cf08ad5a136f7af2335463ca23b 100644 (file)
@@ -9,6 +9,7 @@
 #define _POSIX_C_SOURCE 199506L
 #endif
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -20,7 +21,9 @@
 #include <string.h>
 #include <syslog.h>
 #include <limits.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "database.h"
@@ -34,7 +37,6 @@
 #include "msgbase.h"
 #include "config.h"
 #include "dynloader.h"
-#include "sysdep.h"
 #include "tools.h"