|
1 /* |
|
2 * Copyright (c) 2007-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: Main entry of LibraryAnalyser |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "la.hpp" |
|
20 |
|
21 // init globals |
|
22 bool _cl_use_gcc = false; |
|
23 bool _cl_use_gcce = false; |
|
24 bool _cl_use_rvct = false; |
|
25 bool _cl_use_libs = false; |
|
26 bool _cl_print_debug = false; |
|
27 |
|
28 string _cl_baselinelibdir = ""; |
|
29 string _cl_currentlibdir = ""; |
|
30 string _cl_baselineversion = ""; |
|
31 string _cl_currentversion = ""; |
|
32 string _cl_reportfile = ""; |
|
33 string _cl_toolsdir = ""; |
|
34 string _cl_tempdir = ""; |
|
35 string _cl_cfiltloc = ""; |
|
36 string _cl_set = ""; |
|
37 string _cl_baselinedlldir = ""; |
|
38 string _cl_currentdlldir = ""; |
|
39 |
|
40 string _gcc_nm_location = ""; |
|
41 string _gcce_nm_location = ""; |
|
42 string _gcce_readelf_location = ""; |
|
43 string _gcce_cfilt_location = ""; |
|
44 string _rvct_armar_location = ""; |
|
45 string _rvct_fromelf_location = ""; |
|
46 string _rvct_cfilt_location = ""; |
|
47 string _petran_location = ""; |
|
48 string _dumpsis_location = ""; |
|
49 string _tempfile_location = ""; |
|
50 string _lib_extension = ""; |
|
51 string _toolchain_name = ""; |
|
52 string _baselinedllfile = ""; |
|
53 string _currentdllfile = ""; |
|
54 |
|
55 vector<string> _lib_files_baseline; |
|
56 vector<string> _lib_files_current; |
|
57 |
|
58 vector<string> _lib_dirs_baseline; |
|
59 vector<string> _lib_dirs_current; |
|
60 vector<string> _dll_dirs_baseline; |
|
61 vector<string> _dll_dirs_current; |
|
62 |
|
63 vector<dll_issue> _dll_issuelist; |
|
64 |
|
65 ofstream _reportf; |
|
66 struct tm* _timenow; |
|
67 |
|
68 int _CRT_glob = 0; // globbing not supported |
|
69 |
|
70 // ---------------------------------------------------------------------------------------------------------- |
|
71 |
|
72 int main(int argc, char* argv[]) |
|
73 { |
|
74 // parse command line arguments |
|
75 ParseCommandLineParameters(argc, argv); |
|
76 |
|
77 // init the environment |
|
78 DoInitialChecksAndPreparations(); |
|
79 |
|
80 // get list of .lib / .dso files |
|
81 GetListsOfImportLibraries(); |
|
82 |
|
83 // filter import library lists based on -set parameter |
|
84 FilterListsOfImportLibraries(); |
|
85 |
|
86 // do more checks before starting the actual analysis |
|
87 DoPreAnalysisChecks(); |
|
88 |
|
89 GetDllDataFiles(); |
|
90 |
|
91 // write header of the report |
|
92 WriteReportHeader(); |
|
93 |
|
94 // generate issue list and write it to the report |
|
95 GenerateAndWriteIssueList(); |
|
96 |
|
97 // write footer of the report |
|
98 WriteReportFooter(); |
|
99 |
|
100 // do some final tasks before we can quit |
|
101 DoFinalTasks(); |
|
102 |
|
103 return EXIT_NORMAL; |
|
104 } |
|
105 |
|
106 // ---------------------------------------------------------------------------------------------------------- |
|
107 |