
                             Erlang Open Source
                            --------------------

Please read the whole file before attempting to build and install
Erlang.

What you need
-------------

  erlang_base-47.4.1.src.tar.gz (2.7 Meg)
    This is the Erlang base kit.

  otp_libs-47.4.1.src.tar.gz (2.6 Meg)  [OPTIONAL]
    This file contains all sorts of application libraries.

  gs_apps-47.4.1.src.tar.gz (5 Meg)     [OPTIONAL]
    This file contains all the GUI based application including the
    Erlang GUI system ("gs") itself.


How to build and install Erlang
-------------------------------

Start by unpacking the Erlang base kit distribution file. (Please note
that to unpack the distribution files you will need a zcat program
that can handle gzipped files and a tar program which handles long
file names.)

  1)  zcat erlang-47.4.1.base.tar.gz | tar xf -

Now cd into the base kit directory.

  2)  cd erlang-47.4.1

If you have fetched any of the optional libraries you need to unpack
them *in* the base kit directory - so don't skip step 2 above.

  3a)  zcat otp_lib.tar.gz | tar xf -
  3b)  zcat gs_apps.tar.gz | tar xf -

The basic steps to build and install Erlang now that you have unpacked
the distribution files are:

  4)    ./configure
  5)    make
  6)    make install

Let's go through them in some detail:

    Step 4 runs a configuration script created by the GNU autoconf
utility, which checks for system specific features and the creates a
number of makefiles. The configure script allows you to customize a
number of parameters, type "./configure --help" for details. One of
the things you can specify is where Erlang should be installed, by
default Erlang will install in /usr/local/{bin,lib/erlang,man/man1},
to keep the same structure but install in a different place, let's
call it <Dir>, than /usr/local use the --prefix argument. Like so:
"./configure --prefix=<Dir>". This step will also configure any
additional libraries unpacked in step 3 (if you didn't add any of the
extra libraries configure will issue a warning saying that there is no
configuration information in lib, this warning can safely be ignored).

    Step 5 first build the Erlang (JAM) emulator, this will take
approximately five minutes on a reasonably fast machine. If you have
installed any optional libraries in step 3 the newly built emulator
will be used to compile the libraries, this takes a long time, expect
half an hour up to a couple of hours. After step 5 is completed you
should have a working Erlang system which you can try by typing
"erts/bin/erl". This should start up Erlang and give you a prompt.

    Step 6 is optional. It installs the Erlang system, together with
documentation in the directory which you specified in step 4. (If you
change your mind about where you wish to install you can rerun step 4,
without having to do step 5 again). The installed system has browsable
documentation, point your browser to <Dir>/lib/erlang/index.html
(where <Dir> is your chosen prefix, default /usr/local).

If you or your system has special requirements please read the
Makefile for additional configuration information.


Portability / Required utilities
--------------------------------

Our aim is to make the system as portable as possible and with as
little special requirements as possible. However we only have access
to a limited amount of machines/operating systems locally, these are
the ones which we have succeeded compiling Erlang on:
 
   Operating system    Version   Compiler

    Solaris/sparc      2.6        cc, gcc
    Solaris/x86        2.5.1      gcc
    SunOS              4.1.4      gcc
    Linux/redhat       5.2        gcc
    Linux/suse                    gcc
    Linux/slackware               gcc
    FreeBSD            2.2.8      gcc
    FreeBSD            3.0        gcc
    Irix               6.3        gcc

If you find that you can compile Erlang on an operating system not
listed above please report this to us. Or if you can't but figured out
what needed to be fixed please tell us about that too!

These are the known tools you will need in order to unpack and build
the Erlang base kit.

  Unpacking

    GNU unzip, or a modern uncompress
    A tar program that can handle long filenames (such as e.g. GNU tar)

  Compiling

    GNU make (this is a must)
    C compiler (ANSI)

  Installing
    An install program that can take multiple file names

  Developing (i.e. not needed when compiling the base kit)
    Perl 5


Caveats
-------

There are currently no dependencies in the Makefiles, which means that
if you modify any source code the system might not build properly.
Also "make clean" does not clean out everything that should be
cleaned. (Sorry, we are working on it.)

The install targets needs an "install" program that can handle
multiple files. (This is a bug we need to fix.)


More Information
----------------

More information can be found on http://www.erlang.org/

For commercial inquires (printed documentation, support et.c.) please
visit http://www.erlang.se/info/


BEAM
----

Beam is the name of another Erlang emulator also included in the
Erlang base kit. If you wish to run Beam instead of jam you will need
an Erlang system for the bootstrap procedure. To make things easier we
have provided a "beam" target in the makefile which will do this for
you. Please read the information in the makefile if you wish to build
and install a Beam system. In short the steps required to build and
install a Beam system are:

  ./configure                # Unless you already have done this

  make beam

  make EMULATOR=beam extras  # (Optional) If you have fetched any
                             # extra libraries.

  make EMULATOR=beam install # (Optional) If you wish to install the
                             # beam system


Make and the variable "ERL_TOP"
-------------------------------

All the makefiles in the entire directory tree use the environment
variable ERL_TOP to find the absolute path of the installation. The
configure script will figure this out and set it in the toplevel
Makefile (which, when building, it will pass on). However when
developing it is sometimes convenient to be able to run make in a
subdirectory. In order to do this you need to set the ERL_TOP variable
before you run make.

For example, assume your GNU make program is called "make" and you
wish to rebuild the Erlang part of stdlib, then you could do:

  cd lib/stdlib/src ; env ERL_TOP=<Dir> make

Where <Dir> would be what you find ERL_TOP is set to in the top level
Makefile.

