aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2005-03-07 20:01:40 +0000
committerH. Peter Anvin <hpa@zytor.com>2005-03-07 20:01:40 +0000
commit0037d1bc0deaf7daec3778496656cb04b4e4b9d0 (patch)
tree789ec9854d7130a6fd2aae5145cffad7560bfd4b
parentfc6db92a17568b83c57eb191199eea50df394e28 (diff)
downloadklibc-0037d1bc0deaf7daec3778496656cb04b4e4b9d0.tar.gz
Fix -print-klibc and --versionklibc-0.217
-rw-r--r--klcc.in20
1 files changed, 10 insertions, 10 deletions
diff --git a/klcc.in b/klcc.in
index afce64b71c3f7..111e84f6133da 100644
--- a/klcc.in
+++ b/klcc.in
@@ -115,9 +115,16 @@ while ( defined($a = shift(@ARGV)) ) {
# Not an option. Must be a filename then.
push(@files, $a);
$flang{$a} = $lang || filename2lang($a);
- } elsif ( $a =~ /^(-print|-dump|--help)/ ) {
- # -print and -dump share prefixes with some other options,
- # so put this test early!
+ } elsif ( $a =~ /^-print-klibc-(.*)$/ ) {
+ # This test must precede -print
+ if ( defined($conf{$1}) ) {
+ print ${$conf{$1}}, "\n";
+ exit 0;
+ } else {
+ die "$0: unknown option: $a\n";
+ }
+ } elsif ( $a =~ /^(-print|-dump|--help|--version)/ ) {
+ # These share prefixes with some other options, so put this test early!
# Pseudo-operations; just pass to gcc and don't do anything else
push(@ccopt, $a);
$operation = 'c' if ( $operation eq '' );
@@ -169,13 +176,6 @@ while ( defined($a = shift(@ARGV)) ) {
# Libraries
push(@libs, $a);
push(@libs, shift(@ARGV)) if ( $2 eq '' );
- } elsif ( $a =~ /^-print-klibc-(.*)$/ ) {
- if ( defined($conf{$1}) ) {
- print ${$conf{$1}}, "\n";
- exit 0;
- } else {
- die "$0: unknown option: $a\n";
- }
} else {
die "$0: unknown option: $a\n";
}