@@ -81,33 +81,37 @@ sub pre_workspace {
81
81
# The first option requires setting environment variables.
82
82
# The second option requires passing parameters to the -relative option.
83
83
84
+ # # Try to read the INTEGRITY installation directory and BSP name from environment.
85
+ # # Default values are the installation directory on Windows and the BSP name
86
+ # # for the simulator for PowerPC architecture.
87
+ my $ghs_os_dir = defined $ENV {GHS_OS_DIR } ? $ENV {GHS_OS_DIR } : ' C:\ghs\int1146' ;
88
+ my $ghs_bsp_name = defined $ENV {GHS_BSP_NAME } ? $ENV {GHS_BSP_NAME } : " sim800" ;
89
+
84
90
# # Print out the preliminary information
85
91
print $fh " #!gbuild$crlf " ,
86
- " macro __OS_DIR=C: \g hs \i nt1146 $crlf " ,
87
- " macro __BSP_NAME=sim800 $crlf " ,
88
- ' macro __BSP_DIR=${__OS_DIR}\${__BSP_NAME}$crlf' ,
92
+ " macro __OS_DIR=$ghs_os_dir $crlf" ,
93
+ " macro __BSP_NAME=$ghs_bsp_name $crlf" ,
94
+ " macro __BSP_DIR=\ $ {__OS_DIR}\\\ $ {__BSP_NAME}$crlf " ,
89
95
" macro ACE_ROOT=%expand_path (.)$crlf " ,
90
- ' macro __BUILD_DIR=${ACE_ROOT}\build$crlf' ,
91
- ' macro __LIBS_DIR_BASE=${__OS_DIR}\libs$crlf' ,
96
+ " macro __BUILD_DIR=\ $ {ACE_ROOT}\\ build$crlf " ,
97
+ " macro __LIBS_DIR_BASE=\ $ {__OS_DIR}\\ libs$crlf " ,
92
98
" primaryTarget=$tgt$crlf " ,
93
- ' customization=${__OS_DIR}\target\integrity.bod$crlf' ,
99
+ " customization=\ $ {__OS_DIR}\\ target\\ integrity.bod$crlf " ,
94
100
" [Project]$crlf " ,
95
- # "\t-DACE_HAS_CPP14$crlf",
96
101
" \t -gcc$crlf " ,
97
102
" \t --c++14$crlf " ,
98
103
" \t --libcxx$crlf " ,
99
104
" \t :sourceDir=.$crlf " ,
100
- ' \t:optionsFile=${__OS_DIR}\target\${__BSP_NAME}.opt$crlf' ,
101
- ' \t-I${ACE_ROOT}$crlf' ,
105
+ " \t :optionsFile=\ $ {__OS_DIR}\\ target\\\ $ {__BSP_NAME}.opt$crlf " ,
106
+ " \t -I\ $ {ACE_ROOT}$crlf " ,
102
107
" \t -language=cxx$crlf " ,
103
108
" \t --new_style_casts$crlf " ,
104
109
" \t -non_shared$crlf " ;
105
110
}
106
111
107
112
# TODO(sonndinh): Looks like this only support [INTEGRITY Application] with
108
113
# only one [Program] (i.e., executable) in the image. But this seems sufficient
109
- # for most cases.
110
- # How does a [INTEGRITY Application] gpj file look with more
114
+ # for most cases. How does a [INTEGRITY Application] gpj file look with more
111
115
# than one [Program]s and how does the corresponding .int file look?
112
116
sub create_integrity_project {
113
117
my ($self , $int_proj , $project , $type , $target ) = @_ ;
@@ -165,11 +169,11 @@ sub mix_settings {
165
169
# (sonndinh): Go through the lines in this project's gpj file.
166
170
# Each line may result in some changes added to the workspace gpj file.
167
171
# The changes are returned in the $mix variable.
168
- # In case the project is an
172
+ # In case the project is an
169
173
while (<$rh >) {
170
174
# (sonndinh): Don't need to add compiler/linker options to the workspace file.
171
175
# The gpj file for each individual project should have those already.
172
- # In the workspace file (the top-level project file), only need to list the child projects.
176
+ # In the workspace file (the top-level project file), only need to list the child projects.
173
177
if (/ ^\s *(\[ (Program|Library|Subproject)\] )\s *$ / ) {
174
178
my $type = $1 ;
175
179
if ($integrity_project && $type eq ' [Program]' ) {
0 commit comments