1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

FreeBSD port: dtsearch, dtterm, dtwidget, dthelp

FreeBSD portability of dtsearch, dtterm, dtwidget, dthelp

Work in progress for dtlogin and dtmail
This commit is contained in:
Marcin Cieslak 2012-08-13 17:57:16 +02:00 committed by Jon Trulson
parent ee03634a10
commit 31aaa48344
19 changed files with 43 additions and 27 deletions

View file

@ -22,6 +22,9 @@ SUBDIRS = linux
#ifdef OpenBSDArchitecture #ifdef OpenBSDArchitecture
PLATFORM = openbsd PLATFORM = openbsd
#endif #endif
#ifdef FreeBSDArchitecture
PLATFORM = freebsd
#endif
#ifdef RsArchitecture #ifdef RsArchitecture
PLATFORM = aix PLATFORM = aix
SUBDIRS = ibm SUBDIRS = ibm

View file

@ -67,8 +67,10 @@ XCOMM site: $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $
#ifdef AfterVendorCF #ifdef AfterVendorCF
#ifndef X11ProjectRoot #ifndef X11ProjectRoot
# if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) # if defined(LinuxArchitecture)
# define X11ProjectRoot /usr # define X11ProjectRoot /usr
#elif defined(FreeBSDArchitecture)
# define X11ProjectRoot /usr/local
# else # else
# define X11ProjectRoot /X11 # define X11ProjectRoot /X11
# endif # endif

View file

@ -30,6 +30,9 @@ UDB_RELEASE_OPT = -ReleaseStream linux
#ifdef OpenBSDArchitecture #ifdef OpenBSDArchitecture
UDB_RELEASE_OPT = -ReleaseStream openbsd UDB_RELEASE_OPT = -ReleaseStream openbsd
#endif #endif
#ifdef FreeBSDArchitecture
UDB_RELEASE_OPT = -ReleaseStream freebsd
#endif
/* /*
* Insure that symbols used in the .udb files are undefined for * Insure that symbols used in the .udb files are undefined for

View file

@ -314,10 +314,8 @@ int DtSearchInit (
aa_argv0 = argv0; aa_argv0 = argv0;
if (err_file) if (err_file)
aa_stderr = err_file; aa_stderr = err_file;
#if defined(linux) || defined(CSRG_BASED)
else else
aa_stderr = stderr; aa_stderr = stderr;
#endif
sprintbuf = austext_malloc (SPRINTBUFSZ, PROGNAME "135", NULL); sprintbuf = austext_malloc (SPRINTBUFSZ, PROGNAME "135", NULL);

View file

@ -60,11 +60,7 @@
#include <stdio.h> #include <stdio.h>
#include <nl_types.h> #include <nl_types.h>
#if defined(linux)
FILE *aa_stderr = NULL; FILE *aa_stderr = NULL;
#else
FILE *aa_stderr = stderr;
#endif
char *aa_argv0 = "<argv0>"; char *aa_argv0 = "<argv0>";
nl_catd dtsearch_catd = (nl_catd) -1; nl_catd dtsearch_catd = (nl_catd) -1;
nl_catd austools_catd = (nl_catd) -1; nl_catd austools_catd = (nl_catd) -1;

View file

@ -86,7 +86,7 @@
# define __SVR4_I386_ABI_L1__ # define __SVR4_I386_ABI_L1__
#endif #endif
#include <limits.h> /* pickup WORD_BIT, LONG_BIT */ #include <limits.h> /* pickup WORD_BIT, LONG_BIT */
#if defined(linux) #if defined(linux) || defined(__FreeBSD__)
# undef __SVR4_I386_ABI_L1__ # undef __SVR4_I386_ABI_L1__
# ifndef WORD_BIT # ifndef WORD_BIT
# define WORD_BIT 32 # define WORD_BIT 32

View file

@ -109,6 +109,10 @@ LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c)
LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c) LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c)
#endif #endif
#ifdef FreeBSDArchitecture
LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c)
#endif
#ifdef OpenBSDArchitecture #ifdef OpenBSDArchitecture
LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c) LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c)
#endif #endif

View file

@ -39,10 +39,10 @@ static char rcs_id[] = "$XConsortium: TermPrimDebug.c /main/4 1996/11/21 19:58:1
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#if !defined(linux) #if defined(linux) || defined(CSRG_BASED)
# include <varargs.h>
#else
# include <stdarg.h> # include <stdarg.h>
#else
# include <varargs.h>
#endif #endif
#include "TermHeader.h" #include "TermHeader.h"
#include "TermPrimDebug.h" #include "TermPrimDebug.h"

View file

@ -96,11 +96,11 @@
# define USE_TCSENDBREAK /* use tiocbreak() */ # define USE_TCSENDBREAK /* use tiocbreak() */
#endif /* LINUX_ARCHITECTURE */ #endif /* LINUX_ARCHITECTURE */
#ifdef OPENBSD_ARCHITECTURE #ifdef CSRG_BASED
# define HAS_SETEUID /* seteuid available */ # define HAS_SETEUID /* seteuid available */
# define HAS_SETREUID /* setreuid available */ # define HAS_SETREUID /* setreuid available */
# define USE_TCSENDBREAK /* use tiocbreak() */ # define USE_TCSENDBREAK /* use tiocbreak() */
#endif /* OPENBSD_ARCHITECTURE */ #endif /* CSRG_BASED */
#ifdef SUN_ARCHITECTURE #ifdef SUN_ARCHITECTURE
# define XOR_CAPS_LOCK /* xor caps lock and shift */ # define XOR_CAPS_LOCK /* xor caps lock and shift */

View 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 #define UT_NO_pututline
#endif /* sun */ #endif /* sun */
#ifdef __FreeBSD__
#define UT_UTMPX
#define UT_HOST ut_host
#define UT_NO_pututline
#endif
#ifdef sun #ifdef sun
#define UT_UTMPX #define UT_UTMPX
#define UT_HOST ut_host #define UT_HOST ut_host

View file

@ -15,7 +15,7 @@ XCOMM $XConsortium: Imakefile /main/8 1996/04/21 19:11:16 drk $
DEFINES = DtWidgetDefines DEFINES = DtWidgetDefines
#if defined(LinuxArchitecture) #if defined(LinuxArchitecture)
INCLUDES = -I. -I/usr/include/freetype2 INCLUDES = -I. -I/usr/include/freetype2
#elif defined(OpenBSDArchitecture) #elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture)
INCLUDES = -I. -I$(XPROJECTROOT)/include/freetype2 INCLUDES = -I. -I$(XPROJECTROOT)/include/freetype2
#else #else
INCLUDES = -I. INCLUDES = -I.

View file

@ -439,7 +439,7 @@ M_PAREXTERN int m_argc ;
M_PAREXTERN char **m_argv ; M_PAREXTERN char **m_argv ;
/* PARSER output file */ /* PARSER output file */
#if defined(linux) #if defined(linux) || defined(CSRG_BASED)
M_PAREXTERN FILE *m_outfile; M_PAREXTERN FILE *m_outfile;
M_PAREXTERN FILE *m_errfile; M_PAREXTERN FILE *m_errfile;
#else #else

View file

@ -437,7 +437,7 @@ M_PAREXTERN int m_argc ;
M_PAREXTERN char **m_argv ; M_PAREXTERN char **m_argv ;
/* PARSER output file */ /* PARSER output file */
#if defined(linux) #if defined(linux) || defined(CSRG_BASED)
M_PAREXTERN FILE *m_outfile; M_PAREXTERN FILE *m_outfile;
M_PAREXTERN FILE *m_errfile; M_PAREXTERN FILE *m_errfile;
#else #else

View file

@ -437,7 +437,7 @@ M_PAREXTERN int m_argc ;
M_PAREXTERN char **m_argv ; M_PAREXTERN char **m_argv ;
/* PARSER output file */ /* PARSER output file */
#if defined(linux) #if defined(linux) || defined(CSRG_BASED)
M_PAREXTERN FILE *m_outfile; M_PAREXTERN FILE *m_outfile;
M_PAREXTERN FILE *m_errfile; M_PAREXTERN FILE *m_errfile;
#else #else

View file

@ -53,11 +53,15 @@
# include <sys/signal.h> # include <sys/signal.h>
# include <sys/stat.h> # include <sys/stat.h>
#if defined(__FreeBSD__)
# include <utmpx.h>
#else
# include <utmp.h> # include <utmp.h>
#endif
# include <time.h> # include <time.h>
# include <utime.h> # include <utime.h>
# include <pwd.h> # include <pwd.h>
#if defined(linux) #if defined(linux) || defined(__FreeBSD__)
# include <stdarg.h> # include <stdarg.h>
#else #else
# include <varargs.h> # include <varargs.h>
@ -936,9 +940,9 @@ StartDisplay(
else { else {
strncpy(&(d->utmpId[strlen(d->utmpId)]), t++, 1); 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", Debug ("All DT utmp IDs already in use. Removing display %s\n",
d->name); d->name);
LogError ((unsigned char *)"All DT utmp IDs already in use. Removing display %s\n", LogError ((unsigned char *)"All DT utmp IDs already in use. Removing display %s\n",

View file

@ -202,7 +202,7 @@
***************************************************************************/ ***************************************************************************/
/*#if defined(SYSV) && !defined(hpux)*/ /*#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> # include <sys/wait.h>
# define waitCode(w) WEXITSTATUS(w) # define waitCode(w) WEXITSTATUS(w)
# define waitSig(w) WTERMSIG(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 char *sys_errlist[]; /* system error msgs */
extern int sys_nerr; /* system error msgs */ extern int sys_nerr; /* system error msgs */
#endif #endif

View file

@ -25,9 +25,9 @@
#include <DtMail/DtMailValues.hh> #include <DtMail/DtMailValues.hh>
struct ImplConfigTable { struct ImplConfigTable {
char *impl_name; const char *impl_name;
char *lib_name; const char *lib_name;
char *meta_entry_point; const char *meta_entry_point;
}; };
static const ImplConfigTable initial_impls[] = { static const ImplConfigTable initial_impls[] = {

View file

@ -1618,7 +1618,7 @@ char *from_cs, char *to_cs)
DtMailEnv error; DtMailEnv error;
iconv_t cd; iconv_t cd;
size_t ileft = (size_t) bp_len, oleft = (size_t) bp_len, ret = 0; 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; const char *ip = (const char *) *bp;
#else #else
char *ip = *bp; char *ip = *bp;

View file

@ -1030,7 +1030,7 @@ char *from_cs, char *to_cs)
DtMailEnv error; DtMailEnv error;
iconv_t cd; iconv_t cd;
size_t ileft = (size_t) bp_len, oleft = (size_t) bp_len, ret = 0; 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; const char *ip = (const char *) *bp;
#else #else
char *ip = *bp; char *ip = *bp;