* configure.in, acconfig.h: new files; partially functional GNU
authorNathan Bryant <loanshark@uncensored.citadel.org>
Mon, 28 Sep 1998 23:57:37 +0000 (23:57 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Mon, 28 Sep 1998 23:57:37 +0000 (23:57 +0000)
          autoconf configure script. Run autoheader; autoconf; ./configure
          --prefix=`pwd` to test.
        * Makefile.tmpl: new file; this is what Makefile.in used to be. Used by
          Configure.
        * Makefile.in: modified to work with autoconf-style configure script
        * Configure: modified to use Makefile.tmpl and generate autoconf-style
          macros. Removed procfs detection. Pass -O2 to gcc, -O to other
          compilers. Removed mknod/mkfifo detection; code should use mkfifo(3).
        * citmail.c, msgform.c, netproc.c, routines.c, support.c, userlist.c,
          whobbs.c: use HAVE_STRERROR macro rather than NO_STRERROR
        * commands.c: use HAVE_TERMIOS_H macro rather than POSIX_TERMIO
        * netproc.c: remove procfs stuff. simply attempt to kill the target
          process with signal zero instead; this checks whether the process
          exists.
        * setup.c, useradmin.c: use HAVE_CURSES_H macro

15 files changed:
citadel/.cvsignore
citadel/ChangeLog
citadel/Makefile.in
citadel/Makefile.tmpl [new file with mode: 0644]
citadel/acconfig.h [new file with mode: 0644]
citadel/citmail.c
citadel/commands.c
citadel/configure.in [new file with mode: 0644]
citadel/msgform.c
citadel/netproc.c
citadel/routines.c
citadel/setup.c
citadel/support.c
citadel/userlist.c
citadel/whobbs.c

index b2b03b4dbd1c77c7a588a84cae58809229c25cda..327623c7da1609597e3ed6b5e277eb3f8efd3457 100644 (file)
@@ -27,3 +27,8 @@ citadel.log
 data
 .depend
 import
+config.status
+configure
+config.log
+config.cache
+sysdep.h.in
index a301744c202c9e55c84f5a0d28e880dd4ce448f6..56efec019f3f5ab125af948371ea66a8f0f8767f 100644 (file)
@@ -1,3 +1,21 @@
+1998-09-28 Nathan Bryant <bryant@cs.usm.maine.edu>
+       * configure.in, acconfig.h: new files; partially functional GNU
+         autoconf configure script. Run autoheader; autoconf; ./configure
+         --prefix=`pwd` to test.
+       * Makefile.tmpl: new file; this is what Makefile.in used to be. Used by
+         Configure.
+       * Makefile.in: modified to work with autoconf-style configure script
+       * Configure: modified to use Makefile.tmpl and generate autoconf-style
+         macros. Removed procfs detection. Pass -O2 to gcc, -O to other
+         compilers. Removed mknod/mkfifo detection; code should use mkfifo(3).
+       * citmail.c, msgform.c, netproc.c, routines.c, support.c, userlist.c,
+         whobbs.c: use HAVE_STRERROR macro rather than NO_STRERROR
+       * commands.c: use HAVE_TERMIOS_H macro rather than POSIX_TERMIO
+       * netproc.c: remove procfs stuff. simply attempt to kill the target
+         process with signal zero instead; this checks whether the process
+         exists.
+       * setup.c, useradmin.c: use HAVE_CURSES_H macro
+
 Sun Sep 27 23:41:29 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * BOTH the old and new generation systems are being written to at
          this point.  Code that reads stuff is still using the old system.
index ee36069732f27d759e10ba39b1b619e2b1a22536..4290bfa9788ebbe09d7157c9dea0fe5435a3515b 100644 (file)
 #
 ########################################################################
 
+all: client server utils serv_modules
+
 CLIENT_TARGETS=citadel whobbs
 SERVER_TARGETS=citserver setup
-SERV_MODULES=$(MODDIR)/serv_chat.so $(MODDIR)/serv_test.so
+SERV_MODULES=modules/serv_chat.so modules/serv_test.so
 UTIL_TARGETS=aidepost netmailer netproc netsetup msgform \
        readlog rcit stats citmail netpoll mailinglist userlist
 PROXY_TARGETS=proxy
+CFLAGS=@CFLAGS@ @DEFS@
+CC=@CC@
+SERVER_LFLAGS=@LIBS@
+CURSES=@CURSES@
 
 client: $(CLIENT_TARGETS)
 
@@ -43,28 +49,28 @@ ipc_c_tcp.o: ipc_c_tcp.c
        $(CC) $(CFLAGS) -c ipc_c_tcp.c
 
 citadel.o: citadel.c
-       $(CC) -O $(CFLAGS) -c citadel.c
+       $(CC) $(CFLAGS) -c citadel.c
 
 rooms.o: rooms.c
-       $(CC) -O $(CFLAGS) -c rooms.c
+       $(CC) $(CFLAGS) -c rooms.c
 
 messages.o: messages.c
-       $(CC) -O $(CFLAGS) -c messages.c
+       $(CC) $(CFLAGS) -c messages.c
 
 commands.o: commands.c
-       $(CC) -O $(CFLAGS) -c commands.c
+       $(CC) $(CFLAGS) -c commands.c
 
 routines.o: routines.c
-       $(CC) -O $(CFLAGS) -c routines.c
+       $(CC) $(CFLAGS) -c routines.c
 
 routines2.o: routines2.c
-       $(CC) -O $(CFLAGS) -c routines2.c
+       $(CC) $(CFLAGS) -c routines2.c
 
 client_chat.o: client_chat.c
-       $(CC) -O $(CFLAGS) -c client_chat.c
+       $(CC) $(CFLAGS) -c client_chat.c
 
 serv_info.o: serv_info.c
-       $(CC) -O $(CFLAGS) -c serv_info.c
+       $(CC) $(CFLAGS) -c serv_info.c
 
 
 #
@@ -105,14 +111,14 @@ msgbase.o: msgbase.c
 locate_host.o: locate_host.c
        $(CC) $(CFLAGS) -D_REENTRANT -c locate_host.c
 
-$(MODDIR)/serv_chat.so: serv_chat.o
-       $(CC) -shared -o $(MODDIR)/serv_chat.so serv_chat.o
+modules/serv_chat.so: serv_chat.o
+       $(CC) -shared -o modules/serv_chat.so serv_chat.o
 
 serv_chat.o: serv_chat.c
        $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_chat.c
 
-$(MODDIR)/serv_test.so: serv_test.o
-       $(CC) -shared -o $(MODDIR)/serv_test.so serv_test.o
+modules/serv_test.so: serv_test.o
+       $(CC) -shared -o modules/serv_test.so serv_test.o
 
 serv_test.o: serv_test.c
        $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_test.c
@@ -130,16 +136,16 @@ logging.o: logging.c
        $(CC) $(CFLAGS) -D_REENTRANT -c logging.c
 
 config.o: config.c
-       $(CC) -O $(CFLAGS) -D_REENTRANT -c config.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c config.c
 
 sysdep.o: sysdep.c
-       $(CC) -O $(CFLAGS) -D_REENTRANT -c sysdep.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c sysdep.c
 
 aidepost: aidepost.o config.o
        $(CC) $(CFLAGS) aidepost.o config.o $(LFLAGS) -o aidepost
 
 aidepost.o: aidepost.c
-       $(CC) -O $(CFLAGS) -c aidepost.c
+       $(CC) $(CFLAGS) -c aidepost.c
 
 #
 # 'netmailer' needs to run setuid because it generates headers for Internet
@@ -151,17 +157,17 @@ netmailer: netmailer.o internetmail.o config.o
        chmod 4755 netmailer
 
 netmailer.o: netmailer.c
-       $(CC) -O $(CFLAGS) -c netmailer.c
+       $(CC) $(CFLAGS) -c netmailer.c
 
 internetmail.o: internetmail.c
-       $(CC) -O $(CFLAGS) -c internetmail.c
+       $(CC) $(CFLAGS) -c internetmail.c
 
 netproc: netproc.o config.o ipc_c_tcp.o
-       $(CC) -O $(CFLAGS) netproc.o config.o ipc_c_tcp.o \
+       $(CC) $(CFLAGS) netproc.o config.o ipc_c_tcp.o \
                $(LFLAGS) -o netproc
 
 netproc.o: netproc.c
-       $(CC) -O $(CFLAGS) -c netproc.c
+       $(CC) $(CFLAGS) -c netproc.c
 
 citmail: citmail.o config.o internetmail.o
        #
@@ -173,56 +179,56 @@ citmail: citmail.o config.o internetmail.o
        chmod 4755 citmail
 
 citmail.o: citmail.c
-       $(CC) -O $(CFLAGS) -c citmail.c
+       $(CC) $(CFLAGS) -c citmail.c
 
 mailinglist: mailinglist.o config.o internetmail.o
        $(CC) $(CFLAGS) mailinglist.o config.o internetmail.o \
                $(LFLAGS) -o mailinglist
 
 mailinglist.o: mailinglist.c
-       $(CC) -O $(CFLAGS) -c mailinglist.c
+       $(CC) $(CFLAGS) -c mailinglist.c
 
 setup: setup.o
        $(CC) $(CFLAGS) setup.o $(CURSES) $(LFLAGS) -o setup
 
 setup.o: setup.c
-       $(CC) -O $(CFLAGS) -c setup.c
+       $(CC) $(CFLAGS) -c setup.c
 
 netsetup: netsetup.o config.o
        $(CC) $(CFLAGS) netsetup.o config.o $(LFLAGS) -o netsetup
 
 netsetup.o: netsetup.c
-       $(CC) -O $(CFLAGS) -c netsetup.c
+       $(CC) $(CFLAGS) -c netsetup.c
 
 proxy: proxy.o ipc_c_tcp.o
        $(CC) $(CFLAGS) proxy.o ipc_c_tcp.o $(LFLAGS) -o proxy
 
 proxy.o: proxy.c
-       $(CC) -O $(CFLAGS) -c proxy.c
+       $(CC) $(CFLAGS) -c proxy.c
 
 whobbs: whobbs.o ipc_c_tcp.o
        $(CC) $(CFLAGS) whobbs.o ipc_c_tcp.o $(LFLAGS) -o whobbs
 
 whobbs.o: whobbs.c
-       $(CC) -O $(CFLAGS) -c whobbs.c
+       $(CC) $(CFLAGS) -c whobbs.c
 
 userlist: userlist.o ipc_c_tcp.o
        $(CC) $(CFLAGS) userlist.o ipc_c_tcp.o $(LFLAGS) -o userlist
 
 userlist.o: userlist.c
-       $(CC) -O $(CFLAGS) -c userlist.c
+       $(CC) $(CFLAGS) -c userlist.c
 
 msgform: msgform.o
        $(CC) $(CFLAGS) msgform.o $(LFLAGS) -o msgform
 
 msgform.o: msgform.c
-       $(CC) -O $(CFLAGS) -c msgform.c
+       $(CC) $(CFLAGS) -c msgform.c
 
 readlog: readlog.o config.o
        $(CC) $(CFLAGS) readlog.o config.o $(LFLAGS) -o readlog
 
 readlog.o: readlog.c
-       $(CC) -O $(CFLAGS) -c readlog.c
+       $(CC) $(CFLAGS) -c readlog.c
 
 rcit: rcit.o config.o
        $(CC) $(CFLAGS) rcit.o config.o $(LFLAGS) -o rcit
@@ -233,13 +239,13 @@ rcit: rcit.o config.o
        # 
 
 rcit.o: rcit.c
-       $(CC) -O $(CFLAGS) -c rcit.c
+       $(CC) $(CFLAGS) -c rcit.c
 
 stats: stats.o config.o
        $(CC) $(CFLAGS) stats.o config.o $(LFLAGS) -o stats
 
 stats.o: stats.c
-       $(CC) -O $(CFLAGS) -c stats.c
+       $(CC) $(CFLAGS) -c stats.c
 
 clean:
        find . -name \*.[o] -print -exec rm -f {} \;
@@ -252,4 +258,4 @@ realclean: cleaner
        rm -f Makefile sysdep.h
 
 .depend: $(wildcard *.c) $(wildcard *.h)
-       gcc -MM *.c > .depend
+       $(CC) -MM *.c > .depend
diff --git a/citadel/Makefile.tmpl b/citadel/Makefile.tmpl
new file mode 100644 (file)
index 0000000..ac2d00c
--- /dev/null
@@ -0,0 +1,255 @@
+# Makefile for Citadel/UX
+#
+# NOTE: normally you should not have to modify the Makefile.  All
+# system-dependent configuration is in the "Configure" script, which
+# uses "Makefile.tmpl" to generate a "Makefile".  In the rare instance
+# that you have to modify something here, please take note:
+# 1. Edit Makefile.tmpl, -not- Makefile.
+# 2. Send e-mail to ajc@uncnsrd.mt-kisco.ny.us and let me know what you
+#    did, so any necessary changes can be put into the next release.
+#
+########################################################################
+
+CLIENT_TARGETS=citadel whobbs
+SERVER_TARGETS=citserver setup
+SERV_MODULES=$(MODDIR)/serv_chat.so $(MODDIR)/serv_test.so
+UTIL_TARGETS=aidepost netmailer netproc netsetup msgform \
+       readlog rcit stats citmail netpoll mailinglist userlist
+PROXY_TARGETS=proxy
+
+client: $(CLIENT_TARGETS)
+
+server: $(SERVER_TARGETS)
+
+utils: $(UTIL_TARGETS)
+
+serv_modules: $(SERV_MODULES)
+
+#
+#
+
+citadel: ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o messages.o \
+       commands.o client_chat.o serv_info.o
+       $(CC) $(CFLAGS) ipc_c_tcp.o citadel.o rooms.o routines.o routines2.o \
+       messages.o commands.o client_chat.o serv_info.o $(LFLAGS) -o citadel
+
+netpoll: netpoll.o config.o ipc_c_tcp.o
+       $(CC) $(CFLAGS) netpoll.o config.o ipc_c_tcp.o $(LFLAGS) -o netpoll
+
+netpoll.o: netpoll.c
+       $(CC) $(CFLAGS) -c netpoll.c
+
+ipc_c_tcp.o: ipc_c_tcp.c
+       $(CC) $(CFLAGS) -c ipc_c_tcp.c
+
+citadel.o: citadel.c
+       $(CC) $(CFLAGS) -c citadel.c
+
+rooms.o: rooms.c
+       $(CC) $(CFLAGS) -c rooms.c
+
+messages.o: messages.c
+       $(CC) $(CFLAGS) -c messages.c
+
+commands.o: commands.c
+       $(CC) $(CFLAGS) -c commands.c
+
+routines.o: routines.c
+       $(CC) $(CFLAGS) -c routines.c
+
+routines2.o: routines2.c
+       $(CC) $(CFLAGS) -c routines2.c
+
+client_chat.o: client_chat.c
+       $(CC) $(CFLAGS) -c client_chat.c
+
+serv_info.o: serv_info.c
+       $(CC) $(CFLAGS) -c serv_info.c
+
+
+#
+#
+
+citserver: citserver.o user_ops.o support.o room_ops.o file_ops.o \
+       msgbase.o config.o sysdep.o locate_host.o \
+       housekeeping.o database.o control.o logging.o \
+       dynloader.o
+       $(CC) $(CFLAGS) -rdynamic \
+               citserver.o user_ops.o room_ops.o file_ops.o support.o \
+               msgbase.o config.o sysdep.o locate_host.o \
+               housekeeping.o database.o control.o logging.o \
+               dynloader.o \
+               $(LFLAGS) $(SERVER_LFLAGS) -o citserver
+
+citserver.o: citserver.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c citserver.c
+
+user_ops.o: user_ops.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c user_ops.c
+
+room_ops.o: room_ops.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c room_ops.c
+
+dynloader.o: dynloader.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c dynloader.c
+
+file_ops.o: file_ops.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c file_ops.c
+
+support.o: support.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c support.c
+
+msgbase.o: msgbase.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c msgbase.c
+
+locate_host.o: locate_host.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c locate_host.c
+
+$(MODDIR)/serv_chat.so: serv_chat.o
+       $(CC) -shared -o $(MODDIR)/serv_chat.so serv_chat.o
+
+serv_chat.o: serv_chat.c
+       $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_chat.c
+
+$(MODDIR)/serv_test.so: serv_test.o
+       $(CC) -shared -o $(MODDIR)/serv_test.so serv_test.o
+
+serv_test.o: serv_test.c
+       $(CC) $(CFLAGS) -D_REENTRANT -fPIC -c serv_test.c
+
+housekeeping.o: housekeeping.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c housekeeping.c
+
+database.o: database.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c database.c
+
+control.o: control.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c control.c
+
+logging.o: logging.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c logging.c
+
+config.o: config.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c config.c
+
+sysdep.o: sysdep.c
+       $(CC) $(CFLAGS) -D_REENTRANT -c sysdep.c
+
+aidepost: aidepost.o config.o
+       $(CC) $(CFLAGS) aidepost.o config.o $(LFLAGS) -o aidepost
+
+aidepost.o: aidepost.c
+       $(CC) $(CFLAGS) -c aidepost.c
+
+#
+# 'netmailer' needs to run setuid because it generates headers for Internet
+# mail.  If it is not run setuid, all outgoing mail may always show as coming
+# from your BBSUID rather than the actual sending user.
+#
+netmailer: netmailer.o internetmail.o config.o
+       $(CC) $(CFLAGS) netmailer.o config.o internetmail.o $(LFLAGS) -o netmailer
+       chmod 4755 netmailer
+
+netmailer.o: netmailer.c
+       $(CC) $(CFLAGS) -c netmailer.c
+
+internetmail.o: internetmail.c
+       $(CC) $(CFLAGS) -c internetmail.c
+
+netproc: netproc.o config.o ipc_c_tcp.o
+       $(CC) $(CFLAGS) netproc.o config.o ipc_c_tcp.o \
+               $(LFLAGS) -o netproc
+
+netproc.o: netproc.c
+       $(CC) $(CFLAGS) -c netproc.c
+
+citmail: citmail.o config.o internetmail.o
+       #
+       #                 ###### IMPORTANT ######
+       # To allow Citadel users to receive Internet mail, you must
+       # set this program to be your local mail delivery agent.
+       #
+       $(CC) $(CFLAGS) citmail.o config.o internetmail.o $(LFLAGS) -o citmail
+       chmod 4755 citmail
+
+citmail.o: citmail.c
+       $(CC) $(CFLAGS) -c citmail.c
+
+mailinglist: mailinglist.o config.o internetmail.o
+       $(CC) $(CFLAGS) mailinglist.o config.o internetmail.o \
+               $(LFLAGS) -o mailinglist
+
+mailinglist.o: mailinglist.c
+       $(CC) $(CFLAGS) -c mailinglist.c
+
+setup: setup.o
+       $(CC) $(CFLAGS) setup.o $(CURSES) $(LFLAGS) -o setup
+
+setup.o: setup.c
+       $(CC) $(CFLAGS) $(CURSES_INC) -c setup.c
+
+netsetup: netsetup.o config.o
+       $(CC) $(CFLAGS) netsetup.o config.o $(LFLAGS) -o netsetup
+
+netsetup.o: netsetup.c
+       $(CC) $(CFLAGS) -c netsetup.c
+
+proxy: proxy.o ipc_c_tcp.o
+       $(CC) $(CFLAGS) proxy.o ipc_c_tcp.o $(LFLAGS) -o proxy
+
+proxy.o: proxy.c
+       $(CC) $(CFLAGS) -c proxy.c
+
+whobbs: whobbs.o ipc_c_tcp.o
+       $(CC) $(CFLAGS) whobbs.o ipc_c_tcp.o $(LFLAGS) -o whobbs
+
+whobbs.o: whobbs.c
+       $(CC) $(CFLAGS) -c whobbs.c
+
+userlist: userlist.o ipc_c_tcp.o
+       $(CC) $(CFLAGS) userlist.o ipc_c_tcp.o $(LFLAGS) -o userlist
+
+userlist.o: userlist.c
+       $(CC) $(CFLAGS) -c userlist.c
+
+msgform: msgform.o
+       $(CC) $(CFLAGS) msgform.o $(LFLAGS) -o msgform
+
+msgform.o: msgform.c
+       $(CC) $(CFLAGS) -c msgform.c
+
+readlog: readlog.o config.o
+       $(CC) $(CFLAGS) readlog.o config.o $(LFLAGS) -o readlog
+
+readlog.o: readlog.c
+       $(CC) $(CFLAGS) -c readlog.c
+
+rcit: rcit.o config.o
+       $(CC) $(CFLAGS) rcit.o config.o $(LFLAGS) -o rcit
+       # 
+       # NOTE: TO RECEIVE CITADEL TRAFFIC VIA THE RCIT PROGRAM (ESPECIALLY
+       # IF YOU ARE GATEWAYING TO USENET) YOU MUST LINK RNEWS TO RCIT:
+       #ln -s rcit /usr/bin/rnews
+       # 
+
+rcit.o: rcit.c
+       $(CC) $(CFLAGS) -c rcit.c
+
+stats: stats.o config.o
+       $(CC) $(CFLAGS) stats.o config.o $(LFLAGS) -o stats
+
+stats.o: stats.c
+       $(CC) $(CFLAGS) -c stats.c
+
+clean:
+       find . -name \*.[o] -print -exec rm -f {} \;
+
+cleaner: clean
+       rm -f $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
+               $(SERV_MODULES) $(PROXY_TARGETS)
+
+realclean: cleaner
+       rm -f Makefile sysdep.h
+
+.depend: $(wildcard *.c) $(wildcard *.h)
+       gcc -MM *.c > .depend
diff --git a/citadel/acconfig.h b/citadel/acconfig.h
new file mode 100644 (file)
index 0000000..e96390d
--- /dev/null
@@ -0,0 +1,8 @@
+/* define this to the bbs home directory */
+#undef BBSDIR
+
+/* define this to enable the autologin feature */
+#undef ENABLE_AUTOLOGIN
+
+/* define this to enable ANSI color */
+#undef ANSI_COLOR
index 1dbc5da36235431df38eea288ac62e347bfb0df5..ac2d5c8ccffb700e2607b50997b68e9025717148 100644 (file)
@@ -123,7 +123,7 @@ long conv_date(char *sdbuf)
        }
 
 
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
 /*
  * replacement strerror() for systems that don't have it
  */
index 984355c2d67f778c41a3dd972ecd9c96d3d29864..36b63a8f8bf63e489cc75a92c7e03aab44119b6a 100644 (file)
@@ -17,7 +17,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 
-#ifdef POSIX_TERMIO
+#ifdef HAVE_TERMIOS_H
 #include <termios.h>
 #else
 #include <sgtty.h>
@@ -600,7 +600,7 @@ int getcmd(char *argbuf)
  * 2 - save current settings for later restoral
  * 3 - restore saved settings
  */
-#ifdef POSIX_TERMIO
+#ifdef HAVE_TERMIOS_H
 void sttybbs(int cmd)          /* SysV version of sttybbs() */
          {
        struct termios live;
diff --git a/citadel/configure.in b/citadel/configure.in
new file mode 100644 (file)
index 0000000..c26e425
--- /dev/null
@@ -0,0 +1,56 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.12)
+AC_INIT(citserver.c)
+AC_PREFIX_DEFAULT(/usr/local/citadel)
+if test "$prefix" = NONE; then
+       AC_DEFINE_UNQUOTED(BBSDIR, "$ac_default_prefix")
+else
+       AC_DEFINE_UNQUOTED(BBSDIR, "$prefix")
+fi
+
+AC_ARG_ENABLE(autologin, [  --disable-autologin     disable autologin (default is enabled)],[if test "$enableval" = yes; then
+       AC_DEFINE(ENABLE_AUTOLOGIN)
+fi],AC_DEFINE(ENABLE_AUTOLOGIN))
+
+AC_ARG_ENABLE(ansi-color, [  --enable-ansi-color     enable ANSI color (default is disabled)],[if test "$enableval" = yes; then
+       AC_DEFINE(ANSI_COLOR)
+fi])
+
+dnl Checks for programs.
+AC_PROG_CC
+if test "$GCC" = yes; then
+       CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
+fi
+AC_PROG_RANLIB
+
+dnl Checks for libraries.
+AC_CHECK_LIB(crypt, crypt)
+AC_CHECK_LIB(dl, dlopen)
+AC_CHECK_LIB(gdbm, gdbm_open)
+AC_CHECK_LIB(curses, initscr, CURSES=-lcurses)
+AC_CHECK_LIB(pthread, pthread_create)
+AC_CHECK_LIB(pthreads, pthread_create)
+
+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)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+
+dnl Checks for library functions.
+AC_FUNC_GETPGRP
+AC_PROG_GCC_TRADITIONAL
+AC_TYPE_SIGNAL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(mkdir mktime rmdir select socket strerror)
+
+AC_SUBST(CURSES)
+AC_CONFIG_HEADER(sysdep.h)
+AC_OUTPUT(Makefile)
index 1fbe5d42ffc42b68295f05176649e16c596a1d58..cc3a3b4986ec9b49ccd6ae865ae36f5d75ea9298 100644 (file)
@@ -28,7 +28,7 @@ int fpgetfield(FILE *fp, char *string);
 int fmout(int width, FILE *fp);
 
 
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
 /*
  * replacement strerror() for systems that don't have it
  */
index f999e1c958f63320ee0727ab9ad066e48444b3de..52dafca1c3815802753f15d52d66fd41520de689 100644 (file)
@@ -112,7 +112,7 @@ extern char bbs_home_directory[];
 extern int home_specified;
 
 
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
 /*
  * replacement strerror() for systems that don't have it
  */
@@ -337,29 +337,14 @@ struct syslist *get_sys_ptr(char *sysname)
  */
 int set_lockfile(void) {
        FILE *lfp;
-       int ok = 1;
        int onppid;
-       char buf[64];
 
-       if (access(LOCKFILE,0)==0) {
-
-       /* 
-        * if the /proc filesystem is available, we can further check to
-        * make sure that the process that wrote the lock file is actually
-        * running, and didn't simply terminate and not clean up after itself
-        */
-#ifdef HAVE_PROC_FS
-               lfp = fopen(LOCKFILE,"r");
-               fscanf(lfp,"%d",&onppid);
-               fclose(lfp);
-               sprintf(buf,"/proc/%d/cmdline",onppid);
-               if (access(buf,0)==0) ok = 0;
-#else
-               ok = 0;
-#endif
+       if ((lfp = fopen(LOCKFILE,"r")) != NULL) {
+                fscanf(lfp,"%d",&onppid);
+                fclose(lfp);
+               if (!kill(onppid, 0) || errno == EPERM) return 1;
                }
 
-       if (ok == 0) return(1);
        lfp=fopen(LOCKFILE,"w");
        fprintf(lfp,"%d\n",getpid());
        fclose(lfp);
index e8332de0153c6d90e5f89a0d6d12439baac144f4..8573ff28691328369a1b3f495a2c1ec71ef15a63 100644 (file)
@@ -393,7 +393,7 @@ void strproc(char *string)
        }
 
 
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
 /*
  * replacement strerror() for systems that don't have it
  */
index 66cb932274d72008cc3db9c37f794fee11712997..74a9db293ea1e96b2e49b97858689e9de67422d2 100644 (file)
 #include "sysdep.h"
 #include "config.h"
 
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
 # ifdef OK
 # undef OK
 # endif
-#include CURSES_INC
+#include <curses.h>
 #endif
 
 #define MAXSETUP 19
@@ -228,7 +228,7 @@ struct config config;
 int direction;
 
 void cleanup(int exitcode) {
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
        if (setup_type == UI_CURSES) {
                clear();
                refresh();
@@ -253,7 +253,7 @@ void cleanup(int exitcode) {
        }
 
 
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
 void getlin(int yp, int xp, char *string, int lim)     /* Gets a line from the terminal */
                                /* Where on the screen to start */
                                /* Pointer to string buffer */
@@ -315,7 +315,7 @@ void title(char *text)
 void hit_any_key(void) {
        char junk[5];
 
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
        if (setup_type == UI_CURSES) {
                mvprintw(20, 0, "Press any key to continue... ");
                refresh();
@@ -348,7 +348,7 @@ int yesno(char *question)
                        sprintf(buf, "dialog --yesno \"%s\" 7 80", question);
                        answer = ( (system(buf)==0) ? 1 : 0);
                        break;
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
                case UI_CURSES:
                        do {
                                clear();
@@ -416,7 +416,7 @@ void important_message(char *title, char *msgtext) {
                                title, msgtext);
                        system(buf);
                        break;
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
                case UI_CURSES:
                        clear();
                        move(1, 20);
@@ -477,7 +477,7 @@ void progress(char *text, long int curr, long int cmax)
                                }
                        break;
 
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
                case UI_CURSES:
                        if (curr==0) {
                                clear();
@@ -679,7 +679,7 @@ void set_str_val(int msgpos, char str[]) {
                                                str[strlen(str)-1]=0;
                                }
                        break;
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
                case UI_CURSES:
                        clear();
                        move(1, ((80-strlen(setup_titles[msgpos]))/2) );
@@ -837,7 +837,7 @@ void write_config_to_disk(void) {
  */
 int discover_ui(void) {
 
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
        return UI_CURSES;
 #endif
 
@@ -883,7 +883,7 @@ void main(int argc, char *argv[]) {
                setup_type = discover_ui();
                }
 
-#ifdef CURSES_INC
+#ifdef HAVE_CURSES_H
        if (setup_type == UI_CURSES) {
                initscr();
                raw();
index 62a2f4497b674d13647ddd5a9592e11dc3f18e6e..ea4c39edbaa8d71889697ebb26c2ff9f06cd0941 100644 (file)
@@ -192,12 +192,12 @@ void mesg_locate(char *targ, char *searchfor, int numdirs, char **dirs)
        }
 
 
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
 /*
  * replacement strerror() for systems that don't have it
  */
-char *strerror(e)
-int e; {
+char *strerror(int e)
+{
        static char buf[32];
 
        sprintf(buf,"errno = %d",e);
index d95bc8e63097646534546971d3407594f075673e..fd88681bfa2f9cc07ec2ea7b0791dc5976063608 100644 (file)
@@ -131,7 +131,7 @@ void main(int argc, char **argv)
        }
 
 
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
 /*
  * replacement strerror() for systems that don't have it
  */
index 189773f3ee0f7aceb1351464f0c61b8933b05e91..9dfa181a9cc1369d32403031f37e5054802a24c8 100644 (file)
@@ -123,7 +123,7 @@ void main(int argc, char **argv)
        }
 
 
-#ifdef NO_STRERROR
+#ifndef HAVE_STRERROR
 /*
  * replacement strerror() for systems that don't have it
  */