From: Art Cancro Date: Wed, 20 Apr 2022 00:03:36 +0000 (-0400) Subject: Meow meow! Applied patches sent by LadySerenaKitty for improved FreeBSD compatibility. X-Git-Tag: v951~9 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=eac17f31d1a19eb5b1db674e17c4f2dda87181f1 Meow meow! Applied patches sent by LadySerenaKitty for improved FreeBSD compatibility. --- diff --git a/citadel/clientsocket.c b/citadel/clientsocket.c index 07ec4c382..a88c614d9 100644 --- a/citadel/clientsocket.c +++ b/citadel/clientsocket.c @@ -13,6 +13,9 @@ #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include "ctdl_module.h" #include "clientsocket.h" diff --git a/citadel/domain.c b/citadel/domain.c index 18764725e..79461f55a 100644 --- a/citadel/domain.c +++ b/citadel/domain.c @@ -20,6 +20,9 @@ #ifdef HAVE_ARPA_NAMESER_COMPAT_H #include #endif +#ifdef __FreeBSD__ +#include +#endif #include #endif #include diff --git a/citadel/missing b/citadel/missing old mode 100644 new mode 100755 diff --git a/citadel/modules/nntp/serv_nntp.c b/citadel/modules/nntp/serv_nntp.c index c629fcc41..135d77392 100644 --- a/citadel/modules/nntp/serv_nntp.c +++ b/citadel/modules/nntp/serv_nntp.c @@ -51,7 +51,9 @@ #include "ctdl_module.h" #include "serv_nntp.h" +#ifndef __FreeBSD__ extern long timezone; +#endif // // Tests whether the supplied string is a valid newsgroup name @@ -428,7 +430,11 @@ void nntp_newgroups(const char *cmd) { thetime = mktime(&tm); if (!strcasecmp(stringy_gmt, "GMT")) { tzset(); +#ifdef __FreeBSD__ + thetime += &tm.tm_gmtoff; +#else thetime += timezone; +#endif } diff --git a/citadel/scripts/mk_module_init.sh b/citadel/scripts/mk_module_init.sh index 3d684df2b..cabae3ccb 100755 --- a/citadel/scripts/mk_module_init.sh +++ b/citadel/scripts/mk_module_init.sh @@ -4,7 +4,7 @@ # ECHO=/usr/bin/printf -SED=/bin/sed +SED=/usr/bin/sed #MINUS_e=X`$ECHO -n -e` #if [ $MINUS_e != "X" ] ; then diff --git a/citadel/scripts/mk_svn_revision.sh b/citadel/scripts/mk_svn_revision.sh index 144ffa4ab..9a68d27bd 100755 --- a/citadel/scripts/mk_svn_revision.sh +++ b/citadel/scripts/mk_svn_revision.sh @@ -25,7 +25,7 @@ if test -d $SRC_DIR/.svn ; then else if test -d $SRC_DIR/../.git ; then echo "have Git repository." - BUILD=`/usr/bin/git log -1 --pretty=%h . ` + BUILD=`/usr/bin/env git log -1 --pretty=%h . ` echo "This code base git-revision: $BUILD" CAN_BUILD_SVN_REVISION="yes" else diff --git a/libcitadel/conftools/libtool.m4 b/libcitadel/conftools/libtool.m4 index 0f53cb592..8d379e879 100755 --- a/libcitadel/conftools/libtool.m4 +++ b/libcitadel/conftools/libtool.m4 @@ -1387,7 +1387,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) +freebsd1.*) dynamic_linker=no ;; @@ -1428,7 +1428,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -5866,7 +5866,7 @@ _LT_EOF _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) + freebsd1.*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; @@ -5882,7 +5882,7 @@ _LT_EOF ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes diff --git a/textclient/citadel.rc b/textclient/citadel.rc index 7ad566d83..7f184dbcf 100644 --- a/textclient/citadel.rc +++ b/textclient/citadel.rc @@ -4,8 +4,9 @@ # The standard client looks for this file in: # 1. $HOME/.citadelrc # 2. /citadel.rc -# 3. /etc/citadel.rc -# 4. /citadel.rc +# 3. /usr/local/etc/citadel.rc +# 4. /etc/citadel.rc +# 5. /citadel.rc # Set ENCRYPT to yes to force SSL/TLS encryption when connecting to a # Citadel server, even if the server is on the same machine as the diff --git a/textclient/commands.c b/textclient/commands.c index 81fef751a..c2f9f77bd 100644 --- a/textclient/commands.c +++ b/textclient/commands.c @@ -939,6 +939,9 @@ void load_command_set(void) if (ccfile == NULL) { ccfile = fopen(file_citadel_rc, "r"); } + if (ccfile == NULL) { + ccfile = fopen("/usr/local/etc/citadel.rc", "r"); + } if (ccfile == NULL) { ccfile = fopen("/etc/citadel.rc", "r"); } diff --git a/textclient/configure b/textclient/configure index f43c18f3d..d87d078c5 100755 --- a/textclient/configure +++ b/textclient/configure @@ -87,14 +87,14 @@ int main(int argc, char **argv) { echo SSL: $SSL [ "$SSL" = "yes" ] && { CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' - LDFLAGS=${LDFLAGS}' -lssl -lcrypto' + LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz' } # Output the config.mk ( echo "CFLAGS := ${CFLAGS}" - echo "LDFLAGS := ${LDFLAGS}" + echo "LDFLAGS := ${LDFLAGS} -liconv" echo "PREFIX := ${PREFIX}" echo "BINDIR := ${BINDIR}" echo "CTDLDIR := ${CTDLDIR}" diff --git a/webcit/fmt_date.c b/webcit/fmt_date.c index 62caf410c..a14c3d5c3 100644 --- a/webcit/fmt_date.c +++ b/webcit/fmt_date.c @@ -280,7 +280,11 @@ time_t httpdate_to_timestamp(StrBuf *buf) * some systems. */ tzset(); +#ifdef __FreeBSD__ + tt.tm_sec = tt.tm_sec - tt.tm_gmtoff; +#else tt.tm_sec = tt.tm_sec - (int)timezone; +#endif t = mktime(&tt); return t; } diff --git a/webcit/http_datestring.c b/webcit/http_datestring.c index 33158dca9..d1f6634e3 100644 --- a/webcit/http_datestring.c +++ b/webcit/http_datestring.c @@ -1,5 +1,9 @@ #include "webcit.h" +#ifdef __FreeBSD__ +/** I like to believe there is a better way to do this. */ +#define HAVE_STRUCT_TM_TM_GMTOFF +#endif /** HTTP Months - do not translate - these are not for human consumption */ static char *httpdate_months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", diff --git a/webcit/scripts/get_ical_data.sh b/webcit/scripts/get_ical_data.sh index 0bce6d866..07e6e3f3f 100755 --- a/webcit/scripts/get_ical_data.sh +++ b/webcit/scripts/get_ical_data.sh @@ -6,6 +6,8 @@ echo Running $0 ICAL=/usr/local/ctdlsupport/include/libical/ical.h if test -f /usr/include/libical/ical.h; then ICAL=/usr/include/libical/ical.h +elif test -f /usr/local/include/libical/ical.h; then + ICAL=/usr/local/include/libical/ical.h fi if test ! -f ${ICAL}; then @@ -64,21 +66,21 @@ ICALTYPES="icalproperty_kind"\ for icaltype in $ICALTYPES; do cat ./scripts/get_ical_data__template.sed | \ - sed -e "s;__ICALTYPE__;$icaltype;g" > \ + gsed -e "s;__ICALTYPE__;$icaltype;g" > \ /tmp/get_ical_data.sed printf "Ical_${icaltype} ${icaltype}_map[] = {\n" cat ${ICAL} |\ -sed -e 's;/\*.*\*/;;' -e 's;\t;;g' |\ -sed -nf /tmp/get_ical_data.sed |\ -sed -e "s;.*typedef *enum *${icaltype} *{\(.*\)} ${icaltype} *\;.*;\1,;" \ +gsed -e 's;/\*.*\*/;;' -e 's;\t;;g' |\ +gsed -nf /tmp/get_ical_data.sed |\ +gsed -e "s;.*typedef *enum *${icaltype} *{\(.*\)} ${icaltype} *\;.*;\1,;" \ -e 's;/\*.*\*/;;' \ -e 's;/;\n/\n;g' \ -e 's;,;,\n;g' \ -e 's; *;;g' \ -e 's;^t*;;g' \ -e 's;\=[0-9]*;;g'|\ -sed -e 's;\(.*\),;{HKEY("\1"), \1},;' +gsed -e 's;\(.*\),;{HKEY("\1"), \1},;' printf '{"", 0, 0}\n};\n\n\n' done