FreeBSD port: dtsearch, dtterm, dtwidget, dthelp
authorMarcin Cieslak <saper@saper.info>
Mon, 13 Aug 2012 15:57:16 +0000 (17:57 +0200)
committerJon Trulson <jon@radscan.com>
Tue, 14 Aug 2012 01:53:10 +0000 (19:53 -0600)
FreeBSD portability of dtsearch, dtterm, dtwidget, dthelp

Work in progress for dtlogin and dtmail

19 files changed:
cde/admin/IntegTools/post_install/Imakefile
cde/config/cf/site.def
cde/databases/Imakefile
cde/lib/DtSearch/dtsrapi.c
cde/lib/DtSearch/globals.c
cde/lib/DtSearch/raima/vista.h
cde/lib/DtTerm/TermPrim/Imakefile
cde/lib/DtTerm/TermPrim/TermPrimDebug.c
cde/lib/DtTerm/TermPrim/TermPrimOSDepI.h
cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c
cde/lib/DtWidget/Imakefile
cde/programs/dthelp/parser/canon1/parser/parser.h
cde/programs/dthelp/parser/pass1/parser/parser.h
cde/programs/dthelp/parser/pass2/parser/parser.h
cde/programs/dtlogin/dm.c
cde/programs/dtlogin/dm.h
cde/programs/dtmail/libDtMail/Common/ImplConfigTable.hh
cde/programs/dtmail/libDtMail/Common/Session.C
cde/programs/dtmail/libDtMail/RFC/RFCBodyPart.C

index f8e3d8dc8c9e87fa07d47bd1577673e489e20e93..0120a40c7be45f4608e207dd49032f2373f94b42 100644 (file)
@@ -22,6 +22,9 @@ SUBDIRS = linux
 #ifdef OpenBSDArchitecture
 PLATFORM = openbsd
 #endif
+#ifdef FreeBSDArchitecture
+PLATFORM = freebsd
+#endif
 #ifdef RsArchitecture
 PLATFORM = aix
 SUBDIRS = ibm
index 9404bd93572d8a3b0728ff137c10665b303eff93..e18d4afdafd47de9f625f72c664bd52ecdb18c82 100644 (file)
@@ -67,8 +67,10 @@ XCOMM site:  $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $
 #ifdef AfterVendorCF
 
 #ifndef X11ProjectRoot
-# if defined(LinuxArchitecture) || defined(FreeBSDArchitecture)
+# if defined(LinuxArchitecture)
 #  define X11ProjectRoot       /usr
+#elif defined(FreeBSDArchitecture)
+#  define X11ProjectRoot       /usr/local
 # else
 #  define X11ProjectRoot       /X11
 # endif
index 2db62e42efa2d57f63486dcc6a24194654322bf6..0f6537acb90e8fe3c3c46a6aeebf0417597d4c18 100644 (file)
@@ -30,6 +30,9 @@ UDB_RELEASE_OPT = -ReleaseStream linux
 #ifdef OpenBSDArchitecture
 UDB_RELEASE_OPT = -ReleaseStream openbsd
 #endif
+#ifdef FreeBSDArchitecture
+UDB_RELEASE_OPT = -ReleaseStream freebsd
+#endif
 
 /*
  * Insure that symbols used in the .udb files are undefined for
index b62b871660756d78b39d8f849527b33fb24f6468..c17982675472f49381f238b57413330ae039f92f 100644 (file)
@@ -314,10 +314,8 @@ int             DtSearchInit (
        aa_argv0 = argv0;
     if (err_file)
        aa_stderr = err_file;
-#if defined(linux) || defined(CSRG_BASED)
     else
        aa_stderr = stderr;
-#endif
 
     sprintbuf = austext_malloc (SPRINTBUFSZ, PROGNAME "135", NULL);
 
index 093645d41753b4cc682003fa7da0a95f080a0a2d..4fa4f78882cb26463672af3fb4a99be9bc8f940b 100644 (file)
 #include <stdio.h>
 #include <nl_types.h>
 
-#if defined(linux)
 FILE   *aa_stderr =            NULL;
-#else
-FILE   *aa_stderr =            stderr;
-#endif
 char   *aa_argv0 =             "<argv0>";
 nl_catd        dtsearch_catd =         (nl_catd) -1;
 nl_catd        austools_catd =         (nl_catd) -1;
index ee29579e56bda15ab57a7524a5b059737a6e2874..704e9955c45d9cf9db819896043bf5978fb353e2 100644 (file)
@@ -86,7 +86,7 @@
 # define __SVR4_I386_ABI_L1__
 #endif
 #include <limits.h>    /* pickup WORD_BIT, LONG_BIT */
-#if defined(linux)
+#if defined(linux) || defined(__FreeBSD__)
 # undef __SVR4_I386_ABI_L1__
 # ifndef WORD_BIT
 # define WORD_BIT 32
index 286bcd8eec6627ee5f0b493d54c5000735cf8a83..a0a3b0edaeeb6cb6fc9f4ae0b85631dad7fd875f 100644 (file)
@@ -109,6 +109,10 @@ LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c)
 LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c)
 #endif
 
+#ifdef FreeBSDArchitecture
+LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c)
+#endif
+
 #ifdef OpenBSDArchitecture
 LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c)
 #endif
index 6f8e17008826a555fc09360478bdf5cbeb2e4885..f0a96ddac683bc343f61dc8547695c9e437ddc4d 100644 (file)
@@ -39,10 +39,10 @@ static char rcs_id[] = "$XConsortium: TermPrimDebug.c /main/4 1996/11/21 19:58:1
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
-#if !defined(linux)
-# include <varargs.h>
-#else
+#if defined(linux) || defined(CSRG_BASED)
 # include <stdarg.h>
+#else
+# include <varargs.h>
 #endif
 #include "TermHeader.h"
 #include "TermPrimDebug.h"
index e5a7b77676650cfe3386810545472b70b5e79539..eac6b471a9e0cfbd75abf39ec94a3c5894fe58f4 100644 (file)
 # define USE_TCSENDBREAK       /* use tiocbreak()              */
 #endif /* LINUX_ARCHITECTURE */
 
-#ifdef  OPENBSD_ARCHITECTURE
+#ifdef  CSRG_BASED
 # define HAS_SETEUID             /* seteuid available            */
 # define HAS_SETREUID            /* setreuid available           */
 # define USE_TCSENDBREAK       /* use tiocbreak()              */
-#endif /* OPENBSD_ARCHITECTURE */
+#endif /* CSRG_BASED */
 
 #ifdef SUN_ARCHITECTURE
 # define XOR_CAPS_LOCK         /* xor caps lock and shift      */
index 4328bd25a41da538ea5cbe8d51d5bf7d3ff13083..35cc7269377b2ee00537723ad319a6ac0c16f10f 100644 (file)
@@ -60,6 +60,12 @@ static char rcs_id[] = "$TOG: TermPrimSetUtmp.c /main/10 1998/04/03 17:11:42 mgr
 #define        UT_NO_pututline
 #endif /* sun */
 
+#ifdef __FreeBSD__
+#define        UT_UTMPX
+#define        UT_HOST         ut_host
+#define        UT_NO_pututline
+#endif
+
 #ifdef sun
 #define        UT_UTMPX
 #define        UT_HOST         ut_host
index 9c1a80f41b00a58607950233ed597d7b6f17471c..f167e35aba847d41bbebca125c351724ae593efd 100644 (file)
@@ -15,7 +15,7 @@ XCOMM $XConsortium: Imakefile /main/8 1996/04/21 19:11:16 drk $
 DEFINES = DtWidgetDefines
 #if defined(LinuxArchitecture)
 INCLUDES = -I. -I/usr/include/freetype2
-#elif defined(OpenBSDArchitecture)
+#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture)
 INCLUDES = -I. -I$(XPROJECTROOT)/include/freetype2
 #else
 INCLUDES = -I.
index b7e7eb69624a671519901af9ed83b9ea0d687264..6584c8c9381d74b7fec45ecea89e9630d776a139 100644 (file)
@@ -439,7 +439,7 @@ M_PAREXTERN int m_argc ;
 M_PAREXTERN char **m_argv ;
 
 /* PARSER output file */
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 M_PAREXTERN FILE *m_outfile;
 M_PAREXTERN FILE *m_errfile;
 #else
index 06e4ce7b23c6b434d97155f15d2a42337ac0be33..839381fd10932376b255b05bb23c6bb73cfa9f31 100644 (file)
@@ -437,7 +437,7 @@ M_PAREXTERN int m_argc ;
 M_PAREXTERN char **m_argv ;
 
 /* PARSER output file */
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 M_PAREXTERN FILE *m_outfile;
 M_PAREXTERN FILE *m_errfile;
 #else
index e47dd77b1d6864cb4934e72c957c6c203d80f43b..b9a3300c14f9a8011707647e9a13fdc530cb031a 100644 (file)
@@ -437,7 +437,7 @@ M_PAREXTERN int m_argc ;
 M_PAREXTERN char **m_argv ;
 
 /* PARSER output file */
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
 M_PAREXTERN FILE *m_outfile;
 M_PAREXTERN FILE *m_errfile;
 #else
index 136d0bda87c5548d8116ddb12b60863b825add5c..31635dcd46d94bdfccdaefc2d369649d4ae375e7 100644 (file)
 
 # include      <sys/signal.h>
 # include      <sys/stat.h>
+#if defined(__FreeBSD__)
+# include      <utmpx.h>
+#else
 # include      <utmp.h>
+#endif
 # include      <time.h>
 # include      <utime.h>
 # include      <pwd.h>
-#if defined(linux)
+#if defined(linux) || defined(__FreeBSD__)
 # include      <stdarg.h>
 #else
 # include      <varargs.h>
@@ -936,9 +940,9 @@ StartDisplay(
                else {
                    strncpy(&(d->utmpId[strlen(d->utmpId)]), t++, 1);
                }
-           } while (*t != NULL);
+           } while (*t != '\0');
 
-           if (*t == NULL) {
+           if (*t == '\0') {
                Debug ("All DT utmp IDs already in use. Removing display %s\n",
                        d->name);
                LogError ((unsigned char *)"All DT utmp IDs already in use. Removing display %s\n",
index 9da55bfda9fedc89e3bc27a1ab74ee3f1c2ecf96..032a21d3d96d555f08a93fd29bad74e49df445d1 100644 (file)
  ***************************************************************************/
 
 /*#if defined(SYSV) && !defined(hpux)*/
-#if defined(SYSV) || defined(SVR4) || defined(linux)
+#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__FreeBSD__)
 #   include    <sys/wait.h>
 # define waitCode(w)   WEXITSTATUS(w)
 # define waitSig(w)    WTERMSIG(w)
@@ -477,7 +477,7 @@ struct verify_info {
  *
  ***************************************************************************/
 
-#if !defined(linux)
+#if !defined(linux) && !defined(CSRG_BASED)
 extern char    *sys_errlist[];         /* system error msgs               */
 extern int     sys_nerr;               /* system error msgs               */
 #endif
index 090359098c358515b2ff3cf69cf19fcc92129e9d..bfc801110854160ae910f24344c79d6931a74b52 100644 (file)
@@ -25,9 +25,9 @@
 #include <DtMail/DtMailValues.hh>
 
 struct ImplConfigTable {
-    char       *impl_name;
-    char       *lib_name;
-    char       *meta_entry_point;
+    const char *impl_name;
+    const char *lib_name;
+    const char *meta_entry_point;
 };
 
 static const ImplConfigTable initial_impls[] = {
index d81434c5a76c992848b73b56d75faf7c523781bc..0c664cca34905075820d632ed46a93db87e13081 100644 (file)
@@ -1618,7 +1618,7 @@ char *from_cs, char *to_cs)
    DtMailEnv error;
    iconv_t cd;
    size_t ileft = (size_t) bp_len, oleft = (size_t) bp_len, ret = 0;
-#if defined(_AIX) || defined(sun)
+#if defined(_AIX) || defined(sun) | defined(CSRG_BASED)
    const char *ip = (const char *) *bp;
 #else
    char *ip = *bp;
index cd1923d61303aa0f65843e25978d93eab0aada8b..172b844ef4e8697ca290d677c920e150908908be 100644 (file)
@@ -1030,7 +1030,7 @@ char *from_cs, char *to_cs)
    DtMailEnv error;
    iconv_t cd;
    size_t ileft = (size_t) bp_len, oleft = (size_t) bp_len, ret = 0;
-#if defined(_aix) || defined(sun)
+#if defined(_aix) || defined(sun) || defined(CSRG_BASED)
    const char *ip = (const char *) *bp;
 #else
    char *ip = *bp;