summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2006-01-16 17:20:28 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2006-01-16 17:20:28 +0000
commita097dac241eb454398100f2ef01f908ed93358db (patch)
tree182921345e7435c63092e7a682e37ce030fd8e80
parent6efb257f1792ff7b56e0edde063310ac73c5d77d (diff)
downloadMPC-a097dac241eb454398100f2ef01f908ed93358db.tar.gz
ChangeLogTag: Mon Jan 16 11:17:45 2006 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog47
-rw-r--r--MPC.icobin7168 -> 7168 bytes
-rw-r--r--modules/Creator.pm2
-rw-r--r--modules/FeatureParser.pm9
-rw-r--r--modules/ProjectCreator.pm76
-rw-r--r--modules/TemplateParser.pm25
-rw-r--r--modules/WorkspaceCreator.pm7
-rw-r--r--templates/html.mpd8
-rw-r--r--templates/nmake.mpd4
-rw-r--r--templates/vc6dspdll.mpt4
-rw-r--r--templates/vc7.mpd3
-rw-r--r--templates/vc7csharp.mpd5
-rw-r--r--templates/vc7vb.mpd5
13 files changed, 145 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog
index 9bdbe6a4..cde49078 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,54 @@
+Mon Jan 16 11:17:45 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * MPC.ico:
+
+ Modified the MPC project icon to have the (P) on the left side
+ instead of the right so that it looks better with Tortoise.
+
+ * modules/Creator.pm:
+ * modules/WorkspaceCreator.pm:
+
+ Added support for using -language within a workspace. Previously,
+ this was disallowed but there was no real reason for that.
+
+ * modules/FeatureParser.pm:
+ * modules/ProjectCreator.pm:
+ * modules/TemplateParser.pm:
+
+ Added support for accessing MPC features and their values.
+
+ * templates/html.mpd:
+
+ Added all of the MPC project keywords.
+
+ * templates/nmake.mpd:
+
+ Added the -i parameter to the depgen.pl script.
+
+ * templates/vc6dspdll.mpt:
+
+ Added the _WINDLL and _AFXDLL macros for the MFC configurations.
+
+ * templates/vc7.mpd:
+
+ Added the ability to set the GenerateMapFile setting. Thanks to
+ David Hauck for providing the modification.
+
+ * templates/vc7csharp.mpd:
+ * templates/vc7vb.mpd:
+
+ Added the ReferencePath setting so that libraries can be located
+ (if referenced) and ensured that the 'install' setting worked as
+ it does in all other templates. Thanks to Dan Troesser for
+ providing the ReferencePath setting and pointing out the 'install'
+ discrepancy.
+
Tue Jan 10 16:30:32 2006 Ossama Othman <ossama@dre.vanderbilt.edu>
From Russell Mora <russell_mora at symantec dot com>
* templates/nmake.mpd:
- Add to manifest files, if `.manifest' file exists.
+ Add to manifest files, if `.manifest' file exists.
Mon Jan 9 08:30:14 2006 Chad Elliott <elliott_c@ociweb.com>
diff --git a/MPC.ico b/MPC.ico
index d5651c85..9169cd69 100644
--- a/MPC.ico
+++ b/MPC.ico
Binary files differ
diff --git a/modules/Creator.pm b/modules/Creator.pm
index 26ae4f07..e866ad3b 100644
--- a/modules/Creator.pm
+++ b/modules/Creator.pm
@@ -28,7 +28,7 @@ my(@statekeys) = ('global', 'include', 'template', 'ti',
'addproj', 'progress', 'toplevel', 'baseprojs',
'feature_file', 'features', 'hierarchy',
'name_modifier', 'apply_project', 'into', 'use_env',
- 'expand_vars',
+ 'expand_vars', 'language',
);
my(%all_written) = ();
diff --git a/modules/FeatureParser.pm b/modules/FeatureParser.pm
index 5b9e874f..44122dde 100644
--- a/modules/FeatureParser.pm
+++ b/modules/FeatureParser.pm
@@ -79,10 +79,17 @@ sub parse_line {
}
+sub get_names {
+ my($self) = shift;
+ my(@names) = keys %{$self->{'values'}};
+ return \@names;
+}
+
+
sub get_value {
my($self) = shift;
my($tag) = shift;
- return $self->{'values'}->{$tag};
+ return $self->{'values'}->{lc($tag)};
}
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index d5ef33a8..b08348ed 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -584,6 +584,13 @@ sub parse_line {
}
if ($status) {
+ ## Generate default target names after all source files are added
+ ## and after we've added in all of the options from the
+ ## command line. If the user set exename on the command line
+ ## and no "main" is found, sharedname will be set too and
+ ## most templates do not handle that well.
+ $self->generate_default_target_names();
+
## End of project; Write out the file.
($status, $errorString) = $self->write_project();
@@ -1740,6 +1747,12 @@ sub read_template_input {
}
}
+ if ($status && defined $self->{$tag}) {
+ ## Put the features into the template input set
+ my($features) = $self->{'feature_parser'}->get_names();
+ $self->{$tag}->parse_line(undef, "features = @$features");
+ }
+
return $status, $errorString;
}
@@ -2141,29 +2154,29 @@ sub search_for_entry {
my($commented) = 0;
while(<$fh>) {
- if (!$preproc || !$commented) {
+ if (!$commented) {
## Remove c++ style comments
$_ =~ s/\/\/.*//;
}
- ## If the current language supports a c preprocessor, we
- ## will perform a minimal check for #if 0 and c style comments.
- if ($preproc) {
- ## Remove one line c style comments
- $_ =~ s/\/\*.*\*\///g;
+ ## Remove one line c style comments
+ $_ =~ s/\/\*.*\*\///g;
- if ($commented) {
- if (/\*\//) {
- ## Found the end of a multi-line c style comment
- --$commented;
- }
+ if ($commented) {
+ if (/\*\//) {
+ ## Found the end of a multi-line c style comment
+ --$commented;
}
- else {
- if (/\/\*/) {
- ## Found the beginning of a multi-line c style comment
- ++$commented;
- }
- elsif (/#\s*if\s+0/) {
+ }
+ else {
+ if (/\/\*/) {
+ ## Found the beginning of a multi-line c style comment
+ ++$commented;
+ }
+ elsif ($preproc) {
+ ## If the current language supports a c preprocessor, we
+ ## will perform a minimal check for #if 0
+ if (/#\s*if\s+0/) {
## Found the beginning of a #if 0
++$poundifed;
}
@@ -3083,9 +3096,6 @@ sub generate_defaults {
if ($#rmkeys != -1) {
$self->remove_excluded(@rmkeys);
}
-
- ## Generate default target names after all source files are added
- $self->generate_default_target_names();
}
@@ -3215,7 +3225,11 @@ sub get_special_value {
my($based) = shift;
my(@params) = @_;
- if ($type =~ /^custom_type/) {
+
+ if ($type eq 'feature') {
+ return $self->get_feature_value($cmd, $based);
+ }
+ elsif ($type =~ /^custom_type/) {
return $self->get_custom_value($cmd, $based, @params);
}
elsif ($type =~ /^$grouped_key/) {
@@ -3226,6 +3240,22 @@ sub get_special_value {
}
+sub get_feature_value {
+ my($self) = shift;
+ my($cmd) = shift;
+ my($based) = shift;
+
+ if ($cmd eq 'value') {
+ my($val) = $self->{'feature_parser'}->get_value($based);
+ if (defined $val && $val != 0) {
+ return 1;
+ }
+ }
+
+ return undef;
+}
+
+
sub get_grouped_value {
my($self) = shift;
my($type) = shift;
@@ -3956,9 +3986,11 @@ sub reset_values {
## Only put data structures that need to be cleared
## out when the mpc file is done being read, not at the
- ## end of each project within the mpc file.
+ ## end of each project within the mpc file. Those go in
+ ## the closing curly brace section of parse_line().
$self->{'project_info'} = [];
$self->{'lib_locations'} = {};
+ $self->reset_generating_types();
}
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm
index 0fdb2a09..3c857b0f 100644
--- a/modules/TemplateParser.pm
+++ b/modules/TemplateParser.pm
@@ -66,6 +66,11 @@ my(%target_type_vars) = ('type_is_static' => 1,
'type_is_binary' => 1,
);
+my(%arrow_op_ref) = ('custom_type' => 'custom types',
+ 'grouped_.*_file' => 'grouped files',
+ 'feature' => 'features',
+ );
+
# ************************************************************
# Subroutine Section
# ************************************************************
@@ -1098,17 +1103,17 @@ sub handle_foreach {
## Due to the way flag_overrides works, we can't allow
## the user to name the foreach variable when dealing
- ## with custom types or groupd files.
+ ## with variables that can be used with the -> operator
if (defined $vname) {
- if ($val =~ /^custom_type\->/ || $val eq 'custom_types') {
- $status = 0;
- $errorString = 'The foreach variable can not be ' .
- 'named when dealing with custom types';
- }
- elsif ($val =~ /^grouped_.*_file\->/ || $val =~ /^grouped_.*files$/) {
- $status = 0;
- $errorString = 'The foreach variable can not be ' .
- 'named when dealing with grouped files';
+ foreach my $ref (keys %arrow_op_ref) {
+ my($arrow_re) = $ref;
+ my($name_re) = $ref . 's';
+ if ($val =~ /^$arrow_re\->/ || $val =~ /^$name_re$/) {
+ $status = 0;
+ $errorString = 'The foreach variable can not be ' .
+ 'named when dealing with ' .
+ $arrow_op_ref{$ref};
+ }
}
}
}
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index 140a0db9..97a4645b 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -1777,9 +1777,6 @@ sub process_cmdline {
if (defined $options->{'into'}) {
$self->optionError('-into is ignored');
}
- if (defined $options->{'language'}) {
- $self->optionError('-language is ignored');
- }
if (defined $options->{'input'}->[0]) {
$self->optionError('Command line files ' .
'specified in a workspace are ignored');
@@ -1787,7 +1784,7 @@ sub process_cmdline {
## Determine if it's ok to use the cache
my(@cacheInvalidating) = ('global', 'include', 'baseprojs',
- 'template', 'ti', 'relative',
+ 'template', 'ti', 'relative', 'language',
'addtemp', 'addproj', 'feature_file',
'features', 'use_env', 'expand_vars');
foreach my $key (@cacheInvalidating) {
@@ -1853,7 +1850,7 @@ sub project_creator {
$parameters{'apply_project'},
$self->{'generate_ins'},
$parameters{'into'},
- $self->get_language(),
+ $parameters{'language'},
$parameters{'use_env'},
$parameters{'expand_vars'});
}
diff --git a/templates/html.mpd b/templates/html.mpd
index 82189029..7e8aa512 100644
--- a/templates/html.mpd
+++ b/templates/html.mpd
@@ -68,6 +68,7 @@
<tbody>
<tr><td>after</td><td><%after%></td></tr>
<tr><td>avoids</td><td><%avoids%></td></tr>
+<tr><td>custom_only</td><td><%custom_only%></td></tr>
<tr><td>dllout</td><td><%dllout%></td></tr>
<tr><td>dynamicflags</td><td><%dynamicflags%></td></tr>
<tr><td>exename</td><td><%exename%></td></tr>
@@ -80,7 +81,9 @@
<tr><td>macros</td><td><%macros%></td></tr>
<tr><td>pch_header</td><td><%pch_header%></td></tr>
<tr><td>pch_source</td><td><%pch_source%></td></tr>
+<tr><td>postbuild</td><td><%postbuild%></td></tr>
<tr><td>pure_libs</td><td><%pure_libs%></td></tr>
+<tr><td>recurse</td><td><%recurse%></td></tr>
<tr><td>requires</td><td><%requires%></td></tr>
<tr><td>sharedname</td><td><%libname_prefix%><%sharedname%></td></tr>
<tr><td>staticflags</td><td><%staticflags%></td></tr>
@@ -103,7 +106,7 @@
<%foreach(custom_types)%>
<tr><td><%ucw(custom_type)%></td><td><%custom_type->input_files%></td></tr>
<%endfor%>
-<%if(configurations || pch_defines || postbuild)%>
+<%if(configurations || pch_defines)%>
</tbody>
<thead>
<tr><td colspan="2">MPC Template Settings</td></tr>
@@ -111,9 +114,6 @@
</thead>
<tbody>
<%comment("common to all mpt files")%>
-<%if(postbuild)%>
-<tr><td>postbuild</td><td><%postbuild%></td></tr>
-<%endif%>
<%if(pch_defines)%>
<tr><td>pch_defines</td><td><%pch_defines%></td></tr>
<%endif%>
diff --git a/templates/nmake.mpd b/templates/nmake.mpd
index 88569abe..5f7445ae 100644
--- a/templates/nmake.mpd
+++ b/templates/nmake.mpd
@@ -40,9 +40,9 @@ NULL=nul
!IF "$(DEPGEN)" == ""
!IF EXISTS("$(DEPGEN_ROOT)/depgen.pl")
-DEPGEN=perl $(DEPGEN_ROOT)/depgen.pl -t nmake
+DEPGEN=perl $(DEPGEN_ROOT)/depgen.pl -i -t nmake
!ELSEIF EXISTS("$(ACE_ROOT)/bin/depgen.pl")
-DEPGEN=perl $(ACE_ROOT)/bin/depgen.pl -t nmake
+DEPGEN=perl $(ACE_ROOT)/bin/depgen.pl -i -t nmake
!ENDIF
!ENDIF
diff --git a/templates/vc6dspdll.mpt b/templates/vc6dspdll.mpt
index 5c51dd24..76e2f4cf 100644
--- a/templates/vc6dspdll.mpt
+++ b/templates/vc6dspdll.mpt
@@ -38,7 +38,7 @@ MFC Release {
use_debug_libraries = 0
optimize = 1
compile_flags = /W3 /GX /MD /GR
- defines = NDEBUG
+ defines = NDEBUG _WINDLL _AFXDLL
compile_flags_removed = /YX
output_dir = MFC_Release
intermediate_dir = MFC_Release
@@ -51,7 +51,7 @@ MFC Debug {
use_debug_libraries = 1
optimize =
compile_flags = /W3 /Gm /GX /Zi /MDd /GR /Gy
- defines = _DEBUG
+ defines = _DEBUG _WINDLL _AFXDLL
compile_flags_removed = /Fr /YX
output_dir = MFC_Debug
intermediate_dir = MFC_Debug
diff --git a/templates/vc7.mpd b/templates/vc7.mpd
index 221ec424..4413a9be 100644
--- a/templates/vc7.mpd
+++ b/templates/vc7.mpd
@@ -120,6 +120,9 @@
<%endif%>
<%endif%>
<%endif%>
+<%if(GenerateMapFile)%>
+ GenerateMapFile="<%GenerateMapFile%>"
+<%endif%>
SubSystem="<%subsystem("1")%>"
<%if(StackReserveSize)%>
StackReserveSize="<%StackReserveSize%>"
diff --git a/templates/vc7csharp.mpd b/templates/vc7csharp.mpd
index c0bc6c5c..f574b372 100644
--- a/templates/vc7csharp.mpd
+++ b/templates/vc7csharp.mpd
@@ -39,6 +39,9 @@
RootNamespace = ""
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = "<%startupobject%>"
+<%if(libpaths)%>
+ ReferencePath = "<%foreach(libpaths)%><%libpath%><%fornotlast(";")%><%endfor%>"
+<%endif%>
>
<%foreach(configurations)%>
<Config
@@ -56,7 +59,7 @@
NoWarn = ""
Optimize = "<%if(optimize)%>true<%else%>false<%endif%>"
<%if(exename || sharedname || staticname)%>
- OutputPath = "<%if(exename)%><%if(install)%><%install%><%else%>.<%endif%><%else%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%><%endif%>\<%output_dir%>\"
+ OutputPath = "<%if(exename)%><%if(install)%><%install%><%else%>.\<%output_dir%><%endif%><%else%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%>\<%output_dir%><%endif%>\"
<%endif%>
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
diff --git a/templates/vc7vb.mpd b/templates/vc7vb.mpd
index 8a8a6216..647f5f5f 100644
--- a/templates/vc7vb.mpd
+++ b/templates/vc7vb.mpd
@@ -39,6 +39,9 @@
OptionStrict = "Off"
RootNamespace = ""
StartupObject = "<%startupobject%>"
+<%if(libpaths)%>
+ ReferencePath = "<%foreach(libpaths)%><%libpath%><%fornotlast(";")%><%endfor%>"
+<%endif%>
>
<%foreach(configurations)%>
<Config
@@ -52,7 +55,7 @@
IncrementalBuild = "<%incremental("false")%>"
Optimize = "<%if(optimize)%>true<%else%>false<%endif%>"
<%if(exename || sharedname || staticname)%>
- OutputPath = "<%if(exename)%><%if(install)%><%install%><%else%>.<%endif%><%else%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%><%endif%>\<%output_dir%>\"
+ OutputPath = "<%if(exename)%><%if(install)%><%install%><%else%>.\<%output_dir%><%endif%><%else%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%>\<%output_dir%><%endif%>\"
<%endif%>
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"