Subject: Re: Latest kernel + X problems
To: Michael Graff <explorer@vorpal.com>
From: None <Mark_Weaver@brown.edu>
List: current-users
Date: 01/07/1994 02:13:00
> >- emacs is version 19.22, statically linked (worked fine before)
> 
> Would some kind soul please mail me the patches needed for emacs 19.22 to
> build statically under -current?

I haven't tested these in a couple weeks, but at the very least this
is the worst of it:

diff -c  emacs-19.22/src/s/netbsd.h.mhw1 emacs-19.22/src/s/netbsd.h
*** emacs-19.22/src/s/netbsd.h.mhw1	Fri Dec 10 01:15:09 1993
--- emacs-19.22/src/s/netbsd.h	Fri Dec 10 12:27:20 1993
***************
*** 30,32 ****
--- 30,37 ----
  
  /* For mem-limits.h.  */
  #define BSD4_2
+ 
+ /* Stuff required for NetBSD-current Dec-1 */
+ #define NEED_ERRNO
+ 
+ #define LD_SWITCH_SYSTEM -e __start -Bstatic
diff -c  emacs-19.22/src/callproc.c.mhw1 emacs-19.22/src/callproc.c
*** emacs-19.22/src/callproc.c.mhw1	Thu Nov 25 16:27:23 1993
--- emacs-19.22/src/callproc.c	Fri Dec 10 11:56:38 1993
***************
*** 18,30 ****
  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  
  
  #include <signal.h>
  #include <errno.h>
  
  #include <config.h>
  
  extern int errno;
! #ifndef VMS
  extern char *sys_errlist[];
  #endif
  
--- 18,31 ----
  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  
  
+ #include <stdio.h>
  #include <signal.h>
  #include <errno.h>
  
  #include <config.h>
  
  extern int errno;
! #if !defined(VMS) && defined(NEED_VAR_SYS_ERRLIST)
  extern char *sys_errlist[];
  #endif
  
diff -c  emacs-19.22/src/config.h.in.mhw1 emacs-19.22/src/config.h.in
*** emacs-19.22/src/config.h.in.mhw1	Fri Oct 22 07:19:33 1993
--- emacs-19.22/src/config.h.in	Fri Dec 10 11:16:21 1993
***************
*** 100,105 ****
--- 100,106 ----
  #undef TM_IN_SYS_TIME
  #undef HAVE_TM_ZONE
  #undef HAVE_TZNAME
+ #undef NEED_VAR_SYS_ERRLIST
  
  #undef const
  
diff -c  emacs-19.22/src/emacs.c.mhw1 emacs-19.22/src/emacs.c
*** emacs-19.22/src/emacs.c.mhw1	Thu Nov 25 00:44:44 1993
--- emacs-19.22/src/emacs.c	Fri Dec 10 11:48:27 1993
***************
*** 241,248 ****
--- 241,250 ----
    char stack_bottom_variable;
    int skip_args = 0;
    extern int errno;
+ #ifdef NEED_VAR_SYS_ERRLIST
    extern sys_nerr;
    extern char *sys_errlist[];
+ #endif
    extern void malloc_warning ();
  
  /* Map in shared memory, if we are using that.  */
diff -c  emacs-19.22/src/fileio.c.mhw1 emacs-19.22/src/fileio.c
*** emacs-19.22/src/fileio.c.mhw1	Tue Nov 23 05:08:39 1993
--- emacs-19.22/src/fileio.c	Fri Dec 10 11:49:51 1993
***************
*** 21,26 ****
--- 21,27 ----
  
  #include <sys/types.h>
  #include <sys/stat.h>
+ #include <stdio.h>
  
  #if !defined (S_ISLNK) && defined (S_IFLNK)
  #  define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
***************
*** 49,56 ****
--- 50,59 ----
  
  #ifndef vax11c
  extern int errno;
+ # ifdef NEED_VAR_SYS_ERRLIST
  extern char *sys_errlist[];
  extern int sys_nerr;
+ # endif
  #endif
  
  #define err_str(a) ((a) < sys_nerr ? sys_errlist[a] : "unknown error")
diff -c  emacs-19.22/src/process.c.mhw1 emacs-19.22/src/process.c
*** emacs-19.22/src/process.c.mhw1	Fri Nov 26 20:40:10 1993
--- emacs-19.22/src/process.c	Fri Dec 10 11:52:11 1993
***************
*** 122,129 ****
--- 122,131 ----
  #include "syswait.h"
  
  extern errno;
+ #ifdef NEED_VAR_SYS_ERRLIST
  extern sys_nerr;
  extern char *sys_errlist[];
+ #endif
  
  #ifndef VMS
  #ifndef BSD4_1
diff -c  emacs-19.22/src/sysdep.c.mhw1 emacs-19.22/src/sysdep.c
*** emacs-19.22/src/sysdep.c.mhw1	Fri Nov 26 05:39:10 1993
--- emacs-19.22/src/sysdep.c	Fri Dec 10 11:53:55 1993
***************
*** 65,71 ****
  #include <errno.h>
  
  extern int errno;
! #ifndef VMS
  extern char *sys_errlist[];
  #endif
  
--- 65,71 ----
  #include <errno.h>
  
  extern int errno;
! #if !defined(VMS) && defined(NEED_VAR_SYS_ERRLIST)
  extern char *sys_errlist[];
  #endif
  
diff -c  emacs-19.22/src/unexenix.c.mhw1 emacs-19.22/src/unexenix.c
*** emacs-19.22/src/unexenix.c.mhw1	Sat Sep 11 21:21:32 1993
--- emacs-19.22/src/unexenix.c	Fri Dec 10 11:57:32 1993
***************
*** 66,73 ****
--- 66,75 ----
  	  fatal_unexec(_error_message, _error_arg);
  
  extern int errno;
+ #ifdef NEED_VAR_SYS_ERRLIST
  extern int sys_nerr;
  extern char *sys_errlist[];
+ #endif
  #define EEOF -1
  
  #ifndef L_SET
diff -c  emacs-19.22/src/unexmips.c.mhw1 emacs-19.22/src/unexmips.c
*** emacs-19.22/src/unexmips.c.mhw1	Sat Sep 11 21:21:34 1993
--- emacs-19.22/src/unexmips.c	Fri Dec 10 11:57:58 1993
***************
*** 59,66 ****
--- 59,68 ----
  	  fatal_unexec (_error_message, _error_arg);
  
  extern int errno;
+ #ifdef NEED_VAR_SYS_ERRLIST
  extern int sys_nerr;
  extern char *sys_errlist[];
+ #endif
  #define EEOF -1
  
  static struct scnhdr *text_section;
diff -c  emacs-19.22/lib-src/timer.c.mhw1 emacs-19.22/lib-src/timer.c
*** emacs-19.22/lib-src/timer.c.mhw1	Sun Sep 12 04:45:19 1993
--- emacs-19.22/lib-src/timer.c	Fri Dec 10 12:09:11 1993
***************
*** 30,36 ****
  
  
  extern int errno;
! extern char *sys_errlist[], *malloc ();
  extern time_t time ();
  
  /*
--- 30,39 ----
  
  
  extern int errno;
! #ifdef NEED_VAR_SYS_ERRLIST
! extern char *sys_errlist[];
! #endif
! extern char *malloc ();
  extern time_t time ();
  
  /*
diff -c  emacs-19.22/lib-src/emacsclient.c.mhw1 emacs-19.22/lib-src/emacsclient.c
*** emacs-19.22/lib-src/emacsclient.c.mhw1	Sun Sep 12 04:45:09 1993
--- emacs-19.22/lib-src/emacsclient.c	Fri Dec 10 11:59:12 1993
***************
*** 26,34 ****
  #undef close
  #undef signal
  
  
  #if !defined(HAVE_SOCKETS) && !defined(HAVE_SYSVIPC)
- #include <stdio.h>
  
  main (argc, argv)
       int argc;
--- 26,34 ----
  #undef close
  #undef signal
  
+ #include <stdio.h>
  
  #if !defined(HAVE_SOCKETS) && !defined(HAVE_SYSVIPC)
  
  main (argc, argv)
       int argc;
***************
*** 52,59 ****
--- 52,61 ----
  #include <stdio.h>
  #include <errno.h>
  
+ #ifdef NEED_VAR_SYS_ERRLIST
  extern int sys_nerr;
  extern char *sys_errlist[];
+ #endif
  extern int errno;
  
  main (argc, argv)
diff -c  emacs-19.22/lib-src/env.c.mhw1 emacs-19.22/lib-src/env.c
*** emacs-19.22/lib-src/env.c.mhw1	Wed Jun  9 06:56:10 1993
--- emacs-19.22/lib-src/env.c	Fri Dec 10 11:38:08 1993
***************
*** 195,201 ****
--- 195,203 ----
    else
      {
        extern int errno, sys_nerr;
+ #ifdef NEED_VAR_SYS_ERRLIST
        extern char *sys_errlist[];
+ #endif
  
        environ = nenv;
        (void) execvp (*argv, argv);
diff -c  emacs-19.22/lib-src/movemail.c.mhw1 emacs-19.22/lib-src/movemail.c
*** emacs-19.22/lib-src/movemail.c.mhw1	Fri Nov 12 01:24:26 1993
--- emacs-19.22/lib-src/movemail.c	Fri Dec 10 12:00:44 1993
***************
*** 48,53 ****
--- 48,54 ----
   *
   */
  
+ #include <stdio.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <sys/file.h>
***************
*** 332,339 ****
  pfatal_with_name (name)
       char *name;
  {
!   extern int errno, sys_nerr;
    extern char *sys_errlist[];
    char *s;
  
    if (errno < sys_nerr)
--- 333,343 ----
  pfatal_with_name (name)
       char *name;
  {
!   extern int errno;
! #ifdef NEED_VAR_SYS_ERRLIST
!   extern int sys_nerr;
    extern char *sys_errlist[];
+ #endif
    char *s;
  
    if (errno < sys_nerr)
***************
*** 346,353 ****
  pfatal_and_delete (name)
       char *name;
  {
!   extern int errno, sys_nerr;
    extern char *sys_errlist[];
    char *s;
  
    if (errno < sys_nerr)
--- 350,360 ----
  pfatal_and_delete (name)
       char *name;
  {
!   extern int errno;
! #ifdef NEED_VAR_SYS_ERRLIST
!   extern int sys_nerr;
    extern char *sys_errlist[];
+ #endif
    char *s;
  
    if (errno < sys_nerr)
***************
*** 395,401 ****
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
- #include <stdio.h>
  #include <pwd.h>
  
  #ifdef USG
--- 402,407 ----
***************
*** 716,723 ****
  char *
  get_errmsg ()
  {
!   extern int errno, sys_nerr;
    extern char *sys_errlist[];
    char *s;
  
    if (errno < sys_nerr)
--- 722,732 ----
  char *
  get_errmsg ()
  {
!   extern int errno;
! #ifdef NEED_VAR_SYS_ERRLIST
!   extern int sys_nerr;
    extern char *sys_errlist[];
+ #endif
    char *s;
  
    if (errno < sys_nerr)
diff -c  emacs-19.22/cpp/cccp.c.mhw1 emacs-19.22/cpp/cccp.c
*** emacs-19.22/cpp/cccp.c.mhw1	Mon Oct 10 00:54:29 1988
--- emacs-19.22/cpp/cccp.c	Fri Dec 10 11:58:52 1993
***************
*** 2416,2423 ****
  perror_with_name (name)
       char *name;
  {
!   extern int errno, sys_nerr;
    extern char *sys_errlist[];
  
    fprintf (stderr, "%s: ", progname);
    if (errno < sys_nerr)
--- 2416,2426 ----
  perror_with_name (name)
       char *name;
  {
!   extern int errno;
! #ifdef NEED_VAR_SYS_ERRLIST
!   extern int sys_nerr;
    extern char *sys_errlist[];
+ #endif
  
    fprintf (stderr, "%s: ", progname);
    if (errno < sys_nerr)
diff -c  emacs-19.22/man/texindex.c.mhw1 emacs-19.22/man/texindex.c
*** emacs-19.22/man/texindex.c.mhw1	Sat Nov 27 14:07:26 1993
--- emacs-19.22/man/texindex.c	Fri Dec 10 11:43:55 1993
***************
*** 65,72 ****
--- 65,74 ----
  
  #else /* !VMS */
  
+ #ifdef NEED_VAR_SYS_ERRLIST
  extern int sys_nerr;
  extern char *sys_errlist[];
+ #endif
  
  #  if defined (HAVE_SYS_FCNTL_H)
  #    include <sys/types.h>
diff -c  emacs-19.22/configure.in.mhw1 emacs-19.22/configure.in
*** emacs-19.22/configure.in.mhw1	Sun Nov 21 04:01:42 1993
--- emacs-19.22/configure.in	Fri Dec 10 08:49:04 1993
***************
*** 1275,1280 ****
--- 1275,1283 ----
    [
  fi
  
+ ]
+ AC_NEED_SYS_ERRLIST
+ [
  
  #### Specify what sort of things we'll be editing into Makefile and config.h.
  ### Use configuration here uncanonicalized to avoid exceeding size limits.
diff -c  emacs-19.22/Makefile.in.mhw1 emacs-19.22/Makefile.in
*** emacs-19.22/Makefile.in.mhw1	Sat Nov 27 04:19:22 1993
--- emacs-19.22/Makefile.in	Fri Dec 10 01:19:10 1993
***************
*** 32,38 ****
  #      Still more severe - delete backup and autosave files, too.
  
  SHELL = /bin/sh
! MAKE = make  # BSD doesn't have it as a default.
  
  # ==================== Things `configure' Might Edit ====================
  
--- 32,38 ----
  #      Still more severe - delete backup and autosave files, too.
  
  SHELL = /bin/sh
! MAKE = gmake  # BSD doesn't have it as a default.
  
  # ==================== Things `configure' Might Edit ====================
  
diff -c  emacs-19.22/configure.mhw1 emacs-19.22/configure
*** emacs-19.22/configure.mhw1	Mon Nov 22 22:01:03 1993
--- emacs-19.22/configure	Fri Dec 10 12:03:38 1993
***************
*** 1138,1153 ****
    done
    IFS="$saveifs"
  fi
! if test -z "$INSTALL"; then
!   if test -f ${srcdir}/install.sh; then
!     # We want the top-level source directory, not the subdir's srcdir,
!     # so expand srcdir now rather than in the Makefile.
!     INSTALL="${srcdir}/install.sh -c"
!   else
!     echo "warning: ${srcdir}/install.sh not found; using cp"
!     INSTALL=cp
!   fi
! fi
  test -n "$verbose" && echo "	setting INSTALL to $INSTALL"
  INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  test -n "$verbose" && echo "	setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
--- 1138,1144 ----
    done
    IFS="$saveifs"
  fi
! INSTALL=${INSTALL-cp}
  test -n "$verbose" && echo "	setting INSTALL to $INSTALL"
  INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  test -n "$verbose" && echo "	setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
***************
*** 1589,1597 ****
  rm -fr conftestdir
  if mkdir conftestdir; then
    cd conftestdir
!   cat > Imakefile <<'EOF'
  acfindx:
! 	@echo 'im_incroot="$(INCROOT)"; im_usrlibdir="$(USRLIBDIR)"; im_libdir="$(LIBDIR)"'
  EOF
    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
      no_x=
--- 1580,1588 ----
  rm -fr conftestdir
  if mkdir conftestdir; then
    cd conftestdir
!   cat > Imakefile <<\EOF
  acfindx:
! 	@echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
  EOF
    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
      no_x=
***************
*** 1616,1624 ****
  
  if test -z "$im_usrlibdir"; then
  echo checking for X include and library files directly
- if test ".$x_direct_test_library" = . ; then
-    x_direct_test_library=Xt
- fi
  cat > conftest.c <<EOF
  #include "confdefs.h"
  #include <X11/Intrinsic.h>
--- 1607,1612 ----
***************
*** 1635,1650 ****
      /usr/unsupported/include \
      /usr/x386/include \
      /usr/local/x11r5/include \
-     /usr/include/X11R6 \
      /usr/include/X11R5 \
      /usr/include/X11R4 \
-     /usr/X11R6/include \
      /usr/X11R5/include \
      /usr/X11/include \
      /usr/openwin/include \
      /usr/openwin/share/include \
      /usr/lpp/Xamples/include \
-     /usr/athena/include \
      ; \
    do
      if test -r $dir/X11/Intrinsic.h; then
--- 1623,1635 ----
***************
*** 1658,1666 ****
  # Check for the libraries.  First see if replacing the `include' by
  # `lib' works.
  LIBS_save="${LIBS}"
! LIBS="${LIBS} -l"$x_direct_test_library""
  have_lib=""
! echo checking for -l"$x_direct_test_library"
  cat > conftest.c <<EOF
  #include "confdefs.h"
  
--- 1643,1651 ----
  # Check for the libraries.  First see if replacing the `include' by
  # `lib' works.
  LIBS_save="${LIBS}"
! LIBS="${LIBS} -lXt"
  have_lib=""
! echo checking for -lXt
  cat > conftest.c <<EOF
  #include "confdefs.h"
  
***************
*** 1683,1698 ****
    /usr/x386/lib \
    /usr/local/x11r5/lib \
    /usr/lib/X11 \
-   /usr/lib/X11R6 \
-   /usr/lib/X11R5 \
    /usr/lib/X11R4 \
-   /usr/X11R6/lib \
    /usr/X11R5/lib \
-   /usr/X11R4/lib \
    /usr/X11/lib \
    /usr/openwin/lib \
    /usr/lpp/Xamples/lib \
-   /usr/athena/lib \
    ; \
  do
    for extension in a so sl; do
--- 1668,1678 ----
***************
*** 2413,2418 ****
--- 2393,2426 ----
  fi
  
  
+ echo checking for sys_errlist
+ cat > conftest.c <<EOF
+ #include "confdefs.h"
+ #include <stdio.h>
+ int main() { exit(0); }
+ int t() { sys_errlist; }
+ EOF
+ if eval $compile; then
+   :
+ else
+   rm -rf conftest*
+       
+ {
+ test -n "$verbose" && \
+ echo "	defining NEED_VAR_SYS_ERRLIST"
+ echo "#define" NEED_VAR_SYS_ERRLIST 1 >> confdefs.h
+ DEFS="$DEFS -DNEED_VAR_SYS_ERRLIST=1"
+ SEDDEFS="${SEDDEFS}\${SEDdA}NEED_VAR_SYS_ERRLIST\${SEDdB}NEED_VAR_SYS_ERRLIST\${SEDdC}1\${SEDdD}
+ \${SEDuA}NEED_VAR_SYS_ERRLIST\${SEDuB}NEED_VAR_SYS_ERRLIST\${SEDuC}1\${SEDuD}
+ \${SEDeA}NEED_VAR_SYS_ERRLIST\${SEDeB}NEED_VAR_SYS_ERRLIST\${SEDeC}1\${SEDeD}
+ "
+ }
+ 
+ fi
+ rm -f conftest*
+ 
+ 
+ 
  #### Specify what sort of things we'll be editing into Makefile and config.h.
  ### Use configuration here uncanonicalized to avoid exceeding size limits.
  
***************
*** 2759,2773 ****
    dir=`echo $file|sed 's%/[^/][^/]*$%%'`
    if test "$dir" != "$file"; then
      test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
!     test ! -d "$dir" && mkdir "$dir"
    fi
!   echo creating "$file"
!   rm -f "$file"
!   comment_str="Generated automatically from `echo $file|sed 's|.*/||'`.in by configure."
!   case "$file" in
!     *.c | *.h | *.C | *.cc | *.m )  echo "/* $comment_str */" > "$file" ;;
!     * )          echo "# $comment_str"     > "$file" ;;
!   esac
    sed -e "
  $prsub
  $extrasub
--- 2767,2777 ----
    dir=`echo $file|sed 's%/[^/][^/]*$%%'`
    if test "$dir" != "$file"; then
      test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
!     test ! -d $dir && mkdir $dir
    fi
!   echo creating $file
!   rm -f $file
!   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
    sed -e "
  $prsub
  $extrasub
***************
*** 2814,2837 ****
  # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  # is the cpp macro being defined and VALUE is the value it is being given.
  # Each defining turns into a single global substitution command.
- # Hopefully no one uses "!" as a variable value.
- # Other candidates for the sed separators, like , and @, do get used.
  #
  # SEDd sets the value in "#define NAME VALUE" lines.
! SEDdA='s!^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
! SEDdB='\([ 	][ 	]*\)[^ 	]*!\1#\2'
  SEDdC='\3'
! SEDdD='!g'
  # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
! SEDuA='s!^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
! SEDuB='\([ 	]\)!\1#\2define\3'
  SEDuC=' '
! SEDuD='\4!g'
  # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
! SEDeA='s!^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
! SEDeB='$!\1#\2define\3'
  SEDeC=' '
! SEDeD='!g'
  rm -f conftest.sed
  EOF
  # Turn off quoting long enough to insert the sed commands.
--- 2818,2839 ----
  # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  # is the cpp macro being defined and VALUE is the value it is being given.
  # Each defining turns into a single global substitution command.
  #
  # SEDd sets the value in "#define NAME VALUE" lines.
! SEDdA='s@^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
! SEDdB='\([ 	][ 	]*\)[^ 	]*@\1#\2'
  SEDdC='\3'
! SEDdD='@g'
  # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
! SEDuA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
! SEDuB='\([ 	]\)@\1#\2define\3'
  SEDuC=' '
! SEDuD='\4@g'
  # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
! SEDeA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
! SEDeB='$@\1#\2define\3'
  SEDeC=' '
! SEDeD='@g'
  rm -f conftest.sed
  EOF
  # Turn off quoting long enough to insert the sed commands.

	Mark
--------------------------------------------------------------------
Email: Mark_Weaver@brown.edu           | Brown University
PGP Key: finger mhw@cs.brown.edu       | Dept of Computer Science

------------------------------------------------------------------------------