Meow meow! Applied patches sent by LadySerenaKitty for improved FreeBSD compatibility.
authorArt Cancro <ajc@citadel.org>
Wed, 20 Apr 2022 00:03:36 +0000 (20:03 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 20 Apr 2022 00:03:36 +0000 (20:03 -0400)
13 files changed:
citadel/clientsocket.c
citadel/domain.c
citadel/missing [changed mode: 0644->0755]
citadel/modules/nntp/serv_nntp.c
citadel/scripts/mk_module_init.sh
citadel/scripts/mk_svn_revision.sh
libcitadel/conftools/libtool.m4
textclient/citadel.rc
textclient/commands.c
textclient/configure
webcit/fmt_date.c
webcit/http_datestring.c
webcit/scripts/get_ical_data.sh

index 07ec4c3823195662ddb39e8ba837f1157bc4dc22..a88c614d91240409266e9d461b69f58450cf17f6 100644 (file)
@@ -13,6 +13,9 @@
 #include <unistd.h>
 #include <netdb.h>
 #include <stdio.h>
+#ifdef __FreeBSD__
+#include <sys/socket.h>
+#endif
 #include <libcitadel.h>
 #include "ctdl_module.h"
 #include "clientsocket.h"
index 18764725e093ae357795411e0915d35364a88107..79461f55a1cd6cc22b1893d284fe67a7e26c65c4 100644 (file)
@@ -20,6 +20,9 @@
 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
 #include <arpa/nameser_compat.h>
 #endif
+#ifdef __FreeBSD__
+#include <netinet/in.h>
+#endif
 #include <resolv.h>
 #endif
 #include <libcitadel.h>
old mode 100644 (file)
new mode 100755 (executable)
index c629fcc41856a0a839bbec8713666df7afb95dee..135d773928c9de33960fff14e90be599cbbbc2fd 100644 (file)
@@ -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
        }
 
 
index 3d684df2b54384390ff1c5ef1c5cfd65fede31be..cabae3ccb071b39347f1e73c6e936996e54cdb9e 100755 (executable)
@@ -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
index 144ffa4ab9d7e5c6cf2a02bc33b3d495324fa800..9a68d27bdcad44fe08ab4c39e8c421e9341af427 100755 (executable)
@@ -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
index 0f53cb592ec026467985d5f69d6eff1be58d1e91..8d379e879c3490f29c7740e339a402e45ea0653a 100755 (executable)
@@ -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
index 7ad566d83ef48832f2261f9bfdab7d9802d1c82b..7f184dbcf4319fbc7309917d491a4443bc317006 100644 (file)
@@ -4,8 +4,9 @@
 # The standard client looks for this file in:
 # 1. $HOME/.citadelrc
 # 2. <compiled CTDLDIR>/citadel.rc
-# 3. /etc/citadel.rc
-# 4. <current directory>/citadel.rc
+# 3. /usr/local/etc/citadel.rc
+# 4. /etc/citadel.rc
+# 5. <current directory>/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
index 81fef751a9bc017b1b6c4c499292f6df9ebe6e7d..c2f9f77bd0ce882f4bae8a2eebafbcad0a318de6 100644 (file)
@@ -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");
        }
index f43c18f3d614df4a6a2983b817e5f9d49b18ddd2..d87d078c5654dde417268972db4244dc8530fa9e 100755 (executable)
@@ -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}"
index 62caf410c83524ef23243bb39719cdad58cc815e..a14c3d5c3026ca60c1a0263689273572bd4a52d7 100644 (file)
@@ -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;
 }
index 33158dca92e20d1a9f48d54373a21bb597c4b48e..d1f6634e3df5c1b16f8d4266ac305d583c8e2f36 100644 (file)
@@ -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",
index 0bce6d866ec0ec85eee769fd0167052c8497c808..07e6e3f3f139349a8c94323f15af146ed48646ae 100755 (executable)
@@ -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