1 $v='f$verify(0) !make-cccp.com
3 $! Build the GNU C preprocessor on VMS.
6 $! $ @make-cccp.com [compiler] [link-only]
8 $! where [compiler] is one of "GNUC", "VAXC", "DECC";
9 $! default when none specified is "GNUC",
10 $! and where [link-only] is "LINK" or omitted.
11 $! If both options are specified, the compiler must come first.
13 $ if f$type(gcc_debug).eqs."INTEGER" then if gcc_debug.and.1 then set verify
15 $ p1 = f$edit(p1,"UPCASE,TRIM")
16 $ if p1.eqs."" then p1 = "GNUC"
18 $! Compiler-specific setup (assume GNU C, then override as necessary):
21 $ CFLAGS = "/Debug/noVerbos"
22 $ LIBS = "gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr"
26 $ CFLAGS = "/noOpt" !disable optimizer when bootstrapping with native cc
29 $ if f$trnlnm("DECC$CC_DEFAULT").nes."" then CC = "cc/VAXC"
30 $ LIBS = "alloca.obj,sys$library:vaxcrtl.olb/Libr"
31 $ define/noLog SYS SYS$LIBRARY:
35 $ if f$trnlnm("DECC$CC_DEFAULT").nes."" then CC = "cc/DECC"
36 $ LIBS = "alloca.obj" !DECC$SHR will be found implicitly by linker
37 $ define/noLog SYS DECC$LIBRARY_INCLUDE:
41 $ type sys$input: /Output=sys$error:
43 [compiler] argument should be one of "GNUC", "VAXC", or "DECC".
46 $ @make-cccp.com [compiler] [link-only]
49 $ exit %x1000002C + 0*f$verify(v) !%SYSTEM-F-ABORT
60 $ RENAME = "rename/New_Version"
62 $ echo = "write sys$output"
65 $! Nothing beyond this point should need any local configuration changes.
68 $! Set the default directory to the same place as this command procedure.
69 $ flnm = f$enviroment("PROCEDURE") !get current procedure name
70 $ set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
72 $ if p1.eqs."LINK" .or. p2.eqs."LINK" then goto Link
73 $ echo " Building the preprocessor."
75 $! Compile the simplest file first, to catch problem with compiler setup early.
77 $ 'CC''CFLAGS' version.c
84 $! Compile preprocessor's parser, possibly making it with yacc first.
85 $ if f$search("CEXP.C").nes."" then -
86 if f$cvtime(f$file_attributes("CEXP.C","RDT")).ges.-
87 f$cvtime(f$file_attributes("CEXP.Y","RDT")) then goto skip_yacc
90 $ 'RENAME' cexp_tab.c cexp.c
93 $ echo " (Ignore any warning about not finding file ""bison.simple"".)"
98 $! In case there's no builtin alloca support, use the C simulation.
99 $ if f$locate("alloca.obj",f$edit(LIBS,"lowercase")).lt.f$length(LIBS)
102 $ 'CC''CFLAGS'/Incl=[]/Defi=("HAVE_CONFIG_H","STACK_DIRECTION=(-1)") alloca.c
108 $ echo " Linking the preprocessor."
110 $ 'LINK''LDFLAGS'/Exe=gcc-cpp.exe -
111 cccp.obj,cexp.obj,version.obj,version.opt/Opt,-
117 $ exit 1+0*f$verify(v)