DX on LinuxPPC (working, sort of!)
I have sort of got a running copy of DX on my LinuxPPC R4 system on a Powermac G3/300 running. There are some bizarre user interface bugs (buttons keep getting bigger everytime a panel updates), but the diffs attached below are at least enough to make it compile and run. For some reason, I also have to manually start the server (dxexec -r &) and then connect to port 1900 to get things working. A major problem was that libpthreads breaks some internal handling of the errno global variable, so I disabled it in the configure.in script for linuxppc.
If anyone else out there is working on this, please let me know.
Marcus Mendenhall
Vanderbilt University
aclocal.m4 +10 -7
@@ -285,15 +285,18 @@ if test $unameS = "CYGWIN_95-4.0" ; then ARCH=cygwin fi if test $unameS = "Linux" ; then - isit=`echo $unameM | egrep "i.86"` - if test ! -z "$isit" ; then - ARCH=linux86 - else - ARCH=unknown - fi - fi + isit=`echo $unameM | egrep "i.86"` + if test ! -z "$isit" ; then + ARCH=linux86 + elif test $unameM = "ppc" ; then + ARCH="linuxppc" + else + ARCH=unknown + fi + fi + if test $unameS = "IRIX" || test $unameS = "IRIX64" ; then ARCH=sgi fi if test $unameS = "AIX" ; then
bin/dx.workerscript +8 -2
@@ -109,10 +109,15 @@ breaksw case Linux: - set exarch=linux86 - set uiarch=linux86 + if ($thismach == "ppc") then + set exarch="linuxppc" + set uiarch="linuxppc" + else + set exarch=linux86 + set uiarch=linux86 + endif set remote=/usr/bin/rsh breaksw
@@ -1438,8 +1443,9 @@ case solaris: case aviion: case alphax: case linux86: + case linuxppc: breaksw default: echo "DX user interface does not run on this architecture"
if test $unameS = "Linux" ; then
configure.in +4 -0
@@ -88,9 +88,13 @@ dnl A couple libs for cygwin AC_CHECK_LIB(ICE, IceConnectionNumber) AC_CHECK_LIB(SM, SmcSetProperties) AC_CHECK_LIB(REXP, regcomp) + +if test "$ARCH" != "linuxppc" ; then AC_CHECK_LIB(pthread, pthread_getspecific) +fi + DX_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/file.h sys/ioctl.h sys/time.h unistd.h sys/types.h sys/sysconfig.h sys/un.h values.h wait.h sys/wait.h sys/utsname.h signal.h sys/signal.h process.h sys/filio.h CC/osfcn.h CC/libc.h ) AC_CHECK_FUNCS(getcwd gethostname gettimeofday mkdir mkfifo mktime putenv re_comp regcmp select socket strcspn strdup strerror strspn strstr strtod strtol strtoul uname popen vfork trunc _popen spawnvp _spawnvp regcomp sysmp sysconf)
include/dx/arch.h +1 -1
@@ -106,9 +106,9 @@/* program to run for remote shell */ #define RSH "/usr/bin/rsh" -#ifdef linux86 +#if defined(linux86) || defined(linuxppc)#undef F_CHAR_READY#define F_CHAR_READY (fp) ((fp)->_IO_read_ptr < (fp)->_IO_read_end)
src/exec/dpexec/lex.c +1 -1
@@ -9,9 +9,9 @@#include <dxconfig.h> /* this has to be before stdio.h gets included. */ -#if !defined(os2) && !defined(linux86) +#if !defined(os2) && !defined(linux86) && !defined(linuxppc)#ifdef GETC #undef GETC#endif #define GETC getc
src/exec/dpexec/loader.c +3 -3
@@ -84,9 +84,9 @@#endif /* hp700 */ -#if defined(sun4) || defined(solaris) || defined(sgi) || defined(alphax) || defined(aviion) || defined(linux86) || defined(cygwin) +#if defined(sun4) || defined(solaris) || defined(sgi) || defined(alphax) || defined(aviion) || defined(linux86) || defined(cygwin) || defined(linuxppc)#include <dlfcn.h> typedef void *Handle ;#define __HANDLE_DEF
@@ -101,9 +101,9 @@#define dlerror _dlerror#endif -#endif /* sun4 or solaris or sgi or alpha or aviion of linux86 */ +#endif /* sun4 or solaris or sgi or alpha or aviion or linux86 or linuxppc */ /* default for unsupported platforms */ #ifndef __HANDLE_DEF
@@ -573,9 +573,9 @@#endif /* hp700 */ -#if defined(sun4) || defined(solaris) || defined(sgi) || defined(alphax) || defined(aviion) || defined(linux86) || defined(cygwin) +#if defined(sun4) || defined(solaris) || defined(sgi) || defined(alphax) || defined(aviion) || defined(linux86) || defined(cygwin) || defined(linuxppc)#define __ROUTINES_DEF
src/exec/dxmods/_compoper1.c +3 -0
@@ -456,8 +456,11 @@#endif #ifdef cygwin# define trunc (x) ((float)((int)(x)))#endif +#ifdef linuxppc +# define trunc (x) ((float)((int)(x))) +#endif #ifdef linux86# define trunc (x) ((float)((int)(x)))#endif #ifdef aviion
src/exec/libdx/memory.c +13 -0
@@ -1017,8 +1017,21 @@#define SMALL (x) ((int)x<(int)large)#define LARGE (x) ((int)x>=(int)large)#endif +#ifdef linuxppc +#define initvalues +#define SMALL_BASE 0/* use data segment */ +#define SMALL_GET _dxfgetmem/* expand by using DosSetMem */ +#define LARGE_GET _dxfgetmem/* expand by using DosSetMem */ +#define LARGE_INIT 2 MEG/* doesn't matter; consistent w/ sgi */ +#define LARGE_INCR 2 MEG/* doesn't matter; consistent w/ sgi */ +#define SIZE_ROUND 2 MEG/* doesn't matter; consistent w/ sgi */ +#define MALLOC_NONE 1/* provide malloc from global arena */ +#define SMALL (x) ((int)x<(int)large) +#define LARGE (x) ((int)x>=(int)large) +#endif +#ifdef DXD_WIN #define initvalues#define SMALL_BASE 0/* use data segment */ #define SMALL_GET _dxfgetmem/* expand by using DosSetMem */
src/exec/libdx/message.c +1 -1
@@ -270,9 +270,9 @@void DXPrintError (char *s) {extern int sys_nerr; -#ifndef linux86 +#if !HAVE_SYS_ERRLIST extern char *sys_errlist[];#endif char *msg, *errnomsg;static int been_here =0 ;
src/ui++/dxuilib/Network.C +1 -1
@@ -1184,9 +1184,9 @@ { extern FILE* yyin; /* parser input stream */ -#if defined(linux86) || defined(cygwin) +#if defined(linux86) || defined(cygwin) || defined(linuxppc) int yylineno; #else extern int yylineno; /* lexer line number */ #endif
src/ui++/dxuilib/PacketIF.C +2 -2
@@ -21,9 +21,9 @@ #include "Application.h" #include "ErrorDialogManager.h" -#if defined(linux86) || defined(cygwin) +#if defined(linux86) || defined(cygwin) || defined(linuxppc) extern "C" { #include <errno.h> } #else
@@ -1361,9 +1361,9 @@ ushort port; int fd; int sts; int oldPort; -#if !defined(linux86) && !defined(cygwin) +#if !defined(linux86) && !defined(cygwin) && !defined(linuxppc) extern int errno; #endif int tries; fd_set fds;
src/ui++/startup/StartupWindow.C +1 -1
@@ -64,9 +64,9 @@ // went away and that it's ok to start another one when the user asks. // On these platforms, the pipe doesn't work that way so we'll make a // polling loop that runs once every few seconds and checks the child pid. // -#if defined(ibm6000) || defined(hp700) || defined(alphax) || defined(sun4) || defined(linux86) || defined(cygwin) +#if defined(ibm6000) || defined(hp700) || defined(alphax) || defined(sun4) || defined(linux86) || defined(cygwin) || defined(linuxppc) #define USE_WAIT3 1 #endif #if USE_WAIT3