From:	MERC::"uunet!WKUVX1.BITNET!FILESERV-Mgr" 12-JUN-1992 15:45:03.48
To:	galaxy::gleeve
CC:	
Subj:	GREP.01_OF_12

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On 11-JUN-1992 20:57:45.24   By user GOATHUNTER (@WKUVX1.BITNET)
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$!+ THIS PACKAGE DISTRIBUTED IN 12 PARTS, TO KEEP EACH PART
$!  BELOW 60 BLOCKS
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. [.GREP016]AAAREADME.TXT;1
$!       2. [.GREP016]ALLOCA.C;1
$!       3. [.GREP016]CONFIGURE.;1
$!       4. [.GREP016]CONFIGURE.IN;1
$!       5. [.GREP016]COPYING.;1
$!       6. [.GREP016]DESCRIP.MMS;1
$!       7. [.GREP016]DFA.C;1
$!       8. [.GREP016]DFA.H;1
$!       9. [.GREP016]GETOPT.C;1
$!      10. [.GREP016]GETOPT.H;1
$!      11. [.GREP016]GREP.C;1
$!      12. [.GREP016]GREP.CLD;1
$!      13. [.GREP016]GREP.EXAMPLES;1
$!      14. [.GREP016]GREP.MAN;1
$!      15. [.GREP016]GREP.OPT;1
$!      16. [.GREP016]GREP.RNH;1
$!      17. [.GREP016]INSTALL.;1
$!      18. [.GREP016]MAKEFILE.IN;1
$!      19. [.GREP016]README.;1
$!      20. [.GREP016]README.CRAY;1
$!      21. [.GREP016]README.SUNOS4;1
$!      22. [.GREP016]REGEX.C;1
$!      23. [.GREP016]REGEX.H;1
$!      24. [.GREP016]SHELL_MUNG.C;1
$!      25. [.GREP016]VMSMAKE.COM;1
$!      26. [.GREP016.TESTS]KHADAFY.LINES;1
$!      27. [.GREP016.TESTS]KHADAFY.REGEXP;1
$!      28. [.GREP016.TESTS]REGRESS.SH;1
$!      29. [.GREP016.TESTS]SCRIPTGEN.AWK;1
$!      30. [.GREP016.TESTS]SPENCER.TESTS;1
$!      31. [.GREP016.TESTS]VMSREGRESS.COM;1
$!      32. [.GREP016.TESTS]VMSSCRIPTGEN.AWK;1
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
XGNU grep v1.6 (June 11, 1992)
X
XThis version was taken from prep.ai.mit.edu and modified to run under
XVMS.  It compiles under VMS using GNU C or VAX C.  It was tested with
XGNU C v1.39.1 and VAX C v3.2 under VMS v5.5.
X
XThanks to Henrik Tougaard, Datani A/S, Copenhagen, Denmark <ht@datani.dk>
Xfor the VAX C changes.
X
XAs supplied, VMSMAKE.COM also compiles SHELL_MUNG.C, which will allow grep t
Vo
Xhandle wildcarded file specs.
X
XTo install:
X
X`09$ @VMSMAKE.COM`09`09`09!or just $ MMS
X`09$ GREP :== $dev:`5Bdir`5DGREP.EXE
X`09$ EGREP :== $dev:`5Bdir`5DEGREP.EXE
X`09$ SET DEFAULT `5B.TESTS`5D
X`09$ @VMSREGRESS.COM`09`09!To test it out
X`09$ LIBRARY/HELP/INSERT library GREP
X
XNew to this distribution:
X
X`09VMSMAKE.COM`09`09`09DCL command procedure to build grep
X`09DESCRIP.MMS`09`09`09MMS file to build grep
X`09GREP.CLD`09`09`09Command definition file for e?grep
X`09GREP.EXAMPLES`09`09`09grep commands equiv. to SEARCH commands
X`09GREP.RNH`09`09`09RUNOFF source for on-line VMS help
X`09SHELL_MUNG.C`09`09`09Emulate UNIX shell
X`09GREP.C`09`09`09`09Modified for VMS
X`09DFA.C`09`09`09`09Modified for VMS
X`09DFA.H`09`09`09`09Modified for VMS
X`09REGEX.C`09`09`09`09Modified for VMS
X`09`5B.TESTS`5DVMSSCRIPTGEN.AWK`09GNU awk program to create testing .COM
X`09`5B.TESTS`5DVMSREGRESS.COM`09`09DCL command procedure to test egrep
X
XThis version of grep also includes a few VMS-specific (bracketed by #ifdef V
VMS)
Xchanges.  Specifically:
X
X    1.  Added call to shell_mung
X    2.  References to sys_errlist`5Berrno`5D were causing grep to stack dump
V.
X        I modified it to call strerror instead.
X    3.  The exit statuses were changed to better fit VMS:
X            Meaning                  UNIX       VMS
X            -------                  ----       ---
X            matches found               0         1
X            no matches found            1         3
X            error                       2        44 (SS$_ABORT)
X    4.  Modified print_line to use puts when printing lines instead of
X        putchar.  Much faster output on VMS.
X
XI also modified SHELL_MUNG.C to allow it to be compiled by GNU C.
X
XAny suggestions/comments/etc. can be sent to the address below.
X
XHunter Goatley, VAX Systems Programmer      E-mail: goathunter@WKUVX1.BITNET
XAcademic Computing, STH 226                 Voice:  (502) 745-5251
XWestern Kentucky University
XBowling Green, KY 42101
$ CALL UNPACK [.GREP016]AAAREADME.TXT;1 201598537
$ create 'f'
X/*
X`09alloca -- (mostly) portable public-domain implementation -- D A Gwyn
X
X`09last edit:`0986/05/30`09rms
X`09   include config.h, since on VMS it renames some symbols.
X`09   Use xmalloc instead of malloc.
X
X`09This implementation of the PWB library alloca() function,
X`09which is used to allocate space off the run-time stack so
X`09that it is automatically reclaimed upon procedure exit,`20
X`09was inspired by discussions with J. Q. Johnson of Cornell.
X
X`09It should work under any C implementation that uses an
X`09actual procedure stack (as opposed to a linked list of
X`09frames).  There are some preprocessor constants that can
X`09be defined when compiling for your specific system, for
X`09improved efficiency; however, the defaults should be okay.
X
X`09The general concept of this implementation is to keep
X`09track of all alloca()-allocated blocks, and reclaim any
X`09that are found to be deeper in the stack than the current
X`09invocation.  This heuristic does not reclaim storage as
X`09soon as it becomes invalid, but it will do so eventually.
X
X`09As a special case, alloca(0) reclaims storage without
X`09allocating any.  It is a good idea to use alloca(0) in
X`09your main control loop, etc. to force garbage collection.
X*/
X#ifndef lint
Xstatic char`09SCCSid`5B`5D = "@(#)alloca.c`091.1";`09/* for the "what" utili
Vty */
X#endif
X
X#ifdef emacs
X#include "config.h"
X#ifdef static
X/* actually, only want this if static is defined as ""
X   -- this is for usg, in which emacs must undefine static
X   in order to make unexec workable
X   */
X#ifndef STACK_DIRECTION
Xyou
Xlose
X-- must know STACK_DIRECTION at compile-time
X#endif /* STACK_DIRECTION undefined */
X#endif /* static */
X#endif /* emacs */
X
X#ifndef alloca  /* If compiling with GCC, this file's not needed.  */
X
X#ifdef __STDC__
Xtypedef void`09*pointer;`09`09/* generic pointer type */
X#else
Xtypedef char`09*pointer;`09`09/* generic pointer type */
X#endif
X
X#define`09NULL`090`09`09`09/* null pointer constant */
X
Xextern void`09free();
Xextern pointer`09xmalloc();
X
X/*
X`09Define STACK_DIRECTION if you know the direction of stack
X`09growth for your system; otherwise it will be automatically
X`09deduced at run-time.
X
X`09STACK_DIRECTION > 0 => grows toward higher addresses
X`09STACK_DIRECTION < 0 => grows toward lower addresses
X`09STACK_DIRECTION = 0 => direction of growth unknown
X*/
X
X#ifndef STACK_DIRECTION
X#define`09STACK_DIRECTION`090`09`09/* direction unknown */
X#endif
X
X#if STACK_DIRECTION != 0
X
X#define`09STACK_DIR`09STACK_DIRECTION`09/* known at compile-time */
X
X#else`09/* STACK_DIRECTION == 0; need run-time code */
X
Xstatic int`09stack_dir;`09`09/* 1 or -1 once known */
X#define`09STACK_DIR`09stack_dir
X
Xstatic void
Xfind_stack_direction (/* void */)
X`7B
X  static char`09*addr = NULL;`09/* address of first
X`09`09`09`09   `60dummy', once known */
X  auto char`09dummy;`09`09/* to get stack address */
X
X  if (addr == NULL)
X    `7B`09`09`09`09/* initial entry */
X      addr = &dummy;
X
X      find_stack_direction ();`09/* recurse once */
X    `7D
X  else`09`09`09`09/* second entry */
X    if (&dummy > addr)
X      stack_dir = 1;`09`09/* stack grew upward */
X    else
X      stack_dir = -1;`09`09/* stack grew downward */
X`7D
X
X#endif`09/* STACK_DIRECTION == 0 */
X
X/*
X`09An "alloca header" is used to:
X`09(a) chain together all alloca()ed blocks;
X`09(b) keep track of stack depth.
X
X`09It is very important that sizeof(header) agree with malloc()
X`09alignment chunk size.  The following default should work okay.
X*/
X
X#ifndef`09ALIGN_SIZE
X#define`09ALIGN_SIZE`09sizeof(double)
X#endif
X
Xtypedef union hdr
X`7B
X  char`09align`5BALIGN_SIZE`5D;`09/* to force sizeof(header) */
X  struct
X    `7B
X      union hdr *next;`09`09/* for chaining headers */
X      char *deep;`09`09/* for stack depth measure */
X    `7D h;
X`7D header;
X
X/*
X`09alloca( size ) returns a pointer to at least `60size' bytes of
X`09storage which will be automatically reclaimed upon exit from
X`09the procedure that called alloca().  Originally, this space
X`09was supposed to be taken from the current stack frame of the
X`09caller, but that method cannot be made to work for some
X`09implementations of C, for example under Gould's UTX/32.
X*/
X
Xstatic header *last_alloca_header = NULL; /* -> last alloca header */
X
Xpointer
Xalloca (size)`09`09`09/* returns pointer to storage */
X     unsigned`09size;`09`09/* # bytes to allocate */
X`7B
X  auto char`09probe;`09`09/* probes stack depth: */
X  register char`09*depth = &probe;
X
X#if STACK_DIRECTION == 0
X  if (STACK_DIR == 0)`09`09/* unknown growth direction */
X    find_stack_direction ();
X#endif
X
X`09`09`09`09/* Reclaim garbage, defined as all alloca()ed storage that
X`09`09`09`09   was allocated from deeper in the stack than currently. */
X
X  `7B
X    register header`09*hp;`09/* traverses linked list */
X
X    for (hp = last_alloca_header; hp != NULL;)
X      if ((STACK_DIR > 0 && hp->h.deep > depth)
X`09  `7C`7C (STACK_DIR < 0 && hp->h.deep < depth))
X`09`7B
X`09  register header`09*np = hp->h.next;
X
X`09  free ((pointer) hp);`09/* collect garbage */
X
X`09  hp = np;`09`09/* -> next header */
X`09`7D
X      else
X`09break;`09`09`09/* rest are not deeper */
X
X    last_alloca_header = hp;`09/* -> last valid storage */
X  `7D
X
X  if (size == 0)
X    return NULL;`09`09/* no allocation required */
X
X  /* Allocate combined header + user data storage. */
X
X  `7B
X    register pointer`09new = xmalloc (sizeof (header) + size);
X    /* address of header */
X
X    ((header *)new)->h.next = last_alloca_header;
X    ((header *)new)->h.deep = depth;
X
X    last_alloca_header = (header *)new;
X
X    /* User storage begins just after header. */
X
X    return (pointer)((char *)new + sizeof(header));
X  `7D
X`7D
X
X#endif /* no alloca */
$ CALL UNPACK [.GREP016]ALLOCA.C;1 1767691154
$ create 'f'
X#!/bin/sh
X# Guess values for system-dependent variables and create Makefiles.
X# Generated automatically using autoconf.
X# Copyright (C) 1991, 1992 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X
X# Usage: configure `5B--srcdir=DIR`5D `5B--host=HOST`5D `5B--gas`5D `5B--nfp
V`5D
X#        `5B--prefix=PREFIX`5D `5B--exec_prefix=PREFIX`5D `5B--with-PROGRAM`
V5D `5BTARGET`5D
X# Ignores all args except --srcdir, --prefix, and --exec_prefix.
X
Xtrap 'rm -f conftest* core; exit 1' 1 3 15
X
Xfor arg in $*; do
X  # Handle --exec_prefix with a space before the argument.
X  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix
V=
X  # Handle --host with a space before the argument.
X  elif test x$next_host = xyes; then next_host=
X  # Handle --prefix with a space before the argument.
X  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
X  # Handle --srcdir with a space before the argument.
X  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
X  else
X    case $arg in
X     -exec_prefix=* `7C --exec_prefix=* `7C --exec_prefi=* `7C --exec_pref=*
V `7C --exec_pre=* `7C --exec_pr=* `7C --exec_p=* `7C --exec_=* `7C --exec=*
V `7C --exe=* `7C --ex=* `7C --e=*)
X`09exec_prefix=`60echo $arg `7C sed 's/`5B-a-z_`5D*=//'`60 ;;
X     -exec_prefix `7C --exec_prefix `7C --exec_prefi `7C --exec_pref `7C --e
Vxec_pre `7C --exec_pr `7C --exec_p `7C --exec_ `7C --exec `7C --exe `7C --ex
V `7C --e)
X`09next_exec_prefix=yes ;;
X
X     -gas `7C --gas `7C --ga `7C --g) ;;
X
X     -host=* `7C --host=* `7C --hos=* `7C --ho=* `7C --h=*) ;;
X     -host `7C --host `7C --hos `7C --ho `7C --h)
X`09next_host=yes ;;
X
X     -nfp `7C --nfp `7C --nf `7C --n) ;;
X
X     -prefix=* `7C --prefix=* `7C --prefi=* `7C --pref=* `7C --pre=* `7C --p
Vr=* `7C --p=*)
X`09prefix=`60echo $arg `7C sed 's/`5B-a-z_`5D*=//'`60 ;;
X     -prefix `7C --prefix `7C --prefi `7C --pref `7C --pre `7C --pr `7C --p)
X`09next_prefix=yes ;;
X
X     -srcdir=* `7C --srcdir=* `7C --srcdi=* `7C --srcd=* `7C --src=* `7C --s
Vr=* `7C --s=*)
X`09srcdir=`60echo $arg `7C sed 's/`5B-a-z_`5D*=//'`60 ;;
X     -srcdir `7C --srcdir `7C --srcdi `7C --srcd `7C --src `7C --sr `7C --s)
X`09next_srcdir=yes ;;
X
X     -with-* `7C --with-*) ;;
X
X     *) ;;
X    esac
X  fi
Xdone
X
Xtest -z "$exec_prefix" && exec_prefix='$(prefix)'
X
XINCLUDEDIR=$`7BINCLUDEDIR-/usr/include`7D
X
Xrm -f conftest*
Xcompile='$`7BCC-cc`7D $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
X
X# A filename unique to this package, relative to the directory that
X# configure is in, which we can look for to find out if srcdir is correct.
Xunique_file=grep.c
X
X# Makefile rules whose targets are searched for in VPATH need to use $<.
X# However, old makes do not support it, so we use a combination
X# construction in Makefile.in: `60$file<'.
X# If srcdir is `60.', we use sed to change that to `60file' for old makes.
X# Otherwise, we use sed to change it to `60$<'.
X# vpsub is the sed program, which changes `60$file<' to one or the other.
Xvpsub='s,\$\(`5B-./a-zA-Z0-9_`5D`5B-./a-zA-Z0-9_`5D*\)<,\1,g'
X# srsub changes `60@srcdir@' in Makefile.in into either `60.' or the path
X# of the top of the source tree for the package.
Xsrsub='s,@srcdir@,.,'
X
X# Find the source files, if location was not specified.
Xif test -z "$srcdir"; then
X  srcdirdefaulted=yes; srcdir=.
X  if test ! -r $unique_file; then srcdir=..; fi
Xfi
Xif test ! -r $srcdir/$unique_file; then
X  if test x$srcdirdefaulted = xyes; then
X    echo "configure: Can not find sources in \`60.' or \`60..'." 1>&2
X  else
X    echo "configure: Can not find sources in \`60$`7Bsrcdir`7D'." 1>&2
X  fi
X  exit 1
Xfi
Xif test $srcdir != .; then
X  VPATH='VPATH = $(srcdir)'
X  case $srcdir in
X    /*`7C`7E*) ;;
X    *) srcdir=`60pwd`60/$srcdir ;; # Make relative path absolute.
X  esac
X  vpsub='s,\$\(`5B-./a-zA-Z0-9_`5D`5B-./a-zA-Z0-9_`5D*\)<,\$<,g'
X  srsub="s,@srcdir@,$srcdir,"
Xfi
X
X
X# The Bourne shell writes "command not found" to /dev/tty, so if we get
X# a usage message on stderr, we have the program.
X#
X# ksh and zsh write "command not found" to stderr, but test -n does not
X# want any output if there is no program.  So we use the `60type' builtin
X# instead for them (and bash).
Xif test "$RANDOM" = "$RANDOM"; then
X  checkfor='test -n "`60$checkprog $checkargs 2>&1`60"'
Xelse
X  checkfor='type $checkprog >/dev/null 2>&1'
Xfi
X
Xecho checking for gcc
Xcheckprog=gcc checkargs=''
Xtest -z "$CC" && eval $checkfor && CC='gcc '
XCC=$`7BCC-cc`7D
X
X# Find out if we are using GNU C, under whatever name.
Xcat <<EOF > conftest.c
Xmain() `7B
X#ifdef __GNUC__
X  exit(0);
X#else
X  exit(1);
X#endif
X`7D
XEOF
Xeval $compile
Xif test -s conftest && (./conftest) 2>/dev/null; then
X  GCC=1 # For later tests.
X  CC="$CC -O"
Xelse
X  :
Xfi
Xrm -f conftest*
X
Xecho checking for install
X# Make sure to not get the incompatible SysV /etc/install and
X# /usr/sbin/install, which might be in PATH before a BSD-like install.
Xif test -z "$INSTALL"; then
X  saveifs="$IFS"; IFS="$IFS:"
X  for dir in $PATH; do
X    test -z "$dir" && dir=.
X    case $dir in
X    /etc`7C/usr/sbin) ;;
X    *)
X      if test -f $dir/install; then
X`09INSTALL="$dir/install -c"
X`09INSTALL_PROGRAM='$(INSTALL)'
X`09INSTALL_DATA='$(INSTALL) -m 644'
X`09break
X      fi
X      ;;
X    esac
X  done
X  IFS="$saveifs"
Xfi
XINSTALL=$`7BINSTALL-cp`7D
XINSTALL_PROGRAM=$`7BINSTALL_PROGRAM-'$(INSTALL)'`7D
XINSTALL_DATA=$`7BINSTALL_DATA-'$(INSTALL)'`7D
X
Xecho checking for ANSI C header files
Xtest -r $INCLUDEDIR/stdlib.h && test -r $INCLUDEDIR/string.h &&
X  test -r $INCLUDEDIR/limits.h && DEFS="$DEFS -DSTDC_HEADERS=1"
X
Xecho checking for BSD string and memory functions
Xecho "#include <strings.h>
Xmain() `7B exit(0); `7D t() `7B rindex(0, 0); bzero(0, 0); `7D" > conftest.c
Xeval $compile
Xif test -s conftest && (./conftest) 2>/dev/null; then :
Xelse
X  DEFS="$DEFS -DUSG=1"
Xfi
Xrm -f conftest*
X
Xecho checking for unistd.h
Xtest -f $INCLUDEDIR/unistd.h && DEFS="$DEFS -DHAVE_UNISTD_H=1"
X
Xecho checking for unsigned characters
Xcat <<EOF > conftest.c
X
X/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
X#if !__STDC__
X#define volatile
X#endif
Xmain() `7B
X#ifdef __CHAR_UNSIGNED__
X  exit(1); /* No need to redefine it.  */
X#else
X  volatile char c = 255; exit(c < 0);
X#endif
X`7D
XEOF
Xeval $compile
Xif test -s conftest && (./conftest) 2>/dev/null; then
X  DEFS="$DEFS -D__CHAR_UNSIGNED__=1"
Xelse
X  :
Xfi
Xrm -f conftest*
X
Xdecl="#ifdef __GNUC__
X#define alloca __builtin_alloca
X#else
X#ifdef sparc
X#include <alloca.h>
X#else
X#ifdef _AIX
X #pragma alloca
X#else
Xchar *alloca ();
X#endif
X#endif
X#endif
X"
Xecho checking for alloca
Xecho "$decl
Xmain() `7B exit(0); `7D t() `7B char *p = (char *) alloca(1); `7D" > conftes
Vt.c
Xeval $compile
Xif test -s conftest && (./conftest) 2>/dev/null; then :
Xelse
X  alloca_missing=1
Xfi
Xrm -f conftest*
X
Xif test -n "$alloca_missing"; then
X  SAVELIBS="$LIBS"
X  # Maybe alloca is in a different library.
X  if test -f /usr/ucblib/libucb.a; then
X    LIBS="$LIBS -L/usr/ucblib -lucb" trylib=-lucb # SVR4
X  elif test -f /lib/libPW.a; then
X    LIBS="$LIBS -lPW" trylib=-lPW # SVR2 and SVR3
X  fi
X  if test -n "$trylib"; then
X    alloca_missing=
X    echo checking for alloca in $trylib
Xecho "$decl
Xmain() `7B exit(0); `7D t() `7B char *p = (char *) alloca(1); `7D" > conftes
Vt.c
Xeval $compile
Xif test -s conftest && (./conftest) 2>/dev/null; then :
Xelse
X  alloca_missing=1
Xfi
Xrm -f conftest*
X
X  fi
X  if test -n "$alloca_missing"; then
X    LIBS="$SAVELIBS" ALLOCA=alloca.o
X  fi
Xfi
X
Xtrap 'rm -f Makefile config.status; exit 1' 1 3 15
X
Xif test -n "$prefix"; then
X  prsub="s,`5Eprefix`5B `09`5D*=.*$,prefix = $prefix,
Xs,`5Eexec_prefix`5B `09`5D*=.*$,exec_prefix = $exec_prefix,"
Xfi
X
Xfor file in Makefile; do
X  # Not all systems have dirname.
X  dir=`60echo $file`7Csed 's,/`5B`5E/`5D`5B`5E/`5D*$,,'`60
X  test "$dir" != "$file" && test ! -d $dir && mkdir $dir
X  echo creating $file
X  echo "# Generated automatically from `60basename $file`60.in by configure.
V" > $file
X  sed -e "
X$vpsub
X$srsub
Xs,@VPATH@,$VPATH,
X$prsub
Xs,@CC@,$CC,
Xs,@INSTALL@,$INSTALL,
Xs,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,
Xs,@INSTALL_DATA@,$INSTALL_DATA,
Xs,@ALLOCA@,$ALLOCA,
Xs,@DEFS@,$DEFS,
Xs,@LIBS@,$LIBS,
X" $srcdir/$`7Bfile`7D.in >> $file
Xecho "
X# Prevent GNU make v3 from overflowing arg limit on SysV.
X.NOEXPORT:" >> $file
Xdone
X
Xecho creating config.status
Xrm -f config.status
Xecho "#!/bin/sh
X# Generated automatically by configure.
X# Run this file to recreate the current configuration.
X$0 $*" > config.status
Xchmod +x config.status
X
$ CALL UNPACK [.GREP016]CONFIGURE.;1 1275746945
$ create 'f'
Xdnl Process this file with autoconf to produce a configure script.
XAC_INIT(grep.c)
XAC_PROG_GCC
XAC_PROG_INSTALL
XAC_STDC_HEADERS
XAC_USG
XAC_UNISTD_H
XAC_CHAR_UNSIGNED
XAC_ALLOCA
XAC_OUTPUT(Makefile)
$ CALL UNPACK [.GREP016]CONFIGURE.IN;1 320283171
$ create 'f'
X`09`09    GNU GENERAL PUBLIC LICENSE
X`09`09       Version 2, June 1991
X
X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
X                          675 Mass Ave, Cambridge, MA 02139, USA
X Everyone is permitted to copy and distribute verbatim copies
X of this license document, but changing it is not allowed.
X
X`09`09`09    Preamble
X
X  The licenses for most software are designed to take away your
Xfreedom to share and change it.  By contrast, the GNU General Public
XLicense is intended to guarantee your freedom to share and change free
Xsoftware--to make sure the software is free for all its users.  This
XGeneral Public License applies to most of the Free Software
XFoundation's software and to any other program whose authors commit to
Xusing it.  (Some other Free Software Foundation software is covered by
Xthe GNU Library General Public License instead.)  You can apply it to
Xyour programs, too.
X
X  When we speak of free software, we are referring to freedom, not
Xprice.  Our General Public Licenses are designed to make sure that you
Xhave the freedom to distribute copies of free software (and charge for
Xthis service if you wish), that you receive source code or can get it
Xif you want it, that you can change the software or use pieces of it
Xin new free programs; and that you know you can do these things.
X
X  To protect your rights, we need to make restrictions that forbid
Xanyone to deny you these rights or to ask you to surrender the rights.
XThese restrictions translate to certain responsibilities for you if you
Xdistribute copies of the software, or if you modify it.
X
X  For example, if you distribute copies of such a program, whether
Xgratis or for a fee, you must give the recipients all the rights that
Xyou have.  You must make sure that they, too, receive or can get the
Xsource code.  And you must show them these terms so they know their
Xrights.
X
X  We protect your rights with two steps: (1) copyright the software, and
X(2) offer you this license which gives you legal permission to copy,
Xdistribute and/or modify the software.
X
X  Also, for each author's protection and ours, we want to make certain
Xthat everyone understands that there is no warranty for this free
Xsoftware.  If the software is modified by someone else and passed on, we
Xwant its recipients to know that what they have is not the original, so
Xthat any problems introduced by others will not reflect on the original
Xauthors' reputations.
X
X  Finally, any free program is threatened constantly by software
Xpatents.  We wish to avoid the danger that redistributors of a free
Xprogram will individually obtain patent licenses, in effect making the
Xprogram proprietary.  To prevent this, we have made it clear that any
Xpatent must be licensed for everyone's free use or not licensed at all.
X
X  The precise terms and conditions for copying, distribution and
Xmodification follow.
X`0C
X`09`09    GNU GENERAL PUBLIC LICENSE
X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
X
X  0. This License applies to any program or other work which contains
Xa notice placed by the copyright holder saying it may be distributed
Xunder the terms of this General Public License.  The "Program", below,
Xrefers to any such program or work, and a "work based on the Program"
Xmeans either the Program or any derivative work under copyright law:
Xthat is to say, a work containing the Program or a portion of it,
Xeither verbatim or with modifications and/or translated into another
Xlanguage.  (Hereinafter, translation is included without limitation in
Xthe term "modification".)  Each licensee is addressed as "you".
X
XActivities other than copying, distribution and modification are not
Xcovered by this License; they are outside its scope.  The act of
Xrunning the Program is not restricted, and the output from the Program
Xis covered only if its contents constitute a work based on the
XProgram (independent of having been made by running the Program).
XWhether that is true depends on what the Program does.
X
X  1. You may copy and distribute verbatim copies of the Program's
Xsource code as you receive it, in any medium, provided that you
Xconspicuously and appropriately publish on each copy an appropriate
Xcopyright notice and disclaimer of warranty; keep intact all the
Xnotices that refer to this License and to the absence of any warranty;
Xand give any other recipients of the Program a copy of this License
Xalong with the Program.
X
XYou may charge a fee for the physical act of transferring a copy, and
Xyou may at your option offer warranty protection in exchange for a fee.
X
X  2. You may modify your copy or copies of the Program or any portion
Xof it, thus forming a work based on the Program, and copy and
Xdistribute such modifications or work under the terms of Section 1
Xabove, provided that you also meet all of these conditions:
X
X    a) You must cause the modified files to carry prominent notices
X    stating that you changed the files and the date of any change.
X
X    b) You must cause any work that you distribute or publish, that in
X    whole or in part contains or is derived from the Program or any
X    part thereof, to be licensed as a whole at no charge to all third
X    parties under the terms of this License.
X
X    c) If the modified program normally reads commands interactively
X    when run, you must cause it, when started running for such
X    interactive use in the most ordinary way, to print or display an
X    announcement including an appropriate copyright notice and a
X    notice that there is no warranty (or else, saying that you provide
X    a warranty) and that users may redistribute the program under
X    these conditions, and telling the user how to view a copy of this
X    License.  (Exception: if the Program itself is interactive but
X    does not normally print such an announcement, your work based on
X    the Program is not required to print an announcement.)
X`0C
XThese requirements apply to the modified work as a whole.  If
Xidentifiable sections of that work are not derived from the Program,
Xand can be reasonably considered independent and separate works in
Xthemselves, then this License, and its terms, do not apply to those
Xsections when you distribute them as separate works.  But when you
Xdistribute the same sections as part of a whole which is a work based
Xon the Program, the distribution of the whole must be on the terms of
Xthis License, whose permissions for other licensees extend to the
Xentire whole, and thus to each and every part regardless of who wrote it.
X
XThus, it is not the intent of this section to claim rights or contest
Xyour rights to work written entirely by you; rather, the intent is to
Xexercise the right to control the distribution of derivative or
Xcollective works based on the Program.
X
XIn addition, mere aggregation of another work not based on the Program
+-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
