Commit 63fb6fc7 by Joseph Myers Committed by Joseph Myers

dostage2, [...]: Remove obsolete files.

	* dostage2, dostage3, listing, make-l2.com, makefile.vms,
	patch-apollo-includes, vmsconfig.com: Remove obsolete files.

From-SVN: r45661
parent c1d49704
2001-09-17 Joseph S. Myers <jsm28@cam.ac.uk>
* dostage2, dostage3, listing, make-l2.com, makefile.vms,
patch-apollo-includes, vmsconfig.com: Remove obsolete files.
2001-09-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2001-09-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-aux-info.c (affix_data_type): Use ASTRDUP in lieu of * c-aux-info.c (affix_data_type): Use ASTRDUP in lieu of
......
#!/bin/sh
make -k LANGUAGES=c $1 CC=stage1/xgcc XCFLAGS=-Bstage1/ CFLAGS="-g $2" >log2 2>&1
#!/bin/sh
make -k LANGUAGES=c $1 CC=stage2/xgcc XCFLAGS=-Bstage2/ CFLAGS="-g $2" >log3 2>&1
#!/bin/sh -f
# Generate a source code listing for C or C++ code with assembler code. The
# listing is always written to stdout.
# Author: Igor Metz <metz@iam.unibe.ch>
# Revision 1.4 94/08/26 13:58:27 coxs <coxs@dg-rtp.dg.com>
# lister now guesses how to should be configured. Added elf and coff support.
#
# Revision 1.3 89/12/18 13:58:27 metz
# lister must now be configured before it can be used. This is done in the
# /bin/sh part of the code.
#
#
# Revision 1.2 89/08/16 17:35:02 metz
# Support for SPARC added.
#
# Revision 1.1 89/08/16 16:49:22 metz
# Initial revision
#
# Requires: gawk (may be it works also with nawk)
# usage: lister filename [compiler-options]
# Method:
# compile the source with -g option to assembler code, then merge the
# generated assembler code with the source code. Compiler options
# can be supplied on the command line (for example -O)
# To install lister, assign one of the supported values to the variable MYSYS:
# mc68020 for Motorola 68020 (Sun-3, ..)
# mc68030 for Motorola 68030 (Sun-3, ..)
# sparc for SPARC (SUN-4, ..)
# i386 for i386 (Sun i386, ...)
# i386-gnu-linux for i386 (GNU/Linux, ...)
# Guess what kind of objects we are creating and thus what type of assembler
# symbols to look for
ex /tmp/$$.c <<END >/dev/null
a
main (){}
.
w
q
END
WD=`pwd`
cd /tmp
gcc -c $$.c
case "`file $$.o`" in
*ELF*) MYSYS=elf ;;
*COFF*|*BCS*) MYSYS=coff ;;
*mc68k*|*M68000*) MYSYS=mc68030 ;;
*SPARC*) MYSYS=sparc ;;
*386*) MYSYS=i386 ;;
esac
rm $$.c $$.o
cd $WD
# uncomment the line you need if the above guesses incorrectly:
# MYSYS=mc68020
# MYSYS=mc68030
# MYSYS=sparc
# MYSYS=i386
# MYSYS=i386-gnu-linux
# MYSYS=`mach` # this will work on Suns with SunOS > 4.0.0
# MYSYS=elf
# MYSYS=coff
WHOAMI=$0
if [ $# -gt 0 ] ; then
FILENAME=$1
shift
fi
exec gawk -v whoami=$WHOAMI -vsys=$MYSYS -voptions="$*" '
# commandline arguments:
# ARGV[0] = "gawk"
# ARGV[1] = processid
# ARGV[2] = filename
BEGIN {
if (ARGC != 3) {
usage()
exit 1
}
# Declaration of global variables
c_filename = ""
asm_filename = ""
cmdline = ""
asm_code = ""
c_code = ""
c_lineno = 0
oldlineno = 0
newlineno = 0
ignore_stabd = 0
num_of_fields = 0
# check processor architecture and set sourcecode line_hint accordingly
if (sys == "sparc" || sys == "i386") {
line_hint = "^[ \t]*\.stabn.*"
line_field = 3;
line_delimiter = ",";
line_offset = 0;
}
else if (sys == "mc68020" || sys == "mc68030" || sys == "i386-gnu-linux") {
line_hint = "^[ \t]*\.stabd.*"
line_field = 3;
line_delimiter = ",";
line_offset = 0;
}
else if (sys == "elf") {
line_hint = "section.*\.line"
line_field = 3;
line_delimiter = "\t";
line_offset = 0;
}
else if (sys == "coff") {
line_hint = "^[ \t]*ln"
line_field = 3;
line_delimiter = "\t";
}
else {
error("Processor type " sys " is not supported yet, sorry")
}
parse_cmdline()
printf("compiling %s to asm code\n", c_filename ) > "/dev/stderr"
if (system(cmdline) != 0 ) {
error("Compilation of " c_filename " failed")
}
printf("generating listing\n") > "/dev/stderr"
while ( getline asm_code < asm_filename > 0 ) {
if ( (ignore_stabd==0) && (asm_code ~ line_hint)) {
while ( sys == "elf" && (asm_code !~ "word" && asm_code !~ "byte") &&
getline asm_code < asm_filename > 0);
# source line hint found. Split the line into fields separated by commas.
# num_of_fields is 4 for sparc, 3 for m68k
num_of_fields = split(asm_code, fields, line_delimiter)
newlineno = fields[line_field] + line_offset;
if (newlineno > oldlineno) {
while ( newlineno > c_lineno && getline c_code < c_filename > 0) {
c_lineno++
printf("%4d %s\n", c_lineno, c_code)
}
oldlineno = newlineno
}
}
else if ( asm_code ~ ".*Ltext[ \t]*$" ) {
# filename hint found
if ( match(asm_code, c_filename)) {
ignore_stabd = 0
}
else {
ignore_stabd = 1
}
}
else if ( sys == "elf" && asm_code ~ "section.*\.debug" ) {
while ( asm_code !~ "^[ \t]*[.]*previous" &&
asm_code !~ "\.popsection" &&
getline asm_code < asm_filename > 0 );
if ( ! (getline asm_code < asm_filename > 0)) break;
}
else if ( sys == "coff" && asm_code ~ "^[ \t]*sdef" ) {
if ( asm_code ~ "\.bf" ) {
while ( asm_code !~ "^[ \t]*line" &&
getline asm_code < asm_filename > 0 ) {
num_of_fields = split(asm_code, fields, "\t")
line_offset = fields[line_field] - 1;
}
}
while ( asm_code !~ "^[ \t]*endef" &&
getline asm_code < asm_filename > 0 ) {
}
if ( ! (getline asm_code < asm_filename > 0)) break;
}
printf("\t\t\t%s\n", asm_code)
}
# general cleanup
system("/bin/rm " asm_filename)
}
function usage() {
printf("usage: %s filename compiler-options\n", whoami) > "/dev/stderr"
}
function error(s) {
printf("error: %s\n", s) > "/dev/stderr"
exit 1
}
function parse_cmdline( i) {
# construct filenames to use
asm_filename = "/tmp/lister" ARGV[1] ".s"
ARGV[1] = ""
c_filename = ARGV[2]
ARGV[2] = ""
# construct commandline to use
if ( match(c_filename, ".C") || match(c_filename, ".cc") ) {
cmdline = "g++"
}
else if (match(c_filename, ".c") || match(c_filename, ".i")) {
cmdline = "gcc"
}
else {
error("unknown extension for file " c_filename)
}
cmdline = cmdline " -g -S -o " asm_filename
# now we append the compiler options specified by the user
cmdline = cmdline " " options
# last but not least: the name of the file to compile
cmdline = cmdline " " c_filename
}
' $$ $FILENAME
$! make-l2.com -- VMS build procedure for libgcc2.
$
$! Change working directory to the location of this command procedure.
$ flnm = f$enviroment("PROCEDURE") !get current procedure name
$ set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
$!
$! Command file to build libgcc2.olb. You should only run this once you
$! have the current compiler installed, otherwise some of the builtins will
$! not be recognized. Once you have built libgcc2.olb, you can merge this
$! with gnu_cc:[000000]gcclib.olb
$!
$! All of the C source code is assumed to be in libgcc2.c, and a list of the
$! modules that we need from there is in libgcc2.list (which is generated
$! when vmsconfig.com is run). The C++ source is found in the [.cp.inc]
$! directory and managed via libgcc2-cxx.list.
$!
$ if f$search("gcc-cc1.exe").eqs.""
$ then
$ gcc_cc1:=$gnu_cc:[000000]gcc-cc1
$ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile
$ else
$ gcc_cc1:=$sys$disk:[]gcc-cc1
$ endif
$!
$ if f$search("gcc-cpp.exe").eqs.""
$ then
$ gcc_cpp:=$gnu_cc:[000000]gcc-cpp
$ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile
$ Version:='f$trnlnm("GNU_CC_VERSION")'
$ else
$ gcc_cpp:=$sys$disk:[]gcc-cpp
$ open ifile$ version.opt
$ read ifile$ line
$ close ifile$
$ Version=line - "ident=""" - """
$ endif
$!
$ if f$search("gcc-cc1plus.exe").eqs.""
$ then gcc_cxx = "$gnu_cc:[000000]gcc-cc1plus"
$ else gcc_cxx = "$sys$disk:[]gcc-cc1plus"
$ endif
$!
$gcc_as:=$gnu_cc:[000000]gcc-as
$cpp_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.cpp
$ s_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.s
$!
$set symbol/scope=(nolocal,noglobal)
$!
$lib/create libgcc2.olb
$on error then goto c_err
$on control_y then goto c_err
$
$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$
$open ifile$ libgcc2.list
$loop:
$!
$read ifile$ line/end=c_done
$i=0
$loop1:
$flnm=f$element(i," ",line)
$i=i+1
$if flnm.eqs."" then goto loop
$if flnm.eqs." " then goto loop
$!
$flnm = "L"+flnm
$if flnm.eqs."L_exit" then goto loop1
$write sys$output "$ gcc/debug/define=""''flnm'"" LIBGCC2.C"
$!
$objname = flnm
$if flnm.eqs."L_builtin_New" then objname = "L_builtin_nnew"
$!
$! We do this by hand, since the VMS compiler driver does not have a way
$! of specifying an alternate location for the compiler executables.
$!
$ if arch .eqs. "alpha"
$ then
$ gcc_cpp "-D__IEEE_FLOAT" "-I[]" "-I[.config]" "-I[.ginclude]" "-D''flnm'" libgcc2.c 'cpp_file'
$ gcc_cc1 'cpp_file' -dumpbase 'objname' -
-quiet -mgas "-O1" -mfloat-ieee -o 's_file'
$ else
$ gcc_cpp "-I[]" "-I[.config]" "-I[.ginclude]" "-D''flnm'" libgcc2.c 'cpp_file'
$ gcc_cc1 'cpp_file' -dumpbase 'objname' -
-quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file'
$ endif
$ delete/nolog 'cpp_file';
$ gcc_as 's_file' -o 'objname'.OBJ
$ if arch .eqs. "vax"
$ then
$! Assemble again, preserving lowercase symbol names this time.
$ gcc_as -h3 's_file' -o 'objname'-c.OBJ
$ library libgcc2.olb 'objname'.obj,'objname'-c.obj
$ delete/nolog 'objname'.obj;,'objname'-c.obj;
$ else
$ library libgcc2.olb 'objname'.obj
$ delete/nolog 'objname'.obj;
$ endif
$ delete/nolog 's_file';
$!
$!
$goto loop1
$!
$! In case of error or abort, go here (In order to close file).
$!
$c_err: !'f$verify(0)
$close ifile$
$ exit %x2c
$!
$c_done:
$close ifile$
$
$
$ EXIT
$ !gcc-2.8.0: C++ libgcc2 code disabled since it's not adequately tested
$
$!
$ p1 = p1+" "+p2+" "+p3+" "+p4+" "+p5+" "+p6+" "+p7+" "+p8
$ p1 = " " + f$edit(p1,"COMPRESS,TRIM,UPCASE") + " "
$! (note: substring locations can only be equal when neither string is present)
$ if f$locate(" CC1PLUS ",p1).eq.f$locate(" CXX ",p1) then goto cxx_done
$ if f$search("libgcc2-cxx.list").eqs."" then goto cxx_done
$!
$ open/read ifile$ libgcc2-cxx.list
$cxx_line_loop:
$ read ifile$ line/end=cxx_done
$ i = 0
$cxx_file_loop:
$ flnm = f$element(i,",",line)
$ i = i + 1
$ if flnm.eqs."" .or. flnm.eqs."," then goto cxx_line_loop
$ write sys$output "$ gcc/plus/debug ''flnm'.cc"
$ objname = flnm
$!
$ gcc_cpp -+ "-I[]" "-I[.ginclude]" "-I[.cp.inc]" [.cp]'flnm'.cc 'cpp_file'
$ gcc_cxx 'cpp_file' -dumpbase 'objname' -fexceptions -
-quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file'
$ delete/nolog 'cpp_file';
$ gcc_as "-vGNU CC V''Version'" 's_file' -o 'objname'.OBJ
$! Assemble again, preserving lowercase symbol names this time.
$ gcc_as "-vGNU CC V''Version'" -h3 's_file' -o 'objname'-c.OBJ
$ delete/nolog 's_file';
$
$ library libgcc2.olb 'objname'.obj,'objname'-c.obj
$ delete/nolog 'objname'.obj;,'objname'-c.obj;
$!
$ goto cxx_file_loop
$!
$cxx_done:
$ close ifile$
$ exit
#!/bin/sh
# patch-apollo-includes -- fix some (but not all!) Apollo brain damage.
FILES_TO_PATCH='sys/types.h setjmp.h'
mkdir sys
for i in $FILES_TO_PATCH;
do
cp /bsd4.3/usr/include/$i ./$i
done
patch -b -apollo <<'EOP'
*** /bsd4.3/usr/include/sys/types.h Fri Apr 8 20:29:06 1988
--- sys/types.h Wed Feb 26 21:17:57 1992
***************
*** 38,44 ****
--- 38,47 ----
typedef char * caddr_t;
typedef u_long ino_t;
typedef long swblk_t;
+ #ifndef _SIZE_T
+ #define _SIZE_T
typedef long size_t;
+ #endif
typedef long time_t;
typedef long dev_t;
typedef long off_t;
*** /bsd4.3/usr/include/setjmp.h Fri Feb 3 21:40:21 1989
--- setjmp.h Sun Feb 23 19:06:55 1992
***************
*** 24,30 ****
--- 24,39 ----
#endif
+ #ifdef __GNUC__
#ifdef _PROTOTYPES
+ extern int sigsetjmp (sigjmp_buf env, int savemask);
+ extern void siglongjmp (sigjmp_buf env, int val);
+ #else
+ extern int sigsetjmp();
+ extern void siglongjmp();
+ #endif /* _PROTOTYPES */
+ #else /* not __GNUC__ */
+ #ifdef _PROTOTYPES
extern int sigsetjmp(
sigjmp_buf env,
int savemask
***************
*** 37,43 ****
extern int sigsetjmp() #options(abnormal);
extern void siglongjmp() #options(noreturn);
#endif /* _PROTOTYPES */
!
#undef _PROTOTYPES
#ifdef __cplusplus
--- 46,52 ----
extern int sigsetjmp() #options(abnormal);
extern void siglongjmp() #options(noreturn);
#endif /* _PROTOTYPES */
! #endif /* not __GNUC__ */
#undef _PROTOTYPES
#ifdef __cplusplus
EOP
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment