[comp.sources.unix] v22i104: Error table compiler and library, Patch1

rsalz@uunet.uu.net (Rich Salz) (06/08/90)

Submitted-by: "Jonathan I. Kamens" <jik@pit-manager.mit.edu>
Posting-number: Volume 22, Issue 104
Archive-name: et/patch1
Patch-To: volume22/et


  This is official patch number 1 of the com_err package recently
posted (under the name "et") to comp.sources.unix.  Unshar the shar at
the bottom of this message and feed it to patch with your current
working directory set to the directory in which you keep the com_err
sources, and it should create two new files (PATCHLEVEL and README)
and update several others (Makefile, compile_et.c and et_lex.lex.l).

  Some of the RCS header strings may not patch properly, so you might
have to apply some portions of the patch by hand.

  This patch accomplishes the following:

1. The Makefile has been updated so that it is a little bit cleaner
   and a little bit easier to work with.
2. A PATCHLEVEL file (with initial value 1) has been created.
3. A short README file explaining what com_err is, and how to build
   it, has been written.
4. The library will now compile under A/UX.
5. The library will not compile under System V systems that use
   <string.h> instead of <strings.h>, and strchr and strrchr instead
   of index and rindex.

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  diff
# Wrapped by jik@pit-manager on Fri Jun  8 00:44:20 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'diff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'diff'\"
else
echo shar: Extracting \"'diff'\" \(8287 characters\)
sed "s/^X//" >'diff' <<'END_OF_FILE'
X*** /tmp/,RCSt1018539	Thu Jun  7 23:46:54 1990
X--- Makefile	Thu Jun  7 23:26:33 1990
X***************
X*** 4,34 ****
X  # Copyright 1987, 1989 MIT Student Information Processing Board
X  # For copyright info, see mit-sipb-copyright.h.
X  #
X! #	$Header: /afs/athena.mit.edu/user/j/jik/src/delete/et/RCS/Makefile,v 1.2 89/11/07 18:56:09 jik Exp $
X  #	$Locker:  $
X  #
X  
X! CFLAGS=	-O
X! LINTFLAGS= -uhvpb
X! LINTFILES= error_message.c et_name.c init_et.c com_err.c # perror.c
X! LIBOBJS= error_message.o et_name.o init_et.o com_err.o # perror.o
X  
X! BINDIR=/usr/athena
X! INCDIR=/usr/include
X! LIBDIR=/usr/athena/lib
X! DOCDIR=/usr/doc/athena
X  DESTDIR=
X  
X! FILES=	Makefile et_name.c error_message.c compile_et.c \
X! 		error_table.y et_lex.lex.l init_et.c \
X! 		com_err.c com_err.h \
X! 		error_table.h mit-sipb-copyright.h \
X! 		test.c test1.et test2.et \
X! 		compiler.h internal.h \
X! 		com_err.texinfo texinfo.tex strcasecmp.c
X! CFILES=	compile_et.c error_table.c error_message.c et_name.c \
X! 	init_et.c com_err.c strcasecmp.c
X  
X  #
X  # what to build...
X  #
X--- 4,40 ----
X  # Copyright 1987, 1989 MIT Student Information Processing Board
X  # For copyright info, see mit-sipb-copyright.h.
X  #
X! #	$Header: /afs/athena.mit.edu/user/j/jik/src/delete/et/RCS/Makefile,v 1.7 90/06/07 23:26:23 jik Exp $
X  #	$Locker:  $
X  #
X  
X! RANLIB= 	ranlib
X  
X! DEFINES= 
X! CFLAGS=		-O $(DEFINES)
X! LINTFLAGS= 	-uhvpb
X! LINTFILES= 	error_message.c et_name.c init_et.c com_err.c
X! LIBOBJS= 	error_message.o et_name.o init_et.o com_err.o
X! 
X! BINDIR=		/usr/athena
X! INCDIR=		/usr/include
X! LIBDIR=		/usr/athena/lib
X! DOCDIR=		/usr/doc/athena
X  DESTDIR=
X  
X! CFILES=		com_err.c compile_et.c error_message.c et_name.c\
X! 		init_et.c strcasecmp.c test.c
X! HFILES=		com_err.h compiler.h error_table.h internal.h\
X! 		mit-sipb-copyright.h 
X! MANS=		com_err.3 compile_et.1
X! YACCS=		error_table.y
X! LEXS=		et_lex.lex.l
X! ETS=		test1.et test2.et
X! FILES=		MANIFEST Makefile PATCHLEVEL README\
X! 		com_err.texinfo.Z.uu profiled texinfo.tex.Z.uu\
X! 		$(CFILES) $(HFILES) $(MANS) $(YACCS) $(LEXS) $(ETS)
X  
X+ 
X  #
X  # what to build...
X  #
X***************
X*** 71,80 ****
X  	${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o\
X  		strcasecmp.o -ll
X  
X- et.tar:	${FILES}
X- 	rm -f et.tar
X- 	tar cfrlv et.tar ${FILES}
X- 
X  tags:	TAGS
X  
X  com_err.ps : com_err.dvi
X--- 77,82 ----
X***************
X*** 88,96 ****
X  	install -c -m 444 mit-sipb-copyright.h \
X  				${DESTDIR}${INCDIR}/mit-sipb-copyright.h
X  	install -c libcom_err.a ${DESTDIR}${LIBDIR}/libcom_err.a
X! 	ranlib ${DESTDIR}${LIBDIR}/libcom_err.a
X  	install -c libcom_err_p.a ${DESTDIR}${LIBDIR}/libcom_err_p.a
X! 	ranlib ${DESTDIR}${LIBDIR}/libcom_err_p.a
X  	install -c com_err.texinfo ${DESTDIR}${DOCDIR}/com_err.texinfo
X  	install -c com_err.3 ${DESTDIR}/usr/man/man3/com_err.3
X  	install -c compile_et.1 ${DESTDIR}/usr/man/man1/compile_et.1
X--- 90,98 ----
X  	install -c -m 444 mit-sipb-copyright.h \
X  				${DESTDIR}${INCDIR}/mit-sipb-copyright.h
X  	install -c libcom_err.a ${DESTDIR}${LIBDIR}/libcom_err.a
X! 	${RANLIB} ${DESTDIR}${LIBDIR}/libcom_err.a
X  	install -c libcom_err_p.a ${DESTDIR}${LIBDIR}/libcom_err_p.a
X! 	${RANLIB} ${DESTDIR}${LIBDIR}/libcom_err_p.a
X  	install -c com_err.texinfo ${DESTDIR}${DOCDIR}/com_err.texinfo
X  	install -c com_err.3 ${DESTDIR}/usr/man/man3/com_err.3
X  	install -c compile_et.1 ${DESTDIR}/usr/man/man1/compile_et.1
X***************
X*** 102,112 ****
X  
X  libcom_err.a:	$(LIBOBJS)
X  	ar cruv libcom_err.a $(LIBOBJS)
X! 	ranlib libcom_err.a
X  
X  libcom_err_p.a:	$(LIBOBJS)
X  	(cd profiled; ar uv ../libcom_err_p.a $(LIBOBJS); \
X! 		ranlib ../libcom_err_p.a)
X  
X  libcom_err.o:	$(LIBOBJS)
X  	ld -r -s -o libcom_err.o $(LIBOBJS)
X--- 104,114 ----
X  
X  libcom_err.a:	$(LIBOBJS)
X  	ar cruv libcom_err.a $(LIBOBJS)
X! 	${RANLIB} libcom_err.a
X  
X  libcom_err_p.a:	$(LIBOBJS)
X  	(cd profiled; ar uv ../libcom_err_p.a $(LIBOBJS); \
X! 		${RANLIB} ../libcom_err_p.a)
X  
X  libcom_err.o:	$(LIBOBJS)
X  	ld -r -s -o libcom_err.o $(LIBOBJS)
X***************
X*** 125,130 ****
X--- 127,143 ----
X  		et_lex.lex.c \
X  		test1.h test1.c test2.h test2.c test \
X  		eddep makedep
X+ 
X+ patch: $(FILES)
X+ 	makepatch $(ARCHIVE)
X+ 	mv patch com_err.patch`cat PATCHLEVEL`
X+ 	shar com_err.patch`cat PATCHLEVEL` > com_err.patch`cat PATCHLEVEL`.shar
X+ 
X+ shar: $(FILES)
X+ 	makekit -oMANIFEST $(FILES)
X+ 
X+ tar: $(ARCHIVE)
X+ 	tar cvf - $(ARCHIVE) | compress > com_err.tar.Z
X  
X  # for testing
X  test:	test.o test1.o test2.o libcom_err.a
X*** /dev/null	Thu Jun  7 23:46:57 1990
X--- PATCHLEVEL	Thu Jun  7 21:50:52 1990
X***************
X*** 0 ****
X--- 1 ----
X! 1
X*** /dev/null	Thu Jun  7 23:46:58 1990
X--- README	Thu Jun  7 23:04:48 1990
X***************
X*** 0 ****
X--- 1,50 ----
X+ 		       ABOUT THE COM_ERR LIBARY
X+ 
X+   The com_err library was written by members of the Student
X+ Information Processing Board (SIPB) at MIT, to provide a useful
X+ standardized method for dealing with program errors when writing
X+ software.
X+ 
X+   The version of com_err contained here is currently in flux; the
X+ original authors are working on enhancements, although no definite
X+ release date for them has been set.  You should be aware that when the
X+ new version comes out, the programming interface to the library may
X+ change slightly or not-so-slightly, depending on what the authors feel
X+ is needed.
X+ 
X+   The file com_err.texinfo (and texinfo.tex, for processing it)
X+ contains the detailed documenation for the library.  They may be
X+ compressed and uuencoded when you receive them, since they contain
X+ some control characters in their original form.
X+ 
X+ 
X+ 			     BUILDING IT
X+ 
X+   It should be relatively easy to compile the com_err package on most
X+ architectures.  To do so, make the following changes to the Makefile:
X+ 
X+ 1. Change RANLIB from "ranlib" to some innocuous command like "echo"
X+    if you don't have ranlib on your system.
X+ 
X+ 2. If your system is System V based, add "-DSYSV" to DEFINES.
X+ 
X+ 3. If you plan on installing the library, include files,
X+    documentation and compile_et program, change BINDIR, INCDIR,
X+    LIBDIR, and DOCDIR.
X+ 
X+ After that, you should be all set.
X+ 
X+ 
X+ 			      QUESTIONS?
X+ 
X+   I didn't write com_err, but I'm willing to answer questions and/or
X+ direct them to someone who can.  See my signature to find out how to
X+ contact me.
X+ 
X+   See the file mit-sipb-copyright.h for copyright and distribution
X+ information.
X+ 
X+ Jonathan Kamens			              USnail:
X+ MIT Project Athena				11 Ashford Terrace
X+ jik@Athena.MIT.EDU				Allston, MA  02134
X+ Office: 617-253-8495			      Home: 617-782-0710
X*** /tmp/,RCSt1018539	Thu Jun  7 23:47:10 1990
X--- compile_et.c	Thu Jun  7 21:49:08 1990
X***************
X*** 8,13 ****
X--- 8,17 ----
X   */
X  
X  #include <stdio.h>
X+ #ifdef _AUX_SOURCE
X+ /* AUX uses caddr_t in <sys/file.h>, and it's defined in <sys/types.h> */
X+ #include <sys/types.h>
X+ #endif
X  #include <sys/file.h>
X  #include <string.h>
X  #include <sys/param.h>
X***************
X*** 23,29 ****
X      "Copyright 1987,1988 by MIT Student Information Processing Board";
X  
X  static const char rcsid_compile_et_c[] =
X!     "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/et/RCS/compile_et.c,v 1.1 89/11/07 19:05:27 jik Exp $";
X  #endif
X  
X  extern char *gensym();
X--- 27,33 ----
X      "Copyright 1987,1988 by MIT Student Information Processing Board";
X  
X  static const char rcsid_compile_et_c[] =
X!     "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/et/RCS/compile_et.c,v 1.2 90/06/07 21:48:57 jik Exp $";
X  #endif
X  
X  extern char *gensym();
X*** /tmp/,RCSt1018539	Thu Jun  7 23:47:19 1990
X--- et_lex.lex.l	Thu Jun  7 22:54:17 1990
X***************
X*** 1,7 ****
X--- 1,13 ----
X  PC	[^\"]
X  AN	[A-Z_a-z0-9]
X  %{
X+ #ifdef SYSV
X+ #include <string.h>
X+ #define index strchr
X+ #define rindex strrchr
X+ #else
X  #include <strings.h>
X+ #endif /* SYSV */
X  %}
X  %%
X  
X***************
X*** 25,29 ****
X  .		{ return (*yytext); }
X  %%
X  #ifndef lint
X! static char rcsid_et_lex_lex_l[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/et/RCS/et_lex.lex.l,v 1.2 89/11/07 19:00:35 jik Exp $";
X  #endif
X--- 31,35 ----
X  .		{ return (*yytext); }
X  %%
X  #ifndef lint
X! static char rcsid_et_lex_lex_l[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/et/RCS/et_lex.lex.l,v 1.3 90/06/07 22:53:55 jik Exp $";
X  #endif
END_OF_FILE
if test 8287 -ne `wc -c <'diff'`; then
    echo shar: \"'diff'\" unpacked with wrong size!
fi
# end of 'diff'
fi
echo shar: End of shell archive.
exit 0
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.