--- gcc/listing 2018/04/24 17:55:52 1.1.1.2 +++ gcc/listing 2018/04/24 18:10:58 1.1.1.3 @@ -29,22 +29,26 @@ # mc68030 for Motorola 68030 (Sun-3, ..) # sparc for SPARC (SUN-4, ..) # i386 for i386 (Sun i386, ...) +# i386-linux for i386 (Linux, ...) # uncomment the line you need: # MYSYS=mc68020 # MYSYS=mc68030 # MYSYS=sparc # MYSYS=i386 +# MYSYS=i386-linux # MYSYS=`mach` # this will work on Suns with SunOS > 4.0.0 -exec gawk -vsys=$MYSYS ' +FILENAME=$1 +shift + +exec gawk -vsys=$MYSYS -voptions="$*" ' # commandline arguments: # ARGV[0] = "gawk" # ARGV[1] = processid # ARGV[2] = filename -# ARGV[3] .. ARGV[ARGC-1] = compiler options BEGIN { - if (ARGC < 3) { + if (ARGC != 3) { usage() exit 1 } @@ -65,7 +69,7 @@ BEGIN { if (sys == "sparc" || sys == "i386") { line_hint = "^[ \t]*\.stabn.*" } - else if (sys == "mc68020" || sys == "mc68030") { + else if (sys == "mc68020" || sys == "mc68030" || sys == "i386-linux") { line_hint = "^[ \t]*\.stabd.*" } else { @@ -145,13 +149,11 @@ function parse_cmdline( i) { cmdline = cmdline " -g -S -o " asm_filename # now we append the compiler options specified by the user - for (i = 3; i < ARGC; i++) { - cmdline = cmdline " " ARGV[i] - ARGV[i] = "" # we do not want to treat it as an inputfile - } + cmdline = cmdline " " options # last but not least: the name of the file to compile cmdline = cmdline " " c_filename } -' $$ $* +' $$ $FILENAME +