| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|---|
| 2 | |
|---|
| 3 | <html> |
|---|
| 4 | <head> |
|---|
| 5 | <meta name="generator" content= |
|---|
| 6 | "HTML Tidy for Linux/x86 (vers 1st September 2003), see www.w3.org"> |
|---|
| 7 | <meta http-equiv="Content-Language" content="en-us"> |
|---|
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
|---|
| 9 | <link rel="stylesheet" type="text/css" href="../../../boost.css"> |
|---|
| 10 | |
|---|
| 11 | <title>Boost.Build - gcc-nocygwin toolset</title> |
|---|
| 12 | </head> |
|---|
| 13 | |
|---|
| 14 | <body bgcolor="#FFFFFF" text="#000000"> |
|---|
| 15 | <table border="0" cellpadding="7" cellspacing="0" width="100%" summary= |
|---|
| 16 | "header"> |
|---|
| 17 | <tr> |
|---|
| 18 | <td valign="top" width="300"> |
|---|
| 19 | <h3><a href="http://www.boost.org"><img height="86" width="277" alt= |
|---|
| 20 | "C++ Boost" src="../../../boost.png" border="0"></a></h3> |
|---|
| 21 | </td> |
|---|
| 22 | |
|---|
| 23 | <td valign="top"> |
|---|
| 24 | <h1 align="center">Boost.Build</h1> |
|---|
| 25 | |
|---|
| 26 | <h2 align="center">gcc-nocygwin toolset</h2> |
|---|
| 27 | </td> |
|---|
| 28 | </tr> |
|---|
| 29 | </table> |
|---|
| 30 | <hr> |
|---|
| 31 | |
|---|
| 32 | <h2>Introduction</h2> |
|---|
| 33 | |
|---|
| 34 | <p>This page describes the gcc-nocygwin toolset, which builds Boost using |
|---|
| 35 | the -mno-cygwin option of the <a href= |
|---|
| 36 | "http://sources.redhat.com/cygwin/">Cygwin</a> gcc compiler. This avoids |
|---|
| 37 | introducing dependencies on the Cygwin Unix-emulation layer, allowing you |
|---|
| 38 | to build Windows executables which are not dependant on cygwin1.dll. If |
|---|
| 39 | you're not worried about having the dependencies, you should probably be |
|---|
| 40 | using the plain <a href="gcc-tools.html">gcc toolset</a>.</p> |
|---|
| 41 | |
|---|
| 42 | <p>The other option for producing windows-native executables with gcc is |
|---|
| 43 | the <a href="http://www.mingw.org/">mingw</a> version of gcc with the |
|---|
| 44 | <a href="mingw-tools.html">mingw toolset</a>. However, if you're already |
|---|
| 45 | using Cygwin, this toolset could save you having to install an additional |
|---|
| 46 | compiler.</p> |
|---|
| 47 | |
|---|
| 48 | <h2><a name="configuration" id="configuration">Configuration |
|---|
| 49 | Variables</a></h2> |
|---|
| 50 | |
|---|
| 51 | <p>This toolset operates in one of two modes - the default mode (which is |
|---|
| 52 | recommended) just extends the gcc toolset <a href= |
|---|
| 53 | "gcc-tools.html#configuration">(configuration details here)</a>. You can |
|---|
| 54 | force the gcc-nocygwin toolset to extend gcc-stlport instead by setting |
|---|
| 55 | <code>NOCYGWIN_STLPORT_LIB_ID</code>.</p> |
|---|
| 56 | |
|---|
| 57 | <p>You can set any of the configuration variables in your environment or on |
|---|
| 58 | the bjam command line using options of the form |
|---|
| 59 | <code>-s<i>VARIABLE_NAME</i>=</code><i>value</i>. The following table lists |
|---|
| 60 | the additional configuration variables introduced by gcc-nocygwin.</p> |
|---|
| 61 | |
|---|
| 62 | <table border="1" summary="settings"> |
|---|
| 63 | <tr> |
|---|
| 64 | <th>Variable Name</th> |
|---|
| 65 | |
|---|
| 66 | <th>Semantics</th> |
|---|
| 67 | |
|---|
| 68 | <th>Default</th> |
|---|
| 69 | |
|---|
| 70 | <th width="50%">Notes</th> |
|---|
| 71 | </tr> |
|---|
| 72 | |
|---|
| 73 | <tr> |
|---|
| 74 | <td><code>GCC_NO_<br> |
|---|
| 75 | EXPORT_ALL</code></td> |
|---|
| 76 | |
|---|
| 77 | <td>Suppress the <nobr>--export-all-symbols</nobr> linker flag.</td> |
|---|
| 78 | |
|---|
| 79 | <td><code>true</code></td> |
|---|
| 80 | |
|---|
| 81 | <td>The gcc toolset usually forces the linker to export all symbols |
|---|
| 82 | from the DLLs it builds. There are some hacks in ld to prevent any |
|---|
| 83 | symbols from the run-time library being exported, but old versions of |
|---|
| 84 | ld don't have this support. If necessary, you can re-enable exporting |
|---|
| 85 | all symbols by setting this variable to the empty string |
|---|
| 86 | <nobr>(-sGCC_NO_EXPORT_ALL="")</nobr></td> |
|---|
| 87 | </tr> |
|---|
| 88 | |
|---|
| 89 | <tr> |
|---|
| 90 | <td><code>NOCYGWIN_<br> |
|---|
| 91 | STLPORT_LIB_ID</code></td> |
|---|
| 92 | |
|---|
| 93 | <td>Use the <a href="http://www.stlport.org">STLport</a> standard |
|---|
| 94 | library instead of gcc's own library.</td> |
|---|
| 95 | |
|---|
| 96 | <td><i>empty</i></td> |
|---|
| 97 | |
|---|
| 98 | <td>This option is provided for backwards compatability with the |
|---|
| 99 | original gcc-nocygwin toolset, which used to rely on the STLport |
|---|
| 100 | standard library. Setting a value for this variable forces gcc-nocygwin |
|---|
| 101 | to extend the gcc-stlport toolset <a href= |
|---|
| 102 | "gcc-stlport-tools.html#configuration">(configuration details |
|---|
| 103 | here)</a>. The value you set is irrelevant, unless you want to use the |
|---|
| 104 | <a href="#stlport">STLport iostream implementation</a></td> |
|---|
| 105 | </tr> |
|---|
| 106 | </table><br> |
|---|
| 107 | <br> |
|---|
| 108 | |
|---|
| 109 | <h2>Prerequisites</h2> |
|---|
| 110 | |
|---|
| 111 | <p>The easiest way to use this toolset is with a recent Cygwin gcc |
|---|
| 112 | installation (roughly speaking, installed since October 2002). The Cygwin |
|---|
| 113 | setup utility should add all necessary components of gcc automatically when |
|---|
| 114 | you install or upgrade gcc. Basically, if an iostream-based "hello world" |
|---|
| 115 | program compiles and links using <code>g++ -mno-cygwin</code>, you should |
|---|
| 116 | be OK.</p> |
|---|
| 117 | |
|---|
| 118 | <p>It is also possible to add support manually to older Cygwin compilers if |
|---|
| 119 | you won't upgrade for some reason. See for instance <a href= |
|---|
| 120 | "http://www.delorie.com/howto/cygwin/mno-cygwin-howto.html">these |
|---|
| 121 | details</a>, or search for "mno-cygwin" and "c++" on the web or the |
|---|
| 122 | <a href="http://cygwin.com/lists.html">Cygwin mailing lists</a>.</p> |
|---|
| 123 | |
|---|
| 124 | <p>Another, probably more difficult option, is to install the STLport |
|---|
| 125 | standard library and build it with the -mno-cygwin option. Some details are |
|---|
| 126 | provided in the next section.</p> |
|---|
| 127 | |
|---|
| 128 | <h2><a name="stlport" id="stlport">STLport iostream support</a></h2> |
|---|
| 129 | |
|---|
| 130 | <p>Here's the procedure for using the STLport iostream libraries with |
|---|
| 131 | gcc-nocygwin:</p> |
|---|
| 132 | |
|---|
| 133 | <ol type="1" start="1"> |
|---|
| 134 | <li>Build the iostream libraries with no cygwin1.dll dependencies.</li> |
|---|
| 135 | |
|---|
| 136 | <li>Set the <code>NOCYGWIN_STLPORT_LIB_ID</code> variable to the library |
|---|
| 137 | base name (e.g. stlport_cygwin)</li> |
|---|
| 138 | |
|---|
| 139 | <li>Configure necessary variables for the <a href= |
|---|
| 140 | "gcc-stlport-tools.html#configuration">gcc-stlport toolset</a></li> |
|---|
| 141 | </ol><br> |
|---|
| 142 | <br> |
|---|
| 143 | |
|---|
| 144 | <p>Point 1 above is a little tricky using the Cygwin compiler because the |
|---|
| 145 | current release of STLport (4.5.3) does not provide a suitable makefile. |
|---|
| 146 | Here's a command line to make it work (run from the stlport src |
|---|
| 147 | directory):</p> |
|---|
| 148 | |
|---|
| 149 | <p><code>make <nobr>-f gcc-cygwin.mak</nobr> <nobr>CC="gcc |
|---|
| 150 | -mno-cygwin"</nobr> <nobr>CXX="g++ -mno-cygwin"</nobr> <nobr>DYN_LINK="g++ |
|---|
| 151 | -shared -mno-cygwin -o"</nobr></code></p> |
|---|
| 152 | |
|---|
| 153 | <p>You may get some errors for missing include files like |
|---|
| 154 | <code><nobr>../include/time.h</nobr></code>. This is most easily fixed by |
|---|
| 155 | creating a symbolic link to the mingw include directory so that STLport can |
|---|
| 156 | find it under the expected name. The mingw directory is probably in |
|---|
| 157 | <code>/usr/include</code>, so you would do <code><nobr>ln -s mingw |
|---|
| 158 | include</nobr></code> in that directory. Note that this link may cause |
|---|
| 159 | problems when building a regular Cygwin version of STLport.</p> |
|---|
| 160 | |
|---|
| 161 | <p>If you have a recent version of gcc (e.g. 3.2), you might get a heap of |
|---|
| 162 | errors for include files like <code><nobr>../g++-v3/ctime</nobr></code>. |
|---|
| 163 | The libstdc++ directory is probably something like |
|---|
| 164 | <code><nobr>/usr/include/c++/3.2</nobr></code>, in which case you would use |
|---|
| 165 | <code><nobr>ln -s 3.2 g++-v3</nobr></code> in the |
|---|
| 166 | <code><nobr>/usr/include/c++</nobr></code> directory.</p> |
|---|
| 167 | |
|---|
| 168 | <h2>Toolset limitations</h2> |
|---|
| 169 | |
|---|
| 170 | <p>As of 2002/01/24, some of the Boost test library DLLs don't link because |
|---|
| 171 | of unresolved externals. This problem is shared by the mingw toolset.</p> |
|---|
| 172 | |
|---|
| 173 | <p><i>Written May 2002 and revised January 2003 by <a href= |
|---|
| 174 | "mailto:RaoulGough@yahoo.co.uk">Raoul Gough</a></i></p> |
|---|
| 175 | </body> |
|---|
| 176 | </html> |
|---|