Installing a UNIX-like Enviroment

This short guide is intended to get your software up and running fast and to prevent you from having to read a lot of documentation files for programs you maybe never will use yourself, but other programs may need. Most of this software can do a lot for you, but to explore the possibilities I'd suggest you get a book about Linux/UNIX basics.

1. Prerequisites

1.1 Preparing the drives

Create a UNIX-like directory tree on one partition that is large enough to hold all unixish stuff. You should do this because some -especially older- ported programs are not enhanced to know driveletters and simply won't find files on other drives. If you don't want to do this or simply don't have enough space on one HDD, you can workaround the problem by using the Toronto Virtual File System (TVFS). TVFS allows creating virtual drives and linking directories from other drives into the virtual tree very similar to the UNIX filesystems. Note however that you will experience a slight performance hit.

Suggested tree structure: x:/
+--bin/    (executables and shell scripts)
|
+--doc/    (documentation that's not in the form of man-pages or texinfo files)
|
+--emx/    (emx+gcc related stuff)
|
+--etc/    (configuration files and stuff)
|
+--home/
|    |
|    +-userid/  (your HOME directory, on unixish systems named like your login-ID)
|    the place user-specific configuration files get stored)
|
+--include/    (only needed if you're planning to compile something yourself)
|
+--info/    (documentation in the form of texinfo files)
|
+--lib/    (DLLs and the like)
|
+--man/    (the place the man-pages for the man(ual) help system get stored)
|    |
|    +-man1/    (for man-pages matching the *.1* pattern, e.g. bla.1 or blah.1.gz)
|    |
...  ...
|    |
|    +-man9/
|    |
|    +-mann/
|    |
|    +-cat1/    (for pre-formatted man-pages which are loaded faster)
|    |
...  ...
|    |
|    +-cat9/
|    |
|    +-catn/
|
+--share/    (things shared by programs, e.g. internationalization support)
|
+--tmp/    (for temporary files)

1.2 Getting the necessary software

Get the following packages from LEO, Hobbes or The Power Users's BBS. Some GNU software can also be obtained from Jun Sawataishi's homepage.
  • emx run-time
  • GNU gawk, gettext (only DLL-version needed), grep, groff, fileutils, findutils, readline (only DLL-version needed), sed, shellutils, textutils
  • less, man, pdksh
  • Perl (You can get the latest distribution available via CPAN or http://www.perl.com. However you may come across older programs relying on the naming convention of the 5.002b implementation that's available on Hobbes and LEO and easier to install. If you don't want to fiddle around then you can install both.)
Note: Depending on the version of emx you are using (09c or 09d) you will have to keep an open eye on the packages you choose. Programs that have been compiled with emx 09d won't work with 09c. Most of the software compiled with emx09c or older runs on a 09d system. So there is no reason to still use version 09c, especially if you are developing own programs.

If you're planning to compile things yourself you'll likely need the following:

  • emx+gcc plus certain contribs, pgcc
  • GNU autoconf, gettext (full package), libtool, m4, make, perf, readline (full version)
If you want to develop software yourself these might be of interest:
  • GNU bison, CVS, flex, RCS

2. Installation

2.1 Unpacking and placing the files

Get the free Info-Unzip program and place unzip.exe into a directory that's in your PATH environment variable. Place all needed emx archives into one empty temporary directory and issue a unzip * -d x:\ command. All extracted files will be placed into the x:/emx tree. Create a temporary directory and unzip a package into it (or use your archive viewer). Doing this seperately for each package will reduce the risk of overlooking something. Copy or move all files and subdirectories in directories to their corresponding directory on drive x (e.g. /lib/awk/* into x:/lib/awk). DLLs should be placed into x:/lib.
In case the archive doesn't contain directories consider the following patterns. Copy *.exe, *.cmd, *.*sh and any other shell scripts to x:/bin. Copy *.dll to x:/lib and *.doc, *.htm*, *.ps, *.tex or *.txt to x:/doc. Files like *.info and *.texi* go into x:/info. Put man-pages (e.g. files like *.1 or *.1.gz or *.1.bz2) into the corresponding subdirectories of x:/man.

Some files or directory trees have to be placed in special directories. E.g. language dependent messages go into x:/share/locale/<country_code>/LC_MESSAGES with <country_code> being something like de for German or en for English. Simply copy *.mo files and rename *.gpo to *.mo.

The recent port of Perl has an own installation program. However, don't forget to customize the config.pm file and check the environment variables! (See Perl README.)

Most packages come with the source code or diffs you can apply to the original source. If you don't want to recompile the packages you can safely delete the src/ or diffs/ directories.

2.2 Setting the required environment variables

Note: Note the difference between unix-style "/" and OS/2-style "\" path seperators!

Add x:\bin and x:\emx\bin to your PATH, x:\lib and x:\emx\dll to your LIBPATH statement in CONFIG.SYS. Consider placing x:\bin before bootdrive:\OS2 since OS/2 also has commands like sort and find, but with less functionality so you will run into problems if some program uses them to process files otherwise.

Add the following variables to CONFIG.SYS or add the paths if they already exist. Try copy&paste and replacing x: with the driveletter you have chosen!

Note: Some programs like e.g. certain commercial compilers may use some of the variables (LANGUAGE, TEMP, TMPDIR, TMP, ...) and will change them without notice upon installation. So check your CONFIG.SYS!

Directory for temporary files: SET TEMP=anydrive:\TMP    (the filesystem on anydrive: must support long filenames!)
SET TMP=anydrive:\TMP    (HPFS and ext2fs are a good choice)
SET TMPDIR=anydrive:/TMP    (NFS is possible, but will cause problems if the network goes down!)

Internationalization:

SET LOCALEDIR=x:/share/locale    (add x:/XFree86/lib/X11/locale if you are running XFree86/OS2)
SET GNULOCALEDIR=x:/share/locale    (add this if you are using the new ports from Japan)
SET LANGUAGE=<country_code>    (e.g. jp for Japan, en for English)

GNU awk:
SET AWK=x:/bin/gawk.exe
SET AWKPATH=x:/share/awk    (or x:/lib/awk)

Copy gawk32.exe (old port) to gawk.exe and awk.exe, or gawk.exe (new port) to awk.exe. Not everybody uses the AWK variable.

GNU autoconf:

SET AC_PREFIX=x:    (your drive)

GNU Groff:

SET GROFF_FONT_PATH=x:/lib/groff/font
SET GROFF_TMAC_PATH=x:/lib/groff/tmac
SET REFER=x:/lib/groff/dict/papers/int
SET GROFF_TYPESETTER=cp850    (Or cp437 respectively. These devices don't exist in the port from Jun Sawataishi, so choose another!)
SET NROFF=GROFF -Tascii -mandoc    (Or -Tlatin1 if your're living in Europe.)

Manual system:
SET MAN_CONF=x:/etc/man.conf
SET MANPAGER=less
SET MANPATH=x:/man;x:/emx/man    (add x:/XFree86/man if you're running XFree86/OS2)

Perl:

SET PERL5LIB=x:/perl5/lib    (only for Perl 5.002b)
SET PERL_BADLANG=0    (for recent Perl ports)
SET PERLLIB_PREFIX=F:/perllib/lib;x:\PERLLIB\LIB    (the F: part is hardcoded)
SET PERL_SH_DIR=x:\bin

Something about you:

SET HOME=x:\home\<login-ID>
SET USER=<login-ID>
SET LOGNAME=<login-ID>

The login-ID is best set to the one you use to access your ISP or email account, since some programs automatically will use it for these purposes.

emx:

SET TERM=ansi
SET TERMCAP=x:/emx/etc/termcap.dat    (or x:/XFree86/lib/X11/etc/emx.termcap.x11 if you're running XFree86/OS2)
SET EMXOPT=-h512    (this increases the limit of open files, you may want to set it even higher)
SET HELPNDX=EMXBOOK.NDX    (settings for the OS/2 online help)
SET EMXBOOK=EMXDEV.INF+EMXLIB.INF+EMXGNU.INF+EMXBSD.INF
SET INFOPATH=x:/emx/info;x:/info    (searchpath for the texinfo documentation system)

Miscellaneous:

SET PAGER=less    (something like 'more' or 'less', less has more functionality)
Note: There are some versions of less out there that don't work under XFree86/OS2!
SET EDITOR=your_favourite_editor

Note: It may be a good idea to set this variable to a PM or VIO program in CONFIG.SYS and a X program in a special script that sets variables for use in XFree86/OS2. As far as I know Emacs, ViM and FTE are available in both PM/VIO and X versions so you can use a familiar user interface.

The following is only needed if you want to compile/port programs with emx yourself. Also have a look at Alexander Mai's Porting FAQ.

SET C_INCLUDE_PATH=x:/emx/include;x:/XFree86/include;x:/include
SET CPLUS_INCLUDE_PATH=x:/emx/include/cpp;x:/emx/include;x:/XFree86/include;x:/include
SET GCCLOAD=5
SET GCCOPT=-pipe
SET LIBRARY_PATH=x:/emx/lib;x:/emx/lib/mt;x:/XFree86/lib
SET OBJC_INCLUDE_PATH=x:/emx/include
SET PROTODIR=x:/emx/include/cpp/gen
SET HOSTTYPE=i386
SET MACHTYPE=i386-pc-os2

Well, that's it for now. Now go on and install XFree86/OS2! ;-)

© 2000, 2001 christian.hennecke@ruhr-uni-bochum.de


Unless otherwise noted, all content on this site is Copyright © 2004, VOICE