Hi, here are further patches for X. I grep'd for linux and checked if all places that also apply to the Hurd include __GNU__, too. There are some places I didn't understand, and I welcome any help with them. I would also appreciate it if someone could revise my changes. Here are my notes, and attached is a diff. Thanks, Marcus xdm/dm.h: setgroups arg type is gid_t, not int. xdm/daemon.c: xdm/util.c: xfs/os/daemon.c: Set setgrpg to setpgid. xdm/policy.c: How to get load average. TODO!!! xdm/sessreg.c: Slot allocation. TODO!!! xinit/xinit.c: Some signal stuff? TODO!!! xsm/signals.c: Should we define USE_SYSV_SIGNALS? TODO!!! xterm: Check configure stuff. xterm/main.c: Compare ifdef linux with ifdef __GNU__ TODO!!! xterm/resize.c: We should probably define USE_TERMIOS et al. TODO!!! xfs/os/connection.c: xfs/os/utils.c: Xserver/os/utils.c: Include stdlib.h for random(). Xserver/os/xalloc.c: can and should we use the linux i386 LOG_ALLOC? TODO!!! For __GNU__, define HAVE_MMAP_ANON and include some stuff, including mach/vm_param.h for PAGE_SIZE. Xserver/xkb/ddxLoad.c: Include paths.h Xserver/Xprint/attributes.c: Define iswspace? Xserver/Xprint/Init.c: Use lpc status instead lpstat -v. Xserver/hw/xfree86/common/xf86Beta.c: Activate SYSV and linux code section? TODO!!! Xserver/hw/xfree86/common/xf86Config.c: Here too (done). Xserver/hw/xfree86/SuperProbe/Probe.c: Include string.h and don't define strchr strrchr .../AsmMacro.c: Prolly follow linux on cli sti? Xserver/hw/xfree86/accel/agx/agxInit.c: Use Mach code for priority, as seen in earlier example. Xserver/hw/xfree86/accel/glint/vgaHW.c: Xserver/hw/xfree86/vga256/drivers/tdfx/vb_vgahw.c Define NEED_SAVED_CMAP as done fro MACH386 and linux? (Yes, as in Xserver/hw/xfree86/vga256/vga/vgaHW.c) Define bigger text amount as for Linux? TODO!!! (No? as in Xserver/hw/xfree86/vga256/vga/vgaHW.c) Xserver/hw/xfree86/accel/mach64/mach64init.c: Include mach/vm_param.h Xserver/hw/xfree86/accel/s3/s3ELSA.c: Xserver/hw/xfree86/accel/s3_virge/s3ELSA.c: Xserver/hw/xfree86/vga256/vga/vga.c: Xserver/hw/xfree86/vga256/drivers/s3_svga/s3ELSA.c: Do the same things as on linux?? TODO!!! -- `Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server Marcus Brinkmann GNU http://www.gnu.org for public PGP Key [EMAIL PROTECTED], [EMAIL PROTECTED] PGP Key ID 36E7CD09 http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ [EMAIL PROTECTED]
diff -ur build-tree/xc/config/imake/imakemdep.h build-tree.work/xc/config/imake/imakemdep.h --- build-tree/xc/config/imake/imakemdep.h Wed Mar 8 00:57:37 2000 +++ build-tree.work/xc/config/imake/imakemdep.h Thu Mar 9 20:31:05 2000 @@ -172,13 +172,9 @@ #define imake_ccflags "-DSVR4" #endif -#ifdef MACH -#ifdef __GNU__ -#define imake_ccflags "" -#else +#if defined(MACH) && !defined(__GNU__) #define imake_ccflags "-DNOSTDHDRS" #endif -#endif /* this is for OS/2 under EMX. This won't work with DOS */ #if defined(__EMX__) @@ -274,7 +270,7 @@ #if defined(__sgi) && defined(__ANSI_CPP__) #define USE_CC_E #endif -#ifdef MACH +#if defined(MACH) && !defined(__GNU__) #define USE_CC_E #endif #ifdef __minix_vmd @@ -284,9 +280,6 @@ /* expects cpp in PATH */ #define DEFAULT_CPP "cpp" #endif -#if defined(__GNU__) -#define USE_CC_E -#endif #if defined (__QNX__) #define DEFAULT_CPP "/usr/X11R6/bin/cpp" #endif @@ -336,9 +329,6 @@ # ifdef __m68k__ "-D__m68k__", # endif -# ifdef __GNUC__ - "-traditional", -# endif #endif #ifdef M4330 "-DM4330", /* Tektronix */ @@ -529,6 +519,9 @@ #ifdef NCR "-DNCR", /* NCR */ #endif +#ifdef __GNU__ + "-traditional", +#endif #ifdef linux "-traditional", "-Dlinux", @@ -659,6 +652,10 @@ # define DEFAULT_OS_MAJOR_REV "v V%[0-9]" # define DEFAULT_OS_MINOR_REV "v V%*dL%[0-9]" # define DEFAULT_OS_NAME "srvm %[^\n]" +#elif defined(__GNU__) +# define DEFAULT_OS_MAJOR_REV "r %[0-9]" +# define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" +# define DEFAULT_OS_NAME "srm %[^\n]" #elif defined(linux) # define DEFAULT_OS_MAJOR_REV "r %[0-9]" # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" @@ -985,6 +982,9 @@ #endif #ifdef __NetBSD__ {"__NetBSD__", "1"}, +#endif +#ifdef __GNU__ + {"__GNU__", "1"}, #endif #ifdef __ELF__ {"__ELF__", "1"}, diff -ur build-tree/xc/lib/Xdmcp/GenKey.c build-tree.work/xc/lib/Xdmcp/GenKey.c --- build-tree/xc/lib/Xdmcp/GenKey.c Wed Oct 23 15:08:39 1996 +++ build-tree.work/xc/lib/Xdmcp/GenKey.c Sun Mar 12 16:20:18 2000 @@ -57,7 +57,7 @@ #define random lrand48 #endif -#ifdef linux +#if defined(linux) || defined(__GNU__) #include <stdlib.h> #else long random(); Only in build-tree.work/xc/lib/Xdmcp: GenKey.c~ diff -ur build-tree/xc/programs/Xserver/Xprint/Init.c build-tree.work/xc/programs/Xserver/Xprint/Init.c --- build-tree/xc/programs/Xserver/Xprint/Init.c Sun Jun 15 09:25:27 1997 +++ build-tree.work/xc/programs/Xserver/Xprint/Init.c Sun Mar 12 17:01:11 2000 @@ -183,7 +183,7 @@ " print substr($5, 1, x-1)" " }' | sort"; #else -#if defined(CSRG_BASED) || defined(linux) || defined(ISC) +#if defined(CSRG_BASED) || defined(linux) || defined(ISC) || defined(__GNU__) const char *LIST_QUEUES = "LANG=C lpc status | grep -v '^\t' | " "sed -e /:/s/// | sort"; #else diff -ur build-tree/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h build-tree.work/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h --- build-tree/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h Thu Nov 18 16:52:49 1999 +++ build-tree.work/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h Sun Mar 12 +17:58:45 2000 @@ -44,7 +44,7 @@ #include <stdlib.h> #endif /* MACH386 */ #include <ctype.h> -#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__QNX__) || defined(__QNXNTO__) +#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__QNX__) || +defined(__QNXNTO__) || defined(__GNU__) # include <string.h> #if !(defined(__QNX__) && !defined(__QNXNTO__)) # include <memory.h> diff -ur build-tree/xc/programs/Xserver/hw/xfree86/accel/agx/agxInit.c build-tree.work/xc/programs/Xserver/hw/xfree86/accel/agx/agxInit.c --- build-tree/xc/programs/Xserver/hw/xfree86/accel/agx/agxInit.c Mon Dec 23 07:32:52 1996 +++ build-tree.work/xc/programs/Xserver/hw/xfree86/accel/agx/agxInit.c Sun Mar 12 +18:00:38 2000 @@ -971,7 +971,7 @@ /* First save registers that get written on */ agxClockSelect(CLK_REG_SAVE,0); -#if defined(CSRG_BASED) || defined(MACH386) +#if defined(CSRG_BASED) || defined(MACH386) || defined(__GNU__) saved_nice = getpriority(PRIO_PROCESS, 0); setpriority(PRIO_PROCESS, 0, -20); #endif @@ -1039,7 +1039,7 @@ InfoRec->clock[i] = cnt ? cnt : -1; } -#if defined(CSRG_BASED) || defined(MACH386) +#if defined(CSRG_BASED) || defined(MACH386) || defined(__GNU__) setpriority(PRIO_PROCESS, 0, saved_nice); #endif #if defined(SYSV) || defined(SVR4) || defined(linux) diff -ur build-tree/xc/programs/Xserver/hw/xfree86/accel/glint/vgaHW.c build-tree.work/xc/programs/Xserver/hw/xfree86/accel/glint/vgaHW.c --- build-tree/xc/programs/Xserver/hw/xfree86/accel/glint/vgaHW.c Thu Jul 30 08:23:46 1998 +++ build-tree.work/xc/programs/Xserver/hw/xfree86/accel/glint/vgaHW.c Sun Mar 12 +18:08:10 2000 @@ -71,7 +71,7 @@ #endif #endif -#if defined(Lynx) || defined(CSRG_BASED) || defined(MACH386) || defined(linux) || defined(AMOEBA) || defined(MINIX) +#if defined(Lynx) || defined(CSRG_BASED) || defined(MACH386) || defined(linux) || +defined(AMOEBA) || defined(MINIX) || defined(__GNU__) #ifndef NEED_SAVED_CMAP #define NEED_SAVED_CMAP #endif diff -ur build-tree/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c build-tree.work/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c --- build-tree/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c Wed Mar 8 00:57:51 2000 +++ build-tree.work/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c Sun +Mar 12 18:04:16 2000 @@ -39,6 +39,9 @@ #ifdef linux #include <asm/page.h> #endif +#ifdef __GNU__ +#include <mach/vm_param.h> +#endif #ifdef CSRG_BASED #include <machine/param.h> #endif diff -ur build-tree/xc/programs/Xserver/hw/xfree86/common/xf86Config.c build-tree.work/xc/programs/Xserver/hw/xfree86/common/xf86Config.c --- build-tree/xc/programs/Xserver/hw/xfree86/common/xf86Config.c Fri Jul 30 14:58:16 1999 +++ build-tree.work/xc/programs/Xserver/hw/xfree86/common/xf86Config.c Sun Mar 12 +17:53:55 2000 @@ -901,7 +901,7 @@ { int token; int i, j; -#if defined(SYSV) || defined(linux) +#if defined(SYSV) || defined(linux) || defined(__GNU__) int xcpipe[2]; #endif #ifdef XINPUT @@ -923,7 +923,7 @@ * * For SYSV we fork, and send the data back to the parent through a pipe */ -#if defined(SYSV) || defined(linux) +#if defined(SYSV) || defined(linux) || defined(__GNU__) if (getuid() != 0) { if (pipe(xcpipe)) FatalError("Pipe failed (%s)\n", strerror(errno)); @@ -962,7 +962,7 @@ else { HANDLE_RETURN(findConfigFile(configPath, &configFile)); } -#else /* ! (SYSV || linux) */ +#else /* ! (SYSV || linux || __GNU__) */ { #ifndef __EMX__ /* in OS/2 we don't care about uids */ int real_uid = getuid(); @@ -991,7 +991,7 @@ } #endif /* MINIX */ } -#endif /* SYSV || linux */ +#endif /* SYSV || linux || __GNU__ */ xf86Info.sharedMonitor = FALSE; xf86Info.kbdProc = NULL; xf86Info.notrapSignals = FALSE; @@ -1054,7 +1054,7 @@ if (modulePath) xfree(modulePath); -#if defined(SYSV) || defined(linux) +#if defined(SYSV) || defined(linux) || defined(__GNU__) if (getuid() != 0) { /* Wait for the child */ wait(NULL); diff -ur build-tree/xc/programs/Xserver/os/utils.c build-tree.work/xc/programs/Xserver/os/utils.c --- build-tree/xc/programs/Xserver/os/utils.c Wed Mar 8 00:57:40 2000 +++ build-tree.work/xc/programs/Xserver/os/utils.c Sun Mar 12 16:46:54 2000 @@ -166,7 +166,7 @@ #ifdef MEMBUG #define MEM_FAIL_SCALE 100000 long Memory_fail = 0; -#ifdef linux +#if defined(linux) || defined(__GNU__) #include <stdlib.h> /* for random() */ #endif #endif diff -ur build-tree/xc/programs/Xserver/os/xalloc.c build-tree.work/xc/programs/Xserver/os/xalloc.c --- build-tree/xc/programs/Xserver/os/xalloc.c Sun Dec 20 12:50:17 1998 +++ build-tree.work/xc/programs/Xserver/os/xalloc.c Sun Mar 12 16:55:12 2000 @@ -244,6 +244,13 @@ #include <asm/page.h> /* PAGE_SIZE */ #endif /* linux */ +#if defined(__GNU__) +#define HAS_MMAP_ANON +#include <sys/types.h> +#include <sys/mman.h> +#include <mach/vm_param.h> /* PAGE_SIZE */ +#endif /* __GNU__ */ + #if defined(CSRG_BASED) #define HAS_MMAP_ANON #define HAS_GETPAGESIZE diff -ur build-tree/xc/programs/Xserver/xkb/ddxLoad.c build-tree.work/xc/programs/Xserver/xkb/ddxLoad.c --- build-tree/xc/programs/Xserver/xkb/ddxLoad.c Sun Sep 27 15:21:29 1998 +++ build-tree.work/xc/programs/Xserver/xkb/ddxLoad.c Sun Mar 12 16:56:56 2000 @@ -41,7 +41,7 @@ #include "XKBsrv.h" #include "XI.h" -#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || defined(__osf__) +#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || +defined(__osf__) || defined(__GNU__) #include <paths.h> #endif diff -ur build-tree/xc/programs/xdm/daemon.c build-tree.work/xc/programs/xdm/daemon.c --- build-tree/xc/programs/xdm/daemon.c Fri Jul 30 15:09:09 1999 +++ build-tree.work/xc/programs/xdm/daemon.c Sun Mar 12 16:25:28 2000 @@ -42,7 +42,7 @@ #else #include <sys/ioctl.h> #endif -#if defined(__osf__) || defined(linux) || defined(MINIX) +#if defined(__osf__) || defined(linux) || defined(MINIX) || defined(__GNU__) #define setpgrp setpgid #endif #ifdef hpux @@ -93,7 +93,7 @@ stat = setpgid(child_id, child_id); /* This gets error EPERM. Why? */ #else -#if defined(SYSV)||defined(__GNU__) +#if defined(SYSV) stat = 0; /* don't know how to set child's process group */ #else stat = setpgrp(child_id, child_id); diff -ur build-tree/xc/programs/xdm/dm.h build-tree.work/xc/programs/xdm/dm.h --- build-tree/xc/programs/xdm/dm.h Mon Dec 9 12:57:14 1996 +++ build-tree.work/xc/programs/xdm/dm.h Sun Mar 12 16:27:18 2000 @@ -262,7 +262,7 @@ }; /* setgroups is not covered by POSIX, arg type varies */ -#if defined(SYSV) || defined(SVR4) || defined(__osf__) || defined(linux) +#if defined(SYSV) || defined(SVR4) || defined(__osf__) || defined(linux) || +defined(__GNU__) #define GID_T gid_t #else #define GID_T int diff -ur build-tree/xc/programs/xdm/util.c build-tree.work/xc/programs/xdm/util.c --- build-tree/xc/programs/xdm/util.c Fri Jul 30 15:09:12 1999 +++ build-tree.work/xc/programs/xdm/util.c Sun Mar 12 16:32:51 2000 @@ -53,7 +53,7 @@ #undef _POSIX_SOURCE #endif #endif -#if defined(__osf__) || defined(linux) || defined(MINIX) || defined(__QNXNTO__) +#if defined(__osf__) || defined(linux) || defined(MINIX) || defined(__QNXNTO__) || +defined(__GNU__) #define setpgrp setpgid #endif diff -ur build-tree/xc/programs/xfs/os/connection.c build-tree.work/xc/programs/xfs/os/connection.c --- build-tree/xc/programs/xfs/os/connection.c Thu Nov 5 20:28:31 1998 +++ build-tree.work/xc/programs/xfs/os/connection.c Sun Mar 12 16:44:10 2000 @@ -75,7 +75,7 @@ #include <stdio.h> #include <errno.h> #include <X11/Xos.h> -#ifdef linux +#if defined(linux) || defined(__GNU__) #include <stdlib.h> #endif #ifndef MINIX diff -ur build-tree/xc/programs/xfs/os/daemon.c build-tree.work/xc/programs/xfs/os/daemon.c --- build-tree/xc/programs/xfs/os/daemon.c Wed Mar 8 00:57:41 2000 +++ build-tree.work/xc/programs/xfs/os/daemon.c Sun Mar 12 16:44:47 2000 @@ -36,7 +36,7 @@ #else #include <sys/ioctl.h> #endif -#if defined(__osf__) || defined(linux) || defined(MINIX) +#if defined(__osf__) || defined(linux) || defined(MINIX) || defined(__GNU__) #define setpgrp setpgid #endif #ifdef hpux diff -ur build-tree/xc/programs/xfs/os/utils.c build-tree.work/xc/programs/xfs/os/utils.c --- build-tree/xc/programs/xfs/os/utils.c Wed Mar 8 00:57:41 2000 +++ build-tree.work/xc/programs/xfs/os/utils.c Sun Mar 12 16:45:13 2000 @@ -51,7 +51,7 @@ #include <stdio.h> #include <X11/Xos.h> -#ifdef linux +#if defined(linux) || defined(__GNU__) #include <stdlib.h> #endif #include "misc.h"