1992-02-12 12:50:48 -05:00
|
|
|
$! Set the def dir to proper place for use in batch. Works for interactive too.
|
|
|
|
$flnm = f$enviroment("PROCEDURE") ! get current procedure name
|
|
|
|
$set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
|
|
|
|
$!
|
|
|
|
$! Build the GNU "C" pre-processor on VMS
|
|
|
|
$!
|
1992-08-21 02:26:49 -04:00
|
|
|
$! Note: to build with DEC's VAX C compiler, uncomment the 2nd CC, CFLAGS,
|
|
|
|
$! and LIBS alternatives, and also execute the following command:
|
|
|
|
$! DEFINE SYS SYS$LIBRARY:
|
1992-02-12 12:50:48 -05:00
|
|
|
$
|
|
|
|
$!
|
|
|
|
$! C compiler
|
|
|
|
$!
|
1994-07-11 15:16:22 -04:00
|
|
|
$ CC = "gcc"
|
|
|
|
$! CC = "cc" !uncomment for VAXC
|
|
|
|
$ BISON = "bison"
|
|
|
|
$ RENAME= "rename/New_Version"
|
|
|
|
$ LINK = "link"
|
|
|
|
$ echo = "write sys$output"
|
1992-02-12 12:50:48 -05:00
|
|
|
$!
|
|
|
|
$! Compiler options
|
|
|
|
$!
|
1994-07-11 15:16:22 -04:00
|
|
|
$ CFLAGS = "/Debug/noVerbos"
|
|
|
|
$! CFLAGS = "/noOpt" !uncomment for VAXC
|
1992-02-12 12:50:48 -05:00
|
|
|
$!
|
|
|
|
$! Link options
|
|
|
|
$!
|
1994-07-11 15:16:22 -04:00
|
|
|
$ LDFLAGS = "/noMap"
|
1992-02-12 12:50:48 -05:00
|
|
|
$!
|
|
|
|
$! Link libraries
|
|
|
|
$!
|
1994-07-11 15:16:22 -04:00
|
|
|
$ LIBS = "gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr"
|
|
|
|
$! LIBS = "alloca.obj,sys$library:vaxcrtl.olb/Libr" !uncomment for VAXC
|
|
|
|
$
|
|
|
|
$!!!!!!!
|
|
|
|
$! Nothing beyond this point should need any local configuration changes.
|
|
|
|
$!!!!!!!
|
1992-08-21 02:26:49 -04:00
|
|
|
$
|
1992-02-12 12:50:48 -05:00
|
|
|
$ if "''p1'" .eqs. "LINK" then goto Link
|
1994-07-11 15:16:22 -04:00
|
|
|
$ echo " Building the preprocessor."
|
|
|
|
$ set verify
|
|
|
|
$ 'CC''CFLAGS' cccp.c
|
|
|
|
$!'f$verify(0)
|
1992-02-12 12:50:48 -05:00
|
|
|
$ t1:='f$search("CEXP.C")'
|
|
|
|
$ if "''t1'" .eqs. "" then goto 10$
|
|
|
|
$ t1:='f$file_attributes("CEXP.Y","RDT")'
|
|
|
|
$ t1:='f$cvtime(t1)'
|
|
|
|
$ t2:='f$file_attributes("CEXP.C","RDT")'
|
|
|
|
$ t2:='f$cvtime(t2)'
|
|
|
|
$ if t1 .les. t2 then goto 20$
|
1994-07-11 15:16:22 -04:00
|
|
|
$10$:
|
|
|
|
$ set verify
|
|
|
|
$ 'BISON' cexp.y
|
|
|
|
$ 'RENAME' cexp_tab.c cexp.c
|
|
|
|
$!'f$verify(0)
|
|
|
|
$20$:
|
|
|
|
$!
|
|
|
|
$ if f$locate("alloca.obj",f$edit(LIBS,"lowercase")).lt.f$length(LIBS)
|
|
|
|
$ then
|
|
|
|
$ set verify
|
|
|
|
$ 'CC''CFLAGS'/Define="STACK_DIRECTION=(-1)" alloca.c !#'f$verify(1)
|
|
|
|
$!'f$verify(0)
|
|
|
|
$ endif
|
|
|
|
$!
|
|
|
|
$ echo " (Ignore any warning about not finding file ""bison.simple"".)"
|
|
|
|
$ set verify
|
|
|
|
$ 'CC''CFLAGS' cexp.c
|
|
|
|
$ 'CC''CFLAGS' version.c
|
|
|
|
$!'f$verify(0)
|
|
|
|
$Link:
|
|
|
|
$ echo " Linking the preprocessor."
|
|
|
|
$ set verify
|
|
|
|
$ 'LINK''LDFLAGS'/Exe=gcc-cpp.exe cccp.obj,cexp.obj,version.obj,version.opt/Opt,-
|
|
|
|
'LIBS'
|
|
|
|
$!'f$verify(0)
|
1992-02-12 12:50:48 -05:00
|
|
|
$!
|
|
|
|
$! Done
|
|
|
|
$!
|
|
|
|
$ exit
|