diff options
author | H. Peter Anvin <hpa@zytor.com> | 2005-03-07 19:55:33 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2005-03-07 19:55:33 +0000 |
commit | 1a955fa30b5ee0b8dcc47ed4741a04fafc147699 (patch) | |
tree | 5a328c4d50af417652731ee23f25af13f0701044 | |
parent | ed93e82c2c7a080e99c07487396f21fe3572c566 (diff) | |
download | klibc-1a955fa30b5ee0b8dcc47ed4741a04fafc147699.tar.gz |
Better handling of -M options, and handle -x optionklibc-0.216
-rw-r--r-- | klcc.in | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -136,7 +136,8 @@ while ( defined($a = shift(@ARGV)) ) { # Options to gcc which always take a disjoint argument push(@ccopt, $a, shift(@ARGV)); } elsif ( $a eq '-M' || $a eq '-MM' ) { - # These options force preprocessing + # gcc options, that force preprocessing mode + push(@ccopt, $a); $operation = 'E'; } elsif ( $a =~ /^-[gp]/ || $a eq '-p' ) { # Debugging options to gcc @@ -159,6 +160,8 @@ while ( defined($a = shift(@ARGV)) ) { $strip = 1; } elsif ( $a eq '-o' ) { $output = shift(@ARGV); + } elsif ( $a eq '-x' ) { + $lang = shift(@ARGV); } elsif ( $a eq '-nostdinc' ) { push(@ccopt, $a); @includes = (); @@ -189,6 +192,10 @@ if ( $operation ne '' ) { @outopt = ('-o', $output) if ( defined($output) ); $rv = mysystem($CC, @ccopt, @outopt, files_with_lang(\@files, \%flang)); } else { + if ( scalar(@files) == 0 ) { + die "$0: No input files!\n"; + } + @outopt = ('-o', $output || 'a.out'); @objs = (); |