📄 make-cc1.com
字号:
$v='f$verify(0) !make-cc1.com$!$! Build the GNU C compiler on VMS.$!$! Usage:$! $ @make-cc1.com [host-compiler] [various]$!$! where [host-compiler] is one of "GNUC", "VAXC", "DECC";$! default when none specified is "GNUC",$! and where [various] is one or more of "CC1", "CC1PLUS",$! "CC1OBJ", "OBJCLIB", "INDEPENDENT", "BC", "ALL", "LINK", "DEBUG".$! "CC1" (C compiler) is the default; of the others, only$! "CC1PLUS" (C++ compiler), "CC1OBJ" (Objective-C compiler),$! and "OBJCLIB" (Objective-C run-time library) are of interest$! for normal installation.$! If both [host-compiler] and other option(s) are specified,$! the host compiler argument must come first.$!$ if f$type(gcc_debug).eqs."INTEGER" then if gcc_debug.and.1 then set verify$$ p1 = f$edit(p1,"UPCASE,TRIM")$ if p1.eqs."" then p1 = "GNUC"$!$! Compiler-specific setup (assume GNU C, then override as necessary):$!$ CC = "gcc"$ CFLAGS = "/Opt=2/Debug/noVerbos/CC1=""-mpcc-alignment"""$ LIBS = "gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr"$ if p1.eqs."GNUC"$ then$ p1 = ""$ else$ CC = "cc"$ CFLAGS = "/noOpt" !disable optimizer when bootstrapping with native cc$ if p2.eqs."DEBUG" .or. p3.eqs."DEBUG" then CFLAGS = CFLAGS + "/Debug"$ if p1.eqs."VAXC"$ then$ p1 = ""$ if f$trnlnm("DECC$CC_DEFAULT").nes."" then CC = "cc/VAXC"$ LIBS = "alloca.obj,sys$library:vaxcrtl.olb/Libr"$ define/noLog SYS SYS$LIBRARY:$ else$ if p1.eqs."DECC"$ then$ p1 = ""$ if f$trnlnm("DECC$CC_DEFAULT").nes."" then CC = "cc/DECC"$ CC = CC + "/Prefix=All/Warn=Disabl=(ImplicitFunc)"$ LIBS = "alloca.obj" !DECC$SHR will be found implicitly by linker$ define/noLog SYS DECC$LIBRARY_INCLUDE:$ endif !DECC$ endif !VAXC$ endif !GNUC$$!$! Other setup:$!$ LDFLAGS = "/noMap"$ PARSER = "bison"$ PARSER_FLAGS= "/Define/Verbose"$ RENAME = "rename/New_Version"$ LINK = "link"$ EDIT = "edit"$ SEARCH = "search"$ ABORT = "exit %x002C"$ echo = "write sys$output"$!$! Stage[123] options$!$ CINCL1 = "/Incl=[]" !stage 1 -I flags$ CINCL2 = "/Incl=([],[.ginclude])" !stage 2,3,... flags$ CINCL_SUB = "/Incl=([],[-],[-.ginclude])" ![.cp] flags$$!!!!!!!$! Nothing beyond this point should need any local configuration changes.$!!!!!!!$$! Set the default directory to the same place as this command procedure.$ flnm = f$enviroment("PROCEDURE") !get current procedure name$ set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'$$!$! First we figure out what needs to be done. This is sort of like a limited$! make facility - the command line options specify exactly what components$! we want to build. The following options are understood:$!$! LINK: Assume that the object modules for the selected compiler(s)$! have already been compiled, perform link phase only.$!$! CC1: Compile and link "C" compiler.$!$! CC1PLUS:Compile and link "C++" compiler.$!$! CC1OBJ: Compile and link objective C compiler.$!$! ALL: Compile and link all of the CC1 passes.$!$! INDEPENDENT:$! Compile language independent source modules. (On by default).$!$! BC:$! Compile byte compiler source modules. (On by default).$!$! OBJCLIB:$! Compile Objective-C run-time library.$!$! DEBUG: Link images with /debug.$!$! If you want to list more than one option, you should use a spaces to$! separate them.$!$! Any one of the above options can be prefaced with a "NO". For example,$! if you had already built GCC, and you wanted to build G++, you could use the$! "CC1PLUS NOINDEPENDENT" options, which would only compile the C++ language$! specific source files, and then link the C++ compiler.$!$! If you do not specify which compiler you want to build, it is assumed that$! you want to build GNU-C ("CC1").$!$! Now figure out what we have been requested to do.$p1 = p1+" "+p2+" "+p3+" "+p4+" "+p5+" "+p6+" "+p7+" "+p8$p1 = f$edit(p1,"COMPRESS,TRIM")$i=0$DO_ALL = 0$DO_LINK = 0$DO_DEBUG = 0$DO_CC1PLUS = 0$DO_CC1OBJ = 0$DO_OBJCLIB = 0$if f$trnlnm("cfile$").nes."" then close/noLog cfile$$open cfile$ compilers.list$cinit:read cfile$ compilername/end=cinit_done$DO_'compilername'=0$goto cinit$cinit_done: close cfile$$DO_INDEPENDENT = 1$DO_DEFAULT = 1$DO_BC = 1$loop:$string = f$element(i," ",p1)$if string.eqs." " then goto done$flag = 1$if string.eqs."CC1PLUS" then DO_DEFAULT = 0$if string.eqs."CC1OBJ" then DO_DEFAULT = 0$if string.eqs."OBJCLIB"$then DO_DEFAULT = 0$ DO_INDEPENDENT = DO_CC1OBJ$ DO_BC = DO_CC1OBJ$endif$if f$extract(0,2,string).nes."NO" then goto parse_option$ string=f$extract(2,f$length(string)-2,string)$ flag = 0$parse_option:$DO_'string' = flag$i=i+1$goto loop$!$done:$if DO_DEFAULT.eq.1 then DO_CC1 = 1$echo "This command file will now perform the following actions:$if DO_LINK.eq.1 then goto link_only$if DO_ALL.eq.1 then echo " Compile all language specific object modules."$if DO_CC1.eq.1 then echo " Compile C specific object modules."$if DO_CC1PLUS.eq.1 then echo " Compile C++ specific object modules."$if DO_CC1OBJ.eq.1 then echo " Compile obj-C specific object modules."$if DO_INDEPENDENT.eq.1 then echo " Compile language independent object modules."$if DO_BC.eq.1 then echo " Compile byte compiler object modules."$if DO_OBJCLIB.eq.1 then echo " Create Objective-C run-time library."$link_only:$if DO_CC1.eq.1 then echo " Link C compiler (gcc-cc1.exe)."$if DO_CC1PLUS.eq.1 then echo " Link C++ compiler (gcc-cc1plus.exe)."$if DO_CC1OBJ.eq.1 then echo " Link objective-C compiler (gcc-cc1obj.exe)."$if DO_DEBUG.eq.1 then echo " Link images to run under debugger."$!$! Update CFLAGS with appropriate CINCLx value.$!$if f$edit(f$extract(0,3,CC),"LOWERCASE").nes."gcc" then goto stage1$if f$search("gcc-cc1.exe").eqs."" then goto stage1$if f$file_attr("gnu_cc:[000000]gcc-cc1.exe","FID").nes.- f$file_attr("gcc-cc1.exe","FID") then goto stage1$ CFLAGS = CFLAGS + CINCL2$ goto cinclX$stage1:$ CFLAGS = CFLAGS + CINCL1$cinclX:$!$! Test and see if we need these messages or not. The -1 switch gives it away.$!$gas := $gnu_cc:[000000]gcc-as.exe$if f$search(gas-"$").eqs."" then goto gas_missing_message !must be VAXC$define/user sys$error sys$scratch:gas_test.tmp$gas -1 nla0: -o nla0:$size=f$file_attributes("sys$scratch:gas_test.tmp","ALQ")$delete/nolog sys$scratch:gas_test.tmp;*$if size.eq.0 then goto skip_gas_message$type sys$input: !an old version of gas was found----- Note: you appear to have an old version of gas, the GNU assembler.GCC 2.x treats external variables differently than GCC 1.x does. Beforeyou use GCC 2.x, you should obtain a version of the assembler which workswith GCC 2.x (gas-1.38 and earlier did not have the necessary support;gas-2.0 through gas-2.3 did not work reliably for vax/vms configuration).The assembler in gcc-vms-1.42 contained patches to provide the propersupport, and more recent versions have an up to date version of gas whichprovides the support. gas from binutils-2.5 or later is recommended. If you do not update the assembler, the compiler will still work,but `extern const' variables will be treated as `extern'. This will resultin linker warning messages about mismatched psect attributes, and thesevariables will be placed in read/write storage.-----$goto skip_gas_message$gas_missing_message:$type sys$input: !no version of gas was found----- Note: you appear to be missing gas, the GNU assembler. SinceGCC produces assembly code as output from compilation, you need theassembler to make full use of the compiler. It should be put in placeas GNU_CC:[000000]GCC-AS.EXE. A prebuilt copy of gas is available from the "gcc-vms" distribution,and the gas source code is included in the GNU "binutils" distribution.Version 2.5.2 or later is recommended.-----$skip_gas_message:$!$!$ if DO_DEBUG.eq.1 then LDFLAGS = LDFLAGS + "/Debug"$!$if DO_LINK.eq.1 then goto no_yfiles !compile_cc1$!$! Build alloca if necessary (in 'LIBS for use with VAXC)$!$ if f$locate("alloca.obj",f$edit(LIBS,"lowercase")).ge.f$length(LIBS) then - goto skip_alloca$ if f$search("alloca.obj").nes."" then - !does .obj exist? is it up to date? if f$cvtime(f$file_attributes("alloca.obj","RDT")).gts.- f$cvtime(f$file_attributes("alloca.c","RDT")) then goto skip_alloca$set verify$ 'CC''CFLAGS'/Defi=("HAVE_CONFIG_H","STACK_DIRECTION=(-1)") alloca.c$!'f$verify(0)$skip_alloca:$!$if DO_BC.eq.1$ then$ call compile bi_all.opt ""$ if f$trnlnm("ifile$").nes."" then close/noLog ifile$$ open ifile$ bc_all.list$ read ifile$ bc_line$ close ifile$$ bc_index = 0$bc_loop:$ tfile = f$element(bc_index, ",", bc_line)$ if tfile.eqs."," then goto bc_done$ call bc_generate 'tfile' "bi_all.opt/opt,"$ bc_index = bc_index + 1$ goto bc_loop$bc_done:$ endif$!$!$if DO_INDEPENDENT.eq.1$ then$!$! First build a couple of header files from the machine description$! These are used by many of the source modules, so we build them now.$!$set verify$ 'CC''CFLAGS' rtl.c$ 'CC''CFLAGS' obstack.c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -