Subversion Repositories gelsvn

Rev

Rev 217 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
107 bj 1
package GHSWorkspaceCreator;
2
 
3
# ************************************************************
4
# Description   : An incomplete GHS Workspace creator
5
# Author        : Chad Elliott
6
# Create Date   : 7/3/2002
7
# ************************************************************
8
 
9
# ************************************************************
10
# Pragmas
11
# ************************************************************
12
 
13
use strict;
14
 
15
use GHSProjectCreator;
16
use WorkspaceCreator;
17
 
18
use vars qw(@ISA);
19
@ISA = qw(WorkspaceCreator);
20
 
21
my(%directives) = ('sysincdirs' => 1,
22
                   'libdirs'    => 1,
23
                   'syslibdirs' => 1,
24
                   'libraries'  => 1,
25
                   'defines'    => 1,
26
                   'staticlink' => 1,
27
                   'deflibdirs' => 1,
28
                  );
29
 
30
# ************************************************************
31
# Subroutine Section
32
# ************************************************************
33
 
34
sub compare_output {
35
  #my($self) = shift;
36
  return 1;
37
}
38
 
39
 
40
sub workspace_file_name {
41
  my($self) = shift;
42
  return $self->get_modified_workspace_name('default', '.bld');
43
}
44
 
45
 
46
sub pre_workspace {
47
  my($self) = shift;
48
  my($fh)   = shift;
49
  my($crlf) = $self->crlf();
50
 
51
  print $fh "#!build$crlf",
52
            "default:$crlf",
53
            "\tnobuild$crlf",
54
            "\t:cx_option=exceptions$crlf",
55
            "\t:cx_option=std_namespaces$crlf",
56
            "\t:language=cxx$crlf",
57
            "\t:config_setting=longlong$crlf",
58
            "\t:cx_mode=ansi$crlf";
59
}
60
 
61
 
62
sub mix_settings {
63
  my($self)    = shift;
64
  my($project) = shift;
65
  my($crlf)    = $self->crlf();
66
  my($rh)      = new FileHandle();
67
  my($mix)     = '';
68
  my($outdir)  = $self->get_outdir();
69
 
70
  ## Things that seem like they should be set in the project
71
  ## actually have to be set in the controlling build file.
72
  if (open($rh, "$outdir/$project")) {
73
    while(<$rh>) {
74
      if (/^\s*(program|library|subproject)\s*$/) {
75
        $mix .= "\t$1$crlf" .
76
                "\t:object_dir=" . $self->mpc_dirname($project) .
77
                '/.obj' . $crlf;
78
      }
79
      elsif (/^\s*(shared_library)\s*$/) {
80
        $mix .= "\t$1$crlf" .
81
                "\t:config_setting=pic$crlf" .
82
                "\t:object_dir=" . $self->mpc_dirname($project) .
83
                '/.shobj' . $crlf;
84
      }
85
      else {
86
        if (/^\s*:(\w+)=/) {
87
          if (defined $directives{$1}) {
88
            $mix .= $_;
89
          }
90
        }
91
      }
92
    }
93
    close($rh);
94
  }
95
 
96
  return $mix;
97
}
98
 
99
 
100
sub write_comps {
101
  my($self) = shift;
102
  my($fh)   = shift;
103
  my($crlf) = $self->crlf();
104
 
105
  ## Print out each projet
217 bj 106
  foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
107 bj 107
    print $fh "$project$crlf",
108
              $self->mix_settings($project);
109
  }
110
}
111
 
112
 
113
 
114
1;