[8833] | 1 | $! Set the def dir to proper place for use in batch. Works for interactive too. |
---|
| 2 | $flnm = f$enviroment("PROCEDURE") ! get current procedure name |
---|
| 3 | $set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")' |
---|
| 4 | $! |
---|
| 5 | $! Command file to build libgcc2.olb. You should only run this once you |
---|
| 6 | $! have the current compiler installed, otherwise some of the builtins will |
---|
| 7 | $! not be recognized. Once you have built libgcc2.olb, you can merge this |
---|
| 8 | $! with gnu_cc:[000000]gcclib.olb |
---|
| 9 | $! |
---|
| 10 | $! All of the source code is assumed to be in libgcc2.c, and a list of the |
---|
| 11 | $! modules that we need from there is in libgcc2.list (which is generated |
---|
| 12 | $! when config-gcc.com is run). |
---|
| 13 | $! |
---|
| 14 | $if f$search("gcc-cc1.exe").eqs."" |
---|
| 15 | $ then |
---|
| 16 | $ gcc_cc1:=$gnu_cc:[000000]gcc-cc1 |
---|
| 17 | $ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile |
---|
| 18 | $ else |
---|
| 19 | $ gcc_cc1:=$sys$disk:[]gcc-cc1 |
---|
| 20 | $ endif |
---|
| 21 | $! |
---|
| 22 | $if f$search("gcc-cpp.exe").eqs."" |
---|
| 23 | $ then |
---|
| 24 | $ gcc_cpp:=$gnu_cc:[000000]gcc-cpp |
---|
| 25 | $ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile |
---|
| 26 | $ Version:='f$trnlnm("GNU_CC_VERSION")' |
---|
| 27 | $ else |
---|
| 28 | $ gcc_cpp:=$sys$disk:[]gcc-cpp |
---|
| 29 | $ open ifile$ version.opt |
---|
| 30 | $ read ifile$ line |
---|
| 31 | $ close ifile$ |
---|
| 32 | $ Version=line-"ident="""-""" |
---|
| 33 | $ endif |
---|
| 34 | $! |
---|
| 35 | $gcc_as:=$gnu_cc:[000000]gcc-as |
---|
| 36 | $cpp_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.cpp |
---|
| 37 | $s_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.s |
---|
| 38 | $! |
---|
| 39 | $set symbol/scope=(nolocal,noglobal) |
---|
| 40 | $! |
---|
| 41 | $goto compile |
---|
| 42 | $! |
---|
| 43 | $nocompile: |
---|
| 44 | $write sys$error "You must have gcc version 2 in order to build libgcc2." |
---|
| 45 | $exit 0 |
---|
| 46 | $! |
---|
| 47 | $compile: |
---|
| 48 | $lib/create libgcc2.olb |
---|
| 49 | $on error then goto c_err |
---|
| 50 | $on control_y then goto c_err |
---|
| 51 | $open ifile$ libgcc2.list |
---|
| 52 | $loop: read ifile$ line/end=c_done |
---|
| 53 | $! |
---|
| 54 | $i=0 |
---|
| 55 | $loop1: |
---|
| 56 | $flnm=f$element(i," ",line) |
---|
| 57 | $i=i+1 |
---|
| 58 | $if flnm.eqs."" then goto loop |
---|
| 59 | $if flnm.eqs." " then goto loop |
---|
| 60 | $! |
---|
| 61 | $flnm = "L"+flnm |
---|
| 62 | $if flnm.eqs."L_exit" then goto loop1 |
---|
| 63 | $write sys$output "$ gcc/debug/define=""''flnm'"" LIBGCC2.C" |
---|
| 64 | $! |
---|
| 65 | $objname = flnm |
---|
| 66 | $if flnm.eqs."L_builtin_New" then objname = "L_builtin_nnew" |
---|
| 67 | $! |
---|
| 68 | $! We do this by hand, since the VMS compiler driver does not have a way |
---|
| 69 | $! of specifying an alternate location for the compiler executables. |
---|
| 70 | $! |
---|
| 71 | $ gcc_cpp "-I[]" "-I[.ginclude]" "-D''flnm'" libgcc2.c 'cpp_file' |
---|
| 72 | $ gcc_cc1 'cpp_file' -dumpbase 'objname' - |
---|
| 73 | -quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file' |
---|
| 74 | $ delete/nolog 'cpp_file'; |
---|
| 75 | $ gcc_as "-vGNU CC V''Version'" 's_file' -o 'objname'.OBJ |
---|
| 76 | $! Assemble again, preserving lowercase symbol names this time. |
---|
| 77 | $ gcc_as "-vGNU CC V''Version'" -h3 's_file' -o 'objname'-c.OBJ |
---|
| 78 | $ delete/nolog 's_file'; |
---|
| 79 | $! |
---|
| 80 | $ library libgcc2.olb 'objname'.obj,'objname'-c.obj |
---|
| 81 | $ delete/nolog 'objname'.obj;,'objname'-c.obj; |
---|
| 82 | $! |
---|
| 83 | $goto loop1 |
---|
| 84 | $! |
---|
| 85 | $goto loop |
---|
| 86 | $! |
---|
| 87 | $! In case of error or abort, go here (In order to close file). |
---|
| 88 | $! |
---|
| 89 | $c_err: !'f$verify(0) |
---|
| 90 | $close ifile$ |
---|
| 91 | $ exit %x2c |
---|
| 92 | $! |
---|
| 93 | $c_done: |
---|
| 94 | $close ifile$ |
---|