[comp.binaries.ibm.pc.d] flex 2.1 SysV and DOS/OS-2 patches

seg@smsdpg.uu.net (Scott Garfinkle) (06/24/89)

I just got Vern Paxson's (vern@csam.lbl.gov) new version 2.1 of flex
(Fast Lex) from
comp.sources.unix.  Following are changes for MSDOS and SYS_V.  Sorry that
the change to flexdef.h isn't in patch form.  Please don't write to me for
the original code, though -- I will not be able to retrans it for you.

main.c:
85c85
< char action_file_name[] = "/tmp/flexXXXXXX";
---
> ar action_file_name[1024] = "/tmp/flexXXXXXX";
87c87
< char action_file_name[] = "flexXXXXXX.tmp";
---
> char action_file_name[1289] = "flexXXXXXX";
522a523,528
> #ifdef SYS_V
> 	{	char *ptr;
> 		if(ptr = tmpnam(NULL))
> 			strcpy(action_file_name,ptr);
> 	}
> #endif

This helps put temp files in some desirable place.

Also, you want to change the declaration of char *memset()
to put it inside "#ifndef SYS_V", as <string.h> declares memset
as void *memset().

The following are instructions for MSC 5.1 compilation (DOS, OS/2):
Sufficient compile flags are:
	CFLAGS=-ALu -F 8000 -Gt16000 -Ox -DMS_DOS -DSYS_V -D__RUNTIME_YYMAXDEPTH
	LINKFLAGS=/E /FAR /PAC /NOI

Where you may want to adjust -F up in order to increase available stack
size (though it may not be necessary) and you may want to increase -Gt
to some number that puts just enought of the big data items in their own
data segments.  (The default for -Gt is items of 32k.  This is too high for
flex.)  __RUNTIME_YYMAXDEPTH is useful if you have a parse.c that's
been generated by a yacc that understands how to do this; otherwise, it's a
no-op.