.
===============================================================================
install.doc emx 0.9a INSTALLATION GUIDE 05-Dec-1994
===============================================================================
Copyright (c) 1990-1994 by Eberhard Mattes
Introduction
------------
Welcome to emx 0.9a, an environment for creating 32-bit programs for
OS/2 2.x (and DOS) with the GNU C compiler.
To use the GNU C compiler with emx, you need at least
emxrt.zip emx runtime package
emxdev.zip files required for developing programs with emx
gnudev.zip the GNU C compiler, the GNU debugger, and other tools
(it should also be possible to use a different C compiler)
gppdev.zip additional files for GCC required for compiling C++
programs
gobjcdev.zip additional files for GCC required for compiling
programs written in the Objective C language
and
unzip.exe a free program for unpacking ZIP files
The following packages are optional:
emxview.zip emx documentation in OS/2 .inf format
emxsrcd.zip source for emx devlopment tools
emxsrcr.zip source for the emx runtime package
emxample.zip sample programs
emxtest.zip test programs (used for testing emx and the libraries)
gnuview.zip gnudev.inf (gnudev.doc in OS/2 .inf format)
gnudoc.zip documentation for GNU programs (texinfo sources)
gnuinfo.zip GNU texinfo (includes info file browser)
gnupat.zip patches for GNU sources
gnusrc.zip patched GNU sources (ld, ar, nm, size, strip, objdump,
info, termcap, GPPDEMID)
gccsrc1.zip patched GNU sources (gcc 2.6.3, part 1)
gccsrc2.zip patched GNU sources (gcc 2.6.3, part 2)
gccsrc3.zip patched GNU sources (gcc 2.6.3, part 3)
gassrc.zip patched GNU sources (gas 2.3)
gdbsrc1.zip patched GNU sources (gdb 4.13, part 1)
gdbsrc2.zip patched GNU sources (gdb 4.13, part 2)
gppsrc.zip patched sources of libg++ 2.6.1
bsddev.zip BSD libraries (curses etc.)
bsddoc.zip documentation for BSD libraries
bsdsrc.zip source for BSD libraries
Preliminary tasks
-----------------
IMPORTANT! If there is an older version of emx already installed, you
should delete the old version or rename the old directory. Installing
a new version over an old version is NOT RECOMMENDED.
Some of the emx batch files (such as texi2dvi.cmd) require REXX to be
installed. If you haven't installed REXX, use Selective Install to
install it. (Note to DOS users: REXX is OS/2's batch file language.)
Installing the packages
-----------------------
You should install all the packages on the same drive. For instance,
use
c:
cd \
unzip emxrt
to install the emxrt.zip package on drive C:. PKUNZIP cannot be
used. All the files will be installed in the \emx subdirectory or in
subdirectories thereof. The other packages are installed the same
way.
After unpacking the emx runtime and development system packages,
you'll find further information in the following files:
\emx\doc\COPYING.EMX emx & library license, license overview
\emx\doc\COPYING GNU General Public License
\emx\doc\install.doc Installation guide
\emx\doc\emxrt.doc User's guide to the emx runtime package
\emx\doc\emxdev.doc Application developer's guide
\emx\doc\libref.doc C library reference
\emx\doc\build.doc Compiling the sources
\emx\doc\history.doc Change log
\emx\doc\future.doc Things to do
\emx\book\emxrt.inf .inf version of emxrt.doc
\emx\book\emxdev.inf .inf version of emxdev.doc (optional)
\emx\book\libref.inf .inf version of libref.doc (optional)
After unpacking the GNU and BSD packages, you'll find further
information in the following files:
\emx\doc\COPYING GNU General Public License
\emx\doc\COPYING.LIB GNU Library General Public License
\emx\doc\COPYING.BSD BSD license (for libraries bsd and curses)
\emx\doc\COPYING.IOS Additional information for iostream library
\emx\doc\gnudev.doc GNU development tools information
\emx\doc\bsddev.doc BSD library information
\emx\book\gnudev.inf .inf version of gnudev.doc (optional)
\emx\book\bsddev.inf .inf version of bsddev.doc
Read history.doc first.
Setting environment variables
-----------------------------
OS/2 users should set the environment variables in config.sys, DOS
users should set the environment variables in autoexec.bat. Beware of
blanks at the end of the lines!
Developing programs on drive different from the installation drive
------------------------------------------------------------------
If you want to develop programs on a drive different from the drive
where emx is installed, you have to set the C_INCLUDE_PATH and
LIBRARY_PATH environment variables, for instance,
set C_INCLUDE_PATH=c:/emx/include
set LIBRARY_PATH=c:/emx/lib
If you want to compile C++ programs, set CPLUS_INCLUDE_PATH as well:
set CPLUS_INCLUDE_PATH=c:/emx/include/cpp;c:/emx/include
The genclass utility needs the following environment variable:
set PROTODIR=c:/emx/include/cpp/gen
If you want to compile programs written in the Objective C language,
set OBJC_INCLUDE_PATH as well:
set OBJC_INCLUDE_PATH=c:/emx/include
Speeding up compilation
-----------------------
When compiling projects consisting of many modules (such as libraries)
under OS/2, you can speed up compilation if you have enough memory by
keeping GCC in memory. For example, to keep GCC in memory for 5
minutes, use
set GCCLOAD=5
To make GCC use pipes instead of temporary files under OS/2, use
set GCCOPT=-pipe
Setting up termcap
------------------
To use GDB (the GNU debugger) and info (the GNU info browser) and other
programs that use termcap, set the TERM and TERMCAP environment
variables:
set TERM=mono
set TERMCAP=c:/emx/etc/termcap.dat
Setting up the info browser
---------------------------
Set the INFOPATH environment variable for info:
set INFOPATH=c:/emx/info
Setting up on-line documentation in OS/2 .inf format
----------------------------------------------------
To use the emx documentation in OS/2 .inf format, append c:\emx\book
to the BOOKSHELF environment variable and define an environment
variable which tells VIEW how to concatenate the .inf files. Example:
set BOOKSHELF=C:\OS2\BOOK;C:\EMX\BOOK
set EMXBOOK=emxdev.inf+libref.inf+gnudev.inf+bsddev.inf
To use the .inf files with EPM (the OS/2 Enhanced Editor), add the
following line to your config.sys file:
set HELPNDX=emxbook.ndx
If HELPNDX is already set in your config.sys file, add emxbook.ndx to
the end of the HELPNDX variable, separated by a + character.
Moreover, you should add c:\emx\book to the DPATH environment
variable:
set DPATH=...;c:\emx\book
where ... is the previous value of DPATH.
Finishing the installation
--------------------------
To finish the installation, add c:\emx\bin (insert the correct drive
letter) to your PATH. Add c:\emx\dll (insert the correct drive
letter) to the LIBPATH statement in your config.sys file. Reboot your
computer to enable the new LIBPATH statement and the new environment
variables.
Creating desktop objects
------------------------
After rebooting, you can create a folder containing icons for the
on-line books by typing
emxinst
Creating the OMF libraries
--------------------------
To create the OMF libraries (for linking with LINK386), type the
following commands after installing emx:
cd \emx\lib
omflibs
The omflibs batch file builds .lib files from .a files. If you
install (after running omflibs) a package containing additional .a
files , you should run omflibs again to build the .lib files for the
new package.
Using long file names on HPFS
-----------------------------
To rename and patch the C++ header files for HPFS, type
cd \emx\include\cpp
hpfs
To rename and patch the Objective C header files for HPFS, type
cd \emx\include\objc
hpfs
You can revert to the FAT names by running `fat' instead of `hpfs'.
Trouble shooting
----------------
If OS/2 says
SYS1804: The system cannot find the file EMX.
when running a program compiled for emx, you haven't set LIBPATH
correctly.
Compiling a sample program
--------------------------
Install the emxample.zip package:
c:
cd \
unzip emxample
Compile the sieve program (optimizer enabled):
cd \emx\samples
gcc -O2 sieve.c
Run the sieve program:
sieve
sieve 100000
sieve -p 100
Sample debugging session
------------------------
Compile the sieve program for debugging:
cd \emx\samples
gcc -g sieve.c
Start the debugger and step through some lines:
[D:\EMX\TEST]gdb sieve.exe
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (emx), Copyright 1994 Free Software Foundation, Inc...
(gdb) set arg 10 <- set command line
(gdb) b isqrt <- set breakpoint
Breakpoint 1 at 0x1004e: file sieve.c, line 45.
(gdb) run <- start program
Starting program: d:/emx/samples/sieve.exe 10
Breakpoint 1, isqrt (x=10) at sieve.c:45
45 l = 1; r = x;
(gdb) s <- stop over one line
46 while (l < r)
(gdb) l <- list source
41 static ULONG isqrt (ULONG x)
42 {
43 ULONG l, r, m;
44
45 l = 1; r = x;
46 while (l < r)
47 {
48 m = (l+r) / 2;
49 if (m > 46340) m = 46340;
50 if (m*m < x)
(gdb) disp l <- watch variable
1: l = 1
(gdb) disp r <- watch variable
2: r = 10
(gdb) s 5 <- step over five lines
53 r = m-1;
2: r = 10
1: l = 1
(gdb) p m*m <- show expression
$1 = 25
(gdb) cont <- continue program
Continuing.
4 primes <- output of program
Program exited normally.
(gdb) q <- quit gdb
[D:\EMX\TEST]
Viewing OS/2 .inf files
-----------------------
If you've installed the optional emxview.zip and gnuview.zip packages,
you can use the OS/2 VIEW utility to view a hypertext version of
emxdev.doc, libref.doc, gnudev.doc and bsddev.doc. If you've added
c:\emx\book to the BOOKSHELF environment variable and defined the
EMXBOOK environment variable (see above), type
view emxbook
to view the concatenated .inf files. To get help for, say, printf(),
type
view emxbook printf
If you haven't set the environment variables, type
view c:\emx\book\emxdev
to view emxdev.inf.
If you've properly set the HELPNDX and DPATH environment variables,
you can use the kwhelp (Ctrl-H) command of EPM to get on-line help for
the function at the cursor. With emxbook.ndx, all three books are
required to be installed. If you haven't installed all the books, use
a subset of emxdev.ndx, libref.ndx, gnudev.ndx and bsddev.ndx in the
HELPNDX environment variable.
emxbook.ndx contains all entries of emxdev.ndx, libref.ndx, gnudev.ndx
and bsddev.ndx, pointing to `emxbook'. Setting the EMXBOOK
environment variable as explained above causes the three books to be
concatenated and named `emxbook'.
Viewing the GNU on-line manuals
-------------------------------
To view the GCC, GDB, etc. manuals, unpack gnudoc.zip and gnuinfo.zip
and install info (see install.doc). Use GNU makeinfo to create info
files for on-line help from the texinfo files. makeinf.bat and
makeinf.cmd are batch files which simplify calling makeinfo.
To create info files for the GCC manual, type:
cd \emx\gnu\doc
makeinf gcc (Using and Porting GNU CC)
makeinf cpp (The C Preprocessor)
makeinf gxxint (Internal Architecture of the Compiler)
makeinf reno (The GNU C++ Renovation Project)
To create info files for GDB, type:
cd \emx\gnu\doc
makeinf gdb (Debugging with GDB)
makeinf gdbint (The GNU debugger's internals)
To create info files for GAS, type:
cd \emx\gnu\doc
makeinf as (The GNU assembler)
makeinf gasp (The GNU Assembler Preprocessor)
To create info files for the texinfo manual, type:
cd \emx\gnu\doc
makeinf texi (The documentation format for the GNU Project)
makeinf makeinfo (The makeinfo program)
To create info files for libg++, type:
cd \emx\gnu\doc
makeinf libgpp (User's Guide to the GNU C++ Class Library)
makeinf iostream (The GNU C++ Iostream Library)
After creating the info files, you can use GNU info (see gnudev.doc
for details) or GNU Emacs to view the info files.
Printing the GNU manuals
------------------------
To print the manuals, you have to unpack gnudoc.zip and gnuinfo.zip.
Additionally, you have to install TeX. Of course, I recommend emTeX,
which can be used both under OS/2 and DOS. emTeX is available for
anonymous ftp on
ftp.uni-stuttgart.de [129.69.8.13]: /tex-archive/systems/msdos/emtex
ftp.tex.ac.uk [134.151.44.19]: /tex-archive/systems/msdos/emtex
ftp.shsu.edu [192.92.115.10]: /tex-archive/systems/msdos/emtex
ftp.informatik.tu-muenchen.de [131.159.0.198]: /pub/comp/os/os2/emTeX
Don't forget to fetch the files from the betatest subdirectory!
The following instructions assume that you are using emTeX (with
emTeX386).
To typeset the GCC documentation, type
cd \emx\gnu\doc
makedvi gcc
This creates the following files:
cpp.dvi (The C Preprocessor)
gcc.dvi (Using and Porting GNU CC)
reno.dvi (The GNU C++ Renovation Project)
To typeset internal G++ documentation (you don't need this unless you
want to hack G++), type
cd \emx\gnu\doc
makedvi gxxint
To typeset the GDB documentation, type
cd \emx\gnu\doc
makedvi gdb
This creates the following files:
refcard.dvi (GDB Reference Card)
gdb.dvi (Debugging with GDB)
To typeset internal GDB documentation (you don't need this unless you
want to hack GDB), type
cd \emx\gnu\doc
makedvi gdbint
This create the following files:
gdbint.dvi (The GNU debugger's internals)
stabs.dvi (The "stabs" debugging information format)
To typeset the GAS documentation, type
cd \emx\gnu\doc
makedvi gas
This creates the following files:
as.dvi (The GNU assembler)
gasp.dvi (The GNU Assembler Preprocessor)
To typeset the texinfo documentation, type
cd \emx\gnu\doc
makedvi texinfo
This creates the following files:
texi.dvi (The documentation format for the GNU Project)
makeinfo.dvi (The makeinfo program)
To typeset the libg++ and iostream documentation, type
cd \emx\gnu\doc
makedvi libgpp
makedvi iostream
This creates the following files:
libgpp.dvi (User's Guide to the GNU C++ Class Library)
iostream.dvi (The GNU C++ Iostream Library))
--------------------------- END OF INSTALL.DOC ------------------------------