Skip to content

Commit 5192450

Browse files
committed
Remove the reltop_ uses in GHS template
1 parent 35e8d37 commit 5192450

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

modules/GHSProjectCreator.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ sub fill_value {
8787
$startre = $self->escape_regex_special($self->getstartdir());
8888
}
8989

90+
## NOTE(sonndinh): As of Green Hills MULTI IDE v8.1.4, the paths do not
91+
## need to be relative to the top directory. Hence, most of the reltop_
92+
## uses in the GHS template are removed.
93+
9094
## The Green Hills project format is strange and needs all paths
9195
## relative to the top directory, no matter where the source files
9296
## reside. The template uses reltop_ in front of the real project

modules/GHSWorkspaceCreator.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ sub pre_workspace {
9898
"primaryTarget=$tgt$crlf",
9999
"customization=\${__OS_DIR}\\target\\integrity.bod$crlf",
100100
"[Project]$crlf",
101+
"\t-DACE_HAS_CPP14$crlf",
101102
"\t-gcc$crlf",
102103
"\t--c++14$crlf",
103104
"\t--libcxx$crlf",

templates/ghs.mpd

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
#!gbuild
22
#primaryTarget=<%primaryTarget("ppc_integrity.tgt")%>
33
<%if(exename)%>
4-
[Program]
5-
-o <%if(exeout)%><%reltop_exeout%><%else%><%reltop%><%endif%>/<%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%>
4+
[Program]
5+
-o <%if(exeout)%><%exeout%><%endif%>/<%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%>
66
<%if(need_staticflags)%>
77
-non_shared
88
<%endif%>
99
<%else%>
10-
<%comment("TODO-sonndinh: If we put the sharedname branch before the staticname branch, MPC picks")%>
11-
<%comment("the sharedname branch even if we have a specific clause with ghs type in .mpc file")%>
12-
<%comment("and call mpc.pl -type ghs with that .mpc file. As a temporary fix, put staticname first.")%>
13-
<%if(staticname)%>
14-
[Library]
15-
-o <%reltop_libout%>\<%lib_prefix%><%libname_prefix%><%staticname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%libext(".a")%>
10+
<%comment("sonndinh: When sharedname is defined and staticname is not set in the mpc file,")%>
11+
<%comment("the staticname takes the same value as sharedname. The opposite is also true.")%>
12+
<%comment("Because of that, we can't condition only on whether either of them is defined.")%>
13+
<%comment("This fixes that by including the template input variable need_staticflags.")%>
14+
<%if(!need_staticflags && sharedname)%>
15+
[Shared Object]
16+
-o <%if(dllout)%><%dllout%><%else%><%libout%><%endif%>/<%lib_prefix%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%libext(".so")%>
1617
<%else%>
17-
<%if(sharedname)%>
18-
[Shared Object]
19-
-o <%if(dllout)%><%reltop_dllout%><%else%><%reltop_libout%><%endif%>/<%lib_prefix%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%libext(".so")%>
18+
<%if(need_staticflags && staticname)%>
19+
[Library]
20+
-o <%libout%>/<%lib_prefix%><%libname_prefix%><%staticname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%libext(".a")%>
2021
<%else%>
21-
[Subproject]
22+
[Subproject]
2223
<%endif%>
2324
<%endif%>
2425
<%endif%>
@@ -43,11 +44,11 @@
4344
-D<%pch_define%>
4445
<%endfor%>
4546
<%endif%>
46-
<%foreach(reltop_includes)%>
47-
-I<%reltop_include%>
47+
<%foreach(includes)%>
48+
-I<%include%>
4849
<%endfor%>
49-
<%foreach(reltop_libpaths)%>
50-
-L<%reltop_libpath%>
50+
<%foreach(libpaths)%>
51+
-L<%libpath%>
5152
<%endfor%>
5253
<%if(libs || lit_libs || pure_libs)%>
5354
<%if(exename || sharedname)%>

0 commit comments

Comments
 (0)