summaryrefslogtreecommitdiff
path: root/modules/Depgen
diff options
context:
space:
mode:
authorChad Elliott <elliott_c@ociweb.com>2016-11-16 08:46:24 -0600
committerChad Elliott <elliott_c@ociweb.com>2016-11-16 08:46:24 -0600
commit23e63d637de05f1e7aa7819f48ba18c9725e6782 (patch)
treebc496279b436db40c32646647b667d57e064cd96 /modules/Depgen
parent00c897b98864dc8b529c5277866b1aa0f85f444e (diff)
downloadMPC-23e63d637de05f1e7aa7819f48ba18c9725e6782.tar.gz
Wed Nov 16 14:44:33 UTC 2016 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/Depgen')
-rw-r--r--modules/Depgen/Driver.pm12
-rw-r--r--modules/Depgen/MakeDependencyWriter.pm12
2 files changed, 14 insertions, 10 deletions
diff --git a/modules/Depgen/Driver.pm b/modules/Depgen/Driver.pm
index 65d766d8..491d37b1 100644
--- a/modules/Depgen/Driver.pm
+++ b/modules/Depgen/Driver.pm
@@ -99,7 +99,7 @@ sub usageAndExit {
(defined $self->{'automatic'}->[0] ? "[-A] " : ''),
"[-R <VARNAME>]\n" .
" " . (" " x length($base)) .
- " [-e <file>] [-f <output file>] [-i] [-t <type>] [-n]\n" .
+ " [-e <file>] [-f <output file>] [-g] [-i] [-t <type>] [-n]\n" .
" " . (" " x length($base)) . " <files...>\n" .
"\n";
if (defined $self->{'automatic'}->[0]) {
@@ -110,11 +110,13 @@ sub usageAndExit {
print "-D This option sets a macro to an optional value.\n" .
"-I The -I option adds an include directory.\n" .
"-R Replace \$VARNAME paths with \$(VARNAME).\n" .
- "-a Append to existing dependencies. Useful with -t gnuidl.\n" .
+ "-a Append to existing dependencies." .
+ (exists $types{'gnuidl'} ? ' Useful with -t gnuidl.' : '') . "\n" .
"-e Exclude dependencies generated by <file>, but not <file> " .
"itself.\n" .
"-f Specifies the output file. This file will be edited if it " .
"already\n exists.\n" .
+ "-g Do not create Cygwin paths when on Windows.\n" .
"-i Do not print an error if no source files are provided.\n" .
"-n Do not include inline files (ending in .i or .inl) in the " .
"dependencies.\n" .
@@ -223,6 +225,12 @@ sub run {
$self->usageAndExit('Invalid use of -f');
}
}
+ elsif ($arg eq '-g') {
+ ## By default, on Windows, we assume Cygwin and create paths with
+ ## /cygdrive. Some users have a non-Cygwin make and need paths with
+ ## drive letters.
+ delete $ENV{OS};
+ }
elsif ($arg eq '-a') {
$append = 1;
}
diff --git a/modules/Depgen/MakeDependencyWriter.pm b/modules/Depgen/MakeDependencyWriter.pm
index fcd6cfb9..9371d236 100644
--- a/modules/Depgen/MakeDependencyWriter.pm
+++ b/modules/Depgen/MakeDependencyWriter.pm
@@ -17,17 +17,14 @@ use vars qw(@ISA);
@ISA = qw(DependencyWriter);
# ************************************************************
-# Data Section
-# ************************************************************
-
-my $cygwin = (defined $ENV{OS} && $ENV{OS} =~ /windows/i);
-
-# ************************************************************
# Subroutine Section
# ************************************************************
sub new {
my $self = DependencyWriter::new(@_);
+
+ $self->{'cygwin'} = (defined $ENV{OS} && $ENV{OS} =~ /windows/i);
+
if ($ENV{MPC_DEPGEN_EXCLUDE}) {
$self->{exclude} = [split(' ', $ENV{MPC_DEPGEN_EXCLUDE})];
}
@@ -49,11 +46,10 @@ sub process {
## Replace <drive letter>: with /cygdrive/<drive letter>. The user may
## or may not be using Cygwin, but leaving the colon in there will
## cause make to fail catastrophically on the next invocation.
- map(s/([A-Z]):/\/cygdrive\/$1/gi, @{$deps}) if ($cygwin);
+ map(s/([A-Z]):/\/cygdrive\/$1/gi, @{$deps}) if ($self->{'cygwin'});
## Sort the dependencies to make them reproducible.
return "@{$target}: \\\n " . join(" \\\n ", sort @{$deps}) . "\n";
}
-
1;