$Log$
+Revision 653.9 2005/07/26 02:49:25 ajc
+* Applied a patch sent in by Wilfried Goesgens which allows the various
+ program and data directories to be set to any location on the host
+ system. This will allow packagers to do FSSTND-type configurations.
+
Revision 653.8 2005/07/25 17:37:36 ajc
* citadel_ipc.c: when performing a MSG4 command, don't return the
charset as part of the content-type string.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
/* define this if you have the resolv.h header file. */
#undef HAVE_RESOLV_H
+
+/* define, if the user suplied a data-directory to use. */
+#undef HAVE_DATA_DIR
+#undef DATA_DIR
+
+/* define, if the user suplied a spool-directory to use. */
+#undef HAVE_SPOOL_DIR
+#undef SPOOL_DIR
+
+/* define, where the config should go in unix style */
+#undef HAVE_ETC_DIR
+#undef ETC_DIR
+
+/* define, where the config should go in unix style */
+#undef HAVE_RUN_DIR
+#undef RUN_DIR
+
+
+#undef EGD_POOL
}
snprintf(tempspool, sizeof tempspool,
- "./network/spoolin/ap.%04lx",
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolin/ap.%04lx",
(long)getpid());
unlink(tempspool);
* guaranteed to have the uid/gid we want.
*/
if (!getuid() || !getgid()) {
- if (stat(CTDLDIR "/citadel.config", &st) < 0) {
+ if (stat(
+#ifndef HAVE_ETC_DIR
+ CTDLDIR
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", &st) < 0) {
perror("couldn't stat citadel.config");
logoff(NULL, 3);
}
SSL_set_session_id_context(temp_ssl, "Citadel SID", 14);
#endif
- if (!access("/var/run/egd-pool", F_OK))
- RAND_egd("/var/run/egd-pool");
+ if (!access(EGD_POOL, F_OK))
+ RAND_egd(EGD_POOL);
if (!RAND_status()) {
error_printf("PRNG not properly seeded\n");
if (!strcmp(cithost, UDS)) {
if (!strcasecmp(citport, DEFAULT_PORT)) {
snprintf(sockpath, sizeof sockpath, "%s%s",
- CTDLDIR, "/citadel.socket");
+#ifndef HAVE_RUN_DIR
+ CTDLDIR
+#else
+ RUN_DIR
+#endif
+ , "/citadel.socket");
}
else {
snprintf(sockpath, sizeof sockpath, "%s%s",
- citport, "/citadel.socket");
+ citport,
+#ifndef HAVE_RUN_DIR
+ CTDLDIR
+#else
+ RUN_DIR
+#endif
+ "/citadel.socket");
}
ipc->sock = uds_connectsock(&(ipc->isLocal), sockpath);
if (ipc->sock == -1) {
}
strip_trailing_nonprint(fromline);
- serv_sock = uds_connectsock("lmtp.socket");
+ serv_sock = uds_connectsock(
+#ifndef HAVE_RUN_DIR
+ "."
+#else
+ RUN_DIR
+#endif
+ "/lmtp.socket");
serv_gets(buf);
if (buf[0]!='2') cleanup(1);
static time_t pc_timestamp = 0;
static char public_clients[SIZ];
+#ifndef HAVE_ETC
#define PUBLIC_CLIENTS "./public_clients"
+#else
+#define PUBLIC_CLIENTS ETC_DIR"/public_clients"
+#endif
/*
* Check the time stamp on the public_clients file. If it's been
strcat(public_clients, addrbuf);
}
- fp = fopen("public_clients", "r");
+ fp = fopen(
+#ifndef HAVE_ETC
+ "."
+#else
+ ETC_DIR
+#endif
+ "/public_clients", "r");
if (fp != NULL) while (fgets(buf, sizeof buf, fp)!=NULL) {
for (i=0; i<strlen(buf); ++i) {
if (buf[i] == '#') buf[i] = 0;
extract_token(buf, mname, 0, '|', sizeof buf);
- dirs[0] = strdup("messages");
- dirs[1] = strdup("help");
+ dirs[0] = strdup(
+#ifdef HAVE_DATA_DIR
+ DATA_DIR"/"
+#endif
+ "messages");
+ dirs[1] = strdup(
+#ifdef HAVE_DATA_DIR
+ DATA_DIR"/"
+#endif
+ "help");
snprintf(buf2, sizeof buf2, "%s.%d.%d", buf, CC->cs_clientdev, CC->cs_clienttyp);
mesg_locate(targ, sizeof targ, buf2, 2, (const char **)dirs);
if (strlen(targ) == 0) {
if (buf[a] == '/') buf[a] = '.';
}
- dirs[0] = strdup("messages");
- dirs[1] = strdup("help");
+ dirs[0] = strdup(
+#ifdef HAVE_DATA_DIR
+ DATA_DIR"/"
+#endif
+ "messages");
+ dirs[1] = strdup(
+#ifdef HAVE_DATA_DIR
+ DATA_DIR"/"
+#endif
+ "help");
mesg_locate(targ, sizeof targ, buf, 2, (const char**)dirs);
free(dirs[0]);
free(dirs[1]);
if (strlen(targ)==0) {
- snprintf(targ, sizeof targ, "./help/%s", buf);
+ snprintf(targ, sizeof targ,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/help/%s", buf);
}
mfp = fopen(targ,"w");
ccfile = fopen(buf, "r");
}
if (ccfile == NULL) {
- snprintf(buf, sizeof buf, "%s/citadel.rc", CTDLDIR);
+ snprintf(buf, sizeof buf,
+#ifndef HAVE_ETC_DIR
+ CTDLDIR
+#else
+ ETC_DIR
+#endif
+ "/citadel.rc");
ccfile = fopen(buf, "r");
}
if (ccfile == NULL) {
strerror(errno));
exit(1);
}
- cfp = fopen("citadel.config", "rb");
+ cfp = fopen(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", "rb");
if (cfp == NULL) {
fprintf(stderr, "This program could not be started.\n"
"Unable to open %s/citadel.config\n"
{
FILE *cfp;
- if ((cfp = fopen("citadel.config", "rb+")) == NULL)
+ if ((cfp = fopen(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", "rb+")) == NULL)
perror("citadel.config");
else {
fwrite((char *) &config, sizeof(struct config), 1, cfp);
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2003-01-30'
+timestamp='2005-04-22'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
+ amd64:OpenBSD:*:*)
+ echo x86_64-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ cats:OpenBSD:*:*)
+ echo arm-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
+ luna88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ echo mips64-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- *:MicroBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:MirBSD:*:*)
+ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
+ case $UNAME_RELEASE in
+ *4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
+ # A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit 0 ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
*:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
- x86:Interix*:3*)
- echo i586-pc-interix3
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit 0 ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
+ amd64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit 0 ;;
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
+ # the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit 0 ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit 0 ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
LIBC=gnuaout
#endif
#endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit 0 ;;
- M68*:*:R3V[567]*:*)
+ M68*:*:R3V[5678]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit 0 ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
- case `uname -p` in
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit 0 ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms && exit 0 ;;
+ I*) echo ia64-dec-vms && exit 0 ;;
+ V*) echo vax-dec-vms && exit 0 ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- ftp://ftp.gnu.org/pub/gnu/config/
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2003-02-03'
+timestamp='2005-04-22'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
+ -apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | clipper \
+ | bfin \
+ | c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
- | ip2k \
- | m32r | m68000 | m68k | m88k | mcore \
+ | ip2k | iq2000 \
+ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b \
| strongarm \
- | tahoe | thumb | tic80 | tron \
+ | tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xscale | xstormy16 | xtensa \
+ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
- | bs2000-* \
+ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
+ | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* \
- | m32r-* \
+ | ip2k-* | iq2000-* \
+ | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
+ | mmix-* \
| msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
basic_machine=a29k-amd
os=-udi
;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
basic_machine=a29k-none
os=-bsd
;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
amdahl)
basic_machine=580-amdahl
os=-sysv
basic_machine=j90-cray
os=-unicos
;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16c)
+ basic_machine=cr16c-unknown
+ os=-elf
+ ;;
crds | unos)
basic_machine=m68k-crds
;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
basic_machine=m88k-motorola
os=-sysv3
;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
np1)
basic_machine=np1-gould
;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
basic_machine=or32-unknown
os=-coff
;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
- pentiumii | pentium2)
+ pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumii-* | pentium2-*)
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
pn)
basic_machine=pn-gould
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
sequent)
basic_machine=i386-sequent
;;
basic_machine=sh-hitachi
os=-hms
;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
basic_machine=t90-cray
os=-unicos
;;
- tic4x | c4x*)
- basic_machine=tic4x-unknown
- os=-coff
- ;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
tower | tower-32)
basic_machine=m68k-ncr
;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
udi29k)
basic_machine=a29k-amd
os=-udi
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
xps | xps100)
basic_machine=xps100-honeywell
;;
romp)
basic_machine=romp-ibm
;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
rs6000)
basic_machine=rs6000-ibm
;;
sh64)
basic_machine=sh64-unknown
;;
- sparc | sparcv9 | sparcv9b)
+ sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -microbsd*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-opened*)
os=-openedition
;;
+ -os400*)
+ os=-os400
+ ;;
-wince*)
os=-wince
;;
-atheos*)
os=-atheos
;;
+ -syllable*)
+ os=-syllable
+ ;;
-386bsd)
os=-bsd
;;
-sinix*)
os=-sysv4
;;
+ -tpf*)
+ os=-tpf
+ ;;
-triton*)
os=-sysv3
;;
-kaos*)
os=-kaos
;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
-none)
;;
*)
arm*-semi)
os=-aout
;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
*-ibm)
os=-aix
;;
+ *-knuth)
+ os=-mmixware
+ ;;
*-wec)
os=-proelf
;;
-mvs* | -opened*)
vendor=ibm
;;
+ -os400*)
+ vendor=ibm
+ ;;
-ptx*)
vendor=sequent
;;
+ -tpf*)
+ vendor=ibm
+ ;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
AC_DEFINE_UNQUOTED(CTDLDIR, "$prefix")
fi
+dnl Checks for the Datadir
+AC_ARG_WITH(datadir,
+ [ --with-datadir directory to store the databases under],
+ [ if test "x$withval" != "xno" ; then
+ AC_DEFINE(HAVE_DATA_DIR)
+ AC_DEFINE_UNQUOTED(DATA_DIR, "$withval")
+ fi
+ ]
+)
+
+dnl Checks for the spooldir
+AC_ARG_WITH(spooldir,
+ [ --with-spooldir directory to keep queues under],
+ [ if test "x$withval" != "xno" ; then
+ AC_DEFINE(HAVE_SPOOL_DIR)
+ AC_DEFINE_UNQUOTED(SPOOL_DIR,"$withval")
+ fi
+ ]
+)
+
+
+
+dnl Checks for the Configdir
+AC_ARG_WITH(sysconfdir,
+ [ --with-sysconfdir directory to store the configs under],
+ [ if test "x$withval" != "xno" ; then
+ AC_DEFINE(HAVE_ETC_DIR)
+ AC_DEFINE_UNQUOTED(ETC_DIR, "$withval")
+ fi
+ ]
+)
+
+
+dnl Checks for the run-dir for the sockets
+AC_ARG_WITH(rundir,
+ [ --with-rundir directory to store the configs under],
+ [ if test "x$withval" != "xno" ; then
+ AC_DEFINE(HAVE_RUN_DIR)
+ AC_DEFINE_UNQUOTED(RUN_DIR, "$withval")
+ fi
+ ]
+)
+
+
+dnl Checks for the Pseudo Random Generator sockets TODO: this keeps being default.
+AC_DEFINE_UNQUOTED(EGD_POOL, "/var/run/egd-pool")
+AC_ARG_WITH(egdpool,
+ [ --with-egdpool the socket from Pseudo Random Generator, defaults to /var/run/egd-pool],
+ [ if test "x$withval" != "xno" ; then
+ AC_DEFINE_UNQUOTED(EGD_POOL, "$withval")
+ fi
+ ]
+)
+
+
+
+
AC_ARG_ENABLE(autologin, [ --disable-autologin disable autologin (default is enabled if possible)])
AC_ARG_ENABLE(chkpwd, [ --disable-chkpwd don't build 'chkpwd'])
AC_ARG_WITH(kthread, [ --with-kthread use kernel threads (on FreeBSD) (not recommended yet)])
AC_ARG_WITH(db, [ --with-db@<:@=DIR@:>@ use Sleepycat DB 3.x @<:@DIR=/usr/local/BerkeleyDB.3.@<:@123@:>@@:>@])
AC_ARG_WITH(ssl,
- [ --with-ssl=PATH Specify path to OpenSSL installation ],
+ [ --with-ssl=PATH Specify path to OpenSSL installation ],
[
if test "x$withval" != "xno" ; then
tryssldir=$withval
AC_ARG_WITH(with_zlib, [ --with-zlib use zlib compression if present])
AC_ARG_WITH(with_ldap, [ --with-ldap use OpenLDAP client library])
AC_ARG_WITH(with_libical, [ --with-libical use libical calendaring library])
-AC_ARG_WITH(with_newt, [ --with-newt use newt window library])
+AC_ARG_WITH(with_newt, [ --with-newt use newt window library])
if test "x$with_db" != xno -a "x$with_db" != xyes -a "$with_db"; then
db_dir="$with_db"
esac
dnl DEFS="$DEFS $PTHREAD_DEFS"
+
dnl Checks for programs.
AC_PROG_CC
fi
-
dnl Checks for the zlib compression library.
if test "x$with_zlib" != xno ; then
AC_CHECK_HEADERS(zlib.h,
*/
memset(&CitControl, 0, sizeof(struct CitControl));
if (control_fp == NULL) {
- control_fp = fopen("citadel.control", "rb+");
+ control_fp = fopen(
+#ifndef HAVE_RUN_DIR
+ "."
+#else
+ RUN_DIR
+#endif
+ "/citadel.control", "rb+");
if (control_fp != NULL) {
fchown(fileno(control_fp), config.c_ctdluid, -1);
}
}
if (control_fp == NULL) {
- control_fp = fopen("citadel.control", "wb+");
+ control_fp = fopen(
+#ifndef HAVE_RUN_DIR
+ "."
+#else
+ RUN_DIR
+#endif
+ "/citadel.control", "wb+");
if (control_fp != NULL) {
fchown(fileno(control_fp), config.c_ctdluid, -1);
memset(&CitControl, 0, sizeof(struct CitControl));
struct dirent *d;
char filename[PATH_MAX];
-
+#ifndef HAVE_DATA_DIR
getcwd(dbdirname, sizeof dbdirname);
strcat(dbdirname, "/data");
+#else
+ strcat(dbdirname, DATA_DIR"/data");
+#endif
lprintf(CTDL_DEBUG, "cdb_*: open_databases() starting\n");
lprintf(CTDL_DEBUG, "Compiled db: %s\n", DB_VERSION_STRING);
<td valign="top"><i>IMAP and build patches<br>
</i></td>
</tr>
+ <tr>
+ <td valign="top">Wilfried Goesgens<br>
+ </td>
+ <td valign="top"><i>build system patches<br>
+ </i></td>
+ </tr>
<tr>
<td valign="top">Michael Hampton<br>
</td>
filename[a] = '_';
}
}
- snprintf(pathname, sizeof pathname, "./files/%s/%s",
- CC->room.QRdirname, filename);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/%s",
+ CC->room.QRdirname, filename);
a = unlink(pathname);
if (a == 0) {
cprintf("%d File '%s' deleted.\n", CIT_OK, pathname);
return;
}
snprintf(outfile, sizeof outfile,
- "%s/network/spoolin/nsf.%04lx.%04x",
- CTDLDIR, (long)getpid(), ++seq);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolin/nsf.%04lx.%04x",
+ (long)getpid(), ++seq);
ofp = fopen(outfile, "a");
if (ofp == NULL) {
cprintf("%d internal error\n", ERROR + INTERNAL_ERROR);
fclose(ofp);
snprintf(buf, sizeof buf,
- "cd ./files/%s; uuencode %s <%s 2>/dev/null >>%s",
- CC->room.QRdirname, filename, filename, outfile);
+ "cd "
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ /* FIXME: detect uuencode while installation? or inline */
+ "/files/%s; uuencode %s <%s 2>/dev/null >>%s",
+ CC->room.QRdirname, filename, filename, outfile);
system(buf);
ofp = fopen(outfile, "a");
}
snprintf(pathname, sizeof pathname,
- "./files/%s/%s", CC->room.QRdirname, filename);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/%s", CC->room.QRdirname, filename);
CC->download_fp = fopen(pathname, "r");
if (CC->download_fp == NULL) {
ERROR + NO_SUCH_USER);
return;
}
- snprintf(pathname, sizeof pathname, "./userpics/%ld.gif",
- usbuf.usernum);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/userpics/%ld.gif",
+ usbuf.usernum);
} else if (!strcasecmp(filename, "_floorpic_")) {
which_floor = extract_int(cmdbuf, 1);
snprintf(pathname, sizeof pathname,
- "./images/floor.%d.gif", which_floor);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/floor.%d.gif", which_floor);
} else if (!strcasecmp(filename, "_roompic_")) {
assoc_file_name(pathname, sizeof pathname, &CC->room, "images");
} else {
filename[a] = '_';
}
}
- snprintf(pathname, sizeof pathname, "./images/%s.gif",
- filename);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/%s.gif",
+ filename);
}
CC->download_fp = fopen(pathname, "rb");
CC->upl_file[a] = '_';
}
}
- snprintf(CC->upl_path, sizeof CC->upl_path, "./files/%s/%s",
- CC->room.QRdirname, CC->upl_file);
+ snprintf(CC->upl_path, sizeof CC->upl_path,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/%s",
+ CC->room.QRdirname, CC->upl_file);
snprintf(CC->upl_filedir, sizeof CC->upl_filedir,
- "./files/%s/filedir", CC->room.QRdirname);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/filedir", CC->room.QRdirname);
CC->upload_fp = fopen(CC->upl_path, "r");
if (CC->upload_fp != NULL) {
}
if (CC->user.axlevel >= 6) {
- snprintf(CC->upl_path, sizeof CC->upl_path, "./images/%s",
- basenm);
+ snprintf(CC->upl_path, sizeof CC->upl_path,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/%s",
+ basenm);
}
if (!strcasecmp(basenm, "_userpic_")) {
snprintf(CC->upl_path, sizeof CC->upl_path,
- "./userpics/%ld.gif", CC->user.usernum);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/userpics/%ld.gif", CC->user.usernum);
}
if ((!strcasecmp(basenm, "_floorpic_"))
&& (CC->user.axlevel >= 6)) {
which_floor = extract_int(cmdbuf, 2);
snprintf(CC->upl_path, sizeof CC->upl_path,
- "./images/floor.%d.gif", which_floor);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/floor.%d.gif", which_floor);
}
if ((!strcasecmp(basenm, "_roompic_")) && (is_room_aide())) {
if (CC->dl_is_net == 1) {
CC->dl_is_net = 0;
- snprintf(buf, sizeof buf, "%s/network/spoolout/%s", CTDLDIR,
- CC->net_node);
+ snprintf(buf, sizeof buf,
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolout/%s",
+ CC->net_node);
unlink(buf);
}
return;
}
- snprintf(pathname, sizeof pathname, "%s/network/spoolout/%s",
- CTDLDIR, CC->net_node);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolout/%s",
+ CC->net_node);
/* first open the file in append mode in order to create a
* zero-length file if it doesn't already exist
}
snprintf(CC->upl_path, sizeof CC->upl_path,
- "%s/network/spoolin/%s.%04lx.%04x",
- CTDLDIR, CC->net_node, (long)getpid(), ++seq);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolin/%s.%04lx.%04x",
+ CC->net_node, (long)getpid(), ++seq);
CC->upload_fp = fopen(CC->upl_path, "r");
if (CC->upload_fp != NULL) {
striplt(name);
remove_any_whitespace_to_the_left_or_right_of_at_symbol(name);
- fp = fopen("network/mail.aliases", "r");
+ fp = fopen(
+#ifndef HAVE_ETG_DIR
+ "network/"
+#else
+ ETC_DIR
+#endif
+ "mail.aliases", "r");
if (fp == NULL) {
fp = fopen("/dev/null", "r");
}
{
FILE *fp;
- fp = fopen("citadel.control", "r");
+ fp = fopen(
+#ifndef HAVE_RUN_DIR
+ "."
+#else
+ RUN_DIR
+#endif
+ "/citadel.control", "r");
if (fp == NULL) {
lprintf(CTDL_CRIT, "Cannot open citadel.control: %s\n",
strerror(errno));
serialize_message(&smr, msg);
if (smr.len > 0) {
snprintf(submit_filename, sizeof submit_filename,
- "./network/spoolin/netmail.%04lx.%04x.%04x",
- (long) getpid(), CC->cs_pid, ++seqnum);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolin/netmail.%04lx.%04x.%04x",
+ (long) getpid(), CC->cs_pid, ++seqnum);
network_fp = fopen(submit_filename, "wb+");
if (network_fp != NULL) {
fwrite(smr.ser, smr.len, 1, network_fp);
cprintf("%d not here.\n", ERROR + HIGHER_ACCESS_REQUIRED);
return;
}
- cprintf("%d %s|%s/files/%s\n",
- LISTING_FOLLOWS, config.c_fqdn, CTDLDIR, CC->room.QRdirname);
+ cprintf("%d %s|"
+#ifndef HAVE_DATA_DIR
+ CTDLDIR
+#else
+ DATA_DIR
+#endif
+ "/files/%s\n",
+ LISTING_FOLLOWS, config.c_fqdn, CC->room.QRdirname);
- snprintf(buf, sizeof buf, "ls %s/files/%s >%s 2> /dev/null",
- CTDLDIR, CC->room.QRdirname, tempfilename);
- system(buf);
+ snprintf(buf, sizeof buf, "ls "
+#ifndef HAVE_DATA_DIR
+ CTDLDIR
+#else
+ DATA_DIR
+#endif
+ "/files/%s >%s 2> /dev/null",
+ CC->room.QRdirname, tempfilename);
+ system(buf);
- snprintf(buf, sizeof buf, "%s/files/%s/filedir", CTDLDIR, CC->room.QRdirname);
+ snprintf(buf, sizeof buf,
+#ifndef HAVE_DATA_DIR
+ CTDLDIR
+#else
+ DATA_DIR
+#endif
+ "/files/%s/filedir", CC->room.QRdirname);
fd = fopen(buf, "r");
if (fd == NULL)
fd = fopen("/dev/null", "r");
while (fgets(flnm, sizeof flnm, ls) != NULL) {
flnm[strlen(flnm) - 1] = 0;
if (strcasecmp(flnm, "filedir")) {
- snprintf(buf, sizeof buf, "%s/files/%s/%s",
- CTDLDIR, CC->room.QRdirname, flnm);
+ snprintf(buf, sizeof buf,
+#ifndef HAVE_DATA_DIR
+ CTDLDIR
+#else
+ DATA_DIR
+#endif
+ "/files/%s/%s",
+ CC->room.QRdirname, flnm);
stat(buf, &statbuf);
safestrncpy(comment, "", sizeof comment);
fseek(fd, 0L, 0);
/* Create a room directory if necessary */
if (CC->room.QRflags & QR_DIRECTORY) {
- snprintf(buf, sizeof buf, "./files/%s", CC->room.QRdirname);
+ snprintf(buf, sizeof buf,
+#ifndef HAVE_DATA_DIR
+ CTDLDIR
+#else
+ DATA_DIR
+#endif
+ "/files/%s", CC->room.QRdirname);
mkdir(buf, 0755);
}
snprintf(buf, sizeof buf, "%s> edited by %s\n", CC->room.QRname, CC->curr_user);
int r;
strcpy(hostbuf, UDS); /* Only run on a unix domain socket */
- strcpy(portbuf, "."); /* IPGM will refuse to run on the network */
+ strcpy(portbuf,
+#ifndef HAVE_RUN_DIR
+ "." /* IPGM will refuse to run on the network */
+#else
+ ""
+#endif
+ );
fprintf(stderr, "Attaching to server...\n");
ipc = CtdlIPC_new(1, args, hostbuf, portbuf);
if (!ipc) {
X509_NAME *name = NULL;
FILE *fp;
- if (!access("/var/run/egd-pool", F_OK))
- RAND_egd("/var/run/egd-pool");
+ if (!access(EGD_POOL, F_OK))
+ RAND_egd(EGD_POOL);
if (!RAND_status()) {
lprintf(CTDL_CRIT,
/* write it to the spool file */
snprintf(filename, sizeof filename,
- "./network/spoolout/%s",
- mptr->remote_nodename);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolout/%s",
+ mptr->remote_nodename);
fp = fopen(filename, "ab");
if (fp != NULL) {
fwrite(sermsg.ser,
strcpy(nexthop, msg->cm_fields['D']);
}
snprintf(filename, sizeof filename,
- "./network/spoolout/%s", nexthop);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolout/%s", nexthop);
fp = fopen(filename, "ab");
if (fp != NULL) {
fwrite(sermsg.ser,
struct dirent *d;
char filename[256];
- dp = opendir("./network/spoolin");
+ dp = opendir(
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolin");
if (dp == NULL) return;
while (d = readdir(dp), d != NULL) {
if ((strcmp(d->d_name, ".")) && (strcmp(d->d_name, ".."))) {
snprintf(filename, sizeof filename,
- "./network/spoolin/%s", d->d_name);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolin/%s", d->d_name);
network_process_file(filename);
}
}
char nexthop[256];
int i;
- dp = opendir("./network/spoolout");
+ dp = opendir(
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolout");
if (dp == NULL) return;
while (d = readdir(dp), d != NULL) {
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
continue;
snprintf(filename, sizeof filename,
- "./network/spoolout/%s", d->d_name);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolout/%s", d->d_name);
strcpy(nexthop, "");
i = is_valid_node(nexthop, NULL, d->d_name);
lprintf(CTDL_NOTICE, "Received %ld octets from <%s>",
download_len, remote_nodename);
lprintf(CTDL_DEBUG, "%s", buf);
- snprintf(buf, sizeof buf, "mv %s ./network/spoolin/%s.%ld",
- tempfilename, remote_nodename, (long) getpid());
+ /* TODO: make move inline. forking is verry expensive. */
+ snprintf(buf, sizeof buf, "mv %s "
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolin/%s.%ld",
+ tempfilename, remote_nodename, (long) getpid());
system(buf);
}
return;
}
- snprintf(sfname, sizeof sfname, "./network/spoolout/%s", remote_nodename);
+ snprintf(sfname, sizeof sfname,
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif HAVE_SPOOL_DIR
+ "/network/spoolout/%s", remote_nodename);
fd = open(sfname, O_RDONLY);
if (fd < 0) {
if (errno != ENOENT) {
poll = full_poll;
if (poll == 0) {
snprintf(spoolfile, sizeof spoolfile,
- "./network/spoolout/%s", node);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolout/%s", node);
if (access(spoolfile, R_OK) == 0) {
poll = 1;
}
NULL);
CtdlRegisterServiceHook(0, /* local LMTP */
- "lmtp.socket",
- lmtp_greeting,
- smtp_command_loop,
- NULL);
+#ifndef HAVE_RUN_DIR
+ "."
+#else
+ RUN_DIR
+#endif
+ "/lmtp.socket",
+ lmtp_greeting,
+ smtp_command_loop,
+ NULL);
CtdlRegisterServiceHook(0, /* local LMTP */
- "lmtp-unfiltered.socket",
- lmtp_unfiltered_greeting,
- smtp_command_loop,
- NULL);
+#ifndef HAVE_RUN_DIR
+ "."
+#else
+ RUN_DIR
+#endif
+ "/lmtp-unfiltered.socket",
+ lmtp_unfiltered_greeting,
+ smtp_command_loop,
+ NULL);
smtp_init_spoolout();
CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
* Bind the server to a Unix-domain socket.
*/
CtdlRegisterServiceHook(0,
- "citadel.socket",
+#ifndef HAVE_RUN_DIR
+ "."
+#else
+ RUN_DIR
+#endif
+ "/citadel.socket",
citproto_begin_session,
do_command_loop,
do_async_loop);
FILE *fp;
int fd;
- if ((fd = creat("citadel.config", S_IRUSR | S_IWUSR)) == -1) {
+ if ((fd = creat(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", S_IRUSR | S_IWUSR)) == -1) {
display_error("setup: cannot open citadel.config");
cleanup(1);
}
* completely new copy.
*/
- if ((a = open("citadel.config", O_WRONLY | O_CREAT | O_APPEND,
+ if ((a = open(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", O_WRONLY | O_CREAT | O_APPEND,
S_IRUSR | S_IWUSR)) == -1) {
display_error("setup: cannot append citadel.config");
cleanup(errno);
fclose(fp);
/* now we re-open it, and read the old or blank configuration */
- fp = fopen("citadel.config", "rb");
+ fp = fopen(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", "rb");
if (fp == NULL) {
display_error("setup: cannot open citadel.config");
cleanup(errno);
chown(".", config.c_ctdluid, gid);
sleep(1);
progress("Setting file permissions", 1, 4);
- chown("citadel.config", config.c_ctdluid, gid);
+ chown(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", config.c_ctdluid, gid);
sleep(1);
progress("Setting file permissions", 2, 4);
snprintf(aaa, sizeof aaa,
system(aaa);
sleep(1);
progress("Setting file permissions", 3, 4);
- chmod("citadel.config", S_IRUSR | S_IWUSR);
+ chmod(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", S_IRUSR | S_IWUSR);
sleep(1);
progress("Setting file permissions", 4, 4);
cdb_delete(CDB_USERS, usernamekey, strlen(usernamekey));
/* remove the user's bio file */
- snprintf(filename, sizeof filename, "./bio/%ld", usbuf.usernum);
+ snprintf(filename, sizeof filename,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/bio/%ld", usbuf.usernum);
unlink(filename);
/* remove the user's picture */
- snprintf(filename, sizeof filename, "./userpics/%ld.gif", usbuf.usernum);
+ snprintf(filename, sizeof filename,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/userpics/%ld.gif", usbuf.usernum);
unlink(filename);
return (0);