]> git.saurik.com Git - apple/security.git/blame - libsecurity_codesigning/antlr2/README
Security-55471.14.18.tar.gz
[apple/security.git] / libsecurity_codesigning / antlr2 / README
CommitLineData
427c49bc
A
1ANTLR C++ Support Libraries Additional Notes
2
31.1 Using Microsoft Visual C++
4
5Currently this is still (or again) somewhat experimental. MSVC is not the
6development platform and I don't have access to the compiler currently.
7YMMV
8
9Make sure you compile the library *and* your project with the same
10settings. (multithreaded/debug/etc.)
11
12Visual C++ 6 only is supported for static builds. Some hacking and STLPort
13is needed to build a DLL (only for experts).
14
15Visual C++ 7.0 and 7.1 should support both static and DLL builds (DLL
16builds might be broken). In general the main problem is getting the right
17template instantiations into the DLL. For 7.0 you might have to tweak the
18list in lib/cpp/src/dll.cpp. I'm told 7.1 does not need this.
19
20For a static build (works probably best)
21
221. Create a win32 static library project.
232. Enable RTTI. (Run Time Type Information)
243. Add the source files from <installpath>/antlr/lib/cpp/src to the project
25 (except dll.cpp) put <installpath>/antlr/lib/cpp in the search path for
26 include files.
27
28For the DLL build (MSVC 7.0 tested)
29
30* Project settings ("create new project" dialogs)
31 - Win32 project
32 - Application Settings
33 - Application type
34 - DLL
35 - Additional options
36 - Export symbols
37* Project properties (change defaults to)
38 - Configuration Properties
39 - C/C++
40 - General
41 - Additional Include Directories
42 - drive:\antlr-2.7.2\lib\cpp
43 - Preprocessor
44 - Preprocessor Definitions
45 - WIN32;_DEBUG;_WINDOWS;_USRDLL;ANTLR_EXPORTS
46 - Code Generation
47 - Runtime Library
48 - Multi-threaded Debug DLL (/MDd)
49 - Enable Function-Level Linking:
50 - Yes
51 - Language
52 - Enable Run-Time Type Info
53 - Yes
54 - Precompiled Headers
55 - Create/Use Precompiled Headers
56
57NOTE: Do not use the antlr generated and support library in a multithreaded
58way. It was not designed for a multithreaded environment.
59
601.3 Building with GCJ
61
62NOTE: outdated the new Makefiles do not support this anymore.
63
64It is also possible to build a native binary of ANTLR. This is somewhat
65experimental and can be enabled by giving the --enable-gcj option to
66configure. You need a recent GCC to do this and even then the constructed
67binary crashes on some platforms.
68
692. Tested Compilers for this release
70
71Don't get worried if your favourite compiler is not mentioned here. Any
72somewhat recent ISO compliant C++ compiler should have little trouble with
73the runtime library.
74
75*NOTE* this section was not updated for the new configure script/Makefiles some of the things listed here to pass different flags to configure may not work anymore. Check INSTALL.txt or handedit generated scripts after configure.
76
772.1 Solaris
78
792.1.1 Sun Workshop 6.0
80
81Identifies itself as:
82
83 CC: Sun WorkShop 6 2000/08/30 C++ 5.1 Patch 109490-01
84
85Compiles out of the box configure using:
86
87 CXX=CC CC=cc AR=CC ARFLAGS="-xar -o" ./configure
88
89Use CC to make the archive to ensure bundling of template instances. Check
90manpage for details.
91
922.1.2 GCC
93
94Tested 3.0.4, 3.2.1, 3.2.3, 3.3.2, 3.4.0.
95
96All tested gcc are using a recent GNU binutils for linker and assembler.
97You will probably run into trouble if you use the solaris
98linker/assembler.
99
1002.2 Windows
101
1022.2.1 Visual C++
103
104Visual C++ 6.0 reported to work well with static build. DLL build not
105supported (reported to work when using STLPort in previous ANTLR versions).
106I heart that in some cases there could be problems with precompiled headers
107and the use of normal '/' in the #include directives (with service pack 5).
108
109Visual C++ 7.0 reported to work, might need some tweaks for DLL builds due
110to some shuffling around in the code.
111
112Visual C++ 7.1 reported to work, might need some tweaks, see above.
113
114My current guess is that DLL builds are all over the line broken. A
115workaround is to make a DLL from the complete generated parser including
116the static ANTLR support library.
117
1182.2.2 Cygwin/MinGW
119
120Not expecting any big problems maybe some tweaks needed in configure.
121
1223. Old notes for a number of compilers
123
1243.1 SGI Irix 6.5.10 MIPSPro compiler
125
126You can't compile ANTLR with the MIPSPro compiler on anything < 6.5.10
127because SGI just fixed a big bug dealing with namespaces in that release.
128
129Note: To get it to compile do basically the following:
130
131 CC=cc CXX=CC CXXFLAGS=-LANG:std ./configure --prefix=/usr/local/antlr
132
133Note probably dates back to 2.7.0-2.7.1 era.
134
1353.2 Sun CC 5
136
137It may be you'll have to change one or two static_cast<char*>()'s to a
138C-style cast. (think that's a compiler bug)
139
140Configure using:
141
142 CXX=CC CC=cc RANLIB="CC -xar" ./configure
143
144The custom ranlib is needed to get the template instances into the archive.
145Check manpages. Maybe the Sun CC 6 instructions above will work as well.
146
1473.3 GCC on some platforms (Alpha Tru64)
148
149The -pipe option not supported it seems. Configure using:
150
151CFLAGS="-W -Wall" ./configure
152
153Or remove the -pipe's from the generated scripts/Config.make.
154
1554. IT DOESN'T WORK!?
156
1574.1 Compile problems
158
159The ANTLR code uses some relatively new features of C++ which not all
160compilers support yet (such as namespaces, and new style standard headers).
161
162At the moment, you may be able to work around the problem with a few nasty
163tricks:
164
165Try creating some header files like 'iostream' just containing:
166
167#include <iostream.h>
168
169and compile with an option to define away the word 'std', such as
170
171CC .... -Dstd= ....
172
173Also in the antlr subdirectory there's a file config.hpp. Tweak this one to
174enable/disable the different bells and whistles used in the rest of the code.
175Don't forget to submit those changes back to us (along with compiler info)
176so we can incorporate them in our next release!
177
1784.2 Reporting problems
179
180When reporting problems please try to be as specific as possible e.g.
181mention ANTLR release, and try to provide a clear and minimal example of
182what goes wrong and what you expected.
183
184Bug reports can be done to Terence or the current subsystem maintainers as
185mentioned in the doc directory. Another option is to use the mailing list
186linked from http://www.antlr.org.
187
188Before reporting a problem you might want to try with a development
189snapshot, there is a link to these in the File Sharing section of
190
191http://www.antlr.org.