diff options
-rw-r--r-- | ChangeLog | 28 | ||||
-rw-r--r-- | modules/ProjectCreator.pm | 150 | ||||
-rw-r--r-- | templates/make.mpd | 6 |
3 files changed, 102 insertions, 82 deletions
@@ -1,13 +1,31 @@ +Mon Jan 10 13:58:37 2005 Chad Elliott <elliott_c@ociweb.com> + + * modules/ProjectCreator.pm: + + If 'inputext' is not used in a Define_Custom, still create the + custom type but provide no extensions. This will not cause a + warning when used when "automatic = 1", but nothing will be + automatically added since no input extension was provide. + + Also, fixed a bug where if gendir is set for a particular file + type in one scope, it would be applied to all files even in + different scopes. + + * templates/make.mpd: + + Fixed a bug where the template repository directory wouldn't get + created when necessary. + Mon Jan 10 10:55:51 2005 J.T. Conklin <jtc@acorntoolworks.com> - * templates/automake.mpd: + * templates/automake.mpd: - Added support for pkgconfig_files. + Added support for pkgconfig_files. - * modules/AutomakeWorkspaceCreator.pm: + * modules/AutomakeWorkspaceCreator.pm: - Added pkgconfigdata_DATA to list of automake primaries we detect - for converting = to +=. + Added pkgconfigdata_DATA to list of automake primaries we detect + for converting = to +=. Mon Jan 10 06:27:33 2005 Chad Elliott <elliott_c@ociweb.com> diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index 31f4f702..070b5f83 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -1326,6 +1326,9 @@ sub parse_define_custom { if (!defined $self->{'generated_exts'}->{$tag}->{'automatic'}) { $self->{'generated_exts'}->{$tag}->{'automatic'} = 1; } + if (!defined $self->{'valid_components'}->{$tag}) { + $self->{'valid_components'}->{$tag} = []; + } last; } else { @@ -1703,17 +1706,14 @@ sub generated_filename_arrays { } ## If gendir was specified, then we need to account for that - if (defined $self->{'flag_overrides'}->{$type}) { - foreach my $q (keys %{$self->{'flag_overrides'}->{$type}}) { - if (defined $self->{'flag_overrides'}->{$type}->{$q}->{'gendir'}) { - if ($self->{'flag_overrides'}->{$type}->{$q}->{'gendir'} eq '.') { - $dir = ''; - } - else { - $dir = $self->{'flag_overrides'}->{$type}->{$q}->{'gendir'} . '/'; - } - last; - } + if (defined $self->{'flag_overrides'}->{$type} && + defined defined $self->{'flag_overrides'}->{$type}->{$file} && + defined $self->{'flag_overrides'}->{$type}->{$file}->{'gendir'}) { + if ($self->{'flag_overrides'}->{$type}->{$file}->{'gendir'} eq '.') { + $dir = ''; + } + else { + $dir = $self->{'flag_overrides'}->{$type}->{$file}->{'gendir'} . '/'; } } @@ -1772,91 +1772,93 @@ sub add_generated_files { my($tag) = shift; my($arr) = shift; - ## Remove the escape sequences for the wanted extension. It doesn't - ## matter if the first valid extension is not the same as the actual - ## input file (ex. input = car.y and first ext is .yy). The extension - ## is immediately removed in generated_filename_arrays. my($wanted) = $self->{'valid_components'}->{$gentype}->[0]; - $wanted =~ s/\\//g; + if (defined $wanted) { + ## Remove the escape sequences for the wanted extension. It doesn't + ## matter if the first valid extension is not the same as the actual + ## input file (ex. input = car.y and first ext is .yy). The extension + ## is immediately removed in generated_filename_arrays. + $wanted =~ s/\\//g; - ## Get the generated filenames - my(@added) = (); - foreach my $file (@$arr) { - foreach my $gen ($self->generated_filenames($file, $gentype, $tag, - "$file$wanted", 1, 1)) { - $self->list_generated_file($gentype, $tag, \@added, $gen, $file); + ## Get the generated filenames + my(@added) = (); + foreach my $file (@$arr) { + foreach my $gen ($self->generated_filenames($file, $gentype, $tag, + "$file$wanted", 1, 1)) { + $self->list_generated_file($gentype, $tag, \@added, $gen, $file); + } } - } - if ($#added >= 0) { - my($names) = $self->{$tag}; + if ($#added >= 0) { + my($names) = $self->{$tag}; - ## Get all files in one list and save the directory - ## and component group in a hashed array. - my(@all) = (); - my(%dircomp) = (); - foreach my $name (keys %$names) { - foreach my $key (keys %{$$names{$name}}) { - push(@all, @{$$names{$name}->{$key}}); - foreach my $file (@{$$names{$name}->{$key}}) { - $dircomp{$self->mpc_dirname($file)} = $key; + ## Get all files in one list and save the directory + ## and component group in a hashed array. + my(@all) = (); + my(%dircomp) = (); + foreach my $name (keys %$names) { + foreach my $key (keys %{$$names{$name}}) { + push(@all, @{$$names{$name}->{$key}}); + foreach my $file (@{$$names{$name}->{$key}}) { + $dircomp{$self->mpc_dirname($file)} = $key; + } } } - } - ## Create a small array of only the files we want to add. - ## We put them all together so we can keep them in order when - ## we put them at the front of the main file list. - my(@oktoadd) = (); - foreach my $file (@added) { - if (!$self->already_added(\@all, $file)) { - push(@oktoadd, $file); + ## Create a small array of only the files we want to add. + ## We put them all together so we can keep them in order when + ## we put them at the front of the main file list. + my(@oktoadd) = (); + foreach my $file (@added) { + if (!$self->already_added(\@all, $file)) { + push(@oktoadd, $file); + } } - } - ## If we have files to add, make sure we add them to a group - ## that has the same directory location as the files we're adding. - if ($#oktoadd >= 0) { - my($key) = $dircomp{$self->mpc_dirname($oktoadd[0])}; - if (!defined $key) { - my($defel) = $self->get_default_element_name(); - my($check) = $oktoadd[0]; - foreach my $regext (@{$self->{'valid_components'}->{$tag}}) { - if ($check =~ s/\.inl$//) { - last; + ## If we have files to add, make sure we add them to a group + ## that has the same directory location as the files we're adding. + if ($#oktoadd >= 0) { + my($key) = $dircomp{$self->mpc_dirname($oktoadd[0])}; + if (!defined $key) { + my($defel) = $self->get_default_element_name(); + my($check) = $oktoadd[0]; + foreach my $regext (@{$self->{'valid_components'}->{$tag}}) { + if ($check =~ s/\.inl$//) { + last; + } } - } - foreach my $vc (keys %{$self->{'valid_components'}}) { - if ($vc ne $tag) { - foreach my $name (keys %{$self->{$vc}}) { - foreach my $ckey (keys %{$self->{$vc}->{$name}}) { - if ($ckey ne $defel) { - foreach my $ofile (@{$self->{$vc}->{$name}->{$ckey}}) { - my($file) = $ofile; - foreach my $regext (@{$self->{'valid_components'}->{$vc}}) { - if ($file =~ s/$regext//) { + foreach my $vc (keys %{$self->{'valid_components'}}) { + if ($vc ne $tag) { + foreach my $name (keys %{$self->{$vc}}) { + foreach my $ckey (keys %{$self->{$vc}->{$name}}) { + if ($ckey ne $defel) { + foreach my $ofile (@{$self->{$vc}->{$name}->{$ckey}}) { + my($file) = $ofile; + foreach my $regext (@{$self->{'valid_components'}->{$vc}}) { + if ($file =~ s/$regext//) { + last; + } + } + if ($file eq $check) { + $key = $ckey; last; } } - if ($file eq $check) { - $key = $ckey; - last; - } } + last if (defined $key); } - last if (defined $key); } + last if (defined $key); } - last if (defined $key); + } + if (!defined $key) { + $key = $defel; } } - if (!defined $key) { - $key = $defel; + foreach my $name (keys %$names) { + unshift(@{$$names{$name}->{$key}}, @oktoadd); } } - foreach my $name (keys %$names) { - unshift(@{$$names{$name}->{$key}}, @oktoadd); - } } } } diff --git a/templates/make.mpd b/templates/make.mpd index 083f3772..d58b7950 100644 --- a/templates/make.mpd +++ b/templates/make.mpd @@ -109,7 +109,7 @@ specialscript: <%endif%> <%endfor%> <%endfor%> -$(BIN): <%if(tempinc)%>$(TEMPINCDIR) <%endif%><%targetoutdir%> $(OBJS) <%foreach(configurations)%><%foreach(platforms)%><%if(prelink)%><%targetoutdir%><%noextension(prelink)%>.$(OBJEXT)<%endif%><%endfor%><%endfor%> +$(BIN): <%foreach(configurations)%><%if(tempinc)%>$(TEMPINCDIR) <%endif%><%endfor%><%targetoutdir%> $(OBJS) <%foreach(configurations)%><%foreach(platforms)%><%if(prelink)%><%targetoutdir%><%noextension(prelink)%>.$(OBJEXT)<%endif%><%endfor%><%endfor%> $(LINK.cc) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%endif%> @@ -121,7 +121,7 @@ INSTARGET = $(SHLIB) all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%> -$(SHLIB): <%if(tempinc)%>$(TEMPINCDIR) <%endif%><%targetoutdir%> $(OBJS) +$(SHLIB): <%foreach(configurations)%><%if(tempinc)%>$(TEMPINCDIR) <%endif%><%endfor%><%targetoutdir%> $(OBJS) <%foreach(configurations)%><%foreach(platforms)%><%if(dld)%><%dld%> $(LDFLAGS)<%else%>$(LINK.cc)<%endif%><%endfor%><%endfor%> $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%else%> <%if(!exename)%> @@ -142,7 +142,7 @@ all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%> <%endfor%> <%endfor%> <%if(staticname)%> -$(LIB): <%if(tempinc)%>$(TEMPINCDIR) <%endif%><%targetoutdir%> $(OBJS) +$(LIB): <%foreach(configurations)%><%if(tempinc)%>$(TEMPINCDIR) <%endif%><%endfor%><%targetoutdir%> $(OBJS) $(AR) $(ARFLAGS) $(LIB) $(OBJS)<%foreach(configurations)%><%if(tempinc)%> `find $(TEMPINCDIR) -type f`<%endif%><%endfor%> <%endif%> |