20
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Contains functions to check AT libraries.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
#include "../inc/ATCommonDefines.h"
|
|
18 |
#include "../inc/CATBase.h"
|
|
19 |
|
|
20 |
// Function declarations
|
|
21 |
bool CheckATLibrariesArmv5( string sEpocRoot );
|
|
22 |
bool CheckATLibrariesArmv5Abiv2( string sEpocRoot );
|
|
23 |
bool CheckATLibrariesWinscw( string sEpocRoot );
|
|
24 |
|
|
25 |
// Error msg to user if missing lib
|
|
26 |
const char cMissingAToolLibs[] = "\nCan not find AnalyzeTool libraries from current SDK\n\nInstall libraries first\n";
|
|
27 |
|
|
28 |
// List of libraries what AnalyzeTool needs when compiled applications on armv5 platform
|
|
29 |
const string cAToolLibsArmv5[] = {
|
|
30 |
"epoc32\\RELEASE\\armv5\\LIB\\AToolMemoryHook.lib",
|
|
31 |
"epoc32\\RELEASE\\armv5\\udeb\\AtoolStaticLib.lib",
|
|
32 |
"epoc32\\RELEASE\\armv5\\urel\\AtoolStaticLib.lib"
|
|
33 |
};
|
|
34 |
|
|
35 |
// List of libraries what AnalyzeTool needs when compiled applications on armv5 platform (using sbs2 / ABIV2 binaries)
|
|
36 |
const string cAToolLibsArmv5Abiv2[] = {
|
|
37 |
"epoc32\\RELEASE\\armv5\\LIB\\AToolMemoryHook.dso",
|
|
38 |
"epoc32\\RELEASE\\armv5\\udeb\\AtoolStaticLib.lib",
|
|
39 |
"epoc32\\RELEASE\\armv5\\urel\\AtoolStaticLib.lib"
|
|
40 |
};
|
|
41 |
|
|
42 |
// List of libraries what AnalyzeTool needs when compiled applications on winscw platform
|
|
43 |
const string cAToolLibsWinscw[] = {
|
|
44 |
"epoc32\\RELEASE\\winscw\\udeb\\AToolMemoryHook.lib",
|
|
45 |
"epoc32\\RELEASE\\winscw\\udeb\\AtoolStaticLib.lib",
|
|
46 |
"epoc32\\RELEASE\\winscw\\urel\\AtoolStaticLib.lib"
|
|
47 |
};
|
|
48 |
|
|
49 |
/**
|
|
50 |
* CheckATLibrariesArmv5
|
|
51 |
* Checks that armv5 libraries are in sEpocRoot
|
|
52 |
* @param sEpocRoot, epoc root where to search libs
|
|
53 |
* @return bool true if they are found otherwise false
|
|
54 |
*/
|
|
55 |
bool CheckATLibrariesArmv5(string sEpocRoot )
|
|
56 |
{
|
|
57 |
LOG_FUNC_ENTRY("CheckATLibrariesArmv5");
|
|
58 |
|
|
59 |
// check that epocroot is set
|
|
60 |
if ( sEpocRoot.length() <= 0 )
|
|
61 |
{
|
|
62 |
LOG_FUNC_EXIT("CheckATLibrariesArmv5 Error, EpocRoot not set");
|
|
63 |
return false;
|
|
64 |
}
|
|
65 |
|
|
66 |
// add trailing '\' if root path is missing it
|
|
67 |
if ( sEpocRoot.at( sEpocRoot.length() -1 ) != '\\' )
|
|
68 |
sEpocRoot.append( "\\" );
|
|
69 |
|
|
70 |
// return boolean value
|
|
71 |
bool bReturn = true;
|
|
72 |
|
|
73 |
int arraySize = sizeof( cAToolLibsArmv5 ) / sizeof( string );
|
|
74 |
for ( int i=0 ; i < arraySize ; i++ )
|
|
75 |
{
|
|
76 |
// append epocroot to file
|
|
77 |
string sFileToCheck = sEpocRoot;
|
|
78 |
sFileToCheck.append( cAToolLibsArmv5[i] );
|
|
79 |
// check does it exists
|
|
80 |
if ( ! CATBase::FileExists( sFileToCheck.c_str() ) )
|
|
81 |
{
|
|
82 |
bReturn = false;
|
|
83 |
cout << AT_MSG << "Missing library file: " << sFileToCheck << endl;
|
|
84 |
LOG_STRING("Missing library file: " << sFileToCheck);
|
|
85 |
}
|
|
86 |
}
|
|
87 |
|
|
88 |
if ( ! bReturn )
|
|
89 |
{
|
|
90 |
// print error msg to user
|
|
91 |
cout << cMissingAToolLibs;
|
|
92 |
|
|
93 |
}
|
|
94 |
return bReturn;
|
|
95 |
}
|
|
96 |
|
|
97 |
/**
|
|
98 |
* CheckATLibrariesArmv5Abiv2
|
|
99 |
* Checks that armv5 abiv2 libraries are in sEpocRoot
|
|
100 |
* @param sEpocRoot, epoc root where to search libs
|
|
101 |
* @return bool true if they are found otherwise false
|
|
102 |
*/
|
|
103 |
bool CheckATLibrariesArmv5Abiv2(string sEpocRoot )
|
|
104 |
{
|
|
105 |
LOG_FUNC_ENTRY("CheckATLibrariesArmv5Abiv2");
|
|
106 |
|
|
107 |
// check that epocroot is set
|
|
108 |
if ( sEpocRoot.length() <= 0 )
|
|
109 |
{
|
|
110 |
LOG_FUNC_EXIT("CheckATLibrariesArmv5Abiv2 Error, EpocRoot not set");
|
|
111 |
return false;
|
|
112 |
}
|
|
113 |
|
|
114 |
// add trailing '\' if root path is missing it
|
|
115 |
if ( sEpocRoot.at( sEpocRoot.length() -1 ) != '\\' )
|
|
116 |
sEpocRoot.append( "\\" );
|
|
117 |
|
|
118 |
// return boolean value
|
|
119 |
bool bReturn = true;
|
|
120 |
|
|
121 |
int arraySize = sizeof( cAToolLibsArmv5Abiv2 ) / sizeof( string );
|
|
122 |
for ( int i=0 ; i < arraySize ; i++ )
|
|
123 |
{
|
|
124 |
// append epocroot to file
|
|
125 |
string sFileToCheck = sEpocRoot;
|
|
126 |
sFileToCheck.append( cAToolLibsArmv5Abiv2[i] );
|
|
127 |
// check does it exists
|
|
128 |
if ( ! CATBase::FileExists( sFileToCheck.c_str() ) )
|
|
129 |
{
|
|
130 |
bReturn = false;
|
|
131 |
cout << AT_MSG << "Missing library file: " << sFileToCheck << endl;
|
|
132 |
LOG_STRING("Missing library file: " << sFileToCheck);
|
|
133 |
}
|
|
134 |
}
|
|
135 |
|
|
136 |
if ( ! bReturn )
|
|
137 |
{
|
|
138 |
// print error msg to user
|
|
139 |
cout << cMissingAToolLibs;
|
|
140 |
|
|
141 |
}
|
|
142 |
return bReturn;
|
|
143 |
}
|
|
144 |
|
|
145 |
/**
|
|
146 |
* CheckATLibrariesWinscw
|
|
147 |
* Checks that winscw libraries are in sEpocRoot
|
|
148 |
* @param sEpocRoot, epoc root where to search libs
|
|
149 |
* @return bool true if they are found otherwise false
|
|
150 |
*/
|
|
151 |
bool CheckATLibrariesWinscw(string sEpocRoot )
|
|
152 |
{
|
|
153 |
LOG_FUNC_ENTRY("CheckATLibrariesWinscw");
|
|
154 |
|
|
155 |
// check that epocroot is set
|
|
156 |
if ( sEpocRoot.length() <= 0 )
|
|
157 |
{
|
|
158 |
LOG_FUNC_EXIT("CheckATLibrariesArmv5Abiv2 Error, EpocRoot not set");
|
|
159 |
return false;
|
|
160 |
}
|
|
161 |
|
|
162 |
// add trailing '\' if root path is missing it
|
|
163 |
if ( sEpocRoot.at( sEpocRoot.length() -1 ) != '\\' )
|
|
164 |
sEpocRoot.append( "\\" );
|
|
165 |
|
|
166 |
// return boolean value
|
|
167 |
bool bReturn = true;
|
|
168 |
|
|
169 |
int arraySize = sizeof( cAToolLibsWinscw ) / sizeof( string );
|
|
170 |
for ( int i=0 ; i < arraySize ; i++ )
|
|
171 |
{
|
|
172 |
// append epocroot to file
|
|
173 |
string sFileToCheck = sEpocRoot;
|
|
174 |
sFileToCheck.append( cAToolLibsWinscw[i] );
|
|
175 |
// check does it exists
|
|
176 |
if ( ! CATBase::FileExists( sFileToCheck.c_str() ) )
|
|
177 |
{
|
|
178 |
bReturn = false;
|
|
179 |
cout << AT_MSG << "Missing library file: " << sFileToCheck << endl;
|
|
180 |
LOG_STRING("Missing library file: " << sFileToCheck);
|
|
181 |
}
|
|
182 |
}
|
|
183 |
|
|
184 |
if ( ! bReturn )
|
|
185 |
{
|
|
186 |
// print error msg to user
|
|
187 |
cout << cMissingAToolLibs;
|
|
188 |
|
|
189 |
}
|
|
190 |
return bReturn;
|
|
191 |
}
|
|
192 |
|
|
193 |
//EOF
|