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")'
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
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).
14 $if f$search("gcc-cc1.exe").eqs.""
16 $ gcc_cc1:=$gnu_cc:[000000]gcc-cc1
17 $ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile
19 $ gcc_cc1:=$sys$disk:[]gcc-cc1
22 $if f$search("gcc-cpp.exe").eqs.""
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")'
28 $ gcc_cpp:=$sys$disk:[]gcc-cpp
29 $ open ifile$ version.opt
32 $ Version=line-"ident="""-"""
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
39 $set symbol/scope=(nolocal,noglobal)
44 $write sys$error "You must have gcc version 2 in order to build libgcc2."
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
56 $flnm=f$element(i," ",line)
58 $if flnm.eqs."" then goto loop
59 $if flnm.eqs." " then goto loop
62 $if flnm.eqs."L_exit" then goto loop1
63 $write sys$output "$ gcc/debug/define=""''flnm'"" LIBGCC2.C"
66 $if flnm.eqs."L_builtin_New" then objname = "L_builtin_nnew"
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.
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';
80 $ library libgcc2.olb 'objname'.obj,'objname'-c.obj
81 $ delete/nolog 'objname'.obj;,'objname'-c.obj;
87 $! In case of error or abort, go here (In order to close file).