readme.txt revision 1.1.1.2 1 1.1.1.2 christos /*
2 1.1.1.2 christos * Miscellaneous instructions for building and using the iASL compiler.
3 1.1.1.2 christos */
4 1.1.1.2 christos Last update 9 December 2013.
5 1.1 jruoho
6 1.1 jruoho
7 1.1.1.2 christos 1) Generating iASL from source
8 1.1.1.2 christos ------------------------------
9 1.1.1.2 christos
10 1.1.1.2 christos Generation of the ASL compiler from source code requires these items:
11 1.1.1.2 christos
12 1.1.1.2 christos 1) The ACPICA source code tree.
13 1.1.1.2 christos 2) An ANSI C compiler.
14 1.1.1.2 christos 3) The Flex (or Lex) lexical analyzer generator.
15 1.1.1.2 christos 4) The Bison (or Yacc) parser generator.
16 1.1.1.2 christos
17 1.1.1.2 christos There are three major ACPICA source code components that are required to
18 1.1.1.2 christos generate the compiler (Basically, the entire ACPICA source tree should
19 1.1.1.2 christos be installed):
20 1.1.1.2 christos
21 1.1.1.2 christos 1) The ASL compiler source.
22 1.1.1.2 christos 2) The ACPICA Core Subsystem source. In particular, the Namespace
23 1.1.1.2 christos Manager component is used to create an internal ACPI namespace
24 1.1.1.2 christos and symbol table, and the AML Interpreter is used to evaluate
25 1.1.1.2 christos constant expressions.
26 1.1.1.2 christos 3) The "common" source directory that is used for all ACPI components.
27 1.1.1.2 christos
28 1.1.1.2 christos
29 1.1.1.2 christos 1a) Notes for Linux/Unix generation
30 1.1.1.2 christos -----------------------------------
31 1.1.1.2 christos
32 1.1.1.2 christos iASL has been generated with these versions of Flex/Bison:
33 1.1.1.2 christos
34 1.1.1.2 christos flex: Version 2.5.32
35 1.1.1.2 christos bison: Version 2.6.2
36 1.1.1.2 christos
37 1.1.1.2 christos Other required packages:
38 1.1.1.2 christos
39 1.1.1.2 christos make
40 1.1.1.2 christos gcc C compiler
41 1.1.1.2 christos m4 (macro processor required by bison)
42 1.1.1.2 christos
43 1.1.1.2 christos On Linux/Unix systems, the following commands will build the compiler:
44 1.1.1.2 christos
45 1.1.1.2 christos cd acpica (or cd acpica/generate/unix)
46 1.1.1.2 christos make clean
47 1.1.1.2 christos make iasl
48 1.1.1.2 christos
49 1.1.1.2 christos
50 1.1.1.2 christos 1b) Notes for Windows generation
51 1.1.1.2 christos --------------------------------
52 1.1.1.2 christos
53 1.1.1.2 christos On Windows, the Visual Studio 2008 project file appears in this directory:
54 1.1.1.2 christos
55 1.1.1.2 christos generate/msvc9/AcpiComponents.sln
56 1.1.1.2 christos
57 1.1.1.2 christos The Windows versions of GNU Flex/Bison must be installed, and they must
58 1.1.1.2 christos be installed in a directory that contains no embedded spaces in the
59 1.1.1.2 christos pathname. They cannot be installed in the default "c:\Program Files"
60 1.1.1.2 christos directory. This is a bug in Bison. The default Windows project file for
61 1.1.1.2 christos iASL assumes that these tools are installed at this location:
62 1.1.1.2 christos
63 1.1.1.2 christos c:\GnuWin32
64 1.1.1.2 christos
65 1.1.1.2 christos Once the tools are installed, ensure that this path is added to the
66 1.1.1.2 christos default system $Path environment variable:
67 1.1.1.2 christos
68 1.1.1.2 christos c:\GnuWin32\bin
69 1.1.1.2 christos
70 1.1.1.2 christos Goto: ControlPanel/System/AdvancedSystemSettings/EnvironmentVariables
71 1.1.1.2 christos
72 1.1.1.2 christos Important: Now Windows must be rebooted to make the system aware of
73 1.1.1.2 christos the updated $Path. Otherwise, Bison will not be able to find the M4
74 1.1.1.2 christos interpreter library and will fail.
75 1.1.1.2 christos
76 1.1.1.2 christos iASL has been generated with these versions of Flex/Bison for Windows:
77 1.1.1.2 christos
78 1.1.1.2 christos Flex for Windows: V2.5.4a
79 1.1.1.2 christos Bison for Windows: V2.4.1
80 1.1.1.2 christos
81 1.1.1.2 christos Flex is available at: http://gnuwin32.sourceforge.net/packages/flex.htm
82 1.1.1.2 christos Bison is available at: http://gnuwin32.sourceforge.net/packages/bison.htm
83 1.1.1.2 christos
84 1.1.1.2 christos
85 1.1.1.2 christos
86 1.1.1.2 christos 2) Integration as a custom tool for Visual Studio
87 1.1.1.2 christos -------------------------------------------------
88 1.1 jruoho
89 1.1 jruoho This procedure adds the iASL compiler as a custom tool that can be used
90 1.1.1.2 christos to compile ASL source files. The output is sent to the VC output
91 1.1 jruoho window.
92 1.1 jruoho
93 1.1 jruoho a) Select Tools->Customize.
94 1.1 jruoho
95 1.1 jruoho b) Select the "Tools" tab.
96 1.1 jruoho
97 1.1.1.2 christos c) Scroll down to the bottom of the "Menu Contents" window. There you
98 1.1.1.2 christos will see an empty rectangle. Click in the rectangle to enter a
99 1.1 jruoho name for this tool.
100 1.1 jruoho
101 1.1.1.2 christos d) Type "iASL Compiler" in the box and hit enter. You can now edit
102 1.1 jruoho the other fields for this new custom tool.
103 1.1 jruoho
104 1.1 jruoho e) Enter the following into the fields:
105 1.1 jruoho
106 1.1 jruoho Command: C:\Acpi\iasl.exe
107 1.1.1.2 christos Arguments: -vi "$(FilePath)"
108 1.1 jruoho Initial Directory "$(FileDir)"
109 1.1 jruoho Use Output Window <Check this option>
110 1.1 jruoho
111 1.1 jruoho "Command" must be the path to wherever you copied the compiler.
112 1.1.1.2 christos "-vi" instructs the compiler to produce messages appropriate for VC.
113 1.1 jruoho Quotes around FilePath and FileDir enable spaces in filenames.
114 1.1 jruoho
115 1.1 jruoho f) Select "Close".
116 1.1 jruoho
117 1.1 jruoho These steps will add the compiler to the tools menu as a custom tool.
118 1.1 jruoho By enabling "Use Output Window", you can click on error messages in
119 1.1 jruoho the output window and the source file and source line will be
120 1.1.1.2 christos automatically displayed by VC. Also, you can use F4 to step through
121 1.1 jruoho the messages and the corresponding source line(s).
122 1.1 jruoho
123 1.1 jruoho
124 1.1.1.2 christos
125 1.1.1.2 christos 3) Integrating iASL into a Visual Studio ASL project build
126 1.1.1.2 christos ----------------------------------------------------------
127 1.1 jruoho
128 1.1 jruoho This procedure creates a project that compiles ASL files to AML.
129 1.1 jruoho
130 1.1 jruoho a) Create a new, empty project and add your .ASL files to the project
131 1.1 jruoho
132 1.1 jruoho b) For all ASL files in the project, specify a custom build (under
133 1.1 jruoho Project/Settings/CustomBuild with the following settings (or similar):
134 1.1 jruoho
135 1.1 jruoho Commands:
136 1.1.1.2 christos c:\acpi\libraries\iasl.exe -vs -vi "$(InputPath)"
137 1.1 jruoho
138 1.1 jruoho Output:
139 1.1.1.2 christos $(InputDir)\$(InputPath).aml
140