aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgcc
diff options
Diffstat (limited to 'cgcc')
-rwxr-xr-xcgcc12
1 files changed, 6 insertions, 6 deletions
diff --git a/cgcc b/cgcc
index a941c578..90cc5f77 100755
--- a/cgcc
+++ b/cgcc
@@ -31,10 +31,10 @@ while (@ARGV) {
# Ditto for stdin.
$do_check = 1 if $_ eq '-';
- if ($_ eq '-o') {
- # Need to be checked explicitly since '-o -' is
- # sometimes used and the '-' would otherwise be
- # processed as an option.
+ if (/^-(o|MF|MT|MQ)$/) {
+ # Need to be checked explicitly since otherwise
+ # the argument would be processed as a
+ # (non-existant) source file or as an option.
die ("$0: missing argument for $_") if !@ARGV;
$nargs = 1;
}
@@ -49,7 +49,7 @@ while (@ARGV) {
$m32 = 1 if /^-m32$/;
$m64 = 1 if /^-m64$/;
- $gendeps = 1 if /^-M$/;
+ $gendeps = 1 if /^-(M|MM|MD|MMD)$/;
if (/^-target=(.*)$/) {
$check .= &add_specs ($1);
@@ -273,7 +273,7 @@ sub add_specs {
' -D__NetBSD__=1';
} elsif ($spec eq 'darwin') {
return
- ' -D__APPLE__=1 -D__MACH__=1';
+ ' -D__APPLE__=1 -D__APPLE_CC__=1 -D__MACH__=1';
} elsif ($spec eq 'gnu') { # Hurd
return &add_specs ('unix') . # So, GNU is Unix, uh?
' -D__GNU__=1 -D__gnu_hurd__=1 -D__MACH__=1';