diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 2641703e..737e5040 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -4,7 +4,7 @@ MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *) 2002-08-20 jt: NewStr: txtpos remains 0 for structs read from symbol file *) -IMPORT OPS, OPM, SYSTEM; +IMPORT OPS, OPM, SYSTEM, Configuration; (* Constants - value of literals *) @@ -1310,6 +1310,13 @@ END Import; obj^.mode := Con; obj^.typ := booltyp; obj^.conval^.intval := value END EnterBoolConst; + PROCEDURE EnterIntConst(name: OPS.Name; value: LONGINT); + VAR obj: Object; + BEGIN + Insert(name, obj); obj^.conval := NewConst(); + obj^.mode := Con; obj^.typ := int32typ; obj^.conval^.intval := value; + END EntarIntConst; + PROCEDURE EnterTyp(name: OPS.Name; form: SHORTINT; size: INTEGER; VAR res: Struct); VAR obj: Object; typ: Struct; BEGIN @@ -1367,6 +1374,9 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + (* POSIX systems normally support PATH_MAX *) + EnterIntConst("MAXPATHLEN", Configuration.MaxPathLen); + EnterIntConst("MAXFILENAMELENGTH", Configuration.MaxFnLen); syslink := topScope^.right; universe := topScope; topScope^.right := NIL; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index f82a5d37..df6c6204 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -30,6 +30,7 @@ #include #include #include +#include // for enabling PATH_MAX ... void fail(char *msg) {fprintf(stderr, "Error: %s\n", msg); exit(1);} @@ -42,8 +43,8 @@ char builddate[256]; char installdir[256]; char versionstring[256]; char osrelease[1024]; -char cwd[1024]; -char libspec[1024]; +char cwd[PATH_MAX]; +char libspec[PATH_MAX*8]; #define macrotostringhelper(s) #s #define macrotostring(s) macrotostringhelper(s) @@ -401,6 +402,8 @@ void writeConfigurationMod() { fprintf(fd, " compile* = '%s';\n", cc); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); + fprintf(fd, " MaxPathLen* = %d;\n", PATH_MAX); + fprintf(fd " MaxFnLen* = %d;\n", NAME_MAX); fprintf(fd, "VAR\n"); fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", (int)strnlen(versionstring, 100)+1); fprintf(fd, "BEGIN\n");