aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2005-03-07 19:55:33 +0000
committerH. Peter Anvin <hpa@zytor.com>2005-03-07 19:55:33 +0000
commit1a955fa30b5ee0b8dcc47ed4741a04fafc147699 (patch)
tree5a328c4d50af417652731ee23f25af13f0701044
parented93e82c2c7a080e99c07487396f21fe3572c566 (diff)
downloadklibc-1a955fa30b5ee0b8dcc47ed4741a04fafc147699.tar.gz
Better handling of -M options, and handle -x optionklibc-0.216
-rw-r--r--klcc.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/klcc.in b/klcc.in
index 27d7aaee69c7b..afce64b71c3f7 100644
--- a/klcc.in
+++ b/klcc.in
@@ -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 = ();