home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / e / emxdev8f.zip / INSTALL.DOC < prev    next >
Text File  |  1993-01-03  |  9KB  |  292 lines

  1. ===============================================================================
  2. install.doc       emx 0.8f     INSTALLATION GUIDE                   03-Jan-1993
  3. ===============================================================================
  4.                                      Copyright (c) 1990-1993 by Eberhard Mattes
  5.  
  6. Welcome to emx 0.8f, an environment for creating 32-bit programs for
  7. OS/2 2.0 (and DOS).  You can use the GNU C compiler for compiling
  8. programs.
  9.  
  10. To use the GNU C compiler with emx, you need at least
  11.  
  12.   emxdev.zip    files required for developing programs with emx,
  13.  
  14.   gnudev.zip    the GNU C compiler, the GNU debugger, and other tools
  15.                 (it should also be possible to use a different C compiler;
  16.                 in fact I first used the Xenix386 C compiler)
  17.  
  18.   gppdev.zip    additional files for GCC required for compiling C++
  19.                 programs
  20.  
  21.   gobjcdev.zip  additional files for GCC required for compiling
  22.                 programs written in the Objective C language
  23.  
  24. and
  25.  
  26.   unzip.exe     a free program for unpacking ZIP files
  27.  
  28. The following packages are optional:
  29.  
  30.   emxlib.zip    emx library sources
  31.   emxtest.zip   test programs (used for testing emx and the libraries)
  32.   gnudoc.zip    documentation for GNU programs (texinfo sources)
  33.   gnuinfo.zip   GNU texinfo (includes info file browser)
  34.   gnupat.zip    patches for GNU sources
  35.   gnusrc.zip    patched GNU sources (ld, ar, nm, size, strip, objdump,
  36.                 termcap)
  37.   gccsrc1.zip   patched GNU sources (gcc 2.3.3, part 1)
  38.   gccsrc2.zip   patched GNU sources (gcc 2.3.3, part 2)
  39.   gassrc.zip    patched GNU sources (gas 1.38.1)
  40.   gdbsrc.zip    patched GNU sources (gdb 4.7)
  41.   gppsrc.zip    patched sources of libg++ 2.2
  42.   bsddev.zip    BSD libraries (curses etc.)
  43.   bsddoc.zip    documentation for BSD libraries
  44.   bsdsrc.zip    source for BSD libraries
  45.  
  46. You should install all the packages on the same drive.  For instance,
  47. use
  48.  
  49.   c:
  50.   cd \
  51.   unzip -d emxdev
  52.  
  53. to install the emxdev.zip package on drive C:.  PKUNZIP cannot be
  54. used.  All the files will be installed in the \emx subdirectory or in
  55. subdirectories thereof.  The other packages are installed the same
  56. way.
  57.  
  58. If there's an older version of emx already installed, you should
  59. delete the old version or rename the old directory.  Installing a new
  60. version over an old version is not recommended.  For instance, the
  61. omflib batch file (see below) won't build new versions of the
  62. libraries if the .lib files already exist.  That is, you would
  63. continue to use the .lib files of the previously installed emx
  64. version.
  65.  
  66. If you want to develop programs on a drive different from the drive
  67. where emx is installed, you have to set the C_INCLUDE_PATH and
  68. LIBRARY_PATH environment variables, for instance,
  69.  
  70.     set C_INCLUDE_PATH=c:/emx/include
  71.     set LIBRARY_PATH=c:/emx/lib
  72.  
  73. If you want to compile C++ programs, set CPLUS_INCLUDE_PATH as well:
  74.  
  75.     set CPLUS_INCLUDE_PATH=c:/emx/include.cpp;c:/emx/include
  76.  
  77. The genclass utility needs the following environment variable:
  78.  
  79.     set PROTODIR=c:/emx/include.cpp/gen
  80.  
  81. If you want to compile programs written in the Objective C language,
  82. set OBJC_INCLUDE_PATH as well:
  83.  
  84.     set OBJC_INCLUDE_PATH=c:/emx/include
  85.  
  86. To use GDB (the GNU debugger) and info (the GNU info browser) and other
  87. programs that use termcap, set the TERM and TERMCAP environment
  88. variables:
  89.  
  90.     set TERM=mono
  91.     set TERMCAP=c:/emx/etc/termcap.dat
  92.  
  93. Set the INFOPATH environment variable for info:
  94.  
  95.     set INFOPATH=c:/emx/info
  96.  
  97. OS/2 users should set the environment variables in config.sys, DOS
  98. users should set the environment variables in autoexec.bat.  Beware of
  99. blanks at the end of the lines!
  100.  
  101. To finish the installation, add c:\emx\bin (insert the correct drive
  102. letter) to your PATH.  Add c:\emx\dll (insert the correct drive
  103. letter) to the LIBPATH statement in your config.sys file.  Reboot your
  104. computer to enable the new LIBPATH statement and the new environment
  105. variables.
  106.  
  107. To create the OMF libraries (for linking with LINK386), type the
  108. following commands after installing emx:
  109.  
  110.     cd \emx\lib
  111.     omflib
  112.  
  113. The omflib batch file builds .lib files from .a files.  Already
  114. existing .lib files are not rebuilt.  If you install (after running
  115. omflib) a package containing additional .a files , you should run
  116. omflib again to build the .lib files for the new package.
  117.  
  118. If OS/2 says
  119.  
  120.     SYS1804: The system cannot find the file EMX.
  121.  
  122. when running a program compiled for emx, you haven't set LIBPATH
  123. correctly.
  124.  
  125.  
  126. Compiling a sample program
  127. --------------------------
  128.  
  129. Install the emxtest.zip package:
  130.  
  131.   c:
  132.   cd \
  133.   unzip -d emxtest
  134.  
  135. Compile the sieve program (optimizer enabled):
  136.  
  137.   cd \emx\test
  138.   gcc -O2 -o sieve.exe sieve.c
  139.  
  140. Run the sieve program:
  141.  
  142.   sieve
  143.   sieve 100000
  144.   sieve -p 100
  145.  
  146.  
  147. Sample debugging session
  148. ------------------------
  149.  
  150. Compile the sieve program for debugging:
  151.  
  152.   cd \emx\test
  153.   gcc -g -o sieve.exe sieve.c
  154.  
  155. Start the debugger and step through some lines:
  156.  
  157.   [D:\EMX\TEST]gdb sieve.exe
  158.   GDB is free software and you are welcome to distribute copies of it
  159.    under certain conditions; type "show copying" to see the conditions.
  160.   There is absolutely no warranty for GDB; type "show warranty" for details.
  161.   GDB 4.7, Copyright 1992 Free Software Foundation, Inc...
  162.   (gdb) set arg 10                                      <- set command line
  163.   (gdb) b isqrt                                         <- set breakpoint
  164.   Breakpoint 1 at 0x1004e: file sieve.c, line 45.
  165.   (gdb) run                                             <- start program
  166.   Starting program: d:/emx/test/sieve.exe 10
  167.  
  168.   Breakpoint 1, isqrt (x=10) at sieve.c:45
  169.   45        l = 1; r = x;
  170.   (gdb) s                                               <- stop over one line
  171.   46        while (l < r)
  172.   (gdb) l                                               <- list source
  173.   41      static ULONG isqrt (ULONG x)
  174.   42      {
  175.   43        ULONG l, r, m;
  176.   44      
  177.   45        l = 1; r = x;
  178.   46        while (l < r)
  179.   47          {
  180.   48            m = (l+r) / 2;
  181.   49            if (m > 46340) m = 46340;
  182.   50            if (m*m < x)
  183.   (gdb) disp l                                          <- watch variable
  184.   1: l = 1
  185.   (gdb) disp r                                          <- watch variable
  186.   2: r = 10
  187.   (gdb) s 5                                             <- step over five lines
  188.   53                  r = m-1;
  189.   2: r = 10
  190.   1: l = 1
  191.   (gdb) p m*m                                           <- show expression
  192.   $1 = 25
  193.   (gdb) cont                                            <- continue program
  194.   Continuing.
  195.   4 primes                                              <- output of program
  196.  
  197.  
  198.   Program exited normally.
  199.   (gdb) q                                               <- quit gdb
  200.  
  201.   [D:\EMX\TEST]
  202.  
  203.  
  204. Viewing the GNU on-line manuals
  205. -------------------------------
  206.  
  207. To view the GCC and GDB manuals, unpack gnudoc.zip and gnuinfo.zip and
  208. install info (see install.doc).  Use GNU makeinfo to create info files
  209. for on-line help from the texinfo files.
  210.  
  211. To create info files for the GCC manual, type:
  212.  
  213.   cd \emx\gnu\doc
  214.   set emxopt=-t
  215.   makeinfo gcc.tex -o /emx/info/gcc.inf
  216.   makeinfo cpp.tex -o /emx/info/cpp.inf
  217.  
  218. To create info files for the GDB manual, type:
  219.  
  220.   cd \emx\gnu\doc
  221.   set emxopt=-t
  222.   makeinfo gdb-all.tex -o /emx/info/gdb.inf
  223.  
  224. To create info files for the texinfo manual, type:
  225.  
  226.   cd \emx\gnu\doc
  227.   set emxopt=-t
  228.   makeinfo texinfo2.tex -o /emx/info/texinfo.inf
  229.  
  230. To create info files for libg++, type:
  231.  
  232.   cd \emx\gnu\doc
  233.   set emxopt=-t
  234.   makeinfo libgpp.tex -o /emx/info/libgpp.inf
  235.   makeinfo iostream.tex -o /emx/info/iostream.inf
  236.  
  237. After creating the info files, you can use GNU info (see gnudev.doc
  238. for details) or GNU Emacs to view the info files.
  239.  
  240.  
  241. Printing the GNU manuals
  242. ------------------------
  243.  
  244. To print the manuals, you have to unpack gnudoc.zip and gnuinfo.zip.
  245. Additionally, you have to install TeX.  Of course, I recommend emTeX
  246. (available for anonymous ftp from ftp.uni-stuttgart.de, directory
  247. soft/tex/systems/pc/emtex).  The following instructions assume that
  248. you're using emTeX (with emTeX386).
  249.  
  250. To typeset the GCC documentation, type
  251.  
  252.   cd \emx\gnu\doc
  253.   makedvi gcc
  254.  
  255. This creates the following files:
  256.  
  257.   cpp.dvi        GNU C preprocessor manual
  258.   gcc.dvi        GNU C compiler manual
  259.  
  260. To typeset the GDB documentation, type
  261.  
  262.   cd \emx\gnu\doc
  263.   makedvi gdb
  264.  
  265. This creates the following files:
  266.  
  267.   refcard.dvi    GDB reference card
  268.   gdb-all.dvi    GDB manual
  269.   gdbint.dvi     GDB internals (you might want to delete this one)
  270.  
  271. To typeset the texinfo documentation, type
  272.  
  273.   cd \emx\gnu\doc
  274.   makedvi texinfo
  275.  
  276. This creates the following file:
  277.  
  278.   texinfo2.dvi   texinfo manual
  279.  
  280. To typeset the libg++ documentation, type
  281.  
  282.   cd \emx\gnu\doc
  283.   makedvi libgpp
  284.   makedvi iostream
  285.  
  286. This creates the following files:
  287.  
  288.   libgpp.dvi     libg++ manual
  289.   iostream       iostream manual
  290.  
  291. --------------------------- END OF INSTALL.DOC ------------------------------
  292.