Update years in copyright notice; nfc.
[bpt/emacs.git] / src / s / dgux.h
index 47f5e2f..82956a9 100644 (file)
@@ -1,12 +1,13 @@
 /* Definitions file for GNU Emacs running on Data General's DG/UX
-   version 4.32 and above.
-   Copyright (C) 1985, 1986, 1991 Free Software Foundation, Inc.
+   version 4.32 upto and including 5.4.1.
+   Copyright (C) 1994, 1999, 2002, 2003, 2004,
+                 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -16,8 +17,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
-
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 /*
  *     Define symbols to identify the version of Unix this is.
@@ -32,13 +33,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* #define BSD4_1 */
 #define BSD4_2
 #define BSD4_3
-#define BSD
-/* #define VMS */
+#define BSD4_4
+#define BSD_SYSTEM
 
 /* SYSTEM_TYPE should indicate the kind of system you are using.
  It sets the Lisp variable system-type.  */
 
-#define SYSTEM_TYPE "berkeley-unix"
+#define SYSTEM_TYPE "dgux"
 
 /* NOMULTIPLEJOBS should be defined if your system's shell
  does not have "job control" (the ability to stop a program,
@@ -52,7 +53,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
 
    SIGIO can be used only on systems that implement it (4.2 and 4.3).
-   CBREAK mode has two disadvatages
+   CBREAK mode has two disadvantages
      1) At least in 4.2, it is impossible to handle the Meta key properly.
         I hear that in system V this problem does not exist.
      2) Control-G causes output to be discarded.
@@ -62,33 +63,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    It would have Emacs fork off a separate process
    to read the input and send it to the true Emacs process
    through a pipe.
+
 */
 
 #define INTERRUPT_INPUT
 
-/* Letter to use in finding device name of first pty,
-  if system supports pty's.  'a' means it is /dev/ptya0  */
-
-#define FIRST_PTY_LETTER 'r'
-
 /*
- *     Define HAVE_TIMEVAL if the system supports the BSD style clock values.
- *     Look in <sys/time.h> for a timeval structure.
- */
-
-#define HAVE_TIMEVAL
-
-/*
- *     Define HAVE_SELECT if the system supports the `select' system call.
+ *     Define HAVE_SOCKETS if the system supports sockets.
  */
 
-#define HAVE_SELECT
+#define HAVE_SOCKETS
 
 /*
- *     Define HAVE_SOCKETS if the system supports sockets.
+ *     Define HAVE_UNIX_DOMAIN if the system supports Unix
+ *      domain sockets.
  */
 
-#define HAVE_SOCKETS
+#define HAVE_UNIX_DOMAIN
 
 /*
  *     Define HAVE_PTYS if the system supports pty devices.
@@ -173,18 +164,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define        BAUD_CONVERT    { 0, 110, 134, 150, 300, 600, 1200, 1800, 2400, \
                          4800, 9600, 19200, 38400 }
 
-/*
- *     Define HAVE_GETTIMEOFDAY if gettimeofday() system call is available.
- */
-
-#define HAVE_GETTIMEOFDAY
-
-/*
- *     Define NLIST_STRUCT if the system has nlist.h
- */
-
-#define        NLIST_STRUCT
-
 /*
  *      Make WM Interface Compliant.
  */
@@ -222,24 +201,19 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define        TERMINFO
 
 /*
- *     Define HAVE_TERMIO if the system provides sysV-style ioctls
- *     for terminal control.
- *     DG/UX has both BSD and AT&T style ioctl's.  Bsd ioctl's don't
- *     seem to wait for the output to drain properly, so use System V.
+ *      Send signals to subprocesses using characters.
+ *
  */
 
-#define HAVE_TERMIO
 #define SIGNALS_VIA_CHARACTERS
 
 /*
- *     DG/UX 4.10 needs the following to turn on berkeley ioctl's.
+ *     Define HAVE_TERMIOS since this is POSIX,
+ *     for terminal control.  Prevent redundant inclusion of termio.h.
  */
 
-#ifndef HAVE_TERMIO
-#ifndef _BSD_TTY_FLAVOR                /* Already defined, in dgux 4.30.  */
-#define _BSD_TTY_FLAVOR
-#endif
-#endif
+#define HAVE_TERMIOS
+#define NO_TERMIO
 
 /*
  *     Use a Berkeley style sys/wait.h.
@@ -248,69 +222,134 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define _BSD_WAIT_FLAVOR
 
-/* Enable the x-rebind keysym function.  Do not try to map function
-   keys internally. */
-
-#define XREBINDKEYSYM
-
 /*
  *      Use BSD and POSIX-style signals.  This is crucial!
  */
 
+/* #define SYSTEM_MALLOC */
+
 /* MAKING_MAKEFILE must be defined in "ymakefile" before including config.h */
-#ifndef MAKING_MAKEFILE
+#ifndef NOT_C_CODE
 
 /* Make sure signal.h is included so macros below don't mess with it. */
 /* DG/UX include files prevent multiple inclusion. */
 
 #include <signal.h>
 
+/* but undefine the sigmask and sigpause macros since they will get
+   #define'd later. */
+#undef sigmask
+#undef sigpause
+
 #define POSIX_SIGNALS
 
-/* Not worth converting the old GNU malloc to work with POSIX_SIGNALS.  */
-#define SYSTEM_MALLOC
+#ifndef NO_DGUX_SIGNAL_REDEF
+/* Can't use sys_signal because then etc/server.c would need sysdep.o.  */
+extern struct sigaction act, oact;
+#define signal(SIG,FUNC) berk_signal(SIG,FUNC)
+#endif
 
-/* Define this if you use System 5 Release 4 Streams */
-#define SYSV4_PTYS
-#define open  sys_open
-#define close sys_close
-#define read  sys_read
-#define write sys_write
+#endif /* not NOT_C_CODE */
 
-#define INTERRUPTABLE_OPEN
-#define INTERRUPTABLE_CLOSE
-/* can't hurt to define these, even though read/write should auto restart */
-#define INTERRUPTABLE_IO
+#ifndef __GNUC__
+#error You must use GCC to compiler Emascs on DGUX
+#endif
 
-/* Can't use sys_signal because then etc/server.c would need sysdep.o.  */
-#define signal(SIG,FUNC) berk_signal(SIG,FUNC)
+#define ORDINARY_LINK
+#define START_FILES pre-crt0.o
+#define LIB_GCC /usr/lib/gcc/libgcc.a
 
-#else /* MAKING_MAKEFILE */
-/* force gcc to be used */
-CC=gcc
-#endif /* not MAKING_MAKEFILE */
+#ifdef _M88KBCS_TARGET
+/* Karl Berry says: the environment
+   recommended by gcc (88/open, a.k.a. m88kbcs) doesn't support some system
+   functions, and gcc doesn't make it easy to switch environments.  */
+#define NO_GET_LOAD_AVG
+#endif
 \f
 /* definitions for xmakefile production */
 #ifdef COFF
-#define C_COMPILER \
-  TARGET_BINARY_INTERFACE=m88kdguxcoff gcc -traditional
-#define LINKER \
-  TARGET_BINARY_INTERFACE=m88kdguxcoff gcc -nostdlib
 
-#define MAKE_COMMAND \
-  TARGET_BINARY_INTERFACE=m88kdguxcoff make
+/* Define the following to use all of the available pty's. */
+
+#define PTY_ITERATION                                          \
+  for (c = 'p'; c < 't'; c++)                                  \
+    for (i = 0; (((c == 'p') && (i < 64)) || ((c != 'p') && (i < 16))); i++)
+
+#define PTY_NAME_SPRINTF                                       \
+      if (c == 'p')                                            \
+        sprintf (pty_name, "/dev/pty%c%d", c, i);              \
+      else                                                     \
+        sprintf (pty_name, "/dev/pty%c%x", c, i);
+
+#define PTY_TTY_NAME_SPRINTF                                   \
+      if (c == 'p')                                            \
+        sprintf (pty_name, "/dev/tty%c%d", c, i);              \
+      else                                                     \
+        sprintf (pty_name, "/dev/tty%c%x", c, i);
+
+#define C_DEBUG_SWITCH -g
 
 #else /* not COFF */
 
-#define C_COMPILER \
-  TARGET_BINARY_INTERFACE=m88kdguxelf gcc -traditional
-#define LINKER \
-  TARGET_BINARY_INTERFACE=m88kdguxelf gcc -nostdlib
+/* We are generating ELF object format.  This makes the system more
+   SVR4 like. */
+
+#define SVR4
+
+/* Pseudo-terminal support under SVR4 only loops to deal with errors. */
+
+#define PTY_ITERATION for (i = 0; i < 1; i++)
+
+/* This sets the name of the master side of the PTY. */
+
+#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
+
+/* This sets the name of the slave side of the PTY.  On SysVr4,
+   grantpt(3) forks a subprocess, so keep sigchld_handler() from
+   intercepting that death.  If any child but grantpt's should die
+   within, it should be caught after sigrelse(2). */
+
+#define PTY_TTY_NAME_SPRINTF                   \
+  {                                            \
+    char *ptsname(), *ptyname;                 \
+                                               \
+    sigblock(sigmask(SIGCLD));                         \
+    if (grantpt(fd) == -1)                     \
+      fatal("could not grant slave pty");      \
+    sigunblock(sigmask(SIGCLD));                               \
+    if (unlockpt(fd) == -1)                    \
+      fatal("could not unlock slave pty");     \
+    if (!(ptyname = ptsname(fd)))              \
+      fatal ("could not enable slave pty");    \
+    strncpy(pty_name, ptyname, sizeof(pty_name)); \
+    pty_name[sizeof(pty_name) - 1] = 0;                \
+  }
+
+/* Push various streams modules onto a PTY channel. */
+
+#define SETUP_SLAVE_PTY \
+  if (ioctl (xforkin, I_PUSH, "ptem") == -1)   \
+    fatal ("ioctl I_PUSH ptem", errno);                \
+  if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
+    fatal ("ioctl I_PUSH ldterm", errno);      \
+  if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
+    fatal ("ioctl I_PUSH ttcompat", errno);
+
+#ifdef __GNUC__
+#define C_DEBUG_SWITCH -g -V2 -mversion-03.00 -mstandard
+#endif
+
+#endif /* ELF */
+
+/* Extra stuff which probably should be someplace else but is here out
+   of expediency. */
+
+#define LIB_X11_LIB -lX11
+#define LIB_MOTIF -lXm -lgen
+
+/* Process groups work in the traditional BSD manner.  */
 
-#define MAKE_COMMAND \
-  TARGET_BINARY_INTERFACE=m88kdguxelf make
+#define BSD_PGRPS
 
-#endif /* COFF */
+/* arch-tag: 1b6d117d-82d2-4480-a6d0-3f7a8360f658
+   (do not change this comment) */