[comp.unix.i386] Compiling gawk for System V/386

marc@dumbcat.sf.ca.us (Marco S Hyman) (06/14/90)

Here are the Makefile changes for those System V/386 users that want to
put together gawk.  No problems except for an undocumented (in the makefile)
flag required when compiling one of the string functions in missing.d.
Testing consisted of running a few quick awk scripts -- you get what you pay
for.

Don't through away your shar files too quick!  gawk.texinfo was distributed
in 7 pieces labeled gawk.texinfo.0[1-7].  Yes, Virginia, that's 15
characters.  Extract by hand to create the texinfo file or modify the shars
and re-run.

(enjoy)

// marc

*** Makefile~	Wed Jun 13 21:29:58 1990
--- Makefile	Wed Jun 13 22:50:15 1990
***************
*** 58,64 ****
  #	-DSIGTYPE=int		- signal routines return int (default void)
  
  # Sun running SunOS 4.x
! MISSING = -DSTRERROR_MISSING -DSTRCASE_MISSING
  
  # SGI Personal Iris (Sys V derived)
  # MISSING = -DSPRINTF_INT -DBLKSIZE_MISSING -DSTRERROR_MISSING -DRANDOM_MISSING
--- 58,64 ----
  #	-DSIGTYPE=int		- signal routines return int (default void)
  
  # Sun running SunOS 4.x
! # MISSING = -DSTRERROR_MISSING -DSTRCASE_MISSING
  
  # SGI Personal Iris (Sys V derived)
  # MISSING = -DSPRINTF_INT -DBLKSIZE_MISSING -DSTRERROR_MISSING -DRANDOM_MISSING
***************
*** 78,88 ****
  # MISSING = -DBCOPY_MISSING -DSPRINTF_INT -DRANDOM_MISSING -DSTRERROR_MISSING \
  #	-DSTRCASE_MISSING -DDUP2_MISSING # -DBLKSIZE_MISSING ??????
  
  # Comment out the next line if you don't have gcc.
  # Also choose just one of -g and -O.
! CC=		 gcc
  
! OPTIMIZE=	-O -g
  PROFILE=	#-pg
  DEBUG=		#-DDEBUG #-DMEMDEBUG #-DFUNC_TRACE #-DMPROF
  DEBUGGER=	#-g -Bstatic
--- 78,95 ----
  # MISSING = -DBCOPY_MISSING -DSPRINTF_INT -DRANDOM_MISSING -DSTRERROR_MISSING \
  #	-DSTRCASE_MISSING -DDUP2_MISSING # -DBLKSIZE_MISSING ??????
  
+ # A System V/386 Release 3.2 machine (Added 13jun90: marc@dumbcat.sf.ca.us)
+ # missing.d/strcase.c requires USG to be defined
+ # libPW contains alloca
+ MISSING = -DBCOPY_MISSING -DSPRINTF_INT -DBLKSIZE_MISSING -DRANDOM_MISSING \
+ 	-DRANDOM_MISSING -DSTRCASE_MISSING -DUSG -DSTRERROR_MISSING
+ LIB = -lPW
+ 
  # Comment out the next line if you don't have gcc.
  # Also choose just one of -g and -O.
! # CC=		 gcc
  
! OPTIMIZE=	-O # -g
  PROFILE=	#-pg
  DEBUG=		#-DDEBUG #-DMEMDEBUG #-DFUNC_TRACE #-DMPROF
  DEBUGGER=	#-g -Bstatic
***************
*** 89,96 ****
  WARN=		#-W -Wunused -Wimplicit -Wreturn-type -Wcomment	# for gcc only
  
  # Parser to use on grammar -- if you don't have bison use the first one
! #PARSER = yacc
! PARSER = bison
  
  # ALLOCA
  #	Set equal to alloca.o if your system is S5 and you don't have
--- 96,103 ----
  WARN=		#-W -Wunused -Wimplicit -Wreturn-type -Wcomment	# for gcc only
  
  # Parser to use on grammar -- if you don't have bison use the first one
! PARSER = yacc
! #PARSER = bison
  
  # ALLOCA
  #	Set equal to alloca.o if your system is S5 and you don't have
***************
*** 154,160 ****
  
  # rules to build gawk
  gawk: $(ALLOBJS) $(GNUOBJS)
! 	$(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) -lm
  
  $(AWKOBJS): awk.h
  
--- 161,167 ----
  
  # rules to build gawk
  gawk: $(ALLOBJS) $(GNUOBJS)
! 	$(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) -lm $(LIB)
  
  $(AWKOBJS): awk.h
  
-- 
// marc@dumbcat.sf.ca.us
// {ames,decwrl,sun}!pacbell!dumbcat!marc