summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog135
-rw-r--r--MPC.icobin0 -> 7168 bytes
-rw-r--r--PROBLEM-REPORT-FORM2
-rw-r--r--README15
-rw-r--r--config/swig_java.mpb15
-rw-r--r--modules/AutomakeProjectCreator.pm6
-rw-r--r--modules/Creator.pm13
-rw-r--r--modules/DirectoryManager.pm18
-rw-r--r--modules/Driver.pm7
-rw-r--r--modules/GHSProjectCreator.pm8
-rw-r--r--modules/HTMLProjectCreator.pm6
-rw-r--r--modules/HTMLWorkspaceCreator.pm9
-rw-r--r--modules/MakeProjectCreator.pm6
-rw-r--r--modules/MakeWorkspaceCreator.pm3
-rw-r--r--modules/ProjectCreator.pm121
-rw-r--r--modules/TemplateParser.pm92
-rw-r--r--modules/WinProjectBase.pm12
-rw-r--r--modules/WorkspaceCreator.pm52
-rwxr-xr-xmpc.pl6
-rwxr-xr-xmwc.pl6
-rwxr-xr-xregistry.pl154
-rw-r--r--templates/bmake.mpd2
-rw-r--r--templates/bmakedll.mpt1
-rw-r--r--templates/bmakedllexe.mpt1
-rw-r--r--templates/bmakelibexe.mpt1
-rw-r--r--templates/ghs.mpd4
-rw-r--r--templates/ghsdll.mpt2
-rw-r--r--templates/ghsdllexe.mpt1
-rw-r--r--templates/ghslib.mpt2
-rw-r--r--templates/html.mpd14
-rw-r--r--templates/make.mpd26
-rw-r--r--templates/makedll.mpt9
-rw-r--r--templates/vc7.mpd6
-rw-r--r--templates/vc7dll.mpt4
-rw-r--r--templates/vc7exe.mpt4
-rw-r--r--templates/vc7lib.mpt4
-rw-r--r--templates/vc7libexe.mpt4
-rw-r--r--templates/vc8.mpd6
-rw-r--r--templates/vc8dll.mpt4
-rw-r--r--templates/vc8exe.mpt4
-rw-r--r--templates/vc8lib.mpt4
-rw-r--r--templates/vc8libexe.mpt4
42 files changed, 579 insertions, 214 deletions
diff --git a/ChangeLog b/ChangeLog
index 15d23699..3dbd9950 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,138 @@
+Wed Dec 21 06:28:04 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * MPC.ico:
+ * registry.pl:
+
+ Added the ability to register the .mpc and .mwc file types as well
+ as create context menus within the Windows explorer.
+
+ * PROBLEM-REPORT-FORM:
+
+ Fixed the URL for the MPC FAQ.
+
+ * README:
+ * modules/TemplateParser.pm:
+
+ Added the ability to set the base for the <%forcount%> variable.
+ See the README for details as to how to use this. Also, added
+ code to only check for mixed values (scalars and hash maps) if the
+ foreach value is not the name of an MPC project keyword.
+
+ * config/swig_java.mpb:
+
+ Added support for using SWIG with Java.
+
+ * modules/AutomakeProjectCreator.pm:
+ * modules/Driver.pm:
+ * modules/GHSProjectCreator.pm:
+ * modules/HTMLProjectCreator.pm:
+ * modules/MakeProjectCreator.pm:
+
+ Removed the convert_slashes() method. And use the default from
+ DirectoryManager.pm.
+
+ * modules/Creator.pm:
+
+ Use File::Spec to determine file system capabilities to give the
+ right warning message. Also added the ability to determine if any
+ files were excluded when generating the default file list.
+
+ * modules/DirectoryManager.pm:
+
+ Corrected problems with using Cwd::getcwd() on VMS as it always
+ leaves a trailing slash on the end which no other implementation
+ does. Also, switched the convert_slashes() method to return zero
+ as the default (which will require slightly less code overall in
+ MPC).
+
+ * modules/HTMLWorkspaceCreator.pm:
+ * templates/html.mpd:
+
+ Make the HTML acceptable by WC3 standards.
+
+ * modules/MakeWorkspaceCreator.pm:
+
+ Added a .PHONY: target for each named target. This will only work
+ with GNU Make and won't hurt with other versions of make.
+
+ * modules/ProjectCreator.pm:
+
+ 1) Check for case insensitivity (from a new method) when check
+ whether we should use upper or lower case in the
+ expand_variables() method.
+ 2) Added an is_keyword() method to allow the TemplateParser to
+ determine if a variable is an MPC project keyword or not.
+ 3) When adding the built-in OS compatibility methods, check the
+ base class to see if it's a WinProjectBase to determine if the
+ project type will be used on Windows or not.
+
+ * modules/WinProjectBase.pm:
+
+ For Windows based project types, define the convert_slashes() and
+ case_insensitive() methods.
+
+ * modules/WorkspaceCreator.pm:
+
+ Fixed a bug where file exclusions given on the command line
+ wouldn't work because somewhere down the line MPC would change
+ directory and nothing would match up. Also, fixed a related bug
+ where if all of the .mpc files normally contained within a
+ workspace were excluded a default workspace would then be used
+ possibly adding unwanted .mpc files.
+
+ * mpc.pl:
+ * mwc.pl:
+
+ Finally corrected support for VMS. FindBin doesn't work on VMS if
+ you use a relative directory, so we just use rel2abs() on the
+ dirname of $0 in this situation.
+
+ * templates/bmake.mpd:
+ * templates/bmakedll.mpt:
+ * templates/bmakedllexe.mpt:
+ * templates/bmakelibexe.mpt:
+
+ Modified these to move the binary compile flags into the template
+ such that correct makefiles would be created if the user set the
+ staticname to a valid name and set sharedname to empty.
+
+ * templates/ghs.mpd:
+ * templates/ghsdll.mpt:
+ * templates/ghsdllexe.mpt:
+ * templates/ghslib.mpt:
+
+ Modified these to move the library extensions into the template
+ such that correct build files would be created if the user set the
+ staticname to a valid name and set sharedname to empty.
+
+ * templates/make.mpd:
+
+ Moved the output file to the last part of the link command line.
+ Made "all" the default target for libraries. Parameterized the
+ pch extension. Added better support for precompiled headers.
+
+ * templates/makedll.mpt:
+
+ Set the default pch extension to .gch. Renamed the cxx
+ configurationt to cxx_tru64. Added precompiled header support for
+ SunCC (which was there as of SunCC 5.5). For SunCC 5.4 and below,
+ use -value_template pchsupport= to turn off precompiled header
+ support.
+
+ * templates/vc7.mpd:
+ * templates/vc7dll.mpt:
+ * templates/vc7exe.mpt:
+ * templates/vc7lib.mpt:
+ * templates/vc7libexe.mpt:
+ * templates/vc8.mpd:
+ * templates/vc8dll.mpt:
+ * templates/vc8exe.mpt:
+ * templates/vc8lib.mpt:
+ * templates/vc8libexe.mpt:
+
+ Modified the RuntimeLibrary setting to choose the right value for
+ static/dynamic configurations.
+
Tue Dec 6 06:36:27 2005 Chad Elliott <elliott_c@ociweb.com>
* modules/WorkspaceCreator.pm:
diff --git a/MPC.ico b/MPC.ico
new file mode 100644
index 00000000..d5651c85
--- /dev/null
+++ b/MPC.ico
Binary files differ
diff --git a/PROBLEM-REPORT-FORM b/PROBLEM-REPORT-FORM
index 03830ceb..31841cf9 100644
--- a/PROBLEM-REPORT-FORM
+++ b/PROBLEM-REPORT-FORM
@@ -7,7 +7,7 @@ Please consult the documentation to ensure that you are using MPC correctly.
If you are still having a problem getting MPC to do what you want, please
consult the FAQ before sending a support request.
- http://www.ociweb.com/product/mpc/faq.html
+ http://www.ociweb.com/products/mpc/faq.html
When requesting MPC support please provide the following items:
diff --git a/README b/README
index a15f4719..52e01a8e 100644
--- a/README
+++ b/README
@@ -1,3 +1,5 @@
+.:: 3/13/2002 ::.
+
The Makefile, Project and Workspace Creator.
Designed by Justin Michel (michel_j@ociweb.com) and Chad Elliott.
Implemented by Chad Elliott (elliott_c@ociweb.com).
@@ -685,7 +687,18 @@ fornotlast Insert the text on every foreach iteration except the last.
forlast Insert the text only on the last foreach iteration.
fornotfirst Insert the text on every foreach iteration except the first.
forfirst Insert the text only on the first foreach iteration.
-forcount A one based index number of the foreach iterations.
+forcount By default, a one based index number of the foreach
+ iterations. The base can be modified by providing a base
+ number in the foreach as in the following examples:
+
+<%foreach(4, includes)%>
+ ...
+<%endfor%>
+
+
+<%foreach(include, 4, includes)%>
+ ...
+<%endfor%>
Project Variable and Template Input Variable Interaction
--------------------------------------------------------
diff --git a/config/swig_java.mpb b/config/swig_java.mpb
new file mode 100644
index 00000000..64cdaf49
--- /dev/null
+++ b/config/swig_java.mpb
@@ -0,0 +1,15 @@
+// -*- MPC -*-
+// $Id$
+
+project {
+ Define_Custom(SWIG) {
+ automatic = 1
+ command = swig
+ commandflags = -java -c++
+ inputext = .swg, .swig, .i
+ source_outputext = _wrap.cxx
+ generic_pre_extension = , JNI
+ generic_outputext = .java
+ }
+ includes += $(JAVA_ROOT)/include $(JAVA_ROOT)/include/$(JAVA_PLATFORM)
+}
diff --git a/modules/AutomakeProjectCreator.pm b/modules/AutomakeProjectCreator.pm
index f2b89f09..29b589f8 100644
--- a/modules/AutomakeProjectCreator.pm
+++ b/modules/AutomakeProjectCreator.pm
@@ -28,12 +28,6 @@ sub escape_spaces {
}
-sub convert_slashes {
- #my($self) = shift;
- return 0;
-}
-
-
sub fill_value {
my($self) = shift;
my($name) = shift;
diff --git a/modules/Creator.pm b/modules/Creator.pm
index 281038e4..9ecd0078 100644
--- a/modules/Creator.pm
+++ b/modules/Creator.pm
@@ -12,6 +12,7 @@ package Creator;
use strict;
use FileHandle;
+use File::Spec;
use File::Basename;
use Parser;
@@ -93,6 +94,7 @@ sub new {
$self->{'use_env'} = $use_env;
$self->{'expand_vars'} = $expandvars;
$self->{'convert_slashes'} = $self->convert_slashes();
+ $self->{'case_tolerant'} = File::Spec->case_tolerant();
return $self;
}
@@ -427,6 +429,7 @@ sub generate_default_file_list {
my($self) = shift;
my($dir) = shift;
my($exclude) = shift;
+ my($fileexc) = shift;
my($recurse) = shift;
my($dh) = new FileHandle();
my(@files) = ();
@@ -451,11 +454,13 @@ sub generate_default_file_list {
if ($skip) {
$skip = 0;
+ $$fileexc = 1 if (defined $fileexc);
}
else {
if ($recurse && -d $full) {
push(@files,
- $self->generate_default_file_list($full, $exclude, $recurse));
+ $self->generate_default_file_list($full, $exclude,
+ $fileexc, $recurse));
}
else {
push(@files, $full);
@@ -495,8 +500,10 @@ sub add_file_written {
my($key) = lc($file);
if (defined $self->{'files_written'}->{$key}) {
- $self->warning("$self->{'grammar_type'} $file has " .
- "possibly been overwritten.");
+ $self->warning("$self->{'grammar_type'} $file " .
+ ($self->{'case_tolerant'} ?
+ "has been overwritten." :
+ "of differing case has been processed."));
}
else {
$self->{'files_written'}->{$key} = $file;
diff --git a/modules/DirectoryManager.pm b/modules/DirectoryManager.pm
index 2a9b0b1c..6c1a7903 100644
--- a/modules/DirectoryManager.pm
+++ b/modules/DirectoryManager.pm
@@ -13,11 +13,6 @@ package DirectoryManager;
use strict;
use File::Basename;
-if ($^O eq 'VMS') {
- require VMS::Filespec;
- import VMS::Filespec qw(unixify);
-}
-
# ************************************************************
# Data Section
# ************************************************************
@@ -31,7 +26,8 @@ if ($^O eq 'cygwin' && $cwd !~ /[A-Za-z]:/) {
}
}
elsif ($^O eq 'VMS') {
- $cwd = unixify($cwd);
+ $cwd = VMS::Filespec::unixify($cwd);
+ $cwd =~ s!/$!!g;
}
my($start) = $cwd;
@@ -62,7 +58,8 @@ sub cd {
}
}
elsif ($^O eq 'VMS') {
- $cwd = unixify($cwd);
+ $cwd = VMS::Filespec::unixify($cwd);
+ $cwd =~ s!/$!!g;
}
}
else {
@@ -95,7 +92,9 @@ sub mpc_dirname {
if ($^O eq 'VMS') {
if ($dir =~ /\//) {
- return unixify(dirname($dir));
+ $dir = VMS::Filespec::unixify(dirname($dir));
+ $dir =~ s!/$!!g;
+ return $dir;
}
else {
return '.';
@@ -121,7 +120,6 @@ sub mpc_glob {
my($post) = $3;
for(my $i = 0; $i < length($mid); $i++) {
my($p) = $pre . substr($mid, $i, 1) . $post;
- my(@new) = $self->mpc_glob($p);
foreach my $new ($self->mpc_glob($p)) {
my($found) = undef;
foreach my $file (@files) {
@@ -149,7 +147,7 @@ sub mpc_glob {
sub convert_slashes {
#my($self) = shift;
- return 1;
+ return 0;
}
diff --git a/modules/Driver.pm b/modules/Driver.pm
index 47b89bef..82efd147 100644
--- a/modules/Driver.pm
+++ b/modules/Driver.pm
@@ -52,12 +52,6 @@ sub new {
}
-sub convert_slashes {
- #my($self) = shift;
- return 0;
-}
-
-
sub parse_line {
my($self) = shift;
my($ih) = shift;
@@ -333,6 +327,7 @@ sub run {
else {
my($partial) = $self->getcwd();
my($oescaped) = $self->escape_regex_special($orig_dir) . '(/)?';
+ $partial =~ s!\\!/!g;
$partial =~ s/^$oescaped//;
$diag .= ($partial ne '' ? "$partial/" : '') . $file;
}
diff --git a/modules/GHSProjectCreator.pm b/modules/GHSProjectCreator.pm
index 6fef3dea..83ffec4c 100644
--- a/modules/GHSProjectCreator.pm
+++ b/modules/GHSProjectCreator.pm
@@ -33,12 +33,6 @@ sub compare_output {
}
-sub convert_slashes {
- #my($self) = shift;
- return 0;
-}
-
-
sub project_file_extension {
#my($self) = shift;
return '.bld';
@@ -51,7 +45,7 @@ sub fill_value {
my($value) = undef;
if (!defined $startre) {
- $startre = $self->escape_regex_special($self->getstartdir());
+ $startre = $self->escape_regex_special($self->getstartdir());
}
if ($name =~ /^reltop_(\w+)/) {
diff --git a/modules/HTMLProjectCreator.pm b/modules/HTMLProjectCreator.pm
index df72d948..5955ef71 100644
--- a/modules/HTMLProjectCreator.pm
+++ b/modules/HTMLProjectCreator.pm
@@ -36,12 +36,6 @@ sub file_sorter {
}
-sub convert_slashes {
- #my($self) = shift;
- return 0;
-}
-
-
sub label_nodes {
my($self) = shift;
my($hash) = shift;
diff --git a/modules/HTMLWorkspaceCreator.pm b/modules/HTMLWorkspaceCreator.pm
index 62b0f574..5e72bbea 100644
--- a/modules/HTMLWorkspaceCreator.pm
+++ b/modules/HTMLWorkspaceCreator.pm
@@ -34,12 +34,14 @@ sub pre_workspace {
my($fh) = shift;
my($crlf) = $self->crlf();
- print $fh '<html>', $crlf,
+ print $fh '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', $crlf,
+ '<html>', $crlf,
'<!-- $Id$ -->', $crlf,
'<!-- MPC Command: -->', $crlf,
"<!-- $0@ARGV -->", $crlf,
'<head>', $crlf,
- ' <style>', $crlf,
+ '<title>', $self->get_workspace_name(), '</title>', $crlf,
+ ' <style type="text/css">', $crlf,
' a {font: 12pt bold verdana, lucida; color: white; padding: 3px;}', $crlf,
' td {font: 12pt bold verdana, lucida; color: white; padding: 3px; background-color: cadetblue;}', $crlf,
' thead tr td {font: 18pt "trebuchet ms", helvetica; color: white; padding: 3px; background-color: teal;}', $crlf,
@@ -57,7 +59,8 @@ sub write_comps {
my($project_info) = $self->get_project_info();
my($crlf) = $self->crlf();
- print $fh "<table style=\"table-layout:fixed\" width=\"400\">$crlf" .
+ print $fh "<table style=\"table-layout:fixed\" width=\"400\" " .
+ "summary=\"MPC Projects\">$crlf" .
"<col style=\"background-color: darkcyan;\">$crlf" .
"<thead>$crlf" .
"<tr><td>Projects</td></tr>$crlf" .
diff --git a/modules/MakeProjectCreator.pm b/modules/MakeProjectCreator.pm
index bfb059e3..5d91689c 100644
--- a/modules/MakeProjectCreator.pm
+++ b/modules/MakeProjectCreator.pm
@@ -28,12 +28,6 @@ sub escape_spaces {
}
-sub convert_slashes {
- #my($self) = shift;
- return 0;
-}
-
-
sub get_dll_exe_template_input_file {
#my($self) = shift;
return 'makeexe';
diff --git a/modules/MakeWorkspaceCreator.pm b/modules/MakeWorkspaceCreator.pm
index ecd101a9..60b6f62a 100644
--- a/modules/MakeWorkspaceCreator.pm
+++ b/modules/MakeWorkspaceCreator.pm
@@ -92,7 +92,8 @@ sub write_comps {
## Print out each target separately
foreach my $project (@list) {
my($dname) = $self->mpc_dirname($project);
- print $fh $crlf, $$trans{$project}, ':';
+ print $fh $crlf, '.PHONY: ', $$trans{$project},
+ $crlf, $$trans{$project}, ':';
if (defined $targnum{$project}) {
foreach my $number (@{$targnum{$project}}) {
print $fh " $$trans{$list[$number]}";
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 1f34b6d8..6d9e20a6 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -289,6 +289,7 @@ sub new {
$self->{'addtemp_state'} = undef;
$self->{'command_subs'} = $self->get_command_subs();
$self->{'escape_spaces'} = $self->escape_spaces();
+ $self->{'case_insensitive'} = $self->case_insensitive();
$self->add_default_matching_assignments();
$self->reset_generating_types();
@@ -297,6 +298,13 @@ sub new {
}
+sub is_keyword {
+ my($self) = shift;
+ my($name) = shift;
+ return $validNames{$name};
+}
+
+
sub read_global_configuration {
my($self) = shift;
my($input) = $self->get_global_cfg();
@@ -1157,7 +1165,7 @@ sub parse_components {
if ($line eq '') {
}
elsif ($line =~ /^(\w+)\s*{$/) {
- if (!defined $current || !$set) {
+ if (!$set) {
$current = $1;
$set = 1;
if (!defined $$comps{$current}) {
@@ -1180,31 +1188,29 @@ sub parse_components {
}
}
elsif ($line =~ /^}$/) {
- if (defined $current) {
- if (!defined $$comps{$current}->[0] && !defined $exclude[0]) {
- ## The default components name was never used
- ## so we remove it from the components
- delete $$comps{$current};
- }
- else {
- ## It was used, so we need to add that name to
- ## the set of group names unless it's already been added.
- my($groups) = $self->get_assignment($grtag);
- my($addgroup) = 1;
- if (defined $groups) {
- foreach my $group (@{$self->create_array($groups)}) {
- if ($current eq $group) {
- $addgroup = 0;
- last;
- }
+ if (!defined $$comps{$current}->[0] && !defined $exclude[0]) {
+ ## The default components name was never used
+ ## so we remove it from the components
+ delete $$comps{$current};
+ }
+ else {
+ ## It was used, so we need to add that name to
+ ## the set of group names unless it's already been added.
+ my($groups) = $self->get_assignment($grtag);
+ my($addgroup) = 1;
+ if (defined $groups) {
+ foreach my $group (@{$self->create_array($groups)}) {
+ if ($current eq $group) {
+ $addgroup = 0;
+ last;
}
}
- if ($addgroup) {
- $self->process_assignment_add($grtag, $current);
- }
+ }
+ if ($addgroup) {
+ $self->process_assignment_add($grtag, $current);
}
}
- if (defined $current && $set) {
+ if ($set) {
$current = $defgroup;
$set = undef;
}
@@ -1225,7 +1231,7 @@ sub parse_components {
last;
}
}
- elsif (defined $current) {
+ else {
($status, $error) = $self->process_component_line($tag, $line, \%flags,
\$grname, $current,
\@exclude, $comps,
@@ -1234,11 +1240,6 @@ sub parse_components {
last;
}
}
- else {
- $status = 0;
- $error = 'Syntax error';
- last;
- }
}
## If we didn't encounter an error, didn't have any files explicitly
@@ -1253,7 +1254,8 @@ sub parse_components {
if (!defined $checked{$dname}) {
$checked{$dname} = 1;
push(@files, $self->generate_default_file_list($dname,
- \@exclude, $alldir));
+ \@exclude,
+ undef, $alldir));
}
}
@@ -1637,18 +1639,18 @@ sub parse_define_custom {
sub remove_duplicate_addition {
- my($self) = shift;
- my($name) = shift;
- my($value) = shift;
- my($nval) = shift;
-
- ## If we are modifying the libs, libpaths, macros or includes
- ## assignment with either addition or subtraction, we are going to
- ## perform a little fix on the value to avoid multiple
- ## libraries and to try to insure the correct linking order
- if ($name eq 'macros' ||
- $name eq 'libpaths' || $name eq 'includes' || $name =~ /libs$/) {
- if (defined $nval) {
+ my($self) = shift;
+ my($name) = shift;
+ my($value) = shift;
+ my($nval) = shift;
+
+ if (defined $nval) {
+ ## If we are modifying the libs, libpaths, macros or includes
+ ## assignment with either addition or subtraction, we are going to
+ ## perform a little fix on the value to avoid multiple
+ ## libraries and to try to insure the correct linking order
+ if ($name eq 'macros' ||
+ $name eq 'libpaths' || $name eq 'includes' || $name =~ /libs$/) {
my($allowed) = '';
my(%parts) = ();
@@ -2466,10 +2468,9 @@ sub sift_default_file_list {
my($pchc) = shift;
my($alldir) = $recurse ||
$self->{'flag_overrides'}->{$tag}->{$file}->{'recurse'};
- my(@gen) = $self->generate_default_file_list($file, [], $alldir);
+ my(@gen) = $self->generate_default_file_list($file, [], undef, $alldir);
$self->sift_files(\@gen, $exts, $pchh, $pchc, $tag, $built, $alldir);
-
}
@@ -3022,7 +3023,8 @@ sub generate_defaults {
## Generate the default pch file names (if needed)
my(@files) = $self->generate_default_file_list(
- '.', [], $self->get_assignment('recurse'));
+ '.', [],
+ undef, $self->get_assignment('recurse'));
$self->generate_default_pch_filenames(\@files);
## If the pch file names are empty strings then we need to fix that
@@ -3296,7 +3298,7 @@ sub get_command_subs {
my(%valid) = ();
## Add the built-in OS compatibility commands
- if ($self->{'convert_slashes'}) {
+ if (UNIVERSAL::isa($self, 'WinProjectBase')) {
$valid{'cat'} = 'type';
$valid{'cp'} = 'copy /y';
$valid{'mkdir'} = 'mkdir';
@@ -4045,23 +4047,23 @@ sub update_project_info {
my($tparser) = shift;
my($append) = shift;
my($names) = shift;
- my($sep) = shift;
+ my($sep) = shift || '';
my($pi) = $self->get_project_info();
my($value) = '';
my($arr) = ($append && defined $$pi[0] ? pop(@$pi) : []);
## Set up the hash table when we are starting a new project_info
- if ($append == 0) {
+ if (!$append) {
$self->{'project_info_hash_table'} = {};
}
## Append the values of all names into one string
my(@narr) = @$names;
for(my $i = 0; $i <= $#narr; $i++) {
- my($key) = $narr[$i];
- $value .= $self->translate_value($key,
- $tparser->get_value_with_default($key)) .
- (defined $sep && $i != $#narr ? $sep : '');
+ $value .= $self->translate_value(
+ $narr[$i],
+ $tparser->get_value_with_default($narr[$i]));
+ $value .= $sep if ($i != $#narr);
}
## If we haven't seen this value yet, put it on the array
@@ -4148,7 +4150,6 @@ sub adjust_value {
sub expand_variables {
my($self) = shift;
my($value) = shift;
- my($keys) = shift;
my($rel) = shift;
my($expand_template) = shift;
my($scope) = shift;
@@ -4181,10 +4182,8 @@ sub expand_variables {
$val =~ s/\\/\//g;
}
- ## Here we make an assumption that if we convert slashes to
- ## back-slashes, we also have a case-insensitive file system.
- my($icwd) = ($self->{'convert_slashes'} ? lc($cwd) : $cwd);
- my($ival) = ($self->{'convert_slashes'} ? lc($val) : $val);
+ my($icwd) = ($self->{'case_insensitive'} ? lc($cwd) : $cwd);
+ my($ival) = ($self->{'case_insensitive'} ? lc($val) : $val);
my($iclen) = length($icwd);
my($ivlen) = length($ival);
@@ -4283,7 +4282,7 @@ sub relative {
my($ovalue) = $value;
my(@keys) = keys %{$self->{'expanded'}};
if (defined $keys[0]) {
- $value = $self->expand_variables($value, \@keys,
+ $value = $self->expand_variables($value,
$self->{'expanded'},
$expand_template, $scope, 1);
}
@@ -4292,7 +4291,7 @@ sub relative {
my($rel) = ($self->get_use_env() ? \%ENV : $self->get_relative());
@keys = keys %$rel;
if (defined $keys[0]) {
- $value = $self->expand_variables($value, \@keys, $rel,
+ $value = $self->expand_variables($value, $rel,
$expand_template, $scope,
$self->get_expand_vars(), 1);
}
@@ -4501,6 +4500,12 @@ sub remove_wanted_extension {
# Virtual Methods To Be Overridden
# ************************************************************
+sub case_insensitive {
+ #my($self) = shift;
+ return 0;
+}
+
+
sub escape_spaces {
#my($self) = shift;
return 0;
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm
index 5b44061d..0fdb2a09 100644
--- a/modules/TemplateParser.pm
+++ b/modules/TemplateParser.pm
@@ -392,6 +392,7 @@ sub get_value_with_default {
sub process_foreach {
my($self) = shift;
my($index) = $self->{'foreach'}->{'count'};
+ my($base) = $self->{'foreach'}->{'base'}->[$index];
my($text) = $self->{'foreach'}->{'text'}->[$index];
my($status) = 1;
my($error) = undef;
@@ -399,6 +400,7 @@ sub process_foreach {
my($name) = $self->{'foreach'}->{'name'}->[$index];
my(@cmds) = ();
my($val) = $self->{'foreach'}->{'vars'}->[$index];
+ my($check_for_mixed) = undef;
if ($val =~ /^((\w+),\s*)?flag_overrides\((.*)\)$/) {
my($over) = $self->get_flag_overrides($3);
@@ -439,6 +441,9 @@ sub process_foreach {
$name = $n;
$name =~ s/s$//;
}
+ if (!$check_for_mixed && !$self->{'prjc'}->is_keyword($n)) {
+ $check_for_mixed = 1;
+ }
}
}
@@ -460,25 +465,27 @@ sub process_foreach {
## If the foreach values are mixed (HASH and SCALAR), then
## remove the SCALAR values.
- my(%mixed) = ();
- my($mixed) = 0;
- for(my $i = 0; $i <= $#values; ++$i) {
- $mixed{$values[$i]} = $self->set_current_values($values[$i]);
- $mixed |= $mixed{$values[$i]};
- }
- if ($mixed) {
- my(@nvalues) = ();
- foreach my $key (sort keys %mixed) {
- if ($mixed{$key}) {
- push(@nvalues, $key);
- }
+ if ($check_for_mixed) {
+ my(%mixed) = ();
+ my($mixed) = 0;
+ for(my $i = 0; $i <= $#values; ++$i) {
+ $mixed{$values[$i]} = $self->set_current_values($values[$i]);
+ $mixed |= $mixed{$values[$i]};
}
+ if ($mixed) {
+ my(@nvalues) = ();
+ foreach my $key (sort keys %mixed) {
+ if ($mixed{$key}) {
+ push(@nvalues, $key);
+ }
+ }
- ## Set the new values only if they are different
- ## from the original (except for order).
- my(@sorted) = sort(@values);
- if (@sorted != @nvalues) {
- @values = @nvalues;
+ ## Set the new values only if they are different
+ ## from the original (except for order).
+ my(@sorted) = sort(@values);
+ if (@sorted != @nvalues) {
+ @values = @nvalues;
+ }
}
}
@@ -498,7 +505,7 @@ sub process_foreach {
$$scope{'forlast'} = 1;
$$scope{'fornotlast'} = '';
}
- $$scope{'forcount'} = $i + 1;
+ $$scope{'forcount'} = $i + $base;
## We don't use adjust_value here because these names
## are generated from a foreach and should not be adjusted.
@@ -1054,10 +1061,11 @@ sub handle_foreach {
push(@{$self->{'lstack'}}, $self->get_line_number());
if (!$self->{'if_skip'}) {
+ my($base) = 1;
my($vname) = undef;
if ($val =~ /flag_overrides\([^\)]+\)/) {
}
- elsif ($val =~ /([^,]+),(.*)/) {
+ elsif ($val =~ /([^,]*),(.*)/) {
$vname = $1;
$val = $2;
$vname =~ s/^\s+//;
@@ -1065,24 +1073,50 @@ sub handle_foreach {
$val =~ s/^\s+//;
$val =~ s/\s+$//;
- ## Due to the way flag_overrides works, we can't allow
- ## the user to name the foreach variable when dealing
- ## with custom types.
- if ($val =~ /^custom_type\->/ || $val eq 'custom_types') {
+ if ($vname eq '') {
$status = 0;
- $errorString = 'The foreach variable can not be ' .
- 'named when dealing with custom types';
+ $errorString = 'The foreach variable name is not valid';
}
- elsif ($val =~ /^grouped_.*_file\->/ || $val =~ /^grouped_.*files$/) {
- $status = 0;
- $errorString = 'The foreach variable can not be ' .
- 'named when dealing with grouped files';
+
+ if ($val =~ /([^,]*),(.*)/) {
+ $base = $1;
+ $val = $2;
+ $base =~ s/^\s+//;
+ $base =~ s/\s+$//;
+ $val =~ s/^\s+//;
+ $val =~ s/\s+$//;
+
+ if ($base !~ /^\d+$/) {
+ $status = 0;
+ $errorString = 'The forcount specified is not a valid number';
+ }
+ }
+ elsif ($vname =~ /^\d+$/) {
+ $base = $vname;
+ $vname = undef;
+ }
+
+ ## 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.
+ 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';
+ }
}
}
push(@{$self->{'sstack'}}, $name);
my($index) = ++$self->{'foreach'}->{'count'};
+ $self->{'foreach'}->{'base'}->[$index] = $base;
$self->{'foreach'}->{'name'}->[$index] = $vname;
$self->{'foreach'}->{'vars'}->[$index] = $val;
$self->{'foreach'}->{'text'}->[$index] = '';
diff --git a/modules/WinProjectBase.pm b/modules/WinProjectBase.pm
index d35f9343..96eb032e 100644
--- a/modules/WinProjectBase.pm
+++ b/modules/WinProjectBase.pm
@@ -16,6 +16,18 @@ use strict;
# Subroutine Section
# ************************************************************
+sub convert_slashes {
+ #my($self) = shift;
+ return 1;
+}
+
+
+sub case_insensitive {
+ #my($self) = shift;
+ return 1;
+}
+
+
sub validated_directory {
my($self) = shift;
my($dir) = shift;
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index 7a6107fc..140a0db9 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -607,16 +607,18 @@ sub handle_scoped_unknown {
sub search_for_files {
- my($self) = shift;
- my($files) = shift;
- my($array) = shift;
- my($impl) = shift;
+ my($self) = shift;
+ my($files) = shift;
+ my($array) = shift;
+ my($impl) = shift;
+ my($excluded) = 0;
foreach my $file (@$files) {
if (-d $file) {
my(@f) = $self->generate_default_file_list(
$file,
- $self->{'exclude'}->{$self->{'wctype'}});
+ $self->{'exclude'}->{$self->{'wctype'}},
+ \$excluded);
$self->search_for_files(\@f, $array, $impl);
if ($impl) {
$file =~ s/^\.\///;
@@ -630,6 +632,8 @@ sub search_for_files {
}
}
}
+
+ return $excluded;
}
@@ -653,10 +657,11 @@ sub remove_duplicate_projects {
sub generate_default_components {
- my($self) = shift;
- my($files) = shift;
- my($impl) = shift;
- my($pjf) = $self->{'project_files'};
+ my($self) = shift;
+ my($files) = shift;
+ my($impl) = shift;
+ my($excluded) = shift;
+ my($pjf) = $self->{'project_files'};
if (defined $$pjf[0]) {
## If we have files, then process directories
@@ -692,7 +697,7 @@ sub generate_default_components {
else {
## Add all of the wanted files in this directory
## and in the subdirectories.
- $self->search_for_files($files, $pjf, $impl);
+ $excluded |= $self->search_for_files($files, $pjf, $impl);
## If the workspace is set to implicit
if ($impl) {
@@ -703,7 +708,7 @@ sub generate_default_components {
## If no files were found, then we push the empty
## string, so the Project Creator will generate
## the default project file.
- if (!defined $$pjf[0]) {
+ if (!defined $$pjf[0] && !$excluded) {
push(@$pjf, '');
}
}
@@ -738,13 +743,34 @@ sub generate_defaults {
$self->{'workspace_name'} = $self->get_default_workspace_name();
}
+ ## Modify the exclude list if we have changed directory from the original
+ ## starting directory. Just take off the difference from the front.
+ my(@original) = ();
+ my($top) = $self->getcwd() . '/';
+ my($start) = $self->getstartdir() . '/';
+
+ if ($start ne $top && $top =~ s/^$start//) {
+ foreach my $exclude (@{$self->{'exclude'}->{$self->{'wctype'}}}) {
+ push(@original, $exclude);
+ $exclude =~ s/^$top//;
+ }
+ }
+
+ my($excluded) = 0;
my(@files) = $self->generate_default_file_list(
'.',
- $self->{'exclude'}->{$self->{'wctype'}});
+ $self->{'exclude'}->{$self->{'wctype'}},
+ \$excluded);
## Generate default components
$self->generate_default_components(\@files,
- $self->get_assignment('implicit'));
+ $self->get_assignment('implicit'),
+ $excluded);
+
+ ## Return the actual exclude list of we modified it
+ if (defined $original[0]) {
+ $self->{'exclude'}->{$self->{'wctype'}} = \@original;
+ }
}
diff --git a/mpc.pl b/mpc.pl
index c7f7c30a..855690b1 100755
--- a/mpc.pl
+++ b/mpc.pl
@@ -13,12 +13,16 @@ eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}'
# ******************************************************************
use strict;
-use Cwd;
use Config;
use FindBin;
+use File::Spec;
use File::Basename;
my($basePath) = $FindBin::Bin;
+if ($^O eq 'VMS') {
+ $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq '');
+ $basePath = VMS::Filespec::unixify($basePath);
+}
unshift(@INC, $basePath . '/modules');
require MPC;
diff --git a/mwc.pl b/mwc.pl
index f622b670..ea86661d 100755
--- a/mwc.pl
+++ b/mwc.pl
@@ -13,12 +13,16 @@ eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}'
# ******************************************************************
use strict;
-use Cwd;
use Config;
use FindBin;
+use File::Spec;
use File::Basename;
my($basePath) = $FindBin::Bin;
+if ($^O eq 'VMS') {
+ $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq '');
+ $basePath = VMS::Filespec::unixify($basePath);
+}
unshift(@INC, $basePath . '/modules');
require MWC;
diff --git a/registry.pl b/registry.pl
new file mode 100755
index 00000000..f76e8150
--- /dev/null
+++ b/registry.pl
@@ -0,0 +1,154 @@
+eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}'
+ & eval 'exec perl -w -S $0 $argv:q'
+ if 0;
+
+# ******************************************************************
+# Author: Chad Elliott
+# Date: 12/05/2005
+# $Id$
+# ******************************************************************
+
+# ******************************************************************
+# Pragma Section
+# ******************************************************************
+
+use strict;
+use FindBin;
+use FileHandle;
+use File::Basename;
+
+# ******************************************************************
+# Data Section
+# ******************************************************************
+
+my($Registry) = undef;
+my($MPC_ROOT) = $FindBin::Bin;
+$MPC_ROOT =~ s!/!\\!g;
+
+my($version) = '$Id$';
+$version =~ s/.*\s+(\d+[\.\d]+)\s+.*/$1/;
+
+my(%types) = ('nmake' => 'NMAKE',
+ 'bmake' => 'Borland Make',
+ 'vc6' => 'DSW',
+ 'vc71' => 'SLN 7.1',
+ 'vc8' => 'SLN 8.0',
+ );
+
+# ******************************************************************
+# Subroutine Section
+# ******************************************************************
+
+sub set_ext_icon {
+ my($ext) = shift;
+ my($num) = shift;
+ my($extf) = $ext . 'file';
+ $Registry->{"HKEY_CLASSES_ROOT/.$ext/"} = {'/' => $extf};
+ $Registry->{"HKEY_CLASSES_ROOT/$extf/"} = {};
+ $Registry->{"HKEY_CLASSES_ROOT/$extf/DefaultIcon/"} =
+ {'/' => "$MPC_ROOT\\MPC.ico,$num"};
+}
+
+
+sub set_dir_command {
+ my($type) = shift;
+ my($desc) = shift;
+ my($shell) = 'HKEY_CLASSES_ROOT/Directory/shell';
+ my($hash) = $Registry->{$shell};
+
+ if (!defined $hash) {
+ $Registry->{$shell} = {};
+ $hash = $Registry->{$shell};
+ }
+
+ my($key) = 'MPC' . uc($type) . '/';
+ $hash->{$key} = {'/' => "MPC -> $desc"};
+
+ $key .= 'command/';
+ $hash->{$key} = {'/' => "cmd /c \"cd %L && $MPC_ROOT\\mwc.pl -type $type -recurse || pause\""};
+}
+
+
+sub set_mwc_command {
+ my($type) = shift;
+ my($desc) = shift;
+ my($shell) = 'HKEY_CLASSES_ROOT/mwcfile/shell';
+ my($hash) = $Registry->{$shell};
+
+ if (!defined $hash) {
+ $Registry->{$shell} = {};
+ $hash = $Registry->{$shell};
+ }
+
+ my($key) = 'MPC' . uc($type) . '/';
+ $hash->{$key} = {'/' => "MPC -> $desc"};
+
+ $key .= 'command/';
+ $hash->{$key} = {'/' => "cmd /c \"$MPC_ROOT\\mwc.pl -type $type %L || pause\""};
+
+ set_dir_command($type, $desc);
+}
+
+
+sub delete_key {
+ my($key) = shift;
+ my($val) = $Registry->{$key};
+
+ if (UNIVERSAL::isa($val, 'HASH')) {
+ foreach my $k (keys %$val) {
+ delete_key($key . $k);
+ }
+ }
+ delete $Registry->{$key};
+}
+
+# ******************************************************************
+# Main Section
+# ******************************************************************
+
+if ($^O eq 'MSWin32') {
+ require Win32::TieRegistry;
+ Win32::TieRegistry->import(TiedRef => \$Registry,
+ Delimiter => '/');
+}
+else {
+ print "ERROR: This script will only run on Windows.\n";
+ exit(1);
+}
+
+if (defined $ARGV[0]) {
+ if ($ARGV[0] eq '-r') {
+ delete $Registry->{'HKEY_CURRENT_USER/Environment/MPC_ROOT'};
+
+ delete_key('HKEY_CLASSES_ROOT/.mwc/');
+ delete_key('HKEY_CLASSES_ROOT/mwcfile/');
+ delete_key('HKEY_CLASSES_ROOT/.mpc/');
+ delete_key('HKEY_CLASSES_ROOT/mpcfile/');
+
+ foreach my $type (keys %types) {
+ delete_key('HKEY_CLASSES_ROOT/Directory/shell/MPC' . uc($type) . '/');
+ }
+ }
+ else {
+ print STDERR "registry v$version\n",
+ "Usage: ", basename($0), " [-r]\n\n",
+ " -r Remove MPC related registry keys (this does not work).\n\n",
+ "Set the MPC_ROOT environment variable to the location of this script.\n",
+ "Also, add context menus for .mwc files and directories.\n";
+ exit(0);
+ }
+}
+
+$Registry->{'HKEY_CURRENT_USER/Environment/MPC_ROOT'} = [$MPC_ROOT, 'REG_SZ'];
+
+set_ext_icon('mwc', 0);
+set_ext_icon('mpc', 1);
+
+foreach my $type (keys %types) {
+ set_mwc_command($type, $types{$type});
+}
+
+print "You may need to log out and then ",
+ "log back in for these settings to take effect.\n";
+
+exit(0);
diff --git a/templates/bmake.mpd b/templates/bmake.mpd
index 18c11d6d..4267e323 100644
--- a/templates/bmake.mpd
+++ b/templates/bmake.mpd
@@ -52,7 +52,7 @@ DLLFLAGS = <%dllflags%>
LIBFLAGS = <%libflags%>
EXEFLAGS = <%exeflags%>
WARNFLAGS = <%warnflags%>
-CCFLAGS = <%ccflags%><%if(compile_flags)%> <%compile_flags%><%endif%>
+CCFLAGS = <%ccflags%><%if(type_is_binary)%> <%binary_compile_flags("-tWR -tWD")%><%endif%><%if(compile_flags)%> <%compile_flags%><%endif%>
<%endfor%>
!endif
diff --git a/templates/bmakedll.mpt b/templates/bmakedll.mpt
index 95d6b748..3f66d039 100644
--- a/templates/bmakedll.mpt
+++ b/templates/bmakedll.mpt
@@ -4,7 +4,6 @@
conditional_include "bmakecommon"
startup_obj = c0d32
-compile_flags = -tWR -tWD
use_lib_modifier = 1
Release {
diff --git a/templates/bmakedllexe.mpt b/templates/bmakedllexe.mpt
index 13a884a3..c7ed6ce2 100644
--- a/templates/bmakedllexe.mpt
+++ b/templates/bmakedllexe.mpt
@@ -4,7 +4,6 @@
conditional_include "bmakecommon"
startup_obj = c0x32
-compile_flags = -tWR -tWD
use_exe_modifier =
Release {
diff --git a/templates/bmakelibexe.mpt b/templates/bmakelibexe.mpt
index bc8fe2c7..3484884e 100644
--- a/templates/bmakelibexe.mpt
+++ b/templates/bmakelibexe.mpt
@@ -4,7 +4,6 @@
conditional_include "bmakecommon"
startup_obj = c0x32
-compile_flags = -tWR -tWD
use_exe_modifier =
Release {
diff --git a/templates/ghs.mpd b/templates/ghs.mpd
index 470fea4b..95fa0976 100644
--- a/templates/ghs.mpd
+++ b/templates/ghs.mpd
@@ -9,11 +9,11 @@ default:
<%else%>
<%if(sharedname)%>
shared_library
- :outputname=<%if(dllout)%><%reltop_dllout%><%else%><%reltop_libout%><%endif%>/<%lib_prefix%><%libname_prefix%><%sharedname%><%libdecorator%><%libext%>
+ :outputname=<%if(dllout)%><%reltop_dllout%><%else%><%reltop_libout%><%endif%>/<%lib_prefix%><%libname_prefix%><%sharedname%><%libdecorator%><%libext(".so")%>
<%else%>
<%if(staticname)%>
library
- :outputname=<%reltop_libout%>/<%lib_prefix%><%libname_prefix%><%staticname%><%libdecorator%><%libext%>
+ :outputname=<%reltop_libout%>/<%lib_prefix%><%libname_prefix%><%staticname%><%libdecorator%><%libext(".a")%>
<%else%>
subproject
<%endif%>
diff --git a/templates/ghsdll.mpt b/templates/ghsdll.mpt
index f26eebe4..deead6e8 100644
--- a/templates/ghsdll.mpt
+++ b/templates/ghsdll.mpt
@@ -3,6 +3,4 @@
conditional_include "ghscommon"
-libext = .so
-
conditional_include "user_ghsdll"
diff --git a/templates/ghsdllexe.mpt b/templates/ghsdllexe.mpt
index 1993b4cd..7a8aee0a 100644
--- a/templates/ghsdllexe.mpt
+++ b/templates/ghsdllexe.mpt
@@ -2,4 +2,5 @@
// $Id$
conditional_include "ghscommon"
+
conditional_include "user_ghsdllexe"
diff --git a/templates/ghslib.mpt b/templates/ghslib.mpt
index 9ae5e501..9a894211 100644
--- a/templates/ghslib.mpt
+++ b/templates/ghslib.mpt
@@ -3,6 +3,4 @@
conditional_include "ghscommon"
-libext = .a
-
conditional_include "user_ghslib"
diff --git a/templates/html.mpd b/templates/html.mpd
index 94a12c4f..82189029 100644
--- a/templates/html.mpd
+++ b/templates/html.mpd
@@ -1,7 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <style>
+ <title><%project_name%></title>
+ <style type="text/css">
p {font: 9pt verdana, lucida; width:800px; color: slategray;}
h1 {font: 36pt verdana, lucida; width: 800px; color: darkcyan;}
h2 {font: 16pt "trebuchet ms", helvetica; color: white; padding: 3px; background-color: teal;}
@@ -27,7 +28,7 @@
<%tree_style%>
<%endfor%>
</style>
- <script>
+ <script type="text/javascript">
<!--
function popup(mylink, windowname) {
if (!window.focus) {
@@ -49,7 +50,6 @@
</script>
</head>
<body>
-<title><%project_name%></title>
<h1><%project_name%></h1>
<%foreach(inheritance_nodes)%>
@@ -58,7 +58,7 @@
<%forlast("<br>")%>
<%endfor%>
-<table style="table-layout:fixed" width="800">
+<table style="table-layout:fixed" width="800" summary="MPC Project Information">
<col width="200">
<col width="600">
<thead>
@@ -88,10 +88,12 @@
<tr><td>tagname *</td><td><%tagname%></td></tr>
<tr><td>tagchecks *</td><td><%tagchecks%></td></tr>
<tr><td>version</td><td><%version%></td></tr>
+</tbody>
<thead>
<tr><td colspan="2">MPC Project Files</td></tr>
<tr><th>Name</th><th>Value</th></tr>
</thead>
+<tbody>
<tr><td>Source Files</td><td><%source_files%></td></tr>
<tr><td>Header Files</td><td><%header_files%></td></tr>
<tr><td>Inline Files</td><td><%inline_files%></td></tr>
@@ -102,10 +104,12 @@
<tr><td><%ucw(custom_type)%></td><td><%custom_type->input_files%></td></tr>
<%endfor%>
<%if(configurations || pch_defines || postbuild)%>
+</tbody>
<thead>
<tr><td colspan="2">MPC Template Settings</td></tr>
<tr><th>Name</th><th>Value</th></tr>
</thead>
+<tbody>
<%comment("common to all mpt files")%>
<%if(postbuild)%>
<tr><td>postbuild</td><td><%postbuild%></td></tr>
@@ -163,7 +167,7 @@
</table>
<p>
-* This keyword is specific to the gnuace project type
+* This keyword is specific to the gnuace project type.
</p>
</body>
diff --git a/templates/make.mpd b/templates/make.mpd
index 2a3fc353..35da7055 100644
--- a/templates/make.mpd
+++ b/templates/make.mpd
@@ -38,7 +38,7 @@ ARFLAGS = <%if(extraarflags)%><%extraarflags%> <%endif%><%arflags%>
<%if(tempinc)%>
TEMPINCDIR = <%tempinc%><%if(tempincopt)%><%slash%><%project_name%><%endif%>
<%endif%>
-LDFLAGS =<%if(libpaths)%><%foreach(libpaths)%> -L"<%libpath%>"<%endfor%><%endif%><%if(linkflags)%> <%linkflags%><%endif%><%if(build64bit && linkflags64)%> <%linkflags64%><%endif%>
+LDFLAGS =<%if(libpaths)%><%foreach(libpaths)%> <%libpathopt(-L)%>"<%libpath%>"<%endfor%><%endif%><%if(linkflags)%> <%linkflags%><%endif%><%if(build64bit && linkflags64)%> <%linkflags64%><%endif%>
<%endfor%>
CCC = $(CXX)
MAKEFILE = <%project_file%>
@@ -120,13 +120,9 @@ $(BTARGETDIR):
@$(MKDIR) "$@"
$(BIN): $(BTARGETDIR)<%foreach(configurations)%><%if(tempinc)%> $(TEMPINCDIR)<%endif%><%foreach(platforms)%><%if(prelink)%> <%targetoutdir%><%noextension(prelink)%>$(OBJEXT)<%endif%><%endfor%><%endfor%> $(OBJS)
- $(LINK.cc) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS)
+ $(LINK.cc) $(OBJS) $(LDLIBS) $(OUTPUT_OPTION)
-<%else%>
-$(LTARGETDIR):
- @$(MKDIR) "$@"
<%endif%>
-
<%foreach(configurations)%>
<%foreach(platforms)%>
<%if(dll_ext)%>
@@ -139,7 +135,7 @@ $(SHTARGETDIR):
<%endif%>
$(SHLIB): $(SHTARGETDIR) <%foreach(configurations)%><%if(tempinc)%>$(TEMPINCDIR) <%endif%><%endfor%>$(OBJS)
- <%foreach(configurations)%><%foreach(platforms)%><%if(dld)%><%dld%> $(LDFLAGS)<%else%>$(LINK.cc)<%endif%><%endfor%><%endfor%> $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS)
+ <%foreach(configurations)%><%foreach(platforms)%><%if(dld)%><%dld%> $(LDFLAGS)<%else%>$(LINK.cc)<%endif%><%endfor%><%endfor%> $(SHFLAGS) $(OBJS) $(LDLIBS) $(OUTPUT_OPTION)
<%else%>
<%if(staticname)%>
all: $(LIB)<%if(postbuild)%> __postbuild__<%endif%>
@@ -154,6 +150,11 @@ all: $(LIB)<%if(postbuild)%> __postbuild__<%endif%>
<%endif%>
<%endfor%>
<%endfor%>
+<%if(!exename)%>
+$(LTARGETDIR):
+ @$(MKDIR) "$@"
+
+<%endif%>
<%if(staticname)%>
$(LIB): $(LTARGETDIR) <%foreach(configurations)%><%if(tempinc)%>$(TEMPINCDIR) <%endif%><%endfor%>$(OBJS)
<%foreach(configurations)%>
@@ -226,9 +227,9 @@ $(TEMPINCDIR):
<%endif%>
<%if(pch_source && pchsupport)%>
<%targetoutdir%><%noextension(pch_source)%>$(OBJEXT): <%pch_source%>
- $(COMPILE.cc) <%if(pchcreate)%><%pchcreate%><%targetoutdir%><%pch_header%>.gch <%endif%>$(EXPORTFLAGS)<%if(!pchnobj)%> $(OUTPUT_OPTION)<%endif%> <%pch_source%>
+ $(COMPILE.cc) <%if(pchcreate)%><%pchcreate%><%targetoutdir%><%pch_header%><%pchext%> <%endif%>$(EXPORTFLAGS)<%if(!pchnobj)%> $(OUTPUT_OPTION)<%endif%> <%pch_source%>
<%if(pchnobj)%>
- @$(CP) <%pch_header%>.gch <%targetoutdir%><%noextension(pch_source)%>$(OBJEXT)
+ @$(CP) <%pch_header%><%pchext%> <%targetoutdir%><%noextension(pch_source)%>$(OBJEXT)
<%endif%>
<%endif%>
@@ -237,7 +238,7 @@ $(TEMPINCDIR):
<%if(targetoutdir)%>
@$(MKDIR) <%targetoutdir%><%dirname(source_file)%>
<%endif%>
- $(COMPILE.cc) <%if(pchuse && pch_source && pchsupport)%><%pchuse%><%pch_header%>.gch <%endif%>$(EXPORTFLAGS) $(OUTPUT_OPTION) <%source_file%>
+ $(COMPILE.cc) <%if(pchuse && pch_source && pchsupport)%><%pchuse%><%pch_header%><%pchext%> <%if(pchstop)%><%pchstop%><%pch_header%><%endif%><%endif%>$(EXPORTFLAGS) $(OUTPUT_OPTION) <%source_file%>
<%endfor%>
<%endfor%>
@@ -253,8 +254,11 @@ $(TEMPINCDIR):
<%endfor%>
<%endif%>
clean:
- -$(RM) $(OBJS)<%if(pch_source && pchsupport)%> <%pch_header%>.gch<%endif%>
+ -$(RM) $(OBJS)
<%foreach(configurations)%>
+<%if(pch_source && pchsupport)%>
+ -$(RM) <%pch_header%><%pchext%>
+<%endif%>
<%if(clean)%>
-$(RM) <%clean%>
<%endif%>
diff --git a/templates/makedll.mpt b/templates/makedll.mpt
index a55b47a9..c761ad68 100644
--- a/templates/makedll.mpt
+++ b/templates/makedll.mpt
@@ -29,6 +29,7 @@ targetoutdir =
slash = /
libopt = -l
build64bit = 1
+pchext = .gch
// ***********************************************************************
// Configuration Section
@@ -45,7 +46,7 @@ java {
platforms = jvm
}
-cxx {
+cxx_tru64 {
cxx = cxx
clean = cxx_repository so_locations
tempincopt = "-ptr "
@@ -83,6 +84,10 @@ SunCC {
linkflags = -library=Cstd -library=Crun
clean = SunWS_cache ir.out
platforms = solaris
+ pchcreate = -xpch=collect:
+ pchuse = -xpch=use:
+ pchstop = -xpchstop=
+ pchext = .Cpch
}
aCC {
@@ -184,7 +189,7 @@ openvms {
}
linux {
- ldlibs = -ldl -lpthread
+ ldlibs = -ldl -lpthread $(subst lib,-l,$(sort $(basename $(notdir $(wildcard /usr/lib/librt.so /lib/librt.so)))))
extracppflags = -D_REENTRANT
}
diff --git a/templates/vc7.mpd b/templates/vc7.mpd
index fe9cf224..c3bba7f4 100644
--- a/templates/vc7.mpd
+++ b/templates/vc7.mpd
@@ -49,7 +49,11 @@
<%if(StringPooling)%>
StringPooling="<%StringPooling%>"
<%endif%>
- RuntimeLibrary="<%if(!optimize)%><%runtime_library("3")%><%else%><%runtime_library("2")%><%endif%>"
+<%if(runtime_library)%>
+ RuntimeLibrary="<%runtime_library%>"
+<%else%>
+ RuntimeLibrary="<%if(type_is_static)%><%if(!optimize)%>1<%else%>0<%endif%><%else%><%if(!optimize)%>3<%else%>2<%endif%><%endif%>"
+<%endif%>
BufferSecurityCheck="<%BufferSecurityCheck("TRUE")%>"
EnableFunctionLevelLinking="<%EnableFunctionLevelLinking("TRUE")%>"
TreatWChar_tAsBuiltInType="<%wchar_t("TRUE")%>"
diff --git a/templates/vc7dll.mpt b/templates/vc7dll.mpt
index 9da27daf..f9e5f5ad 100644
--- a/templates/vc7dll.mpt
+++ b/templates/vc7dll.mpt
@@ -14,7 +14,6 @@ Release {
defines = NDEBUG
output_dir = Release
intermediate_dir = Release
- runtime_library = 2
}
Debug {
@@ -23,7 +22,6 @@ Debug {
output_dir = .
intermediate_dir = Debug
lib_modifier = d
- runtime_library = 3
pdbl = 1
pdbc = 1
}
@@ -35,7 +33,6 @@ MFC Release {
output_dir = MFC_Release
intermediate_dir = MFC_Release
lib_modifier = mfc
- runtime_library = 2
use_mfc = 2
}
@@ -45,7 +42,6 @@ MFC Debug {
output_dir = MFC_Debug
intermediate_dir = MFC_Debug
lib_modifier = mfcd
- runtime_library = 3
pdbl = 1
pdbc = 1
use_mfc = 2
diff --git a/templates/vc7exe.mpt b/templates/vc7exe.mpt
index 6c4482eb..bb653f22 100644
--- a/templates/vc7exe.mpt
+++ b/templates/vc7exe.mpt
@@ -16,7 +16,6 @@ Release {
defines = NDEBUG
output_dir = Release
intermediate_dir = Release
- runtime_library = 2
}
Debug {
@@ -25,7 +24,6 @@ Debug {
output_dir = .
intermediate_dir = Debug
lib_modifier = d
- runtime_library = 3
pdbl = 1
pdbc = 1
}
@@ -38,7 +36,6 @@ MFC Release {
output_dir = MFC_Release
intermediate_dir = MFC_Release
lib_modifier = mfc
- runtime_library = 2
use_mfc = 2
unicode_mfc_entry = wWinMainCRTStartup
}
@@ -50,7 +47,6 @@ MFC Debug {
output_dir = MFC_Debug
intermediate_dir = MFC_Debug
lib_modifier = mfcd
- runtime_library = 3
pdbl = 1
pdbc = 1
use_mfc = 2
diff --git a/templates/vc7lib.mpt b/templates/vc7lib.mpt
index d3062d81..c8028acb 100644
--- a/templates/vc7lib.mpt
+++ b/templates/vc7lib.mpt
@@ -15,7 +15,6 @@ Release {
output_dir = Static_Release
intermediate_dir = Static_Release
lib_modifier = s
- runtime_library = 2
}
Debug {
@@ -24,7 +23,6 @@ Debug {
output_dir = Static_Debug
intermediate_dir = Static_Debug
lib_modifier = sd
- runtime_library = 3
pdbc = 1
}
@@ -34,7 +32,6 @@ MFC Release {
output_dir = Static_MFC_Release
intermediate_dir = Static_MFC_Release
lib_modifier = mfcs
- runtime_library = 2
use_mfc = 2
}
@@ -44,7 +41,6 @@ MFC Debug {
output_dir = Static_MFC_Debug
intermediate_dir = Static_MFC_Debug
lib_modifier = mfcsd
- runtime_library = 3
pdbc = 1
use_mfc = 2
}
diff --git a/templates/vc7libexe.mpt b/templates/vc7libexe.mpt
index f380f22c..fbc81623 100644
--- a/templates/vc7libexe.mpt
+++ b/templates/vc7libexe.mpt
@@ -17,7 +17,6 @@ Release {
output_dir = Static_Release
intermediate_dir = Static_Release
lib_modifier = s
- runtime_library = 2
}
Debug {
@@ -26,7 +25,6 @@ Debug {
output_dir = Static_Debug
intermediate_dir = Static_Debug
lib_modifier = sd
- runtime_library = 3
pdbl = 1
pdbc = 1
}
@@ -38,7 +36,6 @@ MFC Release {
output_dir = Static_MFC_Release
intermediate_dir = Static_MFC_Release
lib_modifier = mfcs
- runtime_library = 2
use_mfc = 2
unicode_mfc_entry = wWinMainCRTStartup
}
@@ -49,7 +46,6 @@ MFC Debug {
output_dir = Static_MFC_Debug
intermediate_dir = Static_MFC_Debug
lib_modifier = mfcsd
- runtime_library = 3
pdbl = 1
pdbc = 1
use_mfc = 2
diff --git a/templates/vc8.mpd b/templates/vc8.mpd
index 14bcbc87..8ffbf21e 100644
--- a/templates/vc8.mpd
+++ b/templates/vc8.mpd
@@ -115,7 +115,11 @@
<%if(SmallerTypeCheck)%>
SmallerTypeCheck="<%SmallerTypeCheck%>"
<%endif%>
- RuntimeLibrary="<%RuntimeLibrary("3")%>"
+<%if(runtime_library)%>
+ RuntimeLibrary="<%runtime_library%>"
+<%else%>
+ RuntimeLibrary="<%if(type_is_static)%><%if(!optimize)%>1<%else%>0<%endif%><%else%><%if(!optimize)%>3<%else%>2<%endif%><%endif%>"
+<%endif%>
<%if(StructMemberAlignment)%>
StructMemberAlignment="<%StructMemberAlignment%>"
<%endif%>
diff --git a/templates/vc8dll.mpt b/templates/vc8dll.mpt
index b5a38205..d8c1aeb5 100644
--- a/templates/vc8dll.mpt
+++ b/templates/vc8dll.mpt
@@ -19,7 +19,6 @@ Release {
defines = NDEBUG
output_dir = Release
intermediate_dir = Release
- RuntimeLibrary = 2
}
Debug {
@@ -27,7 +26,6 @@ Debug {
output_dir = .
intermediate_dir = Debug
lib_modifier = d
- RuntimeLibrary = 3
}
MFC Release {
@@ -37,7 +35,6 @@ MFC Release {
output_dir = MFC_Release
intermediate_dir = MFC_Release
lib_modifier = mfc
- RuntimeLibrary = 2
UseOfMFC = 2
}
@@ -46,7 +43,6 @@ MFC Debug {
output_dir = MFC_Debug
intermediate_dir = MFC_Debug
lib_modifier = mfcd
- RuntimeLibrary = 2
UseOfMFC = 2
}
diff --git a/templates/vc8exe.mpt b/templates/vc8exe.mpt
index 6f8518bc..7fdf7c34 100644
--- a/templates/vc8exe.mpt
+++ b/templates/vc8exe.mpt
@@ -19,7 +19,6 @@ Release {
defines = NDEBUG
output_dir = Release
intermediate_dir = Release
- RuntimeLibrary = 2
}
Debug {
@@ -27,7 +26,6 @@ Debug {
output_dir = .
intermediate_dir = Debug
lib_modifier = d
- RuntimeLibrary = 3
}
MFC Release {
@@ -38,7 +36,6 @@ MFC Release {
output_dir = MFC_Release
intermediate_dir = MFC_Release
lib_modifier = mfc
- RuntimeLibrary = 2
UseOfMFC = 2
unicode_mfc_entry = wWinMainCRTStartup
}
@@ -49,7 +46,6 @@ MFC Debug {
output_dir = MFC_Debug
intermediate_dir = MFC_Debug
lib_modifier = mfcd
- RuntimeLibrary = 3
UseOfMFC = 2
unicode_mfc_entry = wWinMainCRTStartup
}
diff --git a/templates/vc8lib.mpt b/templates/vc8lib.mpt
index 56fdd08b..252f2814 100644
--- a/templates/vc8lib.mpt
+++ b/templates/vc8lib.mpt
@@ -19,7 +19,6 @@ Release {
output_dir = Static_Release
intermediate_dir = Static_Release
lib_modifier = s
- RuntimeLibrary = 2
}
Debug {
@@ -27,7 +26,6 @@ Debug {
output_dir = Static_Debug
intermediate_dir = Static_Debug
lib_modifier = sd
- RuntimeLibrary = 3
}
MFC Release {
@@ -36,7 +34,6 @@ MFC Release {
output_dir = Static_MFC_Release
intermediate_dir = Static_MFC_Release
lib_modifier = mfcs
- RuntimeLibrary = 2
UseOfMFC = 2
}
@@ -45,7 +42,6 @@ MFC Debug {
output_dir = Static_MFC_Debug
intermediate_dir = Static_MFC_Debug
lib_modifier = mfcsd
- RuntimeLibrary = 3
UseOfMFC = 2
}
diff --git a/templates/vc8libexe.mpt b/templates/vc8libexe.mpt
index b78b29a5..371776b7 100644
--- a/templates/vc8libexe.mpt
+++ b/templates/vc8libexe.mpt
@@ -20,7 +20,6 @@ Release {
output_dir = Static_Release
intermediate_dir = Static_Release
lib_modifier = s
- RuntimeLibrary = 2
}
Debug {
@@ -28,7 +27,6 @@ Debug {
output_dir = Static_Debug
intermediate_dir = Static_Debug
lib_modifier = sd
- RuntimeLibrary = 3
}
MFC Release {
@@ -38,7 +36,6 @@ MFC Release {
output_dir = Static_MFC_Release
intermediate_dir = Static_MFC_Release
lib_modifier = mfcs
- RuntimeLibrary = 2
UseOfMFC = 2
unicode_mfc_entry = wWinMainCRTStartup
}
@@ -48,7 +45,6 @@ MFC Debug {
output_dir = Static_MFC_Debug
intermediate_dir = Static_MFC_Debug
lib_modifier = mfcsd
- RuntimeLibrary = 3
UseOfMFC = 2
unicode_mfc_entry = wWinMainCRTStartup
}