CN101216776A - Method and system for automatically creating translation and compiling environment - Google Patents

Method and system for automatically creating translation and compiling environment Download PDF

Info

Publication number
CN101216776A
CN101216776A CNA2008100562291A CN200810056229A CN101216776A CN 101216776 A CN101216776 A CN 101216776A CN A2008100562291 A CNA2008100562291 A CN A2008100562291A CN 200810056229 A CN200810056229 A CN 200810056229A CN 101216776 A CN101216776 A CN 101216776A
Authority
CN
China
Prior art keywords
file
critical file
path
compiling environment
exists
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2008100562291A
Other languages
Chinese (zh)
Inventor
田瑞忠
王玉琴
汪康洪
吴永航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CNA2008100562291A priority Critical patent/CN101216776A/en
Publication of CN101216776A publication Critical patent/CN101216776A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a method for automatically creating a compiling environment. The method includes the following steps: firstly, a key file is found in a hardware driver according to the key file corresponding to an object veneer to be compiled and the property requirements corresponding to the key file; secondly, the found existing path of the key file is set as a working path of a compiler; the code of the object veneer to be compiled is compiled by starting command line compiling environment according to the working path of the compiler, thereby automatically creating the command line compiling environment, saving the labor time, improving the labor efficiency, and increasing the portability of the code.

Description

A kind of method and system of automatically creating translation and compiling environment
Technical field
The present invention relates to the communications field, relate in particular to a kind of method and system of automatically creating translation and compiling environment.
Background technology
In the practical application of communication system, tend to use the veneer of different CPU type, at present such as PowerPC, IntelX86, ARM, XSCALE, C51, IXP2400.When the code of the above-mentioned veneer of compiling, adopt command line mode usually.When the CPU at dissimilar veneers and different model compiled, the compiler of use may be different, and compiler is installed under the different catalogues, and may can not find relevant information in registration table.
According to the conventional method, in order to compile the polylith veneer simultaneously, the installation path at the compiler of different CPU type often is set by hand in an autoexec.Use said method, when will treating that at every turn compiled code is transplanted on other machine, all need to revise this autoexec, make it and transplant the installation path coupling of back machine.In addition, in each compiling, also need order of start-up by hand, a drive letter of whole the release directory mapping that will compile, enter into one by one under the catalogue of each veneer under this drive letter, the path of carrying out compiler is provided with, and just can compile then again.When the compiling number of times of version less, the research staff who relates to not for a long time, this method can also be accepted.But more when single board edition to be compiled, when R﹠D force is huge, use this method that work efficiency is descended.
Summary of the invention
For addressing the above problem, the invention provides a kind of method and system of automatically creating translation and compiling environment, its purpose is automatically to set up a command line build environment, saves working time, raises labour efficiency, and strengthens the portability of code.
The invention discloses a kind of method of automatically creating translation and compiling environment, comprising:
Step 1 compiles the critical file of target single board correspondence and the attribute specification of described critical file correspondence according to waiting, searches described critical file in hardware driver;
Step 2, the path that exists of the described critical file that finds is set to the operating path of compiler, according to the operating path startup command row translation and compiling environment of described compiler, to compile the described code of waiting to compile target single board.
Described step 1 further comprises:
Step 21 according to operating system registration table information, is resolved and is obtained the hard disk drive tabulation;
Step 22 according to described hard disk drive tabulation, is searched described critical file in hard disk drive;
Step 23 judges whether the critical file that finds satisfies the attribute specification of described critical file correspondence, if do not satisfy, then execution in step 22 continues to search.
Also comprise after the described step 23, step 24, the path that exists with the described critical file that finds is saved in and waits described in the Search Results file to compile in the board type clauses and subclauses of target single board correspondence.
Also comprise before the described step 1, step 41, the path that exists of in described Search Results file, searching described critical file, if do not find, execution in step 1, otherwise, execution in step 2.
Described step 41 further comprises:
Step 51 judges whether described Search Results file exists, if there is no, and execution in step 1;
Step 52 is searched the described board type clauses and subclauses of waiting to compile the target single board correspondence in described Search Results file, if do not find, and execution in step 1;
Step 53 judges that the critical file in described board type clauses and subclauses exists under the path, whether has the critical file that satisfies described attribute specification, if there is no, and execution in step 1, otherwise, execution in step 2.
Described step 22 also comprises, if do not find described critical file, provides error message, described method abnormal ending.
The invention also discloses a kind of system of automatically creating translation and compiling environment, comprising:
Search module, be used for according to waiting to compile the critical file of target single board correspondence and the attribute of described critical file correspondence is searched described critical file at driver;
Execution module, the path that exists of the described critical file that is used for finding is set to the operating path of compiler, according to the operating path startup command row translation and compiling environment of described compiler, to compile the described code of waiting to compile target single board.
The described module of searching is further used for, according to operating system registration table information, parsing obtains the hard disk drive tabulation, according to described hard disk drive tabulation, in hard disk drive, search described critical file, judge whether the critical file find satisfies the attribute specification of described critical file correspondence, if do not satisfy then continue to search.
The described module of searching also is used for, and the path that exists with the described critical file that finds is saved in and waits described in the Search Results file to compile in the board type clauses and subclauses of target single board correspondence.
Described execution module also is used for searching at described Search Results file the path that exists of described critical file, if do not find, then by the described path that exists of searching module searches to described critical file, if find, the operating path that compiler then is set is that the critical file that finds exists the path.
Beneficial effect of the present invention is, adopt the method for the invention and system, can create a command line build environment automatically, reduce the difficulty that code is transplanted, increase work efficiency, and can effectively prevent because the problem that code release and translation and compiling environment do not match and produced.
Description of drawings
Fig. 1 is a system construction drawing of the present invention;
Fig. 2 is a process flow diagram of realizing the inventive method.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
As shown in Figure 1, the system of automatically creating translation and compiling environment comprises:
Search module 101, be used for according to operating system registration table information, parsing obtains the hard disk drive tabulation, according to described hard disk drive tabulation, in each hard disk drive, search described critical file, judge whether the critical file that finds satisfies the attribute specification of described critical file correspondence, if do not satisfy then continue to search, if satisfy, then the described critical file that will find have a path, be saved in treating in the Search Results file and compile in the board type clauses and subclauses of target single board correspondence, if finally do not find the critical file that satisfies attribute specification, error message then is provided, and the abnormal ending flow process.
Execution module 102, be used to judge whether described Search Results file exists, if there is no, then search by searching module 101, otherwise, judge and whether have the described board type clauses and subclauses of waiting to compile the target single board correspondence in the described Search Results file, if there is no, then search by searching module 101, otherwise, judge that the critical file in described board type clauses and subclauses exists under the path, whether there is the critical file that satisfies described attribute specification, if there is no, search by searching module 101, if exist, the path that exists of the described critical file that finds is set to the operating path of compiler, according to the operating path startup command row translation and compiling environment of described compiler, to compile the described code of waiting to compile target single board.
Method of the present invention is for passing through the data in the registration table of parse operation system, obtain the hard disk drive tabulation, by in each hard disk drive, searching critical file, judge whether the critical file that finds satisfies attribute specification, with the operating path of acquisition compiler, thereby set up corresponding to the command line build environment of waiting to compile target single board.Judge whether hard disk drive exists, the method for judgement for example will judge for judging whether the root file below the hard disk drive exists whether the C dish exists, need only judge the root file c: whether deposit.Concrete analytic method be registry key HKEY_LOCAL_MACHINE SYSTEM search among the MountedDevices have feature string DosDevices character string, extract the character string of feature string place delegation, and extract a letter being right after behind the feature string, the drive letter letter of this letter for existing.Use registry key and do not adopt that to enumerate 26 letters be because do not contain the drive letter of mapping in the project usually, as long as extract effective drive letter, and adopt the method for enumerating 26 letters, and then need to get rid of the drive of virtual map, cause process complicated.
When hard drive space was excessive, critical file search time may be long.In order to shorten the creation-time of translation and compiling environment, reduce search procedure, what the present invention will find waits in the Search Results file to compile in the board type clauses and subclauses of target single board correspondence corresponding to waiting that there is the path in the critical file that compiles target single board, being saved in, and searches plain destination file and is positioned under the particular category.At first determine the path,, carry out search procedure again if can not determine by the Search Results file by the Search Results ff.
Method realization flow of the present invention is as shown in Figure 2:
Step S201 judges whether the Search Results file exists, if there is no, and execution in step S206 then, otherwise, execution in step S202;
Step S202 in the Search Results file, searches the board type clauses and subclauses of waiting to compile the target single board correspondence, if do not find, and execution in step S206 then, otherwise, execution in step S203;
Step S203 judges under the path that the board type clauses and subclauses that find provide, and whether has the critical file that satisfies critical file attribute specification, if there is no, and execution in step S206, otherwise, execution in step S204;
Step S204 is provided with the path that the compiler operating path provides for the board type clauses and subclauses of waiting to compile the target single board correspondence in the Search Results file;
Step S205, the compiler operating path according to being provided with starts a command line build environment;
Step S206 according to the facility information of storing in the registration table, resolves all hard disk drive tabulations of the equipment that obtains;
Step S207 according to hard disk drive tabulation, searches critical file successively in each hard disk drive, if find, and execution in step S208 then, otherwise, execution in step S210;
Step S208 judges whether the attribute of the critical file find satisfies attribute specification, if satisfy, and execution in step S209 then, otherwise execution in step S207;
There is the critical file that finds the path be saved in step S209 to wait in the Search Results file to compile in the board type clauses and subclauses of target single board correspondence.
Step S210 provides error message, the method abnormal ending.
Specific embodiment is described below.
Adopt the board B OARD_A that cpu type is XSCALE, its compiler installation path is DIR_A, the aid installation path is DIR_A_AUX, a cpu type is the board B OARD_B of PowerPC, its compiler installation path is DIR_B, a cpu type is the board B OARD_C of C51, and its compiler installation path is DIR_C.
Corresponding two critical file ccarm.exe of BOARD_A and uca.exe, wherein ccarm.exe is the C language compiler, uca.exe is the microcode instrument, attribute specification is that be 1999-04-23 00:00 ~ 1999-04-23 23:59 the effective time (last modification time) of ccarm.exe, and be 2005-08-21 00:00 ~ 9999-12-31 23:59 the effective time of uca.exe.The corresponding critical file of BOARD_B is ccppc.exe, and attribute specification is that effective size is 133174 bytes.The corresponding critical file c51.exe of BOARD_C.
Use the inventive method and handle and compile the code of BOARD_A, operate as follows:
Judge whether the Search Results file exists, if there is no, then carry out search procedure, otherwise, in the Search Results file, search the board type clauses and subclauses of BRAOAD_A correspondence, if do not find, then carry out search procedure, otherwise, judge under the path that the board type clauses and subclauses that find provide, whether exist respectively and satisfy the file ccarm.exe of effective time at 1999-04-23 00:00 ~ 1999-04-23 23:59, if there is no, carry out search procedure at the file uca.exe of 2005-08-21 00:00 ~ 9999-12-31 23:59 effective time, otherwise, the path that the compiler operating path provides for the board type clauses and subclauses of waiting to compile the target single board correspondence in the Search Results file is set, and the compiling catalogue that enters the BOARD_A place adds relevant compiler directive make BOARD_A, move batch processing then, begin to compile.If compilation tool with treat that the requirement of compiled code does not match, then can report an error, and the needed file of code release is described in prompting.
Search procedure is, according to the facility information of storing in the registration table, parsing obtains the hard disk drive tabulation of equipment, tabulate according to hard disk drive, in each hard disk drive, search critical file successively, if find, judge that then the ccarm.exe file effective time find is whether in 1999-04-2300:00 ~ 1999-04-23 23:59 scope, whether the effective time of uca.exe is in 2005-08-2100:00 ~ 9999-12-31 23:59 scope, if in described scope, existing path DIR_A and uca.exe to exist DIR_A_AUX to be saved in the ccarm.exe that finds waits to compile in the board type clauses and subclauses of target single board correspondence in the Search Results file, if do not meet the demands, then continue to search.If finally do not find, then provide error message, the method abnormal ending.
If compile the code of three veneers, after there was the path in the critical file of then having determined three veneers, the compiler operating path of three veneers was set to critical file and has the path respectively, adds the dependent compilation order, the operation batch processing, then the code of three veneers is once compiled and is finished.
The dynamically manual if desired veneer code that compiles one by one then can be provided with the compiler path and the synthetic order doskey of compiler directive, is stored in this autoexec, and after the operation batch processing, call instruction doskey is to finish dynamically manual compiling.

Claims (10)

1. the method for an automatically creating translation and compiling environment is characterized in that, comprising:
Step 1 compiles the critical file of target single board correspondence and the attribute specification of described critical file correspondence according to waiting, searches described critical file in hardware driver;
Step 2, the path that exists of the described critical file that finds is set to the operating path of compiler, according to the operating path startup command row translation and compiling environment of described compiler, to compile the described code of waiting to compile target single board.
2. the method for automatically creating translation and compiling environment according to claim 1 is characterized in that described step 1 further comprises:
Step 21 according to operating system registration table information, is resolved and is obtained the hard disk drive tabulation;
Step 22 according to described hard disk drive tabulation, is searched described critical file in hard disk drive;
Step 23 judges whether the critical file that finds satisfies the attribute specification of described critical file correspondence, if do not satisfy, then execution in step 22 continues to search.
3. as the method for automatically creating translation and compiling environment as described in the claim 2, it is characterized in that, also comprise step 24 after the described step 23, the path that exists with the described critical file that finds is saved in and waits described in the Search Results file to compile in the board type clauses and subclauses of target single board correspondence.
4. as the method for automatically creating translation and compiling environment as described in the claim 3, it is characterized in that, also comprise before the described step 1, step 41, the path that exists of searching described critical file in described Search Results file is not if find, execution in step 1, otherwise, execution in step 2.
5. as the method for automatically creating translation and compiling environment as described in the claim 4, it is characterized in that described step 41 further comprises:
Step 51 judges whether described Search Results file exists, if there is no, and execution in step 1;
Step 52 is searched the described board type clauses and subclauses of waiting to compile the target single board correspondence in described Search Results file, if do not find, and execution in step 1;
Step 53 judges that the critical file in described board type clauses and subclauses exists under the path, whether has the critical file that satisfies described attribute specification, if there is no, and execution in step 1, otherwise, execution in step 2.
6. as the method for automatically creating translation and compiling environment as described in the claim 2,3,4 or 5, it is characterized in that described step 22 also comprises, if do not find described critical file, provides error message, described method abnormal ending.
7. the system of an automatically creating translation and compiling environment is characterized in that, comprising:
Search module, be used for according to waiting to compile the critical file of target single board correspondence and the attribute of described critical file correspondence is searched described critical file at driver;
Execution module, the path that exists of the described critical file that is used for finding is set to the operating path of compiler, according to the operating path startup command row translation and compiling environment of described compiler, to compile the described code of waiting to compile target single board.
8. as the system of automatically creating translation and compiling environment as described in the claim 7, it is characterized in that, the described module of searching is further used for, according to operating system registration table information, parsing obtains the hard disk drive tabulation, according to described hard disk drive tabulation, searches described critical file in hard disk drive, judge whether the critical file find satisfies the attribute specification of described critical file correspondence, if do not satisfy then continue to search.
9. as the system of automatically creating translation and compiling environment as described in the claim 8, it is characterized in that, the described module of searching also is used for, and the path that exists with the described critical file that finds is saved in and waits described in the Search Results file to compile in the board type clauses and subclauses of target single board correspondence.
10. as the system of automatically creating translation and compiling environment as described in the claim 9, it is characterized in that, described execution module also is used for searching at described Search Results file the path that exists of described critical file, if do not find, then by the described path that exists of searching module searches to described critical file, if find, the operating path that compiler then is set is that the critical file that finds exists the path.
CNA2008100562291A 2008-01-15 2008-01-15 Method and system for automatically creating translation and compiling environment Pending CN101216776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008100562291A CN101216776A (en) 2008-01-15 2008-01-15 Method and system for automatically creating translation and compiling environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008100562291A CN101216776A (en) 2008-01-15 2008-01-15 Method and system for automatically creating translation and compiling environment

Publications (1)

Publication Number Publication Date
CN101216776A true CN101216776A (en) 2008-07-09

Family

ID=39623215

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008100562291A Pending CN101216776A (en) 2008-01-15 2008-01-15 Method and system for automatically creating translation and compiling environment

Country Status (1)

Country Link
CN (1) CN101216776A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467464A (en) * 2010-11-11 2012-05-23 鸿富锦精密工业(深圳)有限公司 System and method for recognizing drive letter of removable storage device drive
CN106648597A (en) * 2016-10-10 2017-05-10 许继集团有限公司 Multi-user concurrent remote compiling engine architecture
US9921857B1 (en) 2017-02-06 2018-03-20 Red Hat Israel, Ltd. Compiler extension for correcting error messages
CN111209005A (en) * 2020-01-06 2020-05-29 腾讯科技(深圳)有限公司 Method and apparatus for compiling program file, and computer-readable storage medium
CN111596920A (en) * 2019-02-21 2020-08-28 迈普通信技术股份有限公司 File compiling method and device, compiling equipment and storage medium
CN112015428A (en) * 2020-08-21 2020-12-01 广州欢网科技有限责任公司 Compiling environment creating method and device and host
CN115827056A (en) * 2023-02-01 2023-03-21 北京乐研科技股份有限公司 Method for configuring multiple compiling environment transformation

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467464A (en) * 2010-11-11 2012-05-23 鸿富锦精密工业(深圳)有限公司 System and method for recognizing drive letter of removable storage device drive
US8713243B2 (en) 2010-11-11 2014-04-29 Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. Removable storage device and method for identifying drive letter of the removable storage device
CN106648597A (en) * 2016-10-10 2017-05-10 许继集团有限公司 Multi-user concurrent remote compiling engine architecture
US9921857B1 (en) 2017-02-06 2018-03-20 Red Hat Israel, Ltd. Compiler extension for correcting error messages
CN111596920A (en) * 2019-02-21 2020-08-28 迈普通信技术股份有限公司 File compiling method and device, compiling equipment and storage medium
CN111209005A (en) * 2020-01-06 2020-05-29 腾讯科技(深圳)有限公司 Method and apparatus for compiling program file, and computer-readable storage medium
CN111209005B (en) * 2020-01-06 2021-07-23 腾讯科技(深圳)有限公司 Method and apparatus for compiling program file, and computer-readable storage medium
CN112015428A (en) * 2020-08-21 2020-12-01 广州欢网科技有限责任公司 Compiling environment creating method and device and host
CN115827056A (en) * 2023-02-01 2023-03-21 北京乐研科技股份有限公司 Method for configuring multiple compiling environment transformation

Similar Documents

Publication Publication Date Title
CN101216776A (en) Method and system for automatically creating translation and compiling environment
EP4099152B1 (en) Extending a virtual machine instruction set architecture
CN100377085C (en) Method for implementing hardware image starting optimizing of embedded operating system
CN101706734B (en) Method and system thereof for translating indirect jump instruction in binary translation
CN103268241A (en) Method for achieving hiding or display of hard disk partitions in BIOS
CN102385527A (en) Device and method for improving execution efficiency of service scripts
US7275242B2 (en) System and method for optimizing a program
CN103902275B (en) A kind of method and system for the language version switching for realizing application
CN102346765A (en) Method and device for querying memory data
KR20040097937A (en) System and method for employing object-based pipelines
CN104794046A (en) Method and system for symbolizing program running log
Chen et al. Effective code discovery for ARM/Thumb mixed ISA binaries in a static binary translator
WO2019042322A1 (en) Translation data management method, storage medium and electronic equipment
CN1975701B (en) Master machine driving external equipment method and system
CN108664238A (en) A kind of execution method and device of explanation type script C-SUB
CN102170428B (en) Dynamic expansion management method of isomerous virtual machine platform
CN112052047A (en) Instruction processing method, terminal and storage medium
WO2020258652A1 (en) Character replacement method and system, computer apparatus, and computer readable storage medium
CN111913704A (en) VScode-based method for rapidly developing GSP7 script and plug-in tool
CN102004633A (en) Method and device for processing control property
CN101295239A (en) Instruction execution method of Java card virtual machine
CN100416448C (en) Computer system and its layout method
CN101876898A (en) Registration method of COM assembly and device thereof
JPH08123697A (en) Emulation speeding-up system
CN100395695C (en) Small size computer system interface command processing method and equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20080709