Home | History | Annotate | only in /sfw/usr/src/lib/antlr2/antlr-2.7.7/lib/cpp
Up to higher level directory
NameDateSize
antlr/01-Nov-2006
AUTHORS01-Nov-200649
ChangeLog01-Nov-200623.7K
contrib/01-Nov-2006
doxygen.cfg01-Nov-20063.6K
Makefile.in01-Nov-2006379
README01-Nov-20066.2K
scripts/01-Nov-2006
src/01-Nov-2006
TODO01-Nov-20063.4K

README

      1 ANTLR C++ Support Libraries Additional Notes
      2 
      3 1.1 Using Microsoft Visual C++
      4 
      5 Currently this is still (or again) somewhat experimental. MSVC is not the
      6 development platform and I don't have access to the compiler currently.
      7 YMMV
      8 
      9 Make sure you compile the library *and* your project with the same
     10 settings. (multithreaded/debug/etc.)
     11 
     12 Visual C++ 6 only is supported for static builds. Some hacking and STLPort
     13 is needed to build a DLL (only for experts).
     14 
     15 Visual C++ 7.0 and 7.1 should support both static and DLL builds (DLL
     16 builds might be broken). In general the main problem is getting the right
     17 template instantiations into the DLL. For 7.0 you might have to tweak the
     18 list in lib/cpp/src/dll.cpp. I'm told 7.1 does not need this.
     19 
     20 For a static build (works probably best)
     21 
     22 1. Create a win32 static library project.
     23 2. Enable RTTI. (Run Time Type Information)
     24 3. 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 
     28 For 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 
     57 NOTE: Do not use the antlr generated and support library in a multithreaded
     58 way. It was not designed for a multithreaded environment.
     59 
     60 1.3 Building with GCJ
     61 
     62 NOTE: outdated the new Makefiles do not support this anymore.
     63 
     64 It is also possible to build a native binary of ANTLR. This is somewhat
     65 experimental and can be enabled by giving the --enable-gcj option to
     66 configure. You need a recent GCC to do this and even then the constructed
     67 binary crashes on some platforms.
     68 
     69 2. Tested Compilers for this release
     70 
     71 Don't get worried if your favourite compiler is not mentioned here. Any
     72 somewhat recent ISO compliant C++ compiler should have little trouble with
     73 the 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 
     77 2.1 Solaris
     78 
     79 2.1.1 Sun Workshop 6.0
     80 
     81 Identifies itself as:
     82 
     83    CC: Sun WorkShop 6 2000/08/30 C++ 5.1 Patch 109490-01
     84 
     85 Compiles out of the box configure using:
     86 
     87    CXX=CC CC=cc AR=CC ARFLAGS="-xar -o" ./configure
     88 
     89 Use CC to make the archive to ensure bundling of template instances. Check
     90 manpage for details.
     91 
     92 2.1.2 GCC
     93 
     94 Tested 3.0.4, 3.2.1, 3.2.3, 3.3.2, 3.4.0.
     95 
     96 All tested gcc are using a recent GNU binutils for linker and assembler.
     97 You will probably run into trouble if you use the solaris
     98 linker/assembler.
     99 
    100 2.2 Windows
    101 
    102 2.2.1 Visual C++
    103 
    104 Visual C++ 6.0 reported to work well with static build. DLL build not
    105 supported (reported to work when using STLPort in previous ANTLR versions).
    106 I heart that in some cases there could be problems with precompiled headers
    107 and the use of normal '/' in the #include directives (with service pack 5).
    108 
    109 Visual C++ 7.0 reported to work, might need some tweaks for DLL builds due
    110 to some shuffling around in the code.
    111 
    112 Visual C++ 7.1 reported to work, might need some tweaks, see above.
    113 
    114 My current guess is that DLL builds are all over the line broken. A
    115 workaround is to make a DLL from the complete generated parser including
    116 the static ANTLR support library.
    117 
    118 2.2.2 Cygwin/MinGW
    119 
    120 Not expecting any big problems maybe some tweaks needed in configure.
    121 
    122 3. Old notes for a number of compilers
    123 
    124 3.1 SGI Irix 6.5.10 MIPSPro compiler
    125 
    126 You can't compile ANTLR with the MIPSPro compiler on anything < 6.5.10
    127 because SGI just fixed a big bug dealing with namespaces in that release.
    128 
    129 Note: To get it to compile do basically the following:
    130 
    131    CC=cc CXX=CC CXXFLAGS=-LANG:std ./configure --prefix=/usr/local/antlr
    132 
    133 Note probably dates back to 2.7.0-2.7.1 era.
    134 
    135 3.2 Sun CC 5
    136 
    137 It may be you'll have to change one or two static_cast<char*>()'s to a
    138 C-style cast. (think that's a compiler bug)
    139 
    140 Configure using:
    141 
    142    CXX=CC CC=cc RANLIB="CC -xar" ./configure
    143 
    144 The custom ranlib is needed to get the template instances into the archive.
    145 Check manpages. Maybe the Sun CC 6 instructions above will work as well.
    146 
    147 3.3 GCC on some platforms (Alpha Tru64)
    148 
    149 The -pipe option not supported it seems. Configure using:
    150 
    151 CFLAGS="-W -Wall" ./configure
    152 
    153 Or remove the -pipe's from the generated scripts/Config.make.
    154 
    155 4. IT DOESN'T WORK!?
    156 
    157 4.1 Compile problems
    158 
    159 The ANTLR code uses some relatively new features of C++ which not all
    160 compilers support yet (such as namespaces, and new style standard headers).
    161 
    162 At the moment, you may be able to work around the problem with a few nasty
    163 tricks:
    164 
    165 Try creating some header files like 'iostream' just containing:
    166 
    167 #include <iostream.h>
    168 
    169 and compile with an option to define away the word 'std', such as
    170 
    171 CC .... -Dstd= ....
    172 
    173 Also in the antlr subdirectory there's a file config.hpp. Tweak this one to
    174 enable/disable the different bells and whistles used in the rest of the code.
    175 Don't forget to submit those changes back to us (along with compiler info)
    176 so we can incorporate them in our next release!
    177 
    178 4.2 Reporting problems
    179 
    180 When reporting problems please try to be as specific as possible e.g.
    181 mention ANTLR release, and try to provide a clear and minimal example of
    182 what goes wrong and what you expected.
    183 
    184 Bug reports can be done to Terence or the current subsystem maintainers as
    185 mentioned in the doc directory. Another option is to use the mailing list
    186 linked from http://www.antlr.org.
    187 
    188 Before reporting a problem you might want to try with a development
    189 snapshot, there is a link to these in the File Sharing section of
    190 
    191 http://www.antlr.org.
    192