📄 install.html.svn-base
字号:
<td><code>% make</code></td> </tr> <tr> <td>MIPS Ultrix 4.3:</td> <td><code>% gmake CC=gcc LD=gcc</code></td> </tr> <tr> <td>SPARC SunOS 5.5.1 (Solaris)</td> <td><code>% make -k CC='cc -DMAXALIGN=8' THREADS=</code></td> </tr> <tr> <td>X86 Linux, Apple Intel Mac OS X 10.4.9</td> <td><code>% make CC='cc -DMAXALIGN=4' AS='cc -c -x assembler-with-cpp -traditional'</code></td> </tr> </table> </blockquote> <p>This command builds, in <code>BUILDDIR</code>, <code>libcii.a</code>, <code>memchk.o</code>, and the examples. There may be some warnings on some platforms. The assignment <code>THREADS=</code> appears on those platforms for which there is no Thread implementation. On these platforms, examples that use Thread won't link correctly, so use the <code>-k</code> option cause make to keep going.</p> <p><a name="maxalign">On most platforms</a>, <code>malloc</code> returns pointers to blocks that are aligned on addresses that are multiples of the size of the largest basic data type. Some CII functions use a union to determine this multiple (cf. <code>union</code> <code>align</code> on p. 80). Alignments are less restrictive on some platforms and, for these, <code>MAXALIGN</code> must be defined as the alignment required as shown above. <a href="misc/maxalign.c"><code>maxalign.c</code></a> is a C program that attempts to determine the correct value for <code>MAXALIGN</code>, if one is necessary, and echo the appropriate <code>-D</code> option. Unfortunately, the method used relies on the C compiler using the same alignments as <code>malloc</code>, which is not required. <code>malloc</code> is the final authority: If it returns addresses that are multiples of <code>sizeof</code> <code>(union</code> <code>align)</code>, then <code>MAXALIGN</code> is unnecessary; otherwise, <code>MAXALIGN</code> must provide the alignment. Incorrect values of <code>MAXALIGN</code> can cause crashes and assertion failures.</p> <p><code>src/{memcmp,memmove,strncmp}.c</code> are implementations of the similarly named ANSI library functions. These are included in the distribution because some of them are implemented incorrectly on some UNIX platforms. The corresponding object files are assigned to <code>EXTRAS</code>; if some of these functions are implemented correctly on your system, you can omit the CII versions by either editing <code>libcii.a</code>, or including the appropriate assignment to <code>EXTRAS</code>, e.g., </p> <blockquote> <pre>% make EXTRAS=${BUILDDIR}memcmp.o</pre> </blockquote> </li> <li>The <a HREF="makefile"><code>makefile</code></a> includes the file named by the <code>CUSTOM</code> macro; the default is <code>custom.mk</code>, and an empty <code>custom.mk</code> is included in the distribution. If desired, prepare a site-specific customization file and define <code>CUSTOM</code> to the path of that file when invoking make in the previous step. For example, on the ALPHA, I use <code>osf.mk</code>:<blockquote> <pre>% cat osf.mkBUILDDIR=/usr/local/lib/cii/1/alpha-osf/CC=cc -std1 -DalphaAS=as -Dalpha% make CUSTOM=osf.mk</pre> </blockquote> </li> <li>Run a few of the test programs, e.g., <blockquote> <pre>% ${BUILDDIR}wf <makefile% ${BUILDDIR}sieve</pre> </blockquote> <p>and then clean up:</p> <blockquote> <pre>% make clean</pre> </blockquote> <p>This command removes everything except <code>include</code> and <code>libcii.a</code>. If you want to leave <code>memchk.o</code> installed, rebuild it, e.g.,</p> <blockquote> <pre>% make ${BUILDDIR}memchk.o</pre> </blockquote> <p><code>memchk.c</code> uses <code>MAXALIGN</code>, so if you defined <code>MAXALIGN</code> when building <code>libcii.a</code>, include it when rebuilding <code>memchk.o</code>, e.g.,</p> <blockquote> <pre>% make CC='cc -DMAXALIGN=8' ${BUILDDIR}memchk.o</pre> </blockquote> <p><code>make clobber</code> removes everything from <code>BUILDDIR</code>.</p> </li> <li>If desired, plant release-independent symbolic links to the include directory and to the installed library, e.g., <blockquote> <pre>% ln -s ${BUILDDIR}include /usr/local/include/cii% ln -s ${BUILDDIR}libcii.a /usr/local/lib/libcii.a</pre> </blockquote> </li></ol><h2><a NAME="win32">Installation on Windows 95/NT</a></h2><p>On Windows NT or Windows 95, you can use a directory organization similar to the onedescribed above for UNIX as follows. The commands below assume the distribution is rootedat <code>C:\dist</code> and that the C compiler is Microsoft Visual C/C++ 5.0.<ol> <li>Create the build directory and set <code>BUILDDIR</code>:<blockquote> <pre>C:\dist>set BUILDDIR=\lib\cii\1C:\dist>mkdir %BUILDDIR%</pre> </blockquote> <p>Change the assignment to <code>BUILDDIR</code> to suit your local conventions. On Windows, <code>BUILDDIR</code> must <em>not</em> include the trailing backslash.</p> </li> <li>Create the include directory in the build directory, and copy the include files:<blockquote> <pre>C:\dist>mkdir %BUILDDIR%\includeC:\dist>copy include\*.h %BUILDDIR%\include</pre> </blockquote> </li> <li>Build everything using <code>nmake</code>:<blockquote> <pre>C:\dist>nmake -f makefile.nt BUILDDIR=%BUILDDIR%</pre> </blockquote> <p>This command builds, in <code>BUILDDIR</code>, <code>libcii.lib</code>, <code>libcii.pdb</code>, <code>memchk.obj</code>, and the examples. The default <code>BUILDDIR</code> is <code>\lib\cii\1</code>, so the assignment to <code>BUILDDIR</code> above can be omitted if you use this default.</p> </li> <li>Run a few of the test programs, e.g., <blockquote> <pre>C:\dist>%BUILDDIR%\wf <makefileC:\dist>%BUILDDIR%\sieve</pre> </blockquote> <p>and then clean up:</p> <blockquote> <pre>C:\dist>nmake -f makefile.nt BUILDDIR=%BUILDDIR% clean</pre> </blockquote> <p>This command removes everything except <code>include</code>, <code>libcii.a</code>, and <code>libcii.pdb</code>. If you want to leave <code>memchk.obj</code> installed, rebuild it, e.g., </p> <blockquote> <pre>C:\dist>nmake -f makefile.nt BUILDDIR=%BUILDDIR% %BUILDDIR%\memchk.obj</pre> </blockquote> <p><code>make clobber</code> removes everything from <code>BUILDDIR</code></p> </li> <li><code>src\libcii.def</code> is a module definition file for the CII library. To create a DLL instead of a statically linked library, execute <blockquote> <pre>C:\dist>nmake -f makefile.nt BUILDDIR=%BUILDDIR% libcii.dll</pre> </blockquote> <p>This command creates <code>%BUILDDIR%\libcii.dll</code>, <strong>overwrites</strong> <code>%BUILDDIR%\libcii.lib</code> with the import library, and creates the export library <code>%BUILDDIR%\libcii.exp</code>. If you use <code>libcii.dll</code>, you'll need to move it to a directory on your <code>PATH</code>.</p> </li></ol><p>Some users copy the include and library files into their Visual C/C++ 5.0 distribution,e.g.,</p><blockquote> <pre>C:\dist>mkdir "\Program Files\DevStudio\VC\include\cii"C:\dist>copy include\*.h "\Program Files\DevStudio\VC\include\cii"C:\dist>copy %BUILDDIR%\libcii.* "\Program Files\DevStudio\VC\lib"</pre></blockquote><h2><a NAME="bugs">Reporting Bugs</a></h2><p>Devise the shortest possible example program that elicits the bug. Prune your exampleuntil it can be pruned no more without sending the error into hiding. I prune most errordemonstrations to only a few lines. Annotate your example with C comments that describethe bug and your suggested fix, if you have one. If the example crashes, please report thelast part of the call chain if you can.</p><p>Send your example by electronic mail to me (see below).Please send only valid C programs; put all remarks in C comments so that I can processreports semi-automatically.</p><hr><address> <a HREF="http://drh.home.dyndns.org/">David Hanson</a><br> $Id$ </address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -