From: Jean-Pierre Radley <jpr@jpradley.jpr.com>
Subject: Re: emacs 18: 59 crashes on select()
Resent-From: mmdf@xenitec.on.ca
Submit-To: scogen@xenitec.on.ca
Content-Type: text
Reply-To: jpr@jpr.com
Organization: [resent by] The SCOGEN gateway and Propagation Society
Date: Sat, 21 Nov 1992 07:20:22 GMT
Content-Length: 6355      
Precedence: bulk

Michael Traub writes:
> In article <9211190011.AA13734@jpradley.jpr.com> jpr@jpr.com writes:
> >Your message and others have shown that to me. OK, I defined SCO_SOCKETS in
> >s-sco.h. I also inserted definitions to use the -s flag for ld, and the
> >-lc_s library.
> 
> Not sure if using shared libraries is a good idea. I didn't. I also didn't
> strip emacs till after it was build and installed.

I've found that the shared library works for stuff in etc, but not in src,
not at all. Stripping while loading gave me no headaches.

> >Now the make gets to this point:
> >        ./temacs -batch -l inc-vers
> >*** Termination code 139
> 
> Needless to say I don't get this. Did you make sure "HAVE_TIMEVAL" was
> also defined in s-sco.h? This was the crux of the original problem.

It was a question of properly intermingling flags and definitions. The
Makefiles are a real jungle, and considering that both gcc and emacs have
RMS as their main author, I find it very odd that one can't set CC=gcc
inside the top Makefile, but that one must set CC in the environment.

I started from the original distribution, copied src/config.h-dist to
src/config.h, applied the following patches, typed "CC=gcc make install",
and had nary a problem save the usual set of complaints about incorrect
types in signal() calls.

Thanks for your pointers, they really helped me focus.


Index: Makefile
*** Makefile~	Fri Oct  2 19:13:56 1992
--- Makefile	Sat Nov 21 00:50:12 1992
***************
*** 17,24 ****
--- 17,28 ----
  # This got changed in late 1991 to say /usr/local/lib/emacs,
  # but there was no explanation of why, so it seems better to keep this stable.
  LIBDIR= /usr/local/emacs
+ LIBDIR= /pub/lib/emacs
  BINDIR= /usr/local/bin
+ BINDIR= /pub/bin
  MANDIR= /usr/local/man/man1
+ MANDIR= /usr/man/man.L
+ MANEXT= L
  
  # Flags passed down to subdirectory makefiles.
  MFLAGS=
***************
*** 26,31 ****
--- 30,36 ----
  # Command used for installation.
  # If `install' doesn't work on your system, try `./install.sh'.
  INSTALL=install
+ INSTALL=install.sh
  
  # Subdirectories to make recursively.  `lisp' is not included
  # because the compiled lisp files are part of the distribution
***************
*** 67,73 ****
  	$(INSTALL) -c etc/etags ${BINDIR}/etags
  	$(INSTALL) -c etc/ctags ${BINDIR}/ctags
  	$(INSTALL) -c -m 1755 src/xemacs ${BINDIR}/xemacs
! 	$(INSTALL) -c -m 444 etc/emacs.1 ${MANDIR}/emacs.1
  	-rm -f ${BINDIR}/emacs
  	mv ${BINDIR}/xemacs ${BINDIR}/emacs
  
--- 72,78 ----
  	$(INSTALL) -c etc/etags ${BINDIR}/etags
  	$(INSTALL) -c etc/ctags ${BINDIR}/ctags
  	$(INSTALL) -c -m 1755 src/xemacs ${BINDIR}/xemacs
! 	$(INSTALL) -c -m 444 etc/emacs.1 ${MANDIR}/emacs.${MANEXT}
  	-rm -f ${BINDIR}/emacs
  	mv ${BINDIR}/xemacs ${BINDIR}/emacs
  
Index: etc/Makefile
*** etc/Makefile~	Wed Oct 21 18:16:47 1992
--- etc/Makefile	Fri Nov 20 22:58:12 1992
***************
*** 1,6 ****
--- 1,8 ----
  CFLAGS= -g
+ CFLAGS= -O2 -s
  # For Xenix.  Needed for movemail
  #  LOADLIBES= -lx
+ LOADLIBES= -lc_s
  # For Mips.  Needed for who knows what.
  #  CFLAGS = -g -systype bsd43
  
Index: src/config.h
*** src/config.h~	Sat Nov 21 00:30:21 1992
--- src/config.h	Wed Nov 18 23:45:17 1992
***************
*** 23,29 ****
     See the file ../etc/MACHINES for a list of systems and
     the names of the s- files to use for them.
     See s-template.h for documentation on writing s- files.  */
! #include "s-bsd4-2.h"
  
  /* Include here a m- file that describes the machine and system you use.
     See the file ../etc/MACHINES for a list of machines and
--- 23,29 ----
     See the file ../etc/MACHINES for a list of systems and
     the names of the s- files to use for them.
     See s-template.h for documentation on writing s- files.  */
! #include "s-sco.h"
  
  /* Include here a m- file that describes the machine and system you use.
     See the file ../etc/MACHINES for a list of machines and
***************
*** 30,36 ****
     the names of the m- files to use for them.
     See m-template.h for info on what m- files should define.
     */
! #include "m-vax.h"
  
  /* Load in the conversion definitions if this system
     needs them and the source file being compiled has not
--- 30,36 ----
     the names of the m- files to use for them.
     See m-template.h for info on what m- files should define.
     */
! #include "m-intel386.h"
  
  /* Load in the conversion definitions if this system
     needs them and the source file being compiled has not
Index: src/s-sco.h
*** src/s-sco.h~	Thu Oct 29 04:38:01 1992
--- src/s-sco.h	Sat Nov 21 00:00:50 1992
***************
*** 60,65 ****
--- 60,66 ----
  
  /* Define SCO_SOCKETS if your machie has sockets installed.
     It is an optional feature in the SCO system.  */
+ #define SCO_SOCKETS
  
  #ifdef SCO_SOCKETS
  #define HAVE_SOCKETS
Index: src/ymakefile
*** src/ymakefile~	Tue Oct  6 14:44:28 1992
--- src/ymakefile	Sat Nov 21 00:44:45 1992
***************
*** 136,142 ****
  
  /* If user wants to optimize, this is how.  */
  #ifndef C_OPTIMIZE_SWITCH
! #define C_OPTIMIZE_SWITCH -O
  #endif
  
  /* cc switches needed to make `asm' keyword work.
--- 136,142 ----
  
  /* If user wants to optimize, this is how.  */
  #ifndef C_OPTIMIZE_SWITCH
! #define C_OPTIMIZE_SWITCH -O2
  #endif
  
  /* cc switches needed to make `asm' keyword work.
***************
*** 158,164 ****
  #else /* not ORDINARY_LINK */
  #if __GNUC__ > 1
  /* Search the proper places so that we can find -lgcc.  */
! #define LINKER gcc -nostdlib
  #else
  #define LINKER ld
  #endif 
--- 158,164 ----
  #else /* not ORDINARY_LINK */
  #if __GNUC__ > 1
  /* Search the proper places so that we can find -lgcc.  */
! #define LINKER gcc -nostdlib -s
  #else
  #define LINKER ld
  #endif 
***************
*** 192,197 ****
--- 192,198 ----
  #endif /* SHORTNAMES */
  
  CFLAGS= C_DEBUG_SWITCH -Demacs $(MYCPPFLAG) C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM
+ CFLAGS= -s C_OPTIMIZE_SWITCH -Demacs $(MYCPPFLAG) C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM
  /* DO NOT use -R.  There is a special hack described in lastfile.c
     which is used instead.  Some initialized data areas are modified
     at initial startup, then labeled as part of the text area when


-- 
Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160.1341
Newsgroups: biz.sco.general
From: ash@cellar.demon.co.uk (Andrew Hardie)