aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
l---------INSTALL-CROSS.md1
-rw-r--r--INSTALL-WIN32.md779
-rw-r--r--INSTALL.md661
-rw-r--r--Makefile.in55
-rw-r--r--README562
-rw-r--r--README.md76
-rw-r--r--README.win32763
-rw-r--r--TAR.include6
-rw-r--r--erts/doc/src/erl_nif.xml113
-rw-r--r--lib/orber/doc/src/ch_install.xml23
-rw-r--r--lib/orber/doc/src/notes.xml7
-rw-r--r--lib/orber/doc/src/orber.xml30
-rw-r--r--lib/orber/src/orber.erl19
-rw-r--r--lib/orber/src/orber_env.erl42
-rw-r--r--lib/orber/src/orber_socket.erl58
-rw-r--r--lib/orber/vsn.mk3
-rw-r--r--lib/reltool/doc/src/notes.xml15
-rw-r--r--lib/reltool/vsn.mk15
-rw-r--r--lib/sasl/doc/src/rb.xml24
-rw-r--r--lib/sasl/src/rb.erl10
-rw-r--r--lib/stdlib/src/escript.erl2
-rw-r--r--lib/tools/emacs/erlang-skels-old.el1267
-rw-r--r--lib/tools/emacs/erlang-skels.el1262
-rw-r--r--lib/tools/emacs/erlang.el1264
-rw-r--r--system/doc/installation_guide/Makefile12
-rw-r--r--system/doc/installation_guide/install.xml23
-rw-r--r--xcomp/README.md404
-rw-r--r--xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf334
-rw-r--r--xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf371
-rw-r--r--xcomp/erl-xcomp-vxworks_ppc32.conf334
-rw-r--r--xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf334
-rw-r--r--xcomp/erl-xcomp.conf.template334
32 files changed, 5449 insertions, 3754 deletions
diff --git a/INSTALL-CROSS.md b/INSTALL-CROSS.md
new file mode 120000
index 0000000000..9e7743b9de
--- /dev/null
+++ b/INSTALL-CROSS.md
@@ -0,0 +1 @@
+xcomp/README.md \ No newline at end of file
diff --git a/INSTALL-WIN32.md b/INSTALL-WIN32.md
new file mode 100644
index 0000000000..305792ef88
--- /dev/null
+++ b/INSTALL-WIN32.md
@@ -0,0 +1,779 @@
+How to Build Erlang/OTP on Windows
+==================================
+
+Table of Contents
+-----------------
+
+1. Introduction
+2. Frequently Asked Questions
+3. Tools you Need and Their Environment
+4. The Shell Environment
+5. Building and Installing
+6. Development
+7. Final Words
+8. Copyright and License
+
+Introduction
+------------
+
+This file describes how to build the Erlang emulator and the OTP
+libraries on Windows. The instructions apply to versions of Windows
+supporting the Cygwin emulated gnuish environment for Windows. We've
+built on the following platforms: Windows 2000 Professional, Windows
+2003 server, Windows XP Home/Professional, and Windows Vista. Any
+Windows95'ish platform will surely get you into trouble, what I'm not
+sure of, but it certainly will...
+
+The procedure described uses Cygwin as a build environment, you run
+the bash shell in Cygwin and uses gnu make/configure/autoconf etc to
+do the build. The emulator C-source code is, however, mostly compiled
+with Microsoft Visual C++(tm), producing a native Windows binary. This
+is the same procedure as we use to build the pre-built binaries. The
+fact that we use VC++ and not gcc is explained further in the FAQ
+section.
+
+I describe the build procedure to make it possible for open source
+customers to build the emulator, given that they have the needed
+tools. The binary Windows releases is still a preferred alternative if
+one does not have Microsoft's development tools and/or don't want to
+install Cygwin.
+
+To use Cygwin, one needs basic experience from a Unix environment, if
+one does not know how to set environment variables, run programs etc
+in a Unix environment, one will be quite lost in the Cygwin
+ditto. I can unfortunately not teach all the world how to use
+Cygwin and bash, neither how to install Cygwin nor perform basic tasks
+on a computer. Please refer to other documentation on the net for
+help, or use the binary release instead if you have problems using the
+tools.
+
+However, if you feel comfortable with the environment and build
+system, and have all the necessary tools, you have a great opportunity
+to make the Erlang/OTP distribution for Windows better. Please submit
+any suggestions and patches to the appropriate mailing lists (see
+<http://www.erlang.org/faq.html>) to let them find their way into the next
+version of Erlang. If making changes to the build system (like
+makefiles etc) please bear in mind that the same makefiles are used on
+Unix/VxWorks/OSEDelta, so that your changes don't break other
+platforms. That of course goes for C-code too, system specific code
+resides in the `$ERL_TOP/erts/emulator/sys/win32` and `$ERL_TOP/erts/etc/win32`
+directories mostly. The `$ERL_TOP/erts/emulator/beam directory` is for
+common code.
+
+Before the R9C release of Erlang/OTP, the Windows release was built
+partly on a Unix (Solaris) box and partly on a Windows box, using Perl
+hacks to communicate and sync between the two machines. R9C was the
+first release ever built solely on Windows, where no Unix machine is
+needed at all. Now we've used this build procedure for a couple of
+releases, and it has worked fine for us. Still, there might be all
+sorts of troubles on different machines and with different
+setups. I'll try to give hints wherever I've encountered difficulties,
+but please share your experiences by using the mailing list
+<[email protected]>. I cannot of course help everyone with all
+their problems, please try to solve the problems and submit
+solutions/workarounds. Remember, it's all about sharing, not about
+demanding...
+
+Lets go then, I'll start with a little FAQ, based on in house questions
+and misunderstandings.
+
+
+Frequently Asked Questions
+--------------------------
+
+* Q: So, now I can build Erlang using GCC on Windows?
+
+ A: No, unfortunately not. You'll need Microsoft's Visual C++ still, a
+ Bourne-shell script (cc.sh) wraps the Visual C++ compiler and runs it
+ from within the Cygwin environment. All other tools needed to build
+ Erlang are free-ware/open source, but not the C compiler.
+
+* Q: Why haven't you got rid of VC++ then, you `******`?
+
+ A: Well, partly because it's a good compiler - really! Actually it's
+ been possible in late R11-releases to build using mingw instead of
+ visual C++ (you might see the remnants of that in some scripts and
+ directories). Unfortunately the development of the SMP version for
+ Windows broke the mingw build and we chose to focus on the VC++ build
+ as the performance has been much better in the VC++ versions. The
+ mingw build will be back, but as long as VC++ gives better
+ performance, the commercial build will be a VC++ one.
+
+* Q: OK, VC++ you need, but now you've started to demand a very recent
+ (and expensive) version of Visual studio, not the old and stable VC++
+ 6.0 that was used in earlier versions. Why?
+
+ A: The SMP version of Erlang needs features in the Visual Studio 2005.
+ Can't live without them. Besides the new compiler gives the Erlang
+ emulator a ~40% performance boost(!)
+
+* Q: Can/will I build a Cygwin binary with the procedure you describe?
+
+ A: No, the result will be a pure Windows binary, and as far as I know,
+ it's not possible to make a Cygwin binary yet. That is of course
+ something desirable, but there are still some problems with the
+ dynamic linking (dynamic Erlang driver loading) as well as the TCP/IP
+ emulation in Cygwin, which, I'm sure of, will improve, but still has
+ some problems. Fixing those problems might be easy or might be hard.
+ I suggest you try yourself and share your experience. No one would be
+ happier if a simple ./configure && make would produce a fully fledged
+ Cygwin binary. Ericsson does however not pay me to do a Cygwin port, so
+ such a port would have to happen in spare time, which is a limited
+ resource...
+
+* Q: Hah, I saw you, you used GCC even though you said you didn't!
+
+ A: OK, I admit, one of the files is compiled using Cygwin's GCC and
+ the resulting object code is then converted to MS VC++ compatible coff
+ using a small C hack. It's because that particular file, `beam_emu.c`
+ benefits immensely from being able to use the GCC labels-as-values
+ extension, which boosts emulator performance by up to 50%. That does
+ unfortunately not (yet) mean that all of OTP could be compiled using
+ GCC, that particular source code does not do anything system specific
+ and actually is adopted to the fact that GCC is used to compile it on
+ Windows.
+
+* Q: So now there's a MS VC++ project file somewhere and I can build OTP
+ using the nifty VC++ GUI?
+
+ A: No, never. The hassle of keeping the project files up to date and
+ do all the steps that constitute an OTP build from within the VC++ GUI
+ is simply not worth it, maybe even impossible. A VC++ project
+ file for Erlang/OTP will never happen, at least I will never make
+ one. Clicking around in super-multi-tab'd dialogs to add a file or
+ compiler option when it's so much easier in a makefile is simply not
+ my style.
+
+* Q: So how does it all work then?
+
+ A: Cygwin is the environment, which closely resembles the environments
+ found on any Unix machine. It's almost like you had a virtual Unix
+ machine inside Windows. Configure, given certain parameters, then
+ creates makefiles that are used by the Cygwin gnu-make to built the
+ system. Most of the actual compilers etc are not, however, Cygwin
+ tools, so I've written a couple of wrappers (Bourne-shell scripts),
+ which reside in `$ERL_TOP/etc/win32/cygwin_tools` and they all do
+ conversion of parameters and switches common in the Unix environment
+ to fit the native Windows tools. Most notable is of course the paths,
+ which in Cygwin are Unix-like paths with "forward slashes" (/) and no
+ drive letters, the Cygwin specific command `cygpath` is used for most
+ of the path conversions. Luckily most compilers accept forward slashes
+ instead of backslashes as path separators, one still have to get the
+ drive letters etc right, though. The wrapper scripts are not general
+ in the sense that, for example, cc.sh would understand and translates
+ every possible gcc option and passes correct options to cl.exe. The
+ principle is that the scripts are powerful enough to allow building of
+ Erlang/OTP, no more, no less. They might need extensions to cope with
+ changes during the development of Erlang, that's one of the reasons I
+ made them into shell-scripts and not Perl-scripts, I believe they are
+ easier to understand and change that way. I might be wrong though,
+ cause another reason I didn't write them in Perl is because I've never
+ liked Perl and my Perl code is no pleasant reading...
+
+ In `$ERL_TOP`, there is a script called `otp_build`, that script handles
+ the hassle of giving all the right parameters to `configure`/`make` and
+ also helps you set up the correct environment variables to work with
+ the Erlang source under Cygwin.
+
+* Q: You use and need Cygwin, but then you haven't taken the time to
+ port Erlang to the Cygwin environment but instead focus on your
+ commercial release, is that really ethical?
+
+ A: No, not really, but see this as a step in the right direction. I'm
+ aiming at GCC compiled emulators and a Cygwin version, but I really
+ need to do other things as well... In time, but don't hold your
+ breath...
+
+* Q: Can I build something that looks exactly as the commercial release?
+
+ A: Yes, we use the exactly same build procedure.
+
+* Q: Which version of Cygwin and other tools do you use then?
+
+ A: For Cygwin we try to use the latest releases available when
+ building. What versions you use shouldn't really matter, I try to
+ include workarounds for the bugs I've found in different Cygwin
+ releases, please help me to add workarounds for new Cygwin-related
+ bugs as soon as you encounter them. Also please do submit bug reports
+ to the appropriate Cygwin developers. The Cygwin GCC we used for R13B
+ was version 3.4.4. We used VC++ 8.0 (i.e. Visual studio 2005 SP1),
+ Sun's JDK 1.5.0\_17, NSIS 2.37, and Win32 OpenSSL 0.9.8e. Please read
+ the next section for details on what you need.
+
+* Q: Can you help me setup X in Cygwin?
+
+ A: No, unfortunately I haven't got time to help with Cygwin related
+ user problems, please read Cygwin related web sites, newsgroups and
+ mailing lists.
+
+* Q: Why is the instruction so long? Is it really that complicated?
+
+ A: Partly it's long because I babble too much, partly because I've
+ described as much as I could about the installation of the needed
+ tools. Once the tools are installed, building is quite easy. I also
+ have tried to make this instruction understandable for people with
+ limited Unix experience. Cygwin is a whole new environment to some
+ Windows users, why careful explanation of environment variables etc
+ seemed to be in place. The short story, for the experienced and
+ impatient is:
+
+ * Get and install complete Cygwin (latest)
+
+ * (Buy and) Install Microsoft Visual studio 2005 and SP1 (or higher)
+
+ * Get and install Sun's JDK 1.4.2
+
+ * Get and install NSIS 2.01 or higher (up to 2.30 tried and working)
+
+ * Get and install OpenSSL 0.9.7c or higher
+
+ * Get and unpack wxWidgets-2.8.9 or higher to `/opt/local/pgm` inside
+ cygwin.
+ * Open `/cygwin/opt/local/pgm/wxWidgets-2.8.9/build/msw/wx.dsw`
+ * Enable `wxUSE_GLCANVAS`, `wxUSE_POSTSCRIPT` and
+ `wxUSE_GRAPHICS_CONTEXT` in `include/wx/msw/setup.h`
+ * Build all unicode release (and unicode debug) packages
+ * Open `/cygwin/opt/local/pgm/wxWidgets-2.8.9/contrib/build/stc/stc.dsw`
+ * Build the unicode release (and unicode debug) packages
+
+ * Get the Erlang source distribution (from
+ <http://www.erlang.org/download.html>) and unpack with Cygwin's `tar`.
+
+ * Set `ERL_TOP` to where you unpacked the source distribution
+
+ * `$ cd $ERL_TOP`
+
+ * Get (from <http://www.erlang.org/download/tcltk85_win32_bin.tar.gz>)
+ and unpack the prebuilt TCL/TK binaries for windows with cygwin tar,
+ standing in `$ERL_TOP`
+
+ * Modify PATH and other environment variables so that all these tools
+ are runnable from a bash shell. Still standing in `$ERL_TOP`, issue
+ the following commands:
+
+ $ eval `./otp_build env_win32`
+ $ ./otp_build autoconf
+ $ ./otp_build configure
+ $ ./otp_build boot -a
+ $ ./otp_build release -a
+ $ ./otp_build installer_win32
+ $ release/win32/otp_win32_<OTP version> /S
+
+ Voila! `Start->Programs->Erlang OTP <OTP version>->Erlang` starts the Erlang
+ Windows shell.
+
+
+Tools you Need and Their Environment
+------------------------------------
+
+You need some tools to be able to build Erlang/OTP on Windows. Most
+notably you'll need Cygwin and Microsoft VC++, but you also might want
+a Java compiler, the NSIS install system and OpenSSL. Only VC++ costs
+money, but then again it costs a lot of money, I know...
+Well' here's the list:
+
+* Cygwin, the very latest is usually best. Get all the development
+ tools and of course all the basic ditto. In fact getting the complete
+ package might be a good idea, as you'll start to love Cygwin after a
+ while if you're accustomed to Unix. Make sure to get jar and also make
+ sure *not* to install a Cygwin'ish Java... The Cygwin jar command is
+ used but Sun's Java compiler and virtual machine...
+
+ URL: <http://www.cygwin.com>
+
+ Get the installer from the web site and use that to install
+ Cygwin. Be sure to have fair privileges. If you're on a NT domain you
+ should consider running `mkpasswd -d` and `mkgroup -d` after the
+ installation to get the user databases correct. See their respective
+ manual pages.
+
+ When you start you first bash shell, you will get an awful prompt. You
+ might also have a `PATH` environment variable that contains backslashes
+ and such. Edit `$HOME/.profile` and `$HOME/.bashrc` to set fair prompts
+ and set a correct PATH. Also do a `export SHELL` in `.profile`. For some
+ non-obvious reason the environment variable `$SHELL` is not exported in
+ bash. Also note that `.profile` is run at login time and `.bashrc` when
+ sub shells are created. You'll need to explicitly source `.bashrc` from
+ `.profile` if you want the commands there to be run at login time (like
+ setting up aliases, shell functions and the like). I personally
+ usually do like this at the end of `.profile`:
+
+ ENV=$HOME/.bashrc
+ export ENV
+ . $ENV
+
+ You might also, if you're a hard core type of person at least, want to
+ setup X-windows (XFree86), that might be as easy as running startx
+ from the command prompt and it might be much harder. Use Google to
+ find help...
+
+ If you don't use X-windows, you might want to setup the Windows
+ console window by selecting properties in the console system menu
+ (upper left corner of the window, the Cygwin icon in the title
+ bar). Especially setting a larger screen buffer size (lines) is useful
+ as it gets you a scrollbar so you can see whatever error messages
+ that might appear...
+
+ If you want to use (t)csh instead of bash you're on your own, I
+ haven't tried and know of no one that has. I expect
+ that you use bash in all shell examples.
+
+* Microsoft Visual Studio 2005 SP1. Please don't skip the service
+ pack! The installer might update your environment so that you can run
+ the `cl` command from the bash prompt, then again it might
+ not... There is always a BAT file in VC\Bin under the installation
+ directory (default `C:\Program Files\Microsoft Visual Studio 8`) called
+ `VCVARS32.BAT`. Either add the environment settings in that file to the
+ global environment settings in Windows or add the corresponding BASH
+ environment settings to your `.profile`/`.bashrc`. For example, in my case
+ I could add the following to `.profile`
+
+ #Visual C++ Root directory as Cygwin style pathname
+ VCROOT=/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio 8
+
+ # Visual C++ Root directory as Windows style pathname
+ WIN_VCROOT="C:\\Program Files\\Microsoft Visual Studio 8"
+
+ # The PATH variable should be Cygwin'ish
+ PATH=$VCROOT/Common7/IDE:$VCROOT/VC/BIN:$VCROOT/Common7/Tools:\
+ $VCROOT/Common7/Tools/bin:$VCROOT/VC/PlatformSDK/bin:$VCROOT/SDK/v2.0/bin:\
+ $VCROOT/VC/VCPackages:$PATH
+
+ # Lib and INCLUDE should be Windows'ish
+ # Note that semicolon (;) is used to separate Windows style paths but
+ # colon (:) to separate Cygwin ditto!
+
+ LIBPATH=$WIN_VCROOT\\VC\\ATLMFC\\LIB
+
+ LIB=$WIN_VCROOT\\VC\\ATLMFC\\LIB\;$WIN_VCROOT\\VC\\LIB\;\
+ $WIN_VCROOT\\VC\\PlatformSDK\\lib\;$WIN_VCROOT\\SDK\\v2.0\\lib
+
+ INCLUDE=$WIN_VCROOT\\VC\\ATLMFC\\INCLUDE\;$WIN_VCROOT\\VC\\INCLUDE\;\
+ $WIN_VCROOT\\VC\\PlatformSDK\\include
+
+ export PATH LIB INCLUDE
+
+ Make a simple hello world and try to compile it with the `cl` command
+ from within bash. If that does not work, your environment needs
+ fixing. Also remember to fix up the PATH environment, especially old
+ Erlang installations might have inserted quoted paths that Cygwin does
+ not understand. Remove or correct such paths. There should be no
+ backslashes in your path environment variable in Cygwin bash, but LIB
+ and INCLUDE should contain Windows style paths with semicolon,
+ drive letters and backslashes.
+
+ If you wish to use Visual Studio 2008, a couple things need to be tweaked,
+ namely the fact that some of the SDK stuff is installed in (by default)
+ `C:\Program Files\Microsoft SDKs\v6.0A` . Just ensure that that
+ `C:\Program Files\Microsoft SDKs\v6.0A\Lib` is in `LIB` and
+ `C:\Program Files\Microsoft SDKs\v6.0A\Include` is in `INCLUDE`. A symptom
+ of not doing this is errors about finding kernel32.lib and windows.h.
+
+ Additionally, if you encounter errors about mc.exe not being found, you must
+ install the entire Windows SDK (the partial SDK included in visual studio
+ apparently does not include it). After installing it you'll want to add
+ something like: `/c/cygdrive/Program\ Files/Microsoft\ SDKs/v7.0/bin` to
+ your `PATH` to allow the environment to find mc.exe. The next Visual Studio
+ (2010) is expected to include this tool.
+
+* Sun's Java JDK 1.5.0 or higher. Our Java code (jinterface, ic) is
+ written for JDK 1.5.0. Get it for Windows and install it, the JRE is
+ not enough. If you don't care about Java, you can skip this step, the
+ result will be that jinterface is not built.
+
+ URL: <http://java.sun.com>
+
+ Add javac *LAST* to your path environment in bash, in my case this means:
+
+ PATH="$PATH:/cygdrive/c/Program Files/Java/jdk1.5.0_17/bin"
+
+ No `CLASSPATH` or anything is needed. Type `javac` at the bash prompt
+ and you should get a list of available Java options. Make sure by
+ typing `which java` that you use the Java you installed. Note however that
+ Cygwin's `jar.exe` is used, that's why the JDK bin-directory should be
+ added last in the `PATH`.
+
+* Nullsoft NSIS installer system. You need this to build the self
+ installing package. It's a free open source installer that's much
+ nicer to use than the commercial Wise and Install shield
+ installers. This is the installer we use for commercial releases as
+ well from R9C an on.
+
+ URL: <http://www.nullsoft.com/free/nsis>
+
+ Install the lot, especially the modern user interface components, as
+ it's definitely needed. Put `makensis` in your path, in my case:
+
+ PATH=/cygdrive/c/Program\ Files/NSIS:$PATH
+
+ type makensis at the bash prompt and you should get a list of options
+ if everything is OK.
+
+* OpenSSL for Windows. This is if you want the SSL and crypto
+ applications to compile (and run). Go to <http://www.openssl.org>, click
+ on the `Related` link and then on the `Binaries` link (upper right
+ corner of the page last time I looked), you can then reach the
+ "Shining Lights Productions" Web site for Windows binaries
+ distributions. Get the latest or 0.9.7c if you get trouble with the
+ latest. It's a nifty installer. The rest should be handled by
+ `configure`, you needn't put anything in the path or anything.
+
+ If you want to build openssl for windows yourself (which might be
+ possible, as you wouldn't be reading this if you weren't a
+ compile-it-yourself person), you either have to put the resulting
+ DLL's in your path or in the windows system directory and either
+ specify where you put the includes etc with the configure-parameter
+ `--with-ssl=<cygwin path to the root>` or put your installation directly
+ under `c:\OpenSSL`. The directory structure under the installation root
+ for OpenSSL is expected to be one with subdirectories named `include`,
+ `bin` and `lib`, possibly with a `VC` subdirectory of `lib` containing
+ the actual `.lib` files. Note that the cygwin distributed OpenSSL cannot be
+ used, it results in cygwin depending binaries and it has unix style
+ archives (`.a`, not `.lib`).
+
+* Building with wxWidgets. Download wxWidgets-2.8.9 or higher patch
+ release (2.9.* is a developer release which currently does not work
+ with wxErlang).
+
+ Install or unpack it to `DRIVE:/PATH/cygwin/opt/local/pgm`
+ Open from explorer (i.e. by double clicking the file)
+ `C:\cygwin\opt\local\pgm\wxMSW-2.8.10\build\msw\wx.dsw`
+ In Microsoft Visual Studio, click File/Open/File, locate and
+ open: `C:\cygwin\opt\local\pgm\wxMSW-2.8.10\include\wx\msw\setup.h`
+ enable `wxUSE_GLCANVAS`, `wxUSE_POSTSCRIPT` and `wxUSE_GRAPHICS_CONTEXT`
+ Build it by clicking Build/Batch Build and select all unicode release
+ (and unicode debug) packages.
+
+ Open `C:\cygwin\opt\local\pgm\wxMSW-2.8.10\contrib/build/stc/stc.dsw`
+ and batch build all unicode packages.
+
+* The Erlang source distribution (from <http://www.erlang.org/download.html>).
+ The same as for Unix platforms. Preferably use tar from within Cygwin to
+ unpack the source tar.gz (`tar zxf otp_src_R13B04.tar.gz`).
+
+ set the environment ERL_TOP to point to the root directory of the
+ source distribution. Let's say I stood in `$HOME/src` and unpacked
+ `otp_src_R13B04.tar.gz`, I then add the following to `.profile`:
+
+ ERL_TOP=$HOME/src/otp_src_R13B04
+ export $ERL_TOP
+
+* The TCL/TK binaries. You could compile Tcl/Tk for windows yourself,
+ but you can get a stripped down version from our website which is
+ suitable to include in the final binary package. If you want to supply
+ tcl/tk yourself, read the instructions about how the tcl/tk tar file
+ used in the build is constructed under `$ERL_TOP/lib/gs/tcl`. The easy
+ way is to download <http://www.erlang.org/download/tcltk85_win32_bin.tar.gz>
+ and unpack it standing in the `$ERL_TOP` directory. This will create the
+ file `win32.tar.gz` in `$ERL_TOP/lib/gs/tcl/binaries`.
+
+ One last alternative is to create a file named `SKIP` in the
+ `$ERL_TOP/lib/gs/` after configure is run, but that will give you an
+ erlang system without gs (which might be okay as you probably will use
+ wx anyway).
+
+The Shell Environment
+---------------------
+
+So, if you have followed the instructions above, when you start a bash
+shell, you should have an INCLUDE environment with a Windows style
+path, a LIB environment variable also in Windows style, and finally a
+PATH that let's you reach cl, makensis, javac etc from the
+command prompt (use `which cl` etc to verify from bash).
+
+You should also have an `ERL_TOP` environment variable that is *Cygwin
+style*, and points to a directory containing, among other files, the
+script `otp_build`.
+
+A final massage of the environment is needed, and that is done by
+the script `$ERL_TOP/otp_build`. Start bash and do the following, note
+the "back-ticks" (\`), can be quite hard to get on some keyboards, but
+pressing the back-tick key followed by the space bar might do it...
+
+ $ cd $ERL_TOP
+ $ eval `./otp_build env_win32`
+
+If you're unable to produce back-ticks on your keyboard, you can use
+the ksh variant:
+
+ $ cd $ERL_TOP
+ $ eval $(./otp_build env_win32)
+
+This should do the final touch to the environment and building should
+be easy after this. You could run `./otp_build env_win32` without
+`eval` just to see what it does, and to see that the environment it
+sets seems OK. The path is cleaned of spaces if possible (using DOS
+style short names instead), the variables `OVERRIDE_TARGET`, `CC`, `CXX`,
+`AR` and `RANLIB` are set to their respective wrappers and the directories
+`$ERL_TOP/erts/etc/win32/cygwin_tools/vc` and
+`$ERL_TOP/erts/etc/win32/cygwin_tool` are added first in the PATH.
+
+Try now a `which erlc`. That should result in the erlc wrapper script
+(which does not have the .sh extension, for reasons best kept
+untold...). It should reside in `$ERL_TOP/erts/etc/win32/cygwin_tools`.
+You could also try `which cc.sh`, which `ar.sh` etc.
+
+Now you're ready to build...
+
+
+Building and Installing
+-----------------------
+
+Now it's assumed that you have executed `` eval `./otp_build env_win32` ``
+for this particular shell...
+
+Building is easiest using the `otp_build` script. That script takes care
+of running configure, bootstrapping etc on Windows in a simple
+way. The `otp_build` script is the utility we use ourselves to build on
+different platforms and it therefore contains code for all sorts of
+platforms. The principle is, however, that for non-Unix platforms, one
+uses `./otp_build env_<target>` to set up environment and then the
+script knows how to build on the platform "by itself". You've already
+run `./otp_build env_win32` in the step above, so now it's mostly like
+we build on any platform. OK, here are then steps; Assuming you will
+want to build a full installation executable with NSIS, you can omit
+`<installation directory>` and the release will be copied to
+`$ERL_TOP/release/win32`: and there is where the packed self installing
+executable will reside too.
+
+ $ ./otp_build autoconf # Ignore the warning blob about versions of autoconf
+ $ ./otp_build configure <optional configure options>
+ $ ./otp_build boot -a
+ $ ./otp_build release -a <installation directory>
+ $ ./otp_build installer_win32 <installation directory> # optional
+
+Now you will have a file called `otp_win32_R12B.exe` in the
+`<installation directory>`, i.e. `$ERL_TOP/release/win32`.
+
+Lets get into more detail:
+
+`$ ./otp_build autoconf` - This step rebuilds the configure scripts to
+work correctly in the cygwin environment. In an ideal world, this
+would not be needed, but alas, we have encountered several
+incompatibilities between our distributed configure scripts (generated
+on a Linux platform) and the cygwin environment over the
+years. Running autoconf on cygwin ensures that the configure scripts
+are generated in a cygwin-compatible way and that they will work well
+in the next step.
+
+`$ ./otp_build configure` - This runs the newly generated configure scripts
+with options making configure behave nicely. The target machine type is
+plainly `win32`, so a lot of the configure-scripts recognize this
+awkward target name and behave accordingly. The CC variable also makes
+the compiler be cc.sh, which wraps MSVC++, so all configure tests
+regarding the C compiler gets to run the right compiler. A lot of the
+tests are not needed on Windows, but I thought it best to run the
+whole configure anyway. The only configure option you might want to
+supply is `--with-ssl`, which might be needed if you have built your own
+openssl distribution. The Shining Lights distribution should be found
+automatically by configure, if that fails, add a `--with-ssl=<dir>` that
+specifies the root directory of your OpenSSL installation.
+
+`$ ./otp_build boot -a` - This uses the bootstrap directory (shipped
+with the source, `$ERL_TOP/bootstrap`) to build a complete OTP
+system. It first builds an emulator and sets up a minimal OTP system
+under `$ERL_TOP/bootstrap`, then starts to compile the different OTP
+compilers to make the `$ERL_TOP/bootstrap` system potent enough to be
+able to compile all Erlang code in OTP. Then, all Erlang and C code
+under `$ERL_TOP/lib` is built using the bootstrap system, giving a
+complete OTP system (although not installed). When this is done, one
+can run Erlang from within the source tree, just type `$ERL_TOP/bin/erl`
+and you should have a prompt. If you omit the -a flag, you'll get a
+smaller system, that might be useful during development. Now
+exit from Erlang and start making a release of the thing:
+
+`$ ./otp_build release -a` - Builds a commercial release tree from the
+source tree, default is to put it in `$ERL_TOP/release/win32`, you can
+give any directory as parameter (Cygwin style), but it doesn't really matter
+if you're going to build a self extracting installer too. You could of
+course build release to the final directory and then run `./Install.exe`
+standing in the directory where the release was put, that will create
+a fully functional OTP installation. But let's make the nifty
+installer:
+
+`$ ./otp_build installer_win32` - Create the self extracting installer
+executable. The executable `otp_win32_<OTP version>.exe` will be placed
+in the top directory of the release created in the previous step. If
+no release directory is specified, the release is expected to have
+been built to `$ERL_TOP/release/win32`, which also will be the place
+where the installer executable will be placed. If you specified some
+other directory for the release (i.e.
+`./otp_build release -a /tmp/erl_release`), you're expected to give the
+same parameter here, (i.e. `./otp_build installer_win32 /tmp/erl_release`).
+You need to have a full NSIS installation and `makensis.exe` in your
+path for this to work of course. Once you have created the installer,
+you can run it to install Erlang/OTP in the regular way, just run the
+executable and follow the steps in the installation wizard. To get all
+default settings in the installation without any questions asked, you
+run the executable with the parameter `/S` (capital S). like in:
+
+ $ cd $ERL_TOP
+ $ release/win32/otp_win32_R13B04 /S
+ ...
+
+and after a while Erlang will have been installed in
+`C:\Program Files\erl5.7.5`, with shortcuts in the menu etc.
+
+*NOTE* Beginning with R9C, the Windows installer does *not* add Erlang
+to the system wide path. If one wants to have Erlang in the path, one
+has to add it by hand.
+
+The necessary setup of an Erlang installation is actually done by the
+program `Install.exe`, which resides in the release top. That program
+creates `.ini`-files and copies the correct boot scripts. If one has
+the correct directory tree (like after a `./otp_build release -a`), only
+the running of Install.exe is necessary to get a fully functional
+OTP. What the self extracting installer adds is (of course) the
+possibility to distribute the binary easily, together with adding
+shortcuts to the Windows start menu. There is also some adding of
+entries in the registry, to associate `.erl` and `.beam` files with Erlang
+and get nifty icons, but that's not something you'll really need to
+run Erlang. The registry is also used to store uninstall information,
+but if one has not used the self extracting installer, one cannot
+(need not) do any uninstall, one just scratches the release directory
+and everything is gone. Erlang/OTP does not *need* to put anything
+in the Windows registry at all, and does not if you don't use the self
+extracting installer. In other words the installer is pure cosmetics.
+
+
+Development
+-----------
+
+Once the system is built, you might want to change it. Having a test
+release in some nice directory might be useful, but you also can run
+Erlang from within the source tree. The target `local_setup`, makes
+the program `$ERL_TOP/bin/erl.exe` usable and it also uses all the OTP
+libraries in the source tree.
+
+If you hack the emulator, you can then build the emulator executable
+by standing in `$ERL_TOP/erts/emulator` and do a simple
+
+ $ make opt
+
+Note that you need to have run ``(cd $ERL_TOP && eval `./otp_build env_win32`)``
+in the particular shell before building anything on Windows. After
+doing a make opt you can test your result by running `$ERL_TOP/bin/erl`.
+If you want to copy the result to a release directory (say
+`/tmp/erl_release`), you do this (still in `$ERL_TOP/erts/emulator`)
+
+ $ make TESTROOT=/tmp/erl_release release
+
+That will copy the emulator executables.
+
+To make a debug build of the emulator, you need to recompile both
+`beam.dll` (the actual runtime system) and `erlexec.dll`. Do like this
+
+ $ cd $ERL_TOP
+ $ rm bin/win32/erlexec.dll
+ $ cd erts/emulator
+ $ make debug
+ $ cd ../etc
+ $ make debug
+
+and sometimes
+
+ $ cd $ERL_TOP
+ $ make local_setup
+
+So now when you run `$ERL_TOP/erl.exe`, you should have a debug compiled
+emulator, which you will see if you do a:
+
+ 1> erlang:system_info(system_version).
+
+in the erlang shell. If the returned string contains `[debug]`, you
+got a debug compiled emulator.
+
+To hack the erlang libraries, you simply do a `make opt` in the
+specific "applications" directory, like:
+
+ $ cd $ERL_TOP/lib/stdlib
+ $ make opt
+
+or even in the source directory...
+
+ $ cd $ERL_TOP/lib/stdlib/src
+ $ make opt
+
+Note that you're expected o have a fresh Erlang in your path when
+doing this, preferably the plain R13B04 you have built in the previous
+steps. You could also add `$ERL_TOP/bootstrap/bin` to your `PATH` before
+rebuilding specific libraries, that would give you a good enough
+Erlang system to compile any OTP erlang code. Setting up the path
+correctly is a little bit tricky, you still need to have
+`$ERL_TOP/erts/etc/win32/cygwin_tools/vc` and
+`$ERL_TOP/erts/etc/win32/cygwin_tools` *before* the actual emulator
+in the path. A typical setting of the path for using the bootstrap
+compiler would be:
+
+ $ export PATH=$ERL_TOP/erts/etc/win32/cygwin_tools/vc:$ERL_TOP/erts/etc/win32/cygwin_tools:$ERL_TOP/bootstrap/bin:$PATH
+
+That should make it possible to rebuild any library without hassle...
+
+If you want to copy a library (an application) newly built, to a
+release area, you do like with the emulator:
+
+ $ cd $ERL_TOP/lib/stdlib
+ $ make TESTROOT=/tmp/erlang_release release
+
+Remember that:
+
+* Windows specific C-code goes in the `$ERL_TOP/erts/emulator/sys/win32`,
+ `$ERL_TOP/erts/emulator/drivers/win32` or `$ERL_TOP/erts/etc/win32`.
+
+* Windows specific erlang code should be used conditionally and the
+ host OS tested in *runtime*, the exactly same beam files should be
+ distributed for every platform! So write code like:
+
+ case os:type() of
+ {win32,_} ->
+ do_windows_specific();
+ Other ->
+ do_fallback_or_exit()
+ end,
+
+That's basically all you need to get going.
+
+Final Words
+-----------
+My hope is that the possibility to build the whole system on Windows
+will open up for free development on this platform too. There are many
+things one might want to do better in the Windows version, like the
+window-style command prompt as well as pure Cygwin porting. Although i
+realize it's a much larger step to start building on Windows (with all
+the software you need) than for instance on Linux, I sincerely hope
+that some of you will make the effort and start submitting Windows
+friendly patches.
+
+The first build system for Erlang using Cygwin on Windows was created
+by Per Bergkvist. I haven't used his build system, but it's rumored to
+be good. The idea to do this came from his work, so credit is well
+deserved.
+
+Of course this would have been completely impossible without the
+excellent Cygwin package. The guys at Cygnus solutions and Redhat
+deserves a huge THANKS! as well as all the other people in the free
+software community who have helped in creating the magnificent
+software that constitutes Cygwin.
+
+Good luck and Happy Hacking,
+Patrik, OTP
+
+Copyright and License
+---------------------
+
+> %CopyrightBegin%
+>
+> Copyright Ericsson AB 2003-2010. All Rights Reserved.
+>
+> The contents of this file are subject to the Erlang Public License,
+> Version 1.1, (the "License"); you may not use this file except in
+> compliance with the License. You should have received a copy of the
+> Erlang Public License along with this software. If not, it can be
+> retrieved online at http://www.erlang.org/.
+>
+> Software distributed under the License is distributed on an "AS IS"
+> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+> the License for the specific language governing rights and limitations
+> under the License.
+>
+> %CopyrightEnd%
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644
index 0000000000..1bc0df9fd8
--- /dev/null
+++ b/INSTALL.md
@@ -0,0 +1,661 @@
+Building and Installing Erlang/OTP
+==================================
+
+Please read the whole file before attempting to build and install Erlang/OTP.
+You can find more information about Open Source Erlang/OTP at:
+
+ <http://www.erlang.org/>
+
+The source code for Erlang/OTP can also be found in a Git repository:
+
+ <http://github.com/erlang/otp>
+
+Portability
+-----------
+
+Erlang/OTP should be possible to build from source on any Unix system,
+including Mac OS X. This document describes how to native compile Erlang/OTP
+on Unix. For detailed instructions on how to
+
+* cross compile Erlang/OTP, see the [`$ERL_TOP/INSTALL-CROSS.md`] [1]
+ document.
+
+* build Erlang/OTP on Windows, see the [`$ERL_TOP/INSTALL-WIN32.md`] [2]
+ document.
+
+ Binary releases for Windows can be found at
+ <http://www.erlang.org/download.html>.
+
+However, you are in any case advised to read this document first, since it
+covers building Erlang/OTP in general as well as other important information.
+
+Daily Build and Test
+--------------------
+At Ericsson we have a "Daily Build and Test" that runs on:
+
+* Solaris 8, 9
+ * Sparc32
+ * Sparc64
+* Solaris 10
+ * Sparc32
+ * Sparc64
+ * x86
+* SuSE Linux/GNU 9.4, 10.1
+ * x86
+* SuSE Linux/GNU 10.0, 10.1
+ * x86
+ * x86_64
+* SuSE Linux/GNU 11.0
+ * x86_64
+* Gentoo Linux/GNU 1.12.11.1
+ * x86
+* MontaVista Linux/GNU 4.0.1
+ * PowerPC
+* FreeBSD 7.1
+ * x86
+* Mac OS X 10.4.11 (Tiger), 10.5.8 (Leopard), 10.6.0 (Snow Leopard)
+ * x86
+* Windows XP SP3, 2003, Vista, 7
+ * x86
+
+We also have the following "Daily Cross Builds":
+
+* SuSE Linux/GNU 10.1 x86 -> SuSE Linux/GNU 10.1 x86_64
+* SuSE Linux/GNU 10.1 x86_64 -> Linux/GNU TILEPro64
+
+and the following "Daily Cross Build Tests":
+
+* SuSE Linux/GNU 10.1 x86_64
+
+Versions Known *not* to Work
+----------------------------
+
+* Suse linux 9.1 is shipped with a patched GCC version 3.3.3, having the
+ rpm named `gcc-3.3.3-41`. That version has a serious optimization bug
+ that makes it unusable for building the Erlang emulator. Please
+ upgrade GCC to a newer version before building on Suse 9.1. Suse Linux
+ Enterprise edition 9 (SLES9) has `gcc-3.3.3-43` and is not affected.
+
+* `gcc-4.3.0` has a serious optimizer bug. It produces an Erlang emulator
+ that will crash immediately. The bug is supposed to be fixed in
+ `gcc-4.3.1`.
+
+* FreeBSD had a bug which caused `kqueue`/`poll`/`select` to fail to detect
+ that a `writev()` on a pipe has been made. This bug should have been fixed
+ in FreeBSD 6.3 and FreeBSD 7.0. NetBSD and DragonFlyBSD probably have or
+ have had the same bug. More information can be found at:
+
+ * <http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/sys_pipe.c>
+ * <http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html>
+
+* `getcwd()` on Solaris 9 can cause an emulator crash. If you have
+ async-threads enabled you can increase the stack size of the
+ async-threads as a temporary workaround. See the `+a` command-line
+ argument in the documentation of `erl(1)`. Without async-threads the
+ emulator is not as vulnerable to this bug, but if you hit it without
+ async-threads the only workaround available is to enable async-threads
+ and increase the stack size of the async-threads. Sun has however
+ released patches that fixes the issue:
+
+ > Problem Description: 6448300 large mnttab can cause stack overrun
+ > during Solaris 9 getcwd
+
+ More information can be found at:
+
+ * <http://sunsolve.sun.com/search/document.do?assetkey=1-21-112874-40-1&searchclause=6448300>
+ * <http://sunsolve.sun.com/search/document.do?assetkey=1-21-114432-29-1&searchclause=6448300>
+
+Required Utilities
+------------------
+
+These are the tools you will need in order to unpack and build Erlang/OTP.
+
+### Unpacking ###
+
+* GNU unzip, or a modern uncompress.
+* A TAR program that understands the GNU TAR format for long filenames
+ (such as GNU TAR).
+
+### Building ###
+
+* GNU make
+* GNU C compiler
+* Perl 5
+* GNU m4 -- If hipe (native code) support is enabled.
+* ncurses (or termcap or termlib) -- The development headers and libraries
+ are needed, often known as ncurses-devel. (Use --without-termcap to build
+ without any of these libraries. Only the old shell (without any line
+ editing) can be used.)
+* OpenSSL -- Optional, but needed for building the Erlang/OTP applications
+ `ssl` and `crypto`. You need the "development package" of OpenSSL, i.e.
+ including the header files. For building the application `ssl` the OpenSSL
+ binary command program `openssl` is also needed.
+ At least version 0.9.7 of OpenSSL is required.
+* Sun Java jdk-1.5.0 or higher -- Optional but needed for building the
+ Erlang/OTP application `jinterface` and parts of `ic` and `orber`. We
+ have also tested IBM's JDK 1.5.0.
+* X Windows -- Optional, but development headers and libraries are needed
+ to build the Erlang/OTP application `gs` on Unix/Linux.
+* `sed` -- There seem to be some problems with some of the `sed` version on
+ Solaris. Make sure `/bin/sed` or `/usr/bin/sed` is used on the Solaris
+ platform.
+* Flex -- Optional, headers and libraries are needed to build the flex
+ scanner for the `megaco` application on Unix/Linux.
+
+If you are building in a Git working directory you also have to have a GNU
+`autoconf` of at least version 2.59. Autoconf is however not needed if you
+build an unmodified version of the released source.
+
+### Installing ###
+
+* An `install` program that can take multiple file names.
+
+How to Build and Install Erlang/OTP
+-----------------------------------
+
+The following instructions are for building using the source tar ball.
+
+The variable `$ERL_TOP` will be mentioned a lot of times. It refers to
+the top directory in the source tree. More information about `$ERL_TOP`
+can be found in the "`make` and `$ERL_TOP`" section below. If you are
+building in git you probably want to take a look at the "Building in Git"
+section below before proceeding.
+
+### Unpacking ###
+
+Step 1: Start by unpacking the Erlang/OTP distribution file with your GNU
+compatible TAR program.
+
+ $ gunzip -c otp_src_R13B04.tar.gz | tar xf -
+ $ zcat otp_src_R13B04.tar.gz | tar xf -
+
+
+Step 2: Now cd into the base directory (`$ERL_TOP`).
+
+ $ cd otp_src_R13B04
+
+### Configuring ###
+
+Step 3: On some platforms Perl may behave strangely if certain locales are
+set, so optionally you may need to set the LANG variable:
+
+ # Bourne shell
+ $ LANG=C; export LANG
+
+or
+
+ # C-Shell
+ $ setenv LANG C
+
+Step 4: Run the following commands to configure the build:
+
+ $ ./configure [ options ]
+
+By default, Erlang/OTP will be installed in `/usr/local/{bin,lib/erlang,man/man1}`.
+To instead install in `<BaseDir>/{bin,lib/erlang,man/man1}`, use the
+`--prefix=<BaseDir>` option.
+
+If you upgraded the source with some patch you may need to clean up
+from previous builds before the new build. Do a `make clean`; see
+"Caveats" below.
+
+### Building ###
+
+Step 5: Build the Erlang/OTP package.
+
+ $ make
+
+### Installing ###
+
+Step 6: Install then Erlang/OTP package
+
+ $ make install
+
+### A Closer Look at the individual Steps ###
+
+Let us go through them in some detail.
+
+#### Configuring ####
+
+Step 4 runs a configuration script created by the GNU autoconf utility, which
+checks for system specific features and then creates a number of makefiles.
+
+The configure script allows you to customize a number of parameters;
+type `./configure --help` or `./configure --help=recursive` for details.
+`./configure --help=recursive` will give help for all `configure` scripts in
+all applications.
+
+One of the things you can specify is where Erlang/OTP should be installed: by
+default Erlang/OTP will be installed in `/usr/local/{bin,lib/erlang,man/man1}`;
+to keep the same structure but install in a different place, `<Dir>` say,
+use the `--prefix` argument like this: `./configure --prefix=<Dir>`.
+
+Some of the available `configure` options are:
+
+ * `--prefix=PATH`: Specify installation prefix.
+ * `--{enable,disable}-threads`: Thread support (enabled by default if
+ possible)
+ * `--{enable,disable}-smp-support`: SMP support (enabled by default if
+ possible)
+ * `--{enable,disable}-kernel-poll`: Kernel poll support (enabled by default
+ if possible)
+ * `--{enable,disable}-hipe`: HiPE support (enabled by default on supported
+ platforms)
+ * `--disable-erlang-mandir`: No private Erlang mandir, i.e., the common
+ mandir under `--prefix`, or `--mandir` will be used
+ * `--enable-darwin-universal`: Build universal binaries on darwin i386.
+ * `--enable-darwin-64bit`: Build 64bit binaries on darwin
+ * `--enable-m64-build`: Build 64bit binaries using the -m64 flag to (g)cc
+ * `--enable-m32-build`: Build 32bit binaries using the -m32 flag to (g)cc
+ * `--{with,without}-termcap`: termcap (without implies that only the old
+ Erlang shell can be used)
+ * `--with-javac=JAVAC`: Specify Java compiler to use
+ * `--{with,without}-javac`: Java compiler (without implies that the
+ `jinterface` application won't be built).
+ * `--{enable,disable}-dynamic-ssl-lib`: Dynamic OpenSSL libraries
+ * `--{enable,disable}-shared-zlib`: Shared zlib library
+ * `--with-ssl=PATH`: Specify location of OpenSSL include and lib
+ * `--{with,without}-ssl`: OpenSSL (without implies that the `crypto`, `ssh`,
+ and `ssl` won't be built)
+
+If you or your system has special requirements please read the
+Makefile for additional configuration information.
+
+#### Building ####
+
+Step 5 builds the Erlang/OTP system. On a fast computer, this will take about
+5 minutes. After completion of this step, you should have a working
+Erlang/OTP system which you can try by typing `bin/erl`. This should start
+up Erlang/OTP and give you a prompt.
+
+#### Installing ####
+
+Step 6 is optional. It installs Erlang/OTP at a standardized location (if you
+change your mind about where you wish to install you can rerun step 4,
+without having to do step 5 again).
+
+##### Alternative Installation Procedures #####
+
+* Staged install using [`DESTDIR`] [3]. You can perform the install
+ phase in a temporary directory and later move the installation into
+ its correct location by use of the `DESTDIR` variable:
+
+ $ make DESTDIR=<tmp install dir> install
+
+ The installation will be created in a location prefixed by `$DESTDIR`.
+ It can, however, not be run from there. It needs to be moved into the
+ correct location before it can be run. If `DESTDIR` have not been set
+ but `INSTALL_PREFIX` has been set, `DESTDIR` will be set to
+ `INSTALL_PREFIX`. Note that `INSTALL_PREFIX` in pre R13B04 was buggy
+ and behaved as `EXTRA_PREFIX` (see below). There are lots of areas of
+ use for an installation procedure using `DESTDIR`, e.g. when creating
+ a package, cross compiling, etc. Here is an example where the
+ installation should be located under `/opt/local`:
+
+ $ ./configure --prefix=/opt/local
+ $ make
+ $ make DESTDIR=/tmp/erlang-build install
+ $ cd /tmp/erlang-build/opt/local
+ $ # gnu-tar is used in this example
+ $ tar -zcf /home/me/my-erlang-build.tgz *
+ $ su -
+ Password: *****
+ $ cd /opt/local
+ $ tar -zxf /home/me/my-erlang-build.tgz
+
+* Install using the `release` target. Instead of doing `make install` you
+ can create the installation in whatever directory you like using the
+ `release` target and run the `Install` script yourself. `RELEASE_ROOT`
+ is used for specifying the directory where the installation should be
+ created. This is what by default ends up under `/usr/local/lib/erlang`
+ if you do the install using `make install`. All installation paths
+ provided in the `configure` phase are ignored, as well as `DESTDIR`,
+ and `INSTALL_PREFIX`. If you want links from a specific `bin` directory
+ to the installation you have to set those up yourself. An example where
+ Erlang/OTP should be located at `/home/me/OTP`:
+
+ $ ./configure
+ $ make
+ $ make RELEASE_ROOT=/home/me/OTP release
+ $ cd /home/me/OTP
+ $ ./Install -minimal /home/me/OTP
+ $ mkdir -p /home/me/bin
+ $ cd /home/me/bin
+ $ ln -s /home/me/OTP/bin/erl erl
+ $ ln -s /home/me/OTP/bin/erlc erlc
+ $ ln -s /home/me/OTP/bin/escript escript
+ ...
+
+ The `Install` script should currently be invoked as follows in the
+ directory where it resides (the top directory):
+
+ $ ./Install [-cross] [-minimal|-sasl] <ERL_ROOT>
+
+ where:
+
+ * `-minimal` Creates an installation that starts up a minimal amount
+ of applications, i.e., only `kernel` and `stdlib` are started. The
+ minimal system is normally enough, and is what `make install` uses.
+ * `-sasl` Creates an installation that also starts up the `sasl`
+ application.
+ * `-cross` For cross compilation. Informs the install script that it
+ is run on the build machine.
+ * `<ERL_ROOT>` - The absolute path to the Erlang installation to use
+ at run time. This is often the same as the current working directory,
+ but does not have to be. It can follow any other path through the
+ file system to the same directory.
+
+ If neither `-minimal`, nor `-sasl` is passed as argument you will be
+ prompted.
+
+* Test install using `EXTRA_PREFIX`. The content of the `EXTRA_PREFIX`
+ variable will prefix all installation paths when doing `make install`.
+ Note that `EXTRA_PREFIX` is similar to `DESTDIR`, but it does *not* have
+ the same effect as `DESTDIR`. The installation can and have to be run
+ from the location specified by `EXTRA_PREFIX`. That is, it can be useful
+ if you want to try the system out, running test suites, etc, before doing
+ the real install without `EXTRA_PREFIX`.
+
+### Symbolic Links in `--bindir` ###
+
+When doing `make install` and the default installation prefix is used,
+relative symbolic links will be created from `/usr/local/bin` to all public
+Erlang/OTP executables in `/usr/local/lib/erlang/bin`. The installation phase
+will try to create relative symbolic links as long as `--bindir` and the
+Erlang bin directory, located under `--libdir`, both have `--exec-prefix` as
+prefix. Where `--exec-prefix` defaults to `--prefix`. `--prefix`,
+`--exec-prefix`, `--bindir`, and `--libdir` are all arguments that can be
+passed to `configure`. One can force relative, or absolute links by passing
+`BINDIR_SYMLINKS=relative|absolute` as arguments to `make` during the install
+phase. Note that such a request might cause a failure if the request cannot
+be satisfied.
+
+### Building in Git ###
+
+When building in a Git working directory you also have to have a GNU `autoconf`
+of at least version 2.59 on your system. This since you need to generate the
+`configure` scripts before you can start building.
+
+The `configure` scripts are generated by invoking `./otp_build autoconf` in
+the `$ERL_TOP` directory. The `configure` scripts also have to be regenerated
+when a `configure.in` or `aclocal.m4` file has been modified. Note that when
+checking out a branch a `configure.in` or `aclocal.m4` file may change
+content, and you may therefore have to regenerate the `configure` scripts
+when checking out a branch. Regenerated `configure` scripts imply that you
+have to run `configure` and build again.
+
+Note that running `./otp_build autoconf` is **not** needed when building an
+unmodified version the released source.
+
+Other useful information can be found at our github wiki:
+<http://wiki.github.com/erlang/otp>
+
+Pre-built Source Tree
+---------------------
+
+The source tree is delivered with a lot of platform independent
+build results already pre-built. If you want to remove these pre-built
+files, invoke `./otp_build remove_prebuilt_files` from the `$ERL_TOP`
+directory. After you have done this, you can build exactly the same way
+as before, but the build process will take a much longer time.
+
+*NOTE*: Doing `make clean` in an arbitrary directory of the source tree,
+may remove files needed for bootstrapping the build. Doing
+`./otp_build save_bootstrap` from the `$ERL_TOP` directory before
+doing `make clean` will ensure that it will be possible to build after
+doing `make clean`. `./otp_build save_bootstrap` will be invoked
+automatically when `make` is invoked from `$ERL_TOP` with either the
+`clean` target, or the default target. It is also automatically invoked
+if `./otp_build remove_prebuilt_files` is invoked.
+
+`make` and `$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 top level
+Makefile (which, when building, it will pass on). However, when
+developing it is sometimes convenient to be able to run make in a
+subdirectory. To do this you must set the `ERL_TOP` variable
+before you run make.
+
+For example, assume your GNU make program is called `make` and you
+want to rebuild the application `STDLIB`, then you could do:
+
+ $ cd lib/stdlib; env ERL_TOP=<Dir> make
+
+where `<Dir>` would be what you find `ERL_TOP` is set to in the top level
+Makefile.
+
+Support for SMP (Symmetric Multi Processing)
+--------------------------------------------
+
+An emulator with SMP support will be built by default on most platforms
+if a usable POSIX thread library or native Windows threads is found.
+
+You can force building of an SMP emulator, by using
+`./configure --enable-smp-support`. However, if configure does not
+automatically enable SMP support, the build is very likely to fail.
+
+Use `./configure --disable-smp-support` if you for some reason do not
+want to have the emulator with SMP support built.
+
+If SMP support is enabled, support for threaded I/O will also be turned on
+(also in the emulator without SMP support).
+
+The `erl` command will automatically start the SMP emulator if the
+computer has more than one logical processor. You can force a start
+of the emulator with SMP support by passing `-smp enable` as
+command line arguments to erl, and you can force a start of the
+emulator without SMP support by passing `-smp disable`.
+
+How to install the Erlang/OTP documentation
+-------------------------------------------
+
+For some graphical tools to find the on-line help you have to install
+the HTML documentation on top of the installed OTP applications, i.e.
+
+ $ cd <PrefixDir>/lib/erlang
+ $ gunzip -c otp_html_R<XY>B-<Z>.tar.gz | tar xf -
+
+For `erl -man <page>` to work the Unix manual pages have to be
+installed in the same way, i.e.
+
+ $ cd <PrefixDir>/lib/erlang
+ $gunzip -c otp_man_R<XY>B-<Z>.tar.gz | tar xf -
+
+
+GS (Graphic System)
+-------------------
+
+GS now Tcl/Tk 8.4. It will be searched for when starting GS.
+
+Using HiPE
+----------
+
+HiPE supports the following system configurations:
+
+* x86: All 32-bit and 64-bit mode processors should work.
+
+ * Linux: Fedora Core is supported. Both 32-bit and 64-bit modes are
+ supported.
+
+ NPTL glibc is strongly preferred, or a LinuxThreads
+ glibc configured for "floating stacks". Old non-floating
+ stacks glibcs have a fundamental problem that makes HiPE
+ support and threads support mutually exclusive.
+
+ * Solaris: Solaris 10 (32-bit and 64-bit) and 9 (32-bit) are supported.
+ The build requires a version of the GNU C compiler (gcc)
+ that has been configured to use the GNU assembler (gas).
+ Sun's x86 assembler is emphatically **not** supported.
+
+ * FreeBSD: FreeBSD 6.1 and 6.2 in 32-bit and 64-bit modes should work.
+
+ * MacOSX/Darwin: Darwin 9.8.0 in 32-bit mode should work.
+
+* PowerPC: All 32-bit 6xx/7xx(G3)/74xx(G4) processors should work. 32-bit
+ mode on 970 (G5) and POWER5 processors should work.
+
+ * Linux (Yellow Dog) and Mac OSX 10.4 are supported.
+
+* SPARC: All UltraSPARC processors running 32-bit user code should work.
+
+ * Solaris 9 is supported. The build requires a `gcc` that has been
+ configured to use Sun's assembler and linker. Using the GNU assembler
+ but Sun's linker has been known to cause problems.
+
+ * Linux (Aurora) is supported.
+
+* ARM: ARMv5TE (i.e. XScale) processors should work. Both big-endian and
+ little-endian modes are supported.
+
+ * Linux is supported.
+
+HiPE is automatically enabled on the following systems:
+
+* x86 in 32-bit mode: Linux, Solaris, FreeBSD
+* x86 in 64-bit mode: Linux, Solaris, FreeBSD
+* PowerPC: Linux, MacOSX
+* SPARC: Linux
+* ARM: Linux
+
+On other supported systems you need to `./configure --enable-hipe`.
+
+If you are running on a platform supporting HiPE and if you have not disabled
+HiPE, you can compile a module into native code like this from the Erlang
+shell:
+
+ 1> c(Module, native).
+
+or
+
+ 1> c(Module, [native|OtherOptions]).
+
+Using the erlc program, write like this:
+
+ $ erlc +native Module.erl
+
+The native code will be placed into the beam file and automatically loaded
+when the beam file is loaded.
+
+To add hipe options, write like this from the Erlang shell:
+
+ 1> c(Module, [native,{hipe,HipeOptions}|MoreOptions]).
+
+Use hipe:help_options/0 to print out the available options.
+
+ 1> hipe:help_options().
+
+Mac OS X (Darwin)
+-----------------
+
+We test Mac OS X 10.4.11 (Tiger) and Mac OS X 10.5.x (Leopard) in our daily
+builds (but only on Intel processors).
+
+Make sure that the command `hostname` returns a valid fully qualified host
+name (this is configured in `/etc/hostconfig`).
+
+If you develop linked-in drivers (shared library) you need to link using
+`gcc` and the flags `-bundle -flat_namespace -undefined suppress`. You also
+include `-fno-common` in `CFLAGS` when compiling. Use `.so` as the library
+suffix.
+
+Universal 32bit binaries can be built on an Intel Mac using the
+`--enable-darwin-universal` configure option. There still may occur
+problems with certain applications using this option, but the base
+system should run smoothly.
+
+When building universal binaries on a PowerPC Mac (at least on Tiger),
+you must point out a suitable SDK that contains universal binaries.
+For instance, to build universal binaries for Tiger (10.4):
+
+ $ CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
+ LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
+ ./configure --enable-darwin-universal
+
+Also, if you run Leopard, but want to build for Tiger, you must do by
+setting the `MACOSX_DEPLOYMENT_TARGET` environmental variable.
+
+ $ export MACOSX_DEPLOYMENT_TARGET=10.4
+
+Experimental support for 64bit x86 darwin binaries can be enabled
+using the `--enable-darwin-64bit` configure flag. The 64bit binaries are
+best built and run on Leopard, but most of the system also works on
+Tiger (Tiger's 64bit libraries are, however, limited; therefore e.g. `odbc`,
+`crypto`, `ssl` etc. are not supported in Tiger). 64bit PPC binaries are not
+supported and we have no plans to add such support (no machines to
+test on).
+
+Universal binaries and 64bit binaries are mutually exclusive options.
+
+How to Build a Debug Enabled Erlang RunTime System
+--------------------------------------------------
+
+After completing all the normal building steps described above a debug
+enabled runtime system can be built. To do this you have to change
+directory to `$ERL_TOP/erts/emulator`.
+
+In this directory execute:
+
+ $ make debug FLAVOR=$FLAVOR
+
+where `$FLAVOR` is either `plain` or `smp`. The flavor options will
+produce a beam.debug and beam.smp.debug executable respectively. The
+files are installed along side with the normal (opt) versions `beam.smp`
+and `beam`.
+
+To start the debug enabled runtime system execute:
+
+ $ $ERL_TOP/bin/cerl -debug
+
+The debug enabled runtime system features lock violation checking,
+assert checking and various sanity checks to help a developer ensure
+correctness. Some of these features can be enabled on a normal beam
+using appropriate configure options.
+
+There are other types of runtime systems that can be built as well
+using the similar steps just described.
+
+ $ make $TYPE FLAVOR=$FLAVOR
+
+where `$TYPE` is `opt`, `gcov`, `gprof`, `debug`, `valgrind`, or `lcnt`.
+These different beam types are useful for debugging and profiling
+purposes.
+
+Authors
+-------
+Authors are mostly listed in the application's `AUTHORS` files,
+that is `$ERL_TOP/lib/*/AUTHORS` and `$ERL_TOP/erts/AUTHORS`,
+not in the individual source files.
+
+Copyright and License
+---------------------
+
+> %CopyrightBegin%
+>
+> Copyright Ericsson AB 1998-2010. All Rights Reserved.
+>
+> The contents of this file are subject to the Erlang Public License,
+> Version 1.1, (the "License"); you may not use this file except in
+> compliance with the License. You should have received a copy of the
+> Erlang Public License along with this software. If not, it can be
+> retrieved online at http://www.erlang.org/.
+>
+> Software distributed under the License is distributed on an "AS IS"
+> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+> the License for the specific language governing rights and limitations
+> under the License.
+>
+> %CopyrightEnd%
+
+More Information
+----------------
+
+More information can be found at <http://www.erlang.org>.
+
+
+
+ [1]: INSTALL-CROSS.html "$ERL_TOP/INSTALL-CROSS.md"
+ [2]: INSTALL-WIN32.html "$ERL_TOP/INSTALL-WIN32.md"
+ [3]: http://www.gnu.org/prep/standards/html_node/DESTDIR.html "DESTDIR"
diff --git a/Makefile.in b/Makefile.in
index 2dcc89144d..be49761490 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -392,16 +392,55 @@ endif
# ---------------------------------------------------------------
# Target only used when building commercial ERTS patches
# ---------------------------------------------------------------
-release_docs docs:
+release_docs docs: html_readmes
ifeq ($(OTP_SMALL_BUILD),true)
- cd $(ERL_TOP)/lib && $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
+ cd $(ERL_TOP)/lib && \
+ ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
else
- cd $(ERL_TOP)/lib && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
- cd $(ERL_TOP)/lib/dialyzer && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
+ cd $(ERL_TOP)/lib && \
+ ERL_TOP=$(ERL_TOP) $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
+ cd $(ERL_TOP)/lib/dialyzer && \
+ ERL_TOP=$(ERL_TOP) $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
endif
- cd $(ERL_TOP)/erts && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
- cd $(ERL_TOP)/system/doc && $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
-
+ cd $(ERL_TOP)/erts && \
+ ERL_TOP=$(ERL_TOP) $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
+ cd $(ERL_TOP)/system/doc && \
+ ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
+
+.PHONY: html_readmes clean_html_readmes
+
+HTML_READMES = INSTALL.html INSTALL-WIN32.html INSTALL-CROSS.html
+
+html_readmes: $(HTML_READMES)
+
+clean_html_readmes:
+ rm -f $(HTML_READMES)
+
+%.html: %.md
+ echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" > $@
+ echo "<html xmlns:fn=\"http://www.w3.org/2005/02/xpath-functions\"><head>" >> $@
+ echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">" >> $@
+ echo "<style type=\"text/css\">" >> $@
+ echo "body {" >> $@
+ echo " margin: 4em 4em 4em 4em;" >> $@
+ echo " background: white;" >> $@
+ echo " font-family: Verdana, Arial, Helvetica, sans-serif;" >> $@
+ echo "}" >> $@
+ echo "code { font-family: courier;font-weight: normal}" >> $@
+ echo "a:link { color: blue; text-decoration: none }" >> $@
+ echo "a:active { color: blue; text-decoration: none }" >> $@
+ echo "a:visited { color: blue; text-decoration: none }" >> $@
+ echo "</style><title>" >> $@
+ cat $< | sed -n "s/[ ]*\([^ ].*[^ ]\)[ ]*/\1/p;/[ ]*[^ ][ ]*/q" >> $@
+ echo "</title></head><body>" >> $@
+ifneq ($(MD2HTML),)
+ $(MD2HTML) $< >> $@
+else
+ echo "<pre>" >> $@
+ cat $< | sed "s|\&|\&amp\;|g;s|\"|\&quot\;|g;s|<|\&lt\;|g;s|>|\&gt\;|g" >> $@
+ echo "</pre>" >> $@
+endif
+ echo "</body></html>" >> $@
# ----------------------------------------------------------------------
ERLANG_EARS=$(BOOTSTRAP_ROOT)/bootstrap/erts
@@ -988,7 +1027,7 @@ $(IBIN_DIR):
# Clean targets
#
-clean: check_recreate_primary_bootstrap
+clean: check_recreate_primary_bootstrap clean_html_readmes
rm -f *~ *.bak config.log config.status prebuilt.files ibin/*
find . -type f -name SKIP -print | xargs $(RM)
cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
diff --git a/README b/README
deleted file mode 100644
index 9622b2d676..0000000000
--- a/README
+++ /dev/null
@@ -1,562 +0,0 @@
-===========================================================================
- OpenSource Erlang/OTP
-===========================================================================
-
-Please read the whole file before attempting to build and install Erlang.
-You can find more information about Open Source Erlang at:
-
- http://www.erlang.org/
-
-The source code for Erlang/OTP can also be found in a Git repository:
-
- http://github.com/erlang/otp
-
-%CopyrightBegin%
-
-Copyright Ericsson AB 1998-2010. All Rights Reserved.
-
-The contents of this file are subject to the Erlang Public License,
-Version 1.1, (the "License"); you may not use this file except in
-compliance with the License. You should have received a copy of the
-Erlang Public License along with this software. If not, it can be
-retrieved online at http://www.erlang.org/.
-
-Software distributed under the License is distributed on an "AS IS"
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-the License for the specific language governing rights and limitations
-under the License.
-
-%CopyrightEnd%
-
-Portability
------------
-
-Erlang/OTP should be possible to build from source on any Unix
-system, including Mac OS X.
-
-Instructions for building from source on Windows are in the file README.win32.
-Binary releases for Windows can be found at http://www.erlang.org/
-
-At Ericsson we have a "Daily Build and Test" that runs on:
-
- Operating system Versions
- -----------------------------------------------------------
- Solaris/Sparc32 8, 9, 10
- Solaris/Sparc64 10
- Solaris/x86 10
- Linux/Suse x86 9.4, 10.1
- Linux/Suse x86_64 10.0, 10.1, 11.0
- FreeBSD x86 7.1
- Mac OS X/Intel 10.4.11 (Tiger), 10.5.8 (Leopard)
- Windows XP SP3, 2003, Vista
-
-We have also done some testing on Mac OS 10.6.0 (Snow Leopard).
-
-Versions known *not* to work
--------------------------------------
-
-Suse linux 9.1 is shipped with a patched GCC version 3.3.3, having the
-rpm named gcc-3.3.3-41. That version has a serious optimization bug
-that makes it unusable for building the Erlang emulator. Please
-upgrade GCC to a newer version before building on Suse 9.1. Suse Linux
-Enterprise edition 9 (SLES9) has gcc-3.3.3-43 and is not affected.
-
-gcc-4.3.0 has a serious optimizer bug. It produces an Erlang emulator
-that will crash immediately. The bug is supposed to be fixed in gcc-4.3.1.
-
-FreeBSD had a bug which caused kqueue/poll/select to fail to detect
-that a writev() on a pipe has been made. This bug should have been fixed
-in FreeBSD 6.3 and FreeBSD 7.0. NetBSD and DragonFlyBSD probably have or
-have had the same bug. More information can be found at:
- * http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/sys_pipe.c
- * http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html
-
-getcwd() on Solaris 9 can cause an emulator crash. If you have async-threads
-enabled you can increase the stack size of the async-threads as a temporary
-workaround. See the +a command-line argument in the documentation of erl(1).
-Without async-threads the emulator isn't as vulnerable to this bug, but if
-you hit it without async-threads the only workaround available is to enable
-async-threads and increase the stack size of the async-threads. Sun has
-however released patches that fixes the issue:
-
-Problem Description: 6448300 large mnttab can cause stack overrun during
-Solaris 9 getcwd
-
-More information can be found at:
- * http://sunsolve.sun.com/search/document.do?assetkey=1-21-112874-40-1&searchclause=6448300
- * http://sunsolve.sun.com/search/document.do?assetkey=1-21-114432-29-1&searchclause=6448300
-
-Required utilities
-------------------
-
-These are the tools you will need in order to unpack and build Erlang/OTP.
-
-Unpacking
-
- * GNU unzip, or a modern uncompress.
- * A TAR program that understands the GNU TAR format for long filenames (such
-as GNU TAR).
-
-Compiling
-
- * GNU make
- * GNU C compiler
- * Perl 5
- * GNU m4 -- If hipe (native code) support is enabled.
- * ncurses (or termcap or termlib) -- The development headers and libraries
- are needed, often known as ncurses-devel. (Use --without-termcap to build
- without any of these libraries. Only the old shell (without any line
- editing) can be used.)
- * OpenSSL -- Optional, but needed for building the Erlang/OTP applications
- 'ssl' and 'crypto'. You need the "development package" of OpenSSL, i.e.
- including the header files. For building the application 'ssl' the OpenSSL
- binary command program 'openssl' is also needed.
- At least version 0.9.7 of OpenSSL is required.
- * Sun Java jdk-1.5.0 or higher -- Optional but needed for building the
- Erlang/OTP application 'jinterface' and parts of 'ic' and 'orber'. We
- have also tested IBM's JDK 1.5.0.
- * X Windows -- Optional, but development headers and libraries are needed
- to build the Erlang/OTP application 'gs' on Unix/Linux.
- * sed -- There seem to be some problems with some of the 'sed' version on
- Solaris. Make sure "/bin/sed" or "/usr/bin/sed" is used on the Solaris
- platform.
- * Flex -- Optional, headers and libraries are needed to build the flex
- scanner for the megaco application on Unix/Linux.
-
-Installing
-
- * An 'install' program that can take multiple file names.
-
-How to build and install Erlang/OTP
------------------------------------
-
-If you are building in a Git repository, see
-
- http://wiki.github.com/erlang/otp
-
-The following instructions are for building using the source tar ball.
-
-Step 1: Start by unpacking the Erlang/OTP distribution file with your GNU
-compatible TAR program.
-
- $ gunzip -c otp_src_R13B03.tar.gz | tar xf -
- $ zcat otp_src_R13B03.tar.gz | tar xf -
-
-Step 2: Now cd into the base directory.
-
- $ cd otp_src_R13B03
-
-Step 3: On some platforms Perl may behave strangely if certain locales are
-set, so optionally you may need to set the LANG variable:
-
- # Bourne shell
- $ LANG=C; export LANG
-or
- # C-Shell
- $ setenv LANG C
-
-Step 4: Run the following commands to configure the build:
-
- $ ./configure [ options ]
-
-By default, Erlang/OTP will be installed in /usr/local/{bin,lib/erlang,man/man1}.
-To instead install in <BaseDir>/{bin,lib/erlang,man/man1}, use the --prefix=<BaseDir>
-option.
-
-If you upgraded the source with some patch you may need to clean up
-from previous builds before the new build. Do a "make clean"; see
-"Caveats" below.
-
-Step 5: Build the Erlang/OTP package.
-
- $ make
-
-Step 6: Install then Erlang/OTP package
-
- $ 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 then 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/OTP should be installed: by
-default Erlang/OTP will be installed in /usr/local/{bin,lib/erlang,man/man1};
-to keep the same structure but install in a different place, <Dir> say,
-use the --prefix argument like this:
-"./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).
-
-You can also specify where the OpenSSL include and library files are
-located, or alternatively disable the use of SSL and Crypto.
-(The details can be found by typing './configure --help'.)
-
-Other options are:
-
- --enable-smp-support See the next section.
-
- --disable-smp-support See the next section.
-
- --disable-threads Disable support for threaded I/O;
- this option also disables building of the SMP
- emulator. (See the next section.)
-
- --enable-threads Enable support for threaded I/O.
- (This is the default if SMP support is enabled.
- See the next section.)
-
- --disable-hipe Disable HiPE (High-Performance Erlang).
- HiPE will automatically be enabled on supported
- platforms.
-
-Step 5 builds the Erlang/OTP system. On a fast computer, this will take about
-5 minutes. After completion of this step, you should have a working
-Erlang/OTP system which you can try by typing "bin/erl". This should start
-up Erlang/OTP and give you a prompt.
-
-Step 6 is optional. It installs Erlang/OTP at a standardized location (if you
-change your mind about where you wish to install you can rerun step 4,
-without having to do step 5 again).
-
-Alternative installation procedures:
-* Staged install using DESTDIR. You can perform the install phase in a
- temporary directory and later move the installation into its correct location
- by use of the DESTDIR variable: 'make DESTDIR=<tmp install dir> install'
- The installation will be created in a location prefixed by $DESTDIR. It
- can, however, not be run from there. It needs to be moved into the correct
- location before it can be run. If DESTDIR have not been set but INSTALL_PREFIX
- has been set, DESTDIR will be set to INSTALL_PREFIX. Note that INSTALL_PREFIX
- in pre R13B04 was buggy and behaved as EXTRA_PREFIX (see below). There are
- lots of areas of use for an installation procedure using DESTDIR, e.g. when
- creating a package, cross compiling, etc. Here is an example where the
- installation should be located under /opt/local:
- $ ./configure --prefix=/opt/local
- $ make
- $ mkdir /tmp/erlang-build
- $ make DESTDIR=/tmp/erlang-build install
- $ cd /tmp/erlang-build/opt/local
- $ # gnu-tar is used in this example
- $ tar -zcf /home/me/my-erlang-build.tgz *
- $ su -
- Password: *****
- $ cd /opt/local
- $ tar -zxf /home/me/my-erlang-build.tgz
-* Test install using EXTRA_PREFIX. Note that EXTRA_PREFIX is similar to
- DESTDIR, but it does not have the same effect as DESTDIR. The EXTRA_PREFIX
- variable will prefix all installation paths, and the installation can and
- have to be run from there. That is, it can be useful if you want to try the
- system out, running test suites, etc, before doing the real install without
- EXTRA_PREFIX.
-* Install using the `release' target. Instead of doing `make install' you can
- creat the installation in whatever directory you like using the `release'
- target and run the `Install' script yourself. RELEASE_ROOT is used for
- specifying the directory where the installation should be created. This is
- what by default ends up under `/usr/local/lib/erlang' if you do the install
- using `make install'. All installation paths provided in the `configure'
- phase are ignored, as well as DESTDIR, and INSTALL_PREFIX. If you want links
- from a specific `bin' directory to the installation you have to set those up
- yourself. An example where Erlang/OTP should be located at /home/me/OTP:
- $ ./configure
- $ make
- $ make RELEASE_ROOT=/home/me/OTP release
- $ cd /home/me/OTP
- $ ./Install -minimal /home/me/OTP
- $ mkdir -p /home/me/bin
- $ cd /home/me/bin
- $ ln -s /home/me/OTP/bin/erl erl
- $ ln -s /home/me/OTP/bin/erlc erlc
- $ ln -s /home/me/OTP/bin/escript escript
- ...
- The `Install' script should currently be invoked as follows in the
- directory where it resides:
- `./Install [-cross] [-minimal|-sasl] <ERL_ROOT>'
- where:
- -minimal - Creates an installation that starts up a minimal amount
- of applications, i.e., only kernel and stdlib are started.
- The minimal system is normally enough.
- -sasl - Creates an installation that also starts up the sasl
- application.
- -cross - For cross compilation. Informs the install script that it
- is run on the build machine.
- <ERL_ROOT> - The absolute path to the Erlang installation to use at run
- time. This is often the same as the current working
- directory, but does not have to be. It can follow any other
- path through the file system to the same directory.
-
- If neither -minimal, nor -sasl is passed as argument you will be prompted.
-
-When doing `make install' and the default installation prefix is used, relative
-symbolic links will be created from /usr/local/bin to all public executables in
-the Erlang installation. The installation phase will try to create relative
-symbolic links as long as `--bindir' and the Erlang bin directory, located under
-`--libdir', both have `--exec-prefix' as prefix. Where `--exec-prefix'
-defaults to `--prefix'. `--prefix', `--exec-prefix', `--bindir', and `--libdir'
-are all arguments that can be passed to `configure'. One can however force
-relative, or absolute links by passing BINDIR_SYMLINKS=relative|absolute
-as arguments to make during the install phase. Note that such a request might
-cause a failure if the request cannot be satisfied.
-
-The source tree is delivered with a lot of platform independent
-build results already pre-built. If you want to remove these pre-built
-files, invoke './otp_build remove_prebuilt_files' from the $ERL_TOP
-directory. After you have done this, you can build exactly the same way
-as before, but the build process will take a much longer time.
-
-NOTE: Doing 'make clean' in an arbitrary directory of the source tree,
-may remove files needed for bootstrapping the build. Doing
-'./otp_build save_bootstrap' from the $ERL_TOP directory before
-doing 'make clean' will ensure that it will be possible to build after
-doing 'make clean'. './otp_build save_bootstrap' will be invoked
-automatically when 'make' is invoked from ERL_TOP with either the
-clean target, or the default target. It is also automatically invoked
-if './otp_build remove_prebuilt_files' is invoked.
-
-If you or your system has special requirements please read the
-Makefile for additional configuration information.
-
-Cross compiling Erlang/OTP
---------------------------
-The support for cross compiling Erlang/OTP is in its early stage of
-development, and should be considered as experimental. For more
-information see: $ERL_TOP/xcomp/README
-
-How to build a debug enabled Erlang runtime system
---------------------------------------------------
-
-After completing all the normal building steps described above a debug
-enabled runtime system can be built. To do this you have to change
-directory to $ERL_TOP/erts/emulator.
-
-In this directory execute:
-
- make debug FLAVOR=$FLAVOR
-
-where $FLAVOR is either "plain" or "smp". The flavor options will
-produce a beam.debug and beam.smp.debug executable respectively. The
-files are installed along side with the normal (opt) versions beam.smp
-and beam.
-
-To start the debug enabled runtime system execute:
-
- $ERL_TOP/bin/cerl -debug
-
-The debug enabled runtime system features lock violation checking,
-assert checking and various sanity checks to help a developer ensure
-correctness. Some of these features can be enabled on a normal beam
-using appropriate configure options.
-
-There are other types of runtime systems that can be built as well
-using the similar steps just described.
-
- make $TYPE FLAVOR=$FLAVOR
-
-where $TYPE is opt, gcov, gprof, debug, valgrind, lcnt. These
-different beam types are useful for debugging and profiling purposes.
-
-
-Support for SMP (Symmetric Multi Processing)
---------------------------------------------
-
-An emulator with SMP support will be built by default on most platforms
-if a usable POSIX thread library or native Windows threads is found.
-
-You can force building of an SMP emulator, by using
-"./configure --enable-smp-support". However, if configure doesn't
-automatically enable SMP support, the build is very likely to fail.
-
-Use "./configure --disable-smp-support" if you for some reason don't
-want to have the emulator with SMP support built.
-
-If SMP support is enabled, support for threaded I/O will also be turned on
-(also in the emulator without SMP support).
-
-The 'erl' command will automatically start the SMP emulator if the
-computer has more than one logical processor. You can force a start
-of the emulator with SMP support by passing '-smp enable' as
-command line arguments to erl, and you can force a start of the
-emulator without SMP support by passing '-smp disable'.
-
-How to install the Erlang/OTP documentation
--------------------------------------------
-
-For some graphical tools to find the on-line help you have to install
-the HTML documentation on top of the installed OTP applications, i.e.
-
- $ cd <PrefixDir>/lib/erlang
- $ gunzip -c otp_html_R<XY>B-<Z>.tar.gz | tar xf -
-
-For "erl -man <page>" to work the Unix manual pages have to be
-installed in the same way, i.e.
-
- $ cd <PrefixDir>/lib/erlang
- $gunzip -c otp_man_R<XY>B-<Z>.tar.gz | tar xf -
-
-
-GS (Graphic System)
--------------------
-
-GS now Tcl/Tk 8.4. It will be searched for when starting GS.
-
-Using HiPE
-----------
-
-HiPE supports the following system configurations:
-
-x86:
- All 32-bit and 64-bit mode processors should work.
-
- Linux:
- Fedora Core is supported.
- Both 32-bit and 64-bit modes are supported.
-
- NPTL glibc is strongly preferred, or a LinuxThreads
- glibc configured for "floating stacks". Old non-floating
- stacks glibcs have a fundamental problem that makes HiPE
- support and threads support mutually exclusive.
-
- Solaris:
- Solaris 10 (32-bit and 64-bit) and 9 (32-bit) are supported.
-
- The build requires a version of the GNU C compiler (gcc)
- that has been configured to use the GNU assembler (gas).
- Sun's x86 assembler is emphatically /not/ supported.
-
- FreeBSD:
- FreeBSD 6.1 and 6.2 in 32-bit and 64-bit modes should work.
-
- MacOSX/Darwin:
- Darwin 9.8.0 in 32-bit mode should work.
-
-PowerPC:
- All 32-bit 6xx/7xx(G3)/74xx(G4) processors should work. 32-bit mode on
- 970 (G5) and POWER5 processors should work.
-
- Linux (Yellow Dog) and Mac OSX 10.4 are supported.
-
-SPARC:
- All UltraSPARC processors running 32-bit user code should work.
-
- Solaris 9 and Linux (Aurora) are supported.
-
- On Solaris the build requires a gcc that has been configured to use Sun's
- assembler and linker. Using the GNU assembler but Sun's linker has been
- known to cause problems.
-
-ARM:
- ARMv5TE (i.e. XScale) processors should work. Both big-endian and
- little-endian modes are supported.
-
- Linux is supported.
-
-HiPE is automatically enabled on the following systems:
- x86 in 32-bit mode: Linux, Solaris, FreeBSD
- x86 in 64-bit mode: Linux, Solaris, FreeBSD
- PowerPC: Linux, MacOSX
- SPARC: Linux
- ARM: Linux
-
-On other supported systems you need to "./configure --enable-hipe".
-
-If you are running on a platform supporting HiPE and if you have not disabled
-HiPE, you can compile a module into native code like this from the Erlang
-shell:
-
- 1> c(Module, native).
-
-or
-
- 1> c(Module, [native|OtherOptions]).
-
-Using the erlc program, write like this:
-
- $ erlc +native Module.erl
-
-The native code will be placed into the beam file and automatically loaded
-when the beam file is loaded.
-
-To add hipe options, write like this from the Erlang shell:
-
- 1> c(Module, [native,{hipe,HipeOptions}|MoreOptions]).
-
-Use hipe:help_options/0 to print out the available options.
-
- 1> hipe:help_options().
-
-Mac OS X (Darwin)
------------------
-
-We test Mac OS X 10.4.11 (Tiger) and Mac OS X 10.5.x (Leopard) in our daily
-builds (but only on Intel processors).
-
-Make sure that the command "hostname" returns a valid fully qualified host
-name (this is configured in "/etc/hostconfig").
-
-If you develop linked-in drivers (shared library) you need to link
-using "gcc" and the flags '-bundle -flat_namespace -undefined
-suppress'. You also include '-fno-common' in CFLAGS when
-compiling. Use ".so" as the library suffix.
-
-Universal 32bit binaries can be built on an Intel Mac using the
-'--enable-darwin-universal' configure option. There still may occur
-problems with certain applications using this option, but the base
-system should run smoothly.
-
-When building universal binaries on a PowerPC Mac (at least on Tiger),
-you must point out a suitable SDK that contains universal binaries.
-For instance, to build universal binaries for Tiger (10.4):
-
- $ CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
- LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
- ./configure --enable-darwin-universal
-
-Also, if you run Leopard, but want to build for Tiger, you must do by setting the MACOSX_DEPLOYMENT_TARGET environmental variable.
-
- $ export MACOSX_DEPLOYMENT_TARGET=10.4
-
-Experimental support for 64bit x86 darwin binaries can be enabled
-using the '--enable-darwin-64bit' configure flag. The 64bit binaries are
-best built and run on Leopard, but most of the system also works on
-Tiger (Tiger's 64bit libraries are, however, limited; therefore e.g. odbc,
-crypto, ssl etc. are not supported in Tiger). 64bit PPC binaries are not
-supported and we have no plans to add such support (no machines to
-test on).
-
-Universal binaries and 64bit binaries are mutually exclusive options.
-
-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 top level
-Makefile (which, when building, it will pass on). However, when
-developing it is sometimes convenient to be able to run make in a
-subdirectory. To do this you must set the ERL_TOP variable
-before you run make.
-
-For example, assume your GNU make program is called "make" and you
-want to rebuild the application STDLIB, then you could do:
-
- $ cd lib/stdlib; env ERL_TOP=<Dir> make
-
-where <Dir> would be what you find ERL_TOP is set to in the top level
-Makefile.
-
-Authors
--------
-Authors are mostly listed in the application's AUTHORS files,
-that is $ERL_TOP/lib/*/AUTHORS and $ERL_TOP/erts/AUTHORS,
-not in the individual source files.
-
-
-More Information
-----------------
-
-More information can be found at http://www.erlang.org/.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..c38f097b0f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,76 @@
+Erlang/OTP
+==========
+
+**Erlang** is a programming language used to build massively scalable soft
+real-time systems with requirements on high availability. Some of its
+uses are in telecom, banking, e-commerce, computer telephony and
+instant messaging. Erlang's runtime system has built-in support for
+concurrency, distribution and fault tolerance.
+
+**OTP** is set of Erlang libraries and design principles providing
+middle-ware to develop these systems. It includes its own distributed
+database, applications to interface towards other languages, debugging
+and release handling tools.
+
+More information can be found at [erlang.org] [1].
+
+Building and Installing
+-----------------------
+
+Information on building and installing Erlang/OTP can be found
+in the `INSTALL.md` document.
+
+Contributing to Erlang/OTP
+--------------------------
+
+Here are the [instructions for submitting patches] [2].
+
+In short:
+
+* We prefer to receive proposed updates via email on the
+ [`erlang-patches`] [3] mailing list rather than through a pull request.
+ Pull requests are not practical because we have a strict policy never to
+ merge any untested changes to the development branch (the only exception
+ being **obviously** correct changes, such as corrections of typos).
+
+* We merge all proposed updates to the `pu` (*proposed updates*) branch,
+ typically within one working day.
+
+* At least once a day, the contents of the `pu` branch will be built on
+ several platforms (Linux, Solaris, Mac OS X, Windows, and so on) and
+ automatic test suites will be run. We will email you if any problems are
+ found.
+
+* If a proposed change builds and passes the tests, it will be reviewed
+ by one or more members of the Erlang/OTP team at Ericsson. The reviewer
+ may suggest improvements that are needed before the change can be accepted
+ and merged.
+
+* Once or twice a week, a status email called "What's cooking in Erlang/OTP"
+ will be sent to the [`erlang-patches`] [3] mailing list.
+
+Copyright and License
+---------------------
+
+> %CopyrightBegin%
+>
+> Copyright Ericsson AB 2010. All Rights Reserved.
+>
+> The contents of this file are subject to the Erlang Public License,
+> Version 1.1, (the "License"); you may not use this file except in
+> compliance with the License. You should have received a copy of the
+> Erlang Public License along with this software. If not, it can be
+> retrieved online at http://www.erlang.org/.
+>
+> Software distributed under the License is distributed on an "AS IS"
+> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+> the License for the specific language governing rights and limitations
+> under the License.
+>
+> %CopyrightEnd%
+
+
+
+ [1]: http://www.erlang.org
+ [2]: http://wiki.github.com/erlang/otp/submitting-patches
+ [3]: http://www.erlang.org/faq.html
diff --git a/README.win32 b/README.win32
deleted file mode 100644
index 6fd14b23dc..0000000000
--- a/README.win32
+++ /dev/null
@@ -1,763 +0,0 @@
-How to build Erlang/OTP on Windows.
------------------------------------
-Table of contents
-
-1. Introduction
-2. Answers to some "frequently asked questions"
-3. Tools you need and their environment
-4. The shell environment
-5. Building and installing
-6. Development
-7. Final words
-
-%CopyrightBegin%
-
-Copyright Ericsson AB 2003-2009. All Rights Reserved.
-
-The contents of this file are subject to the Erlang Public License,
-Version 1.1, (the "License"); you may not use this file except in
-compliance with the License. You should have received a copy of the
-Erlang Public License along with this software. If not, it can be
-retrieved online at http://www.erlang.org/.
-
-Software distributed under the License is distributed on an "AS IS"
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-the License for the specific language governing rights and limitations
-under the License.
-
-%CopyrightEnd%
-
-
-
-Introduction
-------------
-
-This file describes how to build the Erlang emulator and the OTP
-libraries on Windows. The instructions apply to versions of Windows
-supporting the Cygwin emulated gnuish environment for Windows. We've
-built on the following platforms: Windows 2000 Professional, Windows
-2003 server, Windows XP Home/Professional, and Windows Vista. Any
-Windows95'ish platform will surely get you into trouble, what I'm not
-sure of, but it certainly will...
-
-The procedure described uses Cygwin as a build environment, you run
-the bash shell in Cygwin and uses gnu make/configure/autoconf etc to
-do the build. The emulator C-source code is, however, mostly compiled
-with Microsoft Visual C++(tm), producing a native Windows binary. This
-is the same procedure as we use to build the pre-built binaries. The
-fact that we use VC++ and not gcc is explained further in the FAQ
-section.
-
-I describe the build procedure to make it possible for open source
-customers to build the emulator, given that they have the needed
-tools. The binary Windows releases is still a preferred alternative if
-one does not have Microsoft's development tools and/or don't want to
-install Cygwin.
-
-To use Cygwin, one needs basic experience from a Unix environment, if
-one does not know how to set environment variables, run programs etc
-in a Unix environment, one will be quite lost in the Cygwin
-ditto. I can unfortunately not teach all the world how to use
-Cygwin and bash, neither how to install Cygwin nor perform basic tasks
-on a computer. Please refer to other documentation on the net for
-help, or use the binary release instead if you have problems using the
-tools.
-
-However, if you feel comfortable with the environment and build
-system, and have all the necessary tools, you have a great opportunity
-to make the Erlang/OTP distribution for Windows better. Please submit
-any suggestions and patches to the appropriate mailing lists (see
-http://www.erlang.org) to let them find their way into the next
-version of Erlang. If making changes to the build system (like
-makefiles etc) please bear in mind that the same makefiles are used on
-Unix/VxWorks/OSEDelta, so that your changes don't break other
-platforms. That of course goes for C-code too, system specific code
-resides in the $ERL_TOP/erts/emulator/sys/win32 and $ERL_TOP/erts/etc/win32
-directories mostly. The $ERL_TOP/erts/emulator/beam directory is for
-common code.
-
-Before the R9C release of Erlang/OTP, the Windows release was built
-partly on a Unix (Solaris) box and partly on a Windows box, using Perl
-hacks to communicate and sync between the two machines. R9C was the
-first release ever built solely on Windows, where no Unix machine is
-needed at all. Now we've used this build procedure for a couple of
-releases, and it has worked fine for us. Still, there might be all
-sorts of troubles on different machines and with different
-setups. I'll try to give hints wherever I've encountered difficulties,
-but please share your experiences by using the mailing list
[email protected]. I cannot of course help everyone with all
-their problems, please try to solve the problems and submit
-solutions/workarounds. Remember, it's all about sharing, not about
-demanding...
-
-Lets go then, I'll start with a little FAQ, based on in house questions
-and misunderstandings.
-
-
-Answers to "frequently asked questions"
----------------------------------------
-
-Q: So, now I can build Erlang using GCC on Windows?
-
-A: No, unfortunately not. You'll need Microsoft's Visual C++ still, a
-Bourne-shell script (cc.sh) wraps the Visual C++ compiler and runs it
-from within the Cygwin environment. All other tools needed to build
-Erlang are free-ware/open source, but not the C compiler.
-
-Q: Why haven't you got rid of VC++ then, you ******
-
-A: Well, partly because it's a good compiler - really! Actually it's
-been possible in late R11-releases to build using mingw instead of
-visual C++ (you might see the remnants of that in some scripts and
-directories). Unfortunately the development of the SMP version for
-Windows broke the mingw build and we chose to focus on the VC++ build
-as the performance has been much better in the VC++ versions. The
-mingw build will be back, but as long as VC++ gives better
-performance, the commercial build will be a VC++ one.
-
-Q: OK, VC++ you need, but now you've started to demand a very recent
-(and expensive) version of Visual studio, not the old and stable VC++
-6.0 that was used in earlier versions. Why?
-
-A: The SMP version of Erlang needs features in the Visual Studio
-2005. Can't live without them. Besides the new compiler gives the
-Erlang emulator a ~40% performance boost(!)
-
-Q: Can/will I build a Cygwin binary with the procedure you describe?
-
-A: No, the result will be a pure Windows binary, and as far as I know,
-it's not possible to make a Cygwin binary yet. That is of course
-something desirable, but there are still some problems with the
-dynamic linking (dynamic Erlang driver loading) as well as the TCP/IP
-emulation in Cygwin, which, I'm sure of, will improve, but still has
-some problems. Fixing those problems might be easy or might be hard.
-I suggest you try yourself and share your experience. No one would be
-happier if a simple ./configure && make would produce a fully fledged
-Cygwin binary. Ericsson does however not pay me to do a Cygwin port, so
-such a port would have to happen in spare time, which is a limited resource...
-
-Q: Hah, I saw you, you used GCC even though you said you didn't!
-
-A: OK, I admit, one of the files is compiled using Cygwin's GCC and
-the resulting object code is then converted to MS VC++ compatible coff
-using a small C hack. It's because that particular file, beam_emu.c
-benefits immensely from being able to use the GCC labels-as-values
-extension, which boosts emulator performance by up to 50%. That does
-unfortunately not (yet) mean that all of OTP could be compiled using
-GCC, that particular source code does not do anything system specific
-and actually is adopted to the fact that GCC is used to compile it on
-Windows.
-
-Q: So now there's a MS VC++ project file somewhere and I can build OTP
-using the nifty VC++ GUI!
-
-A: No, never. The hassle of keeping the project files up to date and
-do all the steps that constitute an OTP build from within the VC++ GUI
-is simply not worth it, maybe even impossible. A VC++ project
-file for Erlang/OTP will never happen, at least I will never make
-one. Clicking around in super-multi-tab'd dialogs to add a file or
-compiler option when it's so much easier in a makefile is simply not
-my style.
-
-Q: So how does it all work then?
-
-A: Cygwin is the environment, which closely resembles the environments
-found on any Unix machine. It's almost like you had a virtual Unix
-machine inside Windows. Configure, given certain parameters, then
-creates makefiles that are used by the Cygwin gnu-make to built the
-system. Most of the actual compilers etc are not, however, Cygwin
-tools, so I've written a couple of wrappers (Bourne-shell scripts),
-which reside in $ERL_TOP/etc/win32/cygwin_tools and they all do
-conversion of parameters and switches common in the Unix environment
-to fit the native Windows tools. Most notable is of course the paths,
-which in Cygwin are Unix-like paths with "forward slashes" (/) and no
-drive letters, the Cygwin specific command 'cygpath' is used for most
-of the path conversions. Luckily most compilers accept forward slashes
-instead of backslashes as path separators, one still have to get the
-drive letters etc right, though. The wrapper scripts are not general
-in the sense that, for example, cc.sh would understand and translates
-every possible gcc option and passes correct options to cl.exe. The
-principle is that the scripts are powerful enough to allow building of
-Erlang/OTP, no more, no less. They might need extensions to cope with
-changes during the development of Erlang, that's one of the reasons I
-made them into shell-scripts and not Perl-scripts, I believe they are
-easier to understand and change that way. I might be wrong though,
-cause another reason I didn't write them in Perl is because I've never
-liked Perl and my Perl code is no pleasant reading...
-
-In $ERL_TOP, there is a script called otp_build, that script handles
-the hassle of giving all the right parameters to configure/make and
-also helps you set up the correct environment variables to work with
-the Erlang source under Cygwin.
-
-Q: You use and need Cygwin, but then you haven't taken the time to
-port Erlang to the Cygwin environment but instead focus on your
-commercial release, is that really ethical?
-
-A: No, not really, but see this as a step in the right direction. I'm
-aiming at GCC compiled emulators and a Cygwin version, but I really
-need to do other things as well... In time, but don't hold your
-breath...
-
-Q: Can I build something that looks exactly as the commercial release.
-
-A: Yes, we use the exactly same build procedure.
-
-Q: Which version of Cygwin and other tools do you use then?
-
-A: For Cygwin we try to use the latest releases available when
-building. What versions you use shouldn't really matter, I try to
-include workarounds for the bugs I've found in different Cygwin
-releases, please help me to add workarounds for new Cygwin-related
-bugs as soon as you encounter them. Also please do submit bug reports
-to the appropriate Cygwin developers. The Cygwin GCC we used for R13B
-was version 3.4.4. We used VC++ 8.0 (i.e. Visual studio 2005 SP1),
-Sun's JDK 1.5.0_17, NSIS 2.37, and Win32 OpenSSL 0.9.8e. Please read
-the next section for details on what you need.
-
-Q: Can you help me setup X in Cygwin?
-
-A: No, unfortunately I haven't got time to help with Cygwin related
-user problems, please read Cygwin related web sites, newsgroups and
-mailing lists.
-
-Q: Why is the instruction so long? Is it really that complicated?
-
-A: Partly it's long because I babble too much, partly because I've
-described as much as I could about the installation of the needed
-tools. Once the tools are installed, building is quite easy. I also
-have tried to make this instruction understandable for people with
-limited Unix experience. Cygwin is a whole new environment to some
-Windows users, why careful explanation of environment variables etc
-seemed to be in place. The short story, for the experienced and
-impatient is:
-
-* Get and install complete Cygwin (latest)
-* (Buy and) Install Microsoft Visual studio 2005 and SP1 (or higher)
-* Get and install Sun's JDK 1.4.2
-* Get and install NSIS 2.01 or higher (up to 2.30 tried and working)
-* Get and install OpenSSL 0.9.7c or higher
-* Get and unpack wxWidgets-2.8.9 or higher to /opt/local/pgm inside cygwin
- - open /cygwin/opt/local/pgm/wxWidgets-2.8.9/build/msw/wx.dsw
- - enable wxUSE_GLCANVAS, wxUSE_POSTSCRIPT and wxUSE_GRAPHICS_CONTEXT
- in include/wx/msw/setup.h
- - build all unicode release (and unicode debug) packages
- - open /cygwin/opt/local/pgm/wxWidgets-2.8.9/contrib/build/stc/stc.dsw
- - build the unicode release (and unicode debug) packages
-* Get and unpack the erlang source distribution with Cygwin's tar.
-* set ERL_TOP to where you unpacked the source distribution
-* $ cd $ERL_TOP
-* Get (from http://www.erlang.org/download/tcltk85_win32_bin.tar.gz)
-and unpack the prebuilt TCL/TK binaries for windows with cygwin tar,
-standing in $ERL_TOP
-* Modify PATH and other environment variables so that all these tools
-are runnable from a bash shell. Still standing in $ERL_TOP, issue the following
-commands:
-$ eval `./otp_build env_win32`
-$ ./otp_build autoconf
-$ ./otp_build configure
-$ ./otp_build boot -a
-$ ./otp_build release -a
-$ ./otp_build installer_win32
-$ release/win32/otp_win32_<OTP version> /S
-
-Voila! "Start->Programs->Erlang OTP <OTP version>->Erlang" starts the Erlang
-Windows shell.
-
-
-Tools you need and their environment
-------------------------------------
-
-You need some tools to be able to build Erlang/OTP on Windows. Most
-notably you'll need Cygwin and Microsoft VC++, but you also might want
-a Java compiler, the NSIS install system and OpenSSL. Only VC++ costs
-money, but then again it costs a lot of money, I know...
-Well' here's the list:
-
-* Cygwin, the very latest is usually best. Get all the development
-tools and of course all the basic ditto. In fact getting the complete
-package might be a good idea, as you'll start to love Cygwin after a
-while if you're accustomed to Unix. Make sure to get jar and also make
-sure *not* to install a Cygwin'ish Java... The Cygwin jar command is
-used but Sun's Java compiler and virtual machine...
-
-URL: http://www.cygwin.com
-
-- get the installer from the web site and use that to install
-Cygwin. Be sure to have fair privileges. If you're on a NT domain you
-should consider running "mkpasswd -d" and "mkgroup -d" after the
-installation to get the user databases correct. See their respective
-manual pages.
-
-When you start you first bash shell, you will get an awful prompt. You
-might also have a PATH environment variable that contains backslashes
-and such. Edit $HOME/.profile and $HOME/.bashrc to set fair prompts
-and set a correct PATH. Also do a "export SHELL" in .profile. For some
-non-obvious reason the environment variable $SHELL is not exported in
-bash. Also note that .profile is run at login time and .bashrc when
-sub shells are created. You'll need to explicitly source .bashrc from
-.profile if you want the commands there to be run at login time (like
-setting up aliases, shell functions and the like). I personally
-usually do like this at the end of .profile:
-------------------
-ENV=$HOME/.bashrc
-export ENV
-. $ENV
-----------------
-
-You might also, if you're a hard core type of person at least, want to
-setup X-windows (XFree86), that might be as easy as running startx
-from the command prompt and it might be much harder. Use Google to
-find help...
-
-If you don't use X-windows, you might want to setup the Windows
-console window by selecting properties in the console system menu
-(upper left corner of the window, the Cygwin icon in the title
-bar). Especially setting a larger screen buffer size (lines) is useful
-as it gets you a scrollbar so you can see whatever error messages
-that might appear...
-
-If you want to use (t)csh instead of bash you're on your own, I
-haven't tried and know of no one that has. I expect
-that you use bash in all shell examples.
-
-* Microsoft Visual Studio 2005 SP1. Please don't skip the service
-pack! The installer might update your environment so that you can run
-the 'cl' command from the bash prompt, then again it might
-not... There is always a BAT file in VC\Bin under the installation
-directory (default C:\Program Files\Microsoft Visual Studio 8) called
-VCVARS32.BAT. Either add the environment settings in that file to the
-global environment settings in Windows or add the corresponding BASH
-environment settings to your .profile/.bashrc. For example, in my case
-I could add the following to .profile
-------------------------------------------------------------
-#Visual C++ Root directory as Cygwin style pathname
-VCROOT=/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio 8
-
-# Visual C++ Root directory as Windows style pathname
-WIN_VCROOT="C:\\Program Files\\Microsoft Visual Studio 8"
-
-# The PATH variable should be Cygwin'ish
-PATH=$VCROOT/Common7/IDE:$VCROOT/VC/BIN:$VCROOT/Common7/Tools:\
-$VCROOT/Common7/Tools/bin:$VCROOT/VC/PlatformSDK/bin:$VCROOT/SDK/v2.0/bin:\
-$VCROOT/VC/VCPackages:$PATH
-
-# Lib and INCLUDE should be Windows'ish
-# Note that semicolon (;) is used to separate Windows style paths but
-# colon (:) to separate Cygwin ditto!
-
-LIBPATH=$WIN_VCROOT\\VC\\ATLMFC\\LIB
-
-LIB=$WIN_VCROOT\\VC\\ATLMFC\\LIB\;$WIN_VCROOT\\VC\\LIB\;\
-$WIN_VCROOT\\VC\\PlatformSDK\\lib\;$WIN_VCROOT\\SDK\\v2.0\\lib
-
-INCLUDE=$WIN_VCROOT\\VC\\ATLMFC\\INCLUDE\;$WIN_VCROOT\\VC\\INCLUDE\;\
-$WIN_VCROOT\\VC\\PlatformSDK\\include
-
-export PATH LIB INCLUDE
---------------------------------------------------------------
-
-Make a simple hello world and try to compile it with the 'cl' command
-from within bash. If that does not work, your environment needs
-fixing. Also remember to fix up the PATH environment, especially old
-Erlang installations might have inserted quoted paths that Cygwin does
-not understand. Remove or correct such paths. There should be no
-backslashes in your path environment variable in Cygwin bash, but LIB
-and INCLUDE should contain Windows style paths with semicolon,
-drive letters and backslashes.
-
-If you wish to use Visual Studio 2008, a couple things need to be tweaked,
-namely the fact that some of the SDK stuff is installed in (by default)
-C:\Program Files\Microsoft SDKs\v6.0A . Just ensure that that
-C:\Program Files\Microsoft SDKs\v6.0A\Lib is in LIB and
-C:\Program Files\Microsoft SDKs\v6.0A\Include is in INCLUDE. A symptom of not
-doing this is errors about finding kernel32.lib and windows.h.
-
-Additionally, if you encounter errors about mc.exe not being found, you must
-install the entire Windows SDK (the partial SDK included in visual studio
-apparently does not include it). After installing it you'll want to add
-something like: /c/cygdrive/Program\ Files/Microsoft\ SDKs/v7.0/bin to your
-PATH to allow the environment to find mc.exe. The next Visual Studio (2010) is
-expected to include this tool.
-
-* Sun's Java JDK 1.5.0 or higher. Our Java code (jinterface, ic) is
-written for JDK 1.5.0. Get it for Windows and install it, the JRE is
-not enough. If you don't care about Java, you can skip this step, the
-result will be that jinterface is not built.
-
-URL: http://java.sun.com
-
-Add javac *LAST* to your path environment in bash, in my case this means:
---------------------------------------------------------------
-PATH="$PATH:/cygdrive/c/Program Files/Java/jdk1.5.0_17/bin"
---------------------------------------------------------------
-No CLASSPATH or anything is needed. Type "javac" at the bash prompt
-and you should get a list of available Java options. Make sure by
-typing "which java" that you use the Java you installed. Note however that
-Cygwin's jar.exe is used, that's why the JDK bin-directory should be
-added last in the PATH.
-
-* Nullsoft NSIS installer system. You need this to build the self
-installing package. It's a free open source installer that's much
-nicer to use than the commercial Wise and Install shield
-installers. This is the installer we use for commercial releases as
-well from R9C an on.
-URL: http://www.nullsoft.com/free/nsis
-Install the lot, especially the modern user interface components, as
-it's definitely needed. Put "makensis" in your path, in my case:
---------------------------------------------------------------
-PATH=/cygdrive/c/Program\ Files/NSIS:$PATH
---------------------------------------------------------------
-type makensis at the bash prompt and you should get a list of options
-if everything is OK.
-
-* OpenSSL for Windows. This is if you want the SSL and crypto
-applications to compile (and run). Go to http://www.openssl.org, click
-on the "Related" link and then on the "Binaries" link (upper right
-corner of the page last time I looked), you can then reach the
-"Shining Lights Productions" Web site for Windows binaries
-distributions. Get the latest or 0.9.7c if you get trouble with the
-latest. It's a nifty installer. The rest should be handled by
-configure, you needn't put anything in the path or anything.
-
-If you want to build openssl for windows yourself (which might be
-possible, as you wouldn't be reading this if you weren't a
-compile-it-yourself person), you either have to put the resulting
-DLL's in your path or in the windows system directory and either
-specify where you put the includes etc with the configure-parameter
---with-ssl=<cygwin path to the root> or put your installation directly
-under c:\OpenSSL. The directory structure under the installation root
-for OpenSSL is expected to be one with subdirectories named "include",
-"bin" and "lib", possibly with a "VC" subdirectory of "lib" containing
-the actual .lib files. Note that the cygwin distributed OpenSSL cannot be
-used, it results in cygwin depending binaries and it has unix style
-archives (.a, not .lib).
-
-* Building with wxWidgets. Download wxWidgets-2.8.9 or higher patch
-release (2.9.* is a developer release which currently does not work
-with wxErlang).
-Install or unpack it to DRIVE:/PATH/cygwin/opt/local/pgm
-Open from explorer (i.e. by double clicking the file)
-C:\cygwin\opt\local\pgm\wxMSW-2.8.10\build\msw\wx.dsw
-In Microsoft Visual Studio, click File/Open/File, locate and
-open: C:\cygwin\opt\local\pgm\wxMSW-2.8.10\include\wx\msw\setup.h
-enable wxUSE_GLCANVAS, wxUSE_POSTSCRIPT and wxUSE_GRAPHICS_CONTEXT
-Build it by clicking Build/Batch Build and select all unicode release
-(and unicode debug) packages.
-Open C:\cygwin\opt\local\pgm\wxMSW-2.8.10\contrib/build/stc/stc.dsw
-and batch build all unicode packages.
-
-* The Erlang source distribution. The same as for Unix
-platforms. Preferably use tar from within Cygwin to unpack the source
-tar.gz (tar zxf otp_src_R13B03.tar.gz).
-
-set the environment ERL_TOP to point to the root directory of the
-source distribution. Let's say I stood in $HOME/src and unpacked
-otp_src_R13B03.tar.gz, I then add the following to .profile:
---------------------------------------------------------
-ERL_TOP=$HOME/src/otp_src_R13B03
-export $ERL_TOP
---------------------------------------------------------
-
-* The TCL/TK binaries. You could compile Tcl/Tk for windows yourself,
-but you can get a stripped down version from our website which is
-suitable to include in the final binary package. If you want to supply
-tcl/tk yourself, read the instructions about how the tcl/tk tar file
-used in the build is constructed under $ERL_TOP/lib/gs/tcl. The easy
-way is to download
-http://www.erlang.org/download/tcltk85_win32_bin.tar.gz and unpack it
-standing in the $ERL_TOP directory. This will create the file
-win32.tar.gz in $ERL_TOP/lib/gs/tcl/binaries.
-
-One last alternative is to create a file named 'SKIP' in the
-$ERL_TOP/lib/gs/ after configure is run, but that will give you an
-erlang system without gs (which might be okay as you probably will use
-wx anyway).
-
-The shell environment
----------------------
-
-So, if you have followed the instructions above, when you start a bash
-shell, you should have an INCLUDE environment with a Windows style
-path, a LIB environment variable also in Windows style, and finally a
-PATH that let's you reach cl, makensis, javac etc from the
-command prompt (use "which cl" etc to verify from bash).
-
-You should also have an ERL_TOP environment variable that is *Cygwin
-style*, and points to a directory containing, among other files, the
-script "otp_build".
-
-A final massage of the environment is needed, and that is done by
-the script $ERL_TOP/otp_build. Start bash and do the following, note
-the "back-ticks" (`), can be quite hard to get on some keyboards, but
-pressing the back-tick key followed by the space bar might do it...
-
-------------------------
-$ cd $ERL_TOP
-$ eval `./otp_build env_win32`
-------------------------
-If you're unable to produce back-ticks on your keyboard, you can use
-the ksh variant:
-------------------------
-$ cd $ERL_TOP
-$ eval $(./otp_build env_win32)
-------------------------
-
-This should do the final touch to the environment and building should
-be easy after this. You could run "./otp_build env_win32" without
-"eval" just to see what it does, and to see that the environment it
-sets seems OK. The path is cleaned of spaces if possible (using DOS
-style short names instead), the variables OVERRIDE_TARGET, CC, CXX, AR
-and RANLIB are set to their respective wrappers and the directories
-$ERL_TOP/erts/etc/win32/cygwin_tools/vc and
-$ERL_TOP/erts/etc/win32/cygwin_tool are added first in the PATH.
-
-Try now a "which erlc". That should result in the erlc wrapper script
-(which does not have the .sh extension, for reasons best kept
-untold...). It should reside in $ERL_TOP/erts/etc/win32/cygwin_tools.
-You could also try "which cc.sh", which "ar.sh" etc.
-
-Now you're ready to build...
-
-
-Building and installing
------------------------
-Now it's assumed that you have executed "eval `./otp_build env_win32`"
-for this particular shell...
-
-Building is easiest using the otp_build script. That script takes care
-of running configure, bootstrapping etc on Windows in a simple
-way. The otp_build script is the utility we use ourselves to build on
-different platforms and it therefore contains code for all sorts of
-platforms. The principle is, however, that for non-Unix platforms, one
-uses "./otp_build env_<target>" to set up environment and then the
-script knows how to build on the platform "by itself". You've already
-run "./otp_build env_win32" in the step above, so now it's mostly like
-we build on any platform. OK, here are then steps; Assuming you will
-want to build a full installation executable with NSIS, you can omit
-<installation directory> and the release will be copied to
-$ERL_TOP/release/win32: and there is where the packed self installing
-executable will reside too.
-
-$ ./otp_build autoconf # Ignore the warning blob about versions of autoconf
-$ ./otp_build configure <optional configure options>
-$ ./otp_build boot -a
-$ ./otp_build release -a <installation directory>
-$ ./otp_build installer_win32 <installation directory> # optional
-
-Now you will have a file called otp_win32_R12B.exe in the <installation
-directory>, i.e. $ERL_TOP/release/win32.
-
-Lets get into more detail:
-
-$ ./otp_build autoconf - This step rebuilds the configure scripts to
-work correctly in the cygwin environment. In an ideal world, this
-would not be needed, but alas, we have encountered several
-incompatibilities between our distributed configure scripts (generated
-on a Linux platform) and the cygwin environment over the
-years. Running autoconf on cygwin ensures that the configure scripts
-are generated in a cygwin-compatible way and that they will work well
-in the next step.
-
-$ ./otp_build configure - This runs the newly generated configure scripts
-with options making configure behave nicely. The target machine type is
-plainly "win32", so a lot of the configure-scripts recognize this
-awkward target name and behave accordingly. The CC variable also makes
-the compiler be cc.sh, which wraps MSVC++, so all configure tests
-regarding the C compiler gets to run the right compiler. A lot of the
-tests are not needed on Windows, but I thought it best to run the
-whole configure anyway. The only configure option you might want to
-supply is --with-ssl, which might be needed if you have built your own
-openssl distribution. The Shining Lights distribution should be found
-automatically by configure, if that fails, add a --with-ssl=<dir> that
-specifies the root directory of your OpenSSL installation.
-
-$ ./otp_build boot -a - This uses the bootstrap directory (shipped
-with the source, $ERL_TOP/bootstrap) to build a complete OTP
-system. It first builds an emulator and sets up a minimal OTP system
-under $ERL_TOP/bootstrap, then starts to compile the different OTP
-compilers to make the $ERL_TOP/bootstrap system potent enough to be
-able to compile all Erlang code in OTP. Then, all Erlang and C code
-under $ERL_TOP/lib is built using the bootstrap system, giving a
-complete OTP system (although not installed). When this is done, one
-can run Erlang from within the source tree, just type $ERL_TOP/bin/erl
-and you should have a prompt. If you omit the -a flag, you'll get a
-smaller system, that might be useful during development. Now
-exit from Erlang and start making a release of the thing:
-
-$ ./otp_build release -a - Builds a commercial release tree from the
-source tree, default is to put it in $ERL_TOP/release/win32, you can
-give any directory as parameter (Cygwin style), but it doesn't really matter
-if you're going to build a self extracting installer too. You could of
-course build release to the final directory and then run ./Install.exe
-standing in the directory where the release was put, that will create
-a fully functional OTP installation. But let's make the nifty
-installer:
-
-$ ./otp_build installer_win32 - Create the self extracting installer
-executable. The executable otp_win32_<OTP version>.exe will be placed
-in the top directory of the release created in the previous step. If
-no release directory is specified, the release is expected to have
-been built to $ERL_TOP/release/win32, which also will be the place
-where the installer executable will be placed. If you specified some
-other directory for the release (i.e.
-./otp_build release -a /tmp/erl_release), you're expected to give the
-same parameter here, (i.e. ./otp_build installer_win32 /tmp/erl_release).
-You need to have a full NSIS installation and makensis.exe in your
-path for this to work of course. Once you have created the installer,
-you can run it to install Erlang/OTP in the regular way, just run the
-executable and follow the steps in the installation wizard. To get all
-default settings in the installation without any questions asked, you
-run the executable with the parameter "/S" (capital S). like in:
-------------------------------------------------------
-$ cd $ERL_TOP
-$ release/win32/otp_win32_R13B03 /S
-.....
-------------------------------------------------------
-- and after a while Erlang will have been installed in
-C:\Program Files\erl5.7.4, with shortcuts in the menu etc.
-
-*NOTE* Beginning with R9C, the Windows installer does *not* add Erlang
-to the system wide path. If one wants to have Erlang in the path, one
-has to add it by hand.
-
-The necessary setup of an Erlang installation is actually done by the
-program Install.exe, which resides in the release top. That program
-creates ".ini-files" and copies the correct boot scripts. If one has
-the correct directory tree (like after a ./otp_build release -a), only
-the running of Install.exe is necessary to get a fully functional
-OTP. What the self extracting installer adds is (of course) the
-possibility to distribute the binary easily, together with adding
-shortcuts to the Windows start menu. There is also some adding of
-entries in the registry, to associate .erl and .beam files with Erlang
-and get nifty icons, but that's not something you'll really need to
-run Erlang. The registry is also used to store uninstall information,
-but if one has not used the self extracting installer, one cannot
-(need not) do any uninstall, one just scratches the release directory
-and everything is gone. Erlang/OTP does not *need* to put anything
-in the Windows registry at all, and does not if you don't use the self
-extracting installer. In other words the installer is pure cosmetics.
-
-
-Development
------------
-
-Once the system is built, you might want to change it. Having a test
-release in some nice directory might be useful, but you also can run
-Erlang from within the source tree. The target 'local_setup', makes
-the program $ERL_TOP/bin/erl.exe usable and it also uses all the OTP
-libraries in the source tree.
-
-If you hack the emulator, you can then build the emulator executable
-by standing in $ERL_TOP/erts/emulator and do a simple
-
-$ make opt
-
-Note that you need to have run (cd $ERL_TOP && eval `./otp_build env_win32`)
-in the particular shell before building anything on Windows. After
-doing a make opt you can test your result by running $ERL_TOP/bin/erl.
-If you want to copy the result to a release directory (say
-/tmp/erl_release), you do this (still in $ERL_TOP/erts/emulator)
-
-$ make TESTROOT=/tmp/erl_release release
-
-That will copy the emulator executables.
-
-To make a debug build of the emulator, you need to recompile both
-beam.dll (the actual runtime system) and erlexec.dll. Do like this
-
-$ cd $ERL_TOP
-$ rm bin/win32/erlexec.dll
-$ cd erts/emulator
-$ make debug
-$ cd ../etc
-$ make debug
-
-- and sometimes
-
-$ cd $ERL_TOP
-$ make local_setup
-
-So now when you run $ERL_TOP/erl.exe, you should have a debug compiled
-emulator, which you will see if you do a:
-
-1> erlang:system_info(system_version).
-
-- in the erlang shell. If the returned string contains "[debug]", you
-got a debug compiled emulator.
-
-To hack the erlang libraries, you simply do a "make opt" in the
-specific "applications" directory, like:
-
-$ cd $ERL_TOP/lib/stdlib
-$ make opt
-
-- or even in the source directory...
-
-$ cd $ERL_TOP/lib/stdlib/src
-$ make opt
-
-Note that you're expected o have a fresh Erlang in your path when
-doing this, preferably the plain R13B03 you have built in the previous
-steps. You could also add $ERL_TOP/bootstrap/bin to your PATH before
-rebuilding specific libraries, that would give you a good enough
-Erlang system to compile any OTP erlang code. Setting up the path
-correctly is a little bit tricky, you still need to have
-$ERL_TOP/erts/etc/win32/cygwin_tools/vc and
-$ERL_TOP/erts/etc/win32/cygwin_tools *before* the actual emulator
-in the path. A typical setting of the path for using the bootstrap
-compiler would be:
-
-$ export PATH=$ERL_TOP/erts/etc/win32/cygwin_tools/vc:$ERL_TOP/erts/etc/win32/cygwin_tools:$ERL_TOP/bootstrap/bin:$PATH
-
-That should make it possible to rebuild any library without hassle...
-
-If you want to copy a library (an application) newly built, to a
-release area, you do like with the emulator:
-
-$ cd $ERL_TOP/lib/stdlib
-$ make TESTROOT=/tmp/erlang_release release
-
-Remember that:
-
-- Windows specific C-code goes in the
-$ERL_TOP/erts/emulator/sys/win32, $ERL_TOP/erts/emulator/drivers/win32
-or $ERL_TOP/erts/etc/win32.
-
-- Windows specific erlang code should be used conditionally and the
-host OS tested in *runtime*, the exactly same beam files should be
-distributed for every platform! So write code like:
-
-case os:type() of
- {win32,_} ->
- do_windows_specific();
- Other ->
- do_fallback_or_exit()
-end,
-
-That's basically all you need to get going.
-
-Final words
------------
-My hope is that the possibility to build the whole system on Windows
-will open up for free development on this platform too. There are many
-things one might want to do better in the Windows version, like the
-window-style command prompt as well as pure Cygwin porting. Although i
-realize it's a much larger step to start building on Windows (with all
-the software you need) than for instance on Linux, I sincerely hope
-that some of you will make the effort and start submitting Windows
-friendly patches.
-
-The first build system for Erlang using Cygwin on Windows was created
-by Per Bergkvist. I haven't used his build system, but it's rumored to
-be good. The idea to do this came from his work, so credit is well
-deserved.
-
-Of course this would have been completely impossible without the
-excellent Cygwin package. The guys at Cygnus solutions and Redhat
-deserves a huge THANKS! as well as all the other people in the free
-software community who have helped in creating the magnificent
-software that constitutes Cygwin.
-
-Good luck and Happy Hacking,
-Patrik, OTP
diff --git a/TAR.include b/TAR.include
index 78be579869..27b10d6243 100644
--- a/TAR.include
+++ b/TAR.include
@@ -1,8 +1,10 @@
AUTHORS
EPLICENCE
Makefile.in
-README
-README.win32
+README.md
+INSTALL.md
+INSTALL-CROSS.md
+INSTALL-WIN32.md
configure.in
aclocal.m4
otp_build
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index c013d96fc4..d25c63be3d 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -36,24 +36,26 @@
<description>
<warning><p>The NIF concept was introduced in R13B03 as an
EXPERIMENTAL feature. The interfaces may be changed in any way
- in coming releases. The API is still sparse and contains only
- the most basic functions to read and write Erlang terms.
- </p><p><em>R13B04</em>: The function prototypes of the NIFs
- have changed to expect <c>argc</c> and <c>argv</c>
- arguments. The arity of a NIF is by that no longer limited to
- 3.</p>
- <p>enif_get_data renamed as enif_priv_data.</p>
+ in coming releases. The plan is however to lift the experimental label and
+ maintain interface backward compatibility from R14B.</p>
+ <p>Incompatible changes in <em>R13B04</em>:</p>
+ <list>
+ <item>The function prototypes of the NIFs have changed to expect <c>argc</c> and <c>argv</c>
+ arguments. The arity of a NIF is by that no longer limited to 3.</item>
+ <item><c>enif_get_data</c> renamed as <c>enif_priv_data</c>.</item>
+ <item><c>enif_make_string</c> got a third argument for character encoding.</item>
+ </list>
</warning>
<p>A NIF library contains native implementation of some functions
- of an erlang module. The native implemented functions (NIFs) are
+ of an Erlang module. The native implemented functions (NIFs) are
called like any other functions without any difference to the
caller. Each NIF must also have an implementation in Erlang that
will be invoked if the function is called before the NIF library
has been successfully loaded. A typical such stub implementation
is to throw an exception. But it can also be used as a fallback
implementation if the NIF library is not implemented for some
- architecture.</p>
+ architecture.</p>
<p>A minimal example of a NIF library can look like this:</p>
<p/>
<code type="none">
@@ -62,7 +64,7 @@
static ERL_NIF_TERM hello(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
- return enif_make_string(env, "Hello world!");
+ return enif_make_string(env, "Hello world!", ERL_NIF_LATIN1);
}
static ErlNifFunc nif_funcs[] =
@@ -73,7 +75,7 @@ static ErlNifFunc nif_funcs[] =
ERL_NIF_INIT(niftest,nif_funcs,NULL,NULL,NULL,NULL)
</code>
- <p>and the erlang module would have to look something like
+ <p>and the Erlang module would have to look something like
this:</p>
<p/>
<code type="none">
@@ -107,6 +109,10 @@ ok
the new directive <seealso
marker="doc/reference_manual:code_loading#on_load">on_load</seealso> to automatically
load the NIF library when the module is loaded.</p>
+ <note><p>A NIF must be exported or used locally by the module (or both).
+ An unused local stub function will be optimized away by the compiler
+ causing loading of the NIF library to fail.</p>
+ </note>
<p>A loaded NIF library is tied to the Erlang module code version
that loaded it. If the module is upgraded with a new version, the
new code will have to load its own NIF library (or maybe choose not
@@ -116,7 +122,7 @@ ok
will be shared as well. To avoid unintentionally shared static
data, each Erlang module code can keep its own private data. This
private data can be set when the NIF library is loaded and
- then retrieved by calling <seealso marker="erl_nif#enif_priv_data">enif_priv_data()</seealso>.</p>
+ then retrieved by calling <seealso marker="#enif_priv_data">enif_priv_data()</seealso>.</p>
<p>There is no way to explicitly unload a NIF library. A library will be
automatically unloaded when the module code that it belongs to is purged
by the code server. A NIF library will also be unloaded if it is replaced
@@ -131,7 +137,7 @@ ok
<taglist>
<tag>Read and write Erlang terms</tag>
<item><p>Any Erlang terms can be passed to a NIF as function arguments and
- be returned as function return value. The terms are of C-type <c>ERL_NIF_TERM</c>
+ be returned as function return values. The terms are of C-type <c>ERL_NIF_TERM</c>
and can only be read or written using API functions. Most functions to read
the content of a term are prefixed <c>enif_get_</c> and usually return
true (or false) if the term was of the expected type (or not).
@@ -139,25 +145,42 @@ ok
return the created <c>ERL_NIF_TERM</c>. There are also some functions
to query terms, like <c>enif_is_atom</c>, <c>enif_is_identical</c> and
<c>enif_compare</c>.</p></item>
+ <tag>Binaries</tag>
+ <item><p>Terms of type binary are accessed through the struct type <seealso marker="#ErlNifBinary">ErlNifBinary</seealso>
+ that contains a pointer (<c>data</c>) to the raw binary data and the length
+ (<c>size</c>) of the data in bytes. Both <c>data</c> and <c>size</c> are
+ read-only and should only be written using calls to API functions.
+ Instances of <c>ErlNifBinary</c> are however always allocated by the user
+ (usually as local variables).</p>
+ <p>The raw data pointed to by <c>data</c> is only mutable after a call to
+ <seealso marker="#enif_alloc_binary">enif_alloc_binary</seealso>.
+ All other functions that operates on a binary will leave the data as read-only.
+ An allocated binary must in the end either be freed with
+ <seealso marker="#enif_release_binary">enif_release_binary</seealso>
+ or transferred to an Erlang term with <seealso marker="#enif_make_binary">enif_make_binary</seealso>.
+ But it does not have do happen in the same NIF call.</p>
+ <p>Binaries must be a number of whole bytes. Bitstrings with an arbitrary
+ bit length have no support yet.</p>
+ </item>
<tag>Resource objects</tag>
<item><p>Resource objects are a way to return pointers to native data
structures from a NIF in a safe way. A resource object is just a block
- of memory allocated with <seealso marker="erl_nif#enif_alloc_resource">enif_alloc_resource()</seealso>.
+ of memory allocated with <seealso marker="#enif_alloc_resource">enif_alloc_resource()</seealso>.
A handle ("safe pointer") to this memory block can then be returned to Erlang by the use of
- <seealso marker="erl_nif#enif_make_resource">enif_make_resource()</seealso>.
+ <seealso marker="#enif_make_resource">enif_make_resource()</seealso>.
The term returned by <c>enif_make_resource</c>
is totally opaque in nature. It can be stored and passed between processses
on the same node, but the only real end usage is to pass it back as argument to a NIF.
- The NIF can then do <seealso marker="erl_nif#enif_get_resource">enif_get_resource()</seealso>
+ The NIF can then do <seealso marker="#enif_get_resource">enif_get_resource()</seealso>
and get back a pointer to the memory block that is guaranteed to still be
valid. A resource object will not be deallocated until the last handle term
has been garbage collected by the VM and the resource has been
- released with <seealso marker="erl_nif#enif_release_resource">enif_release_resource()</seealso>
+ released with <seealso marker="#enif_release_resource">enif_release_resource()</seealso>
(not necessarily in that order).</p>
<p>All resource objects are created as instances of some <em>resource type</em>.
This makes resources from different modules or applications to be distinguishable.
A resource type is created by calling
- <seealso marker="erl_nif#enif_open_resource_type">enif_open_resource_type()</seealso>
+ <seealso marker="#enif_open_resource_type">enif_open_resource_type()</seealso>
when a library is loaded. Objects of that resource type can then later be allocated
and <c>enif_get_resource</c> verifies that the resource is of the expected type.
A resource type can have a destructor function that is automatically
@@ -172,12 +195,18 @@ ok
</item>
<tag>Threads and concurrency</tag>
<item><p>A NIF is thread-safe without any explicit synchronization as
- long as it acts as a pure function and only operates on the supplied
- arguments. As soon as you access a shared state either through static
- variables or <seealso marker="erl_nif#enif_priv_data">enif_priv_data</seealso>
- you need to supply your own explicit synchronization.</p>
+ long as it acts as a pure function and only reads the supplied
+ arguments. As soon as you write towards a shared state either through
+ static variables or <seealso marker="#enif_priv_data">enif_priv_data</seealso>
+ you need to supply your own explicit synchronization. Resource objects
+ will also require synchronization if you treat them as mutable.</p>
<p>The library initialization callbacks <c>load</c>, <c>reload</c> and
- <c>upgrade</c> are all thread-safe even for shared state data.</p></item>
+ <c>upgrade</c> are all thread-safe even for shared state data.</p>
+ <p>Avoid doing lengthy work in NIF calls as that may degrade the
+ responsiveness of the VM. NIFs are called directly by the same scheduler
+ thread that executed the calling Erlang code. The calling scheduler will thus
+ be blocked from doing any other work until the NIF returns.</p>
+ </item>
</taglist>
</section>
<section>
@@ -328,7 +357,7 @@ typedef enum {
</item>
<tag><marker id="ErlNifSysInfo"/>ErlNifSysInfo</tag>
<item>
- <p>Used by <seealso marker="erl_nif#enif_system_info">enif_system_info</seealso>
+ <p>Used by <seealso marker="#enif_system_info">enif_system_info</seealso>
to return information about the runtime system. Contains currently
the exact same content as <seealso marker="erl_driver#ErlDrvSysInfo">ErlDrvSysInfo</seealso>.</p>
</item>
@@ -346,9 +375,9 @@ typedef enum {
<desc><p>Allocate a new binary of size of <c>size</c>
bytes. Initialize the structure pointed to by <c>bin</c> to
refer to the allocated binary. The binary must either be released by
- <seealso marker="erl_nif#enif_release_binary">enif_release_binary()</seealso>
- or ownership transferred to an erlang term with
- <seealso marker="erl_nif#enif_make_binary">enif_make_binary()</seealso>.
+ <seealso marker="#enif_release_binary">enif_release_binary()</seealso>
+ or ownership transferred to an Erlang term with
+ <seealso marker="#enif_make_binary">enif_make_binary()</seealso>.
An allocated (and owned) <c>ErlNifBinary</c> can be kept between NIF
calls.</p>
<p>Return false if allocation failed.</p>
@@ -437,7 +466,9 @@ typedef enum {
<func><name><ret>int</ret><nametext>enif_get_resource(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifResourceType* type, void** objp)</nametext></name>
<fsummary>Get the pointer to a resource object</fsummary>
<desc><p>Set <c>*objp</c> to point to the resource object referred to by <c>term</c>.
- Return false if <c>term</c> is not a handle to a resource object of type <c>type</c>.</p></desc>
+ The pointer is valid until the calling NIF returns and should not be released.</p>
+ <p>Return false if <c>term</c> is not a handle to a resource object
+ of type <c>type</c>.</p></desc>
</func>
<func><name><ret>int</ret><nametext>enif_get_string(ErlNifEnv* env,
ERL_NIF_TERM list, char* buf, unsigned size,
@@ -446,11 +477,11 @@ typedef enum {
<desc><p>Write a null-terminated string, in the buffer pointed to by
<c>buf</c> with size <c>size</c>, consisting of the characters
in the string <c>list</c>. The characters are written using encoding
- <c>encode</c>. Return the number of bytes written
- (including terminating null character), or <c>-size</c> if the
- string was truncated due to buffer space, or 0 if <c>list</c>
- is not a string that can be encoded with <c>encode</c> or
- if <c>size</c> was less than 1.
+ <seealso marker="#ErlNifCharEncoding">encode</seealso>.
+ Return the number of bytes written (including terminating null
+ character), or <c>-size</c> if the string was truncated due to
+ buffer space, or 0 if <c>list</c> is not a string that can be
+ encoded with <c>encode</c> or if <c>size</c> was less than 1.
The written string is always null-terminated unless buffer
<c>size</c> is less than 1.</p></desc>
</func>
@@ -577,7 +608,7 @@ typedef enum {
<name><ret>ERL_NIF_TERM</ret><nametext>enif_make_list9(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e9)</nametext></name>
<fsummary>Create a list term.</fsummary>
<desc><p>Create an ordinary list term with length indicated by the
- function name. Prefere these functions (macros) over the variadic
+ function name. Prefer these functions (macros) over the variadic
<c>enif_make_list</c> to get compile time error if the number of
arguments does not match.</p></desc>
</func>
@@ -601,9 +632,9 @@ typedef enum {
<func><name><ret>ERL_NIF_TERM</ret><nametext>enif_make_resource(ErlNifEnv* env, void* obj)</nametext></name>
<fsummary>Create an opaque handle to a resource object</fsummary>
<desc><p>Create an opaque handle to a memory managed resource object
- obtained by <seealso marker="erl_nif#enif_alloc_resource">enif_alloc_resource</seealso>.
+ obtained by <seealso marker="#enif_alloc_resource">enif_alloc_resource</seealso>.
No ownership transfer is done, the resource object still needs to be released by
- <seealso marker="erl_nif#enif_release_resource">enif_release_resource</seealso>.</p>
+ <seealso marker="#enif_release_resource">enif_release_resource</seealso>.</p>
<p>Note that the only defined behaviour when using of a resource term in
an Erlang program is to store it and send it between processes on the
same node. Other operations such as matching or <c>term_to_binary</c>
@@ -612,7 +643,7 @@ typedef enum {
<func><name><ret>ERL_NIF_TERM</ret><nametext>enif_make_string(ErlNifEnv* env, const char* string, ErlNifCharEncoding encoding)</nametext></name>
<fsummary>Create a string.</fsummary>
<desc><p>Create a list containing the characters of the
- null-terminated string <c>string</c> with encoding <c>encoding</c>.</p></desc>
+ null-terminated string <c>string</c> with encoding <seealso marker="#ErlNifCharEncoding">encoding</seealso>.</p></desc>
</func>
<func><name><ret>ERL_NIF_TERM</ret><nametext>enif_make_sub_binary(ErlNifEnv*
env, ERL_NIF_TERM bin_term, unsigned pos, unsigned size)</nametext></name>
@@ -640,7 +671,7 @@ typedef enum {
<name><ret>ERL_NIF_TERM</ret><nametext>enif_make_tuple9(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e9)</nametext></name>
<fsummary>Create a tuple term.</fsummary>
<desc><p>Create a tuple term with length indicated by the
- function name. Prefere these functions (macros) over the variadic
+ function name. Prefer these functions (macros) over the variadic
<c>enif_make_tuple</c> to get compile time error if the number of
arguments does not match.</p></desc>
</func>
@@ -686,7 +717,7 @@ typedef enum {
ErlNifResourceDtor* dtor, ErlNifResourceFlags flags, ErlNifResourceFlags* tried)</nametext></name>
<fsummary>Create or takeover a resource type</fsummary>
<desc><p>Create or takeover a resource type identified by the string
- <c>name</c> and give it the destructor function pointed to by <c>dtor</c>.
+ <c>name</c> and give it the destructor function pointed to by <seealso marker="#ErlNifResourceDtor">dtor</seealso>.
Argument <c>flags</c> can have the following values:</p>
<taglist>
<tag><c>ERL_NIF_RT_CREATE</c></tag>
@@ -706,8 +737,8 @@ typedef enum {
On failure, return <c>NULL</c> and set <c>*tried</c> to <c>flags</c>.
It is allowed to set <c>tried</c> to <c>NULL</c>.</p>
<p>Note that <c>enif_open_resource_type</c> is only allowed to be called in the three callbacks
- <seealso marker="erl_nif#load">load</seealso>, <seealso marker="erl_nif#reload">reload</seealso>
- and <seealso marker="erl_nif#upgrade">upgrade</seealso>.</p>
+ <seealso marker="#load">load</seealso>, <seealso marker="#reload">reload</seealso>
+ and <seealso marker="#upgrade">upgrade</seealso>.</p>
</desc>
</func>
<func><name><ret>void*</ret><nametext>enif_priv_data(ErlNifEnv* env)</nametext></name>
diff --git a/lib/orber/doc/src/ch_install.xml b/lib/orber/doc/src/ch_install.xml
index ab5885954b..dde4bf4006 100644
--- a/lib/orber/doc/src/ch_install.xml
+++ b/lib/orber/doc/src/ch_install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Installing Orber</title>
@@ -234,6 +234,16 @@ nodeB@hostB> orber:start().
<cell align="left" valign="middle">0</cell>
</row>
<row>
+ <cell align="left" valign="middle">iiop_out_ports_attempts</cell>
+ <cell align="left" valign="middle">integer() > 0</cell>
+ <cell align="left" valign="middle">1</cell>
+ </row>
+ <row>
+ <cell align="left" valign="middle">iiop_out_ports_random</cell>
+ <cell align="left" valign="middle">true | false</cell>
+ <cell align="left" valign="middle">false</cell>
+ </row>
+ <row>
<cell align="left" valign="middle">iiop_max_fragments</cell>
<cell align="left" valign="middle">integer() > 0 | infinity</cell>
<cell align="left" valign="middle">infinity</cell>
@@ -506,6 +516,13 @@ nodeB@hostB> orber:start().
If communicating via SSL, make sure you use a version that supports
the local <c>{port, Port}</c> option. See also
<seealso marker="ch_install#firewall">Firewall Configuration</seealso>.</item>
+ <tag><em>iiop_out_ports_random</em></tag>
+ <item>Requires that <c>iiop_out_ports</c> define a port range. If that is the
+ case Orber will select a port randomly from that sequence.</item>
+ <tag><em>iiop_out_ports_attempts</em></tag>
+ <item>Requires that <c>iiop_out_ports</c> define a port range. If so Orber will
+ accept a number of timeouts, defined by this parameter, when trying to connect
+ to another ORB.</item>
<tag><em>iiop_max_fragments</em></tag>
<item>Limits the number of IIOP fragments allowed per request.</item>
<tag><em>iiop_max_in_requests</em></tag>
diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml
index c7a2dab617..d388cc42a8 100644
--- a/lib/orber/doc/src/notes.xml
+++ b/lib/orber/doc/src/notes.xml
@@ -40,6 +40,13 @@
<list type="bulleted">
<item>
<p>
+ Added the configuration parameters iiop_out_ports_attempts and
+ iiop_out_ports_random.</p>
+ <p>
+ Own Id: OTP-8448 Aux Id: seq11498</p>
+ </item>
+ <item>
+ <p>
Removed obsolete SSL dependency.</p>
<p>
Own Id: OTP-8374 Aux Id:</p>
diff --git a/lib/orber/doc/src/orber.xml b/lib/orber/doc/src/orber.xml
index 05036667cc..5e38e4cf9f 100644
--- a/lib/orber/doc/src/orber.xml
+++ b/lib/orber/doc/src/orber.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>orber</title>
@@ -162,13 +162,33 @@
</func>
<func>
<name>iiop_out_ports() -> 0 | {Min, Max}</name>
- <fsummary>Display the ports Orber may use when connecting to another ORB</fsummary>
+ <fsummary>Display the ports Orber may use when connecting to another ORB</fsummary>
<desc>
<p>The return value of this operation is what the configuration
parameter <seealso marker="ch_install#config">iiop_out_ports</seealso>
- have been set to.</p>
+ has been set to.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>iiop_out_ports_random() -> true | false</name>
+ <fsummary>Determine if Orber should select local ports randomly</fsummary>
+ <desc>
+ <p>Return the value of the configuration parameter
+ <seealso marker="ch_install#config">iiop_out_ports_random</seealso>.</p>
</desc>
</func>
+
+ <func>
+ <name>iiop_out_ports_attempts() -> int()</name>
+ <fsummary>Display if Orber should accept more than one timeout connecting to another ORB</fsummary>
+ <desc>
+ <p>Return the value of the configuration parameter
+ <seealso marker="ch_install#config">iiop_out_ports_attempts</seealso>.</p>
+ </desc>
+ </func>
+
+
<func>
<name>iiop_ssl_port() -> int()</name>
<fsummary>Display the IIOP port number used for secure connections</fsummary>
diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl
index e9c6822551..c3d37ad1fb 100644
--- a/lib/orber/src/orber.erl
+++ b/lib/orber/src/orber.erl
@@ -1,20 +1,20 @@
%%--------------------------------------------------------------------
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -34,7 +34,8 @@
%% External exports
%%-----------------------------------------------------------------
-export([start/0, start/1, stop/0, install/1, install/2, orber_nodes/0, iiop_port/0,
- domain/0, iiop_ssl_port/0, iiop_out_ports/0,
+ domain/0, iiop_ssl_port/0, iiop_out_ports/0, iiop_out_ports_random/0,
+ iiop_out_ports_attempts/0,
ssl_server_certfile/0, ssl_client_certfile/0, set_ssl_client_certfile/1,
ssl_server_verify/0, ssl_client_verify/0, set_ssl_client_verify/1,
ssl_server_depth/0, ssl_client_depth/0, set_ssl_client_depth/1,
@@ -305,6 +306,12 @@ nat_iiop_port() ->
iiop_out_ports() ->
orber_env:iiop_out_ports().
+iiop_out_ports_random() ->
+ orber_env:iiop_out_ports_random().
+
+iiop_out_ports_attempts() ->
+ orber_env:iiop_out_ports_attempts().
+
orber_nodes() ->
case catch mnesia:table_info(orber_objkeys,ram_copies) of
Nodes when is_list(Nodes) ->
diff --git a/lib/orber/src/orber_env.erl b/lib/orber/src/orber_env.erl
index 79f852eee0..d80edb4ee0 100644
--- a/lib/orber/src/orber_env.erl
+++ b/lib/orber/src/orber_env.erl
@@ -1,20 +1,20 @@
%%--------------------------------------------------------------------
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -43,8 +43,8 @@
-export([iiop_acl/0, iiop_port/0, nat_iiop_port/0, nat_iiop_port/1, iiop_out_ports/0,
domain/0, ip_address_variable_defined/0, nat_host/0, nat_host/1, host/0,
- ip_address/0, ip_address/1, giop_version/0, iiop_timeout/0,
- iiop_connection_timeout/0, iiop_setup_connection_timeout/0,
+ ip_address/0, ip_address/1, giop_version/0, iiop_timeout/0, iiop_out_ports_random/0,
+ iiop_connection_timeout/0, iiop_setup_connection_timeout/0, iiop_out_ports_attempts/0,
iiop_in_connection_timeout/0, iiop_max_fragments/0, iiop_max_in_requests/0,
iiop_max_in_connections/0, iiop_backlog/0, objectkeys_gc_time/0,
get_ORBInitRef/0, get_ORBDefaultInitRef/0, get_interceptors/0,
@@ -234,6 +234,8 @@ create_main_info() ->
"IIOP out connection timeout...: ~p msec~n"
"IIOP setup connection timeout.: ~p msec~n"
"IIOP out ports................: ~p~n"
+ "IIOP out ports attempts.......: ~p~n"
+ "IIOP out ports random.........: ~p~n"
"IIOP out connections..........: ~p~n"
"IIOP out connections (pending): ~p~n"
"IIOP out keepalive............: ~p~n"
@@ -256,7 +258,8 @@ create_main_info() ->
nat_host(), ip_address_local(),
orber:orber_nodes(), Major, Minor,
iiop_timeout(), iiop_connection_timeout(),
- iiop_setup_connection_timeout(), iiop_out_ports(),
+ iiop_setup_connection_timeout(), iiop_out_ports(),
+ iiop_out_ports_attempts(), iiop_out_ports_random(),
orber:iiop_connections(out), orber:iiop_connections_pending(),
iiop_out_keepalive(), orber:iiop_connections(in),
iiop_in_connection_timeout(), iiop_in_keepalive(),
@@ -389,6 +392,23 @@ iiop_out_ports() ->
0
end.
+iiop_out_ports_random() ->
+ case application:get_env(orber, iiop_out_ports_random) of
+ {ok, true} ->
+ true;
+ _ ->
+ false
+ end.
+
+iiop_out_ports_attempts() ->
+ case application:get_env(orber, iiop_out_ports_attempts) of
+ {ok, No} when is_integer(No) andalso No > 0 ->
+ No;
+ _ ->
+ 1
+ end.
+
+
domain() ->
case application:get_env(orber, domain) of
{ok, Domain} when is_list(Domain) ->
@@ -1251,6 +1271,12 @@ configure(nat_ip_address, {local, Value1, Value2}, Status) when is_list(Value1)
%% Set the range of ports we may use on this machine when connecting to a server.
configure(iiop_out_ports, {Min, Max}, Status) when is_integer(Min) andalso is_integer(Max) ->
do_safe_configure(iiop_out_ports, {Min, Max}, Status);
+configure(iiop_out_ports_attempts, Max, Status) when is_integer(Max) andalso Max > 0 ->
+ do_safe_configure(iiop_out_ports_attempts, Max, Status);
+configure(iiop_out_ports_random, true, Status) ->
+ do_safe_configure(iiop_out_ports_random, true, Status);
+configure(iiop_out_ports_random, false, Status) ->
+ do_safe_configure(iiop_out_ports_random, false, Status);
%% Set the lightweight option.
configure(lightweight, Value, Status) when is_list(Value) ->
do_safe_configure(lightweight, Value, Status);
diff --git a/lib/orber/src/orber_socket.erl b/lib/orber/src/orber_socket.erl
index 2a64bd4e75..af6df01b7d 100644
--- a/lib/orber/src/orber_socket.erl
+++ b/lib/orber/src/orber_socket.erl
@@ -1,20 +1,20 @@
%%--------------------------------------------------------------------
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -82,17 +82,17 @@ connect(Type, Host, Port, Options) ->
end,
case orber:iiop_out_ports() of
{Min, Max} when Type == normal ->
- multi_connect(Min, Max, Type, Host, Port,
- [binary, {reuseaddr, true},
- {packet,cdr}| Options2], Timeout);
+ multi_connect(get_port_sequence(Min, Max), orber_env:iiop_out_ports_attempts(),
+ Type, Host, Port, [binary, {reuseaddr, true},
+ {packet,cdr}| Options2], Timeout);
{Min, Max} when Generation > 2 ->
- multi_connect(Min, Max, Type, Host, Port,
- [binary, {reuseaddr, true},
- {packet,cdr}| Options2], Timeout);
+ multi_connect(get_port_sequence(Min, Max), orber_env:iiop_out_ports_attempts(),
+ Type, Host, Port, [binary, {reuseaddr, true},
+ {packet,cdr}| Options2], Timeout);
{Min, Max} ->
%% reuseaddr not available for older SSL versions
- multi_connect(Min, Max, Type, Host, Port,
- [binary, {packet,cdr}| Options2], Timeout);
+ multi_connect(get_port_sequence(Min, Max), orber_env:iiop_out_ports_attempts(),
+ Type, Host, Port, [binary, {packet,cdr}| Options2], Timeout);
_ ->
connect(Type, Host, Port, [binary, {packet,cdr}| Options2], Timeout)
end.
@@ -130,17 +130,17 @@ connect(ssl, Host, Port, Options, Timeout) ->
corba:raise(#'COMM_FAILURE'{completion_status=?COMPLETED_NO})
end.
-multi_connect(CurrentPort, Max, Type, Host, Port, Options, _) when CurrentPort > Max ->
+multi_connect([], _Retries, Type, Host, Port, Options, _) ->
orber:dbg("[~p] orber_socket:multi_connect(~p, ~p, ~p, ~p);~n"
"Unable to use any of the sockets defined by 'iiop_out_ports'.~n"
"Either all ports are in use or to many connections already exists.",
[?LINE, Type, Host, Port, Options], ?DEBUG_LEVEL),
corba:raise(#'IMP_LIMIT'{minor=(?ORBER_VMCID bor 1), completion_status=?COMPLETED_NO});
-multi_connect(CurrentPort, Max, normal, Host, Port, Options, Timeout) ->
+multi_connect([CurrentPort|Rest], Retries, normal, Host, Port, Options, Timeout) ->
case catch gen_tcp:connect(Host, Port, [{port, CurrentPort}|Options], Timeout) of
{ok, Socket} ->
Socket;
- {error, timeout} ->
+ {error, timeout} when Retries =< 1 ->
orber:dbg("[~p] orber_socket:multi_connect(normal, ~p, ~p, ~p);~n"
"Timeout after ~p msec.",
[?LINE, Host, Port, [{port, CurrentPort}|Options],
@@ -148,13 +148,13 @@ multi_connect(CurrentPort, Max, normal, Host, Port, Options, Timeout) ->
corba:raise(#'COMM_FAILURE'{minor=(?ORBER_VMCID bor 4),
completion_status=?COMPLETED_NO});
_ ->
- multi_connect(CurrentPort+1, Max, normal, Host, Port, Options, Timeout)
+ multi_connect(Rest, Retries - 1, normal, Host, Port, Options, Timeout)
end;
-multi_connect(CurrentPort, Max, ssl, Host, Port, Options, Timeout) ->
+multi_connect([CurrentPort|Rest], Retries, ssl, Host, Port, Options, Timeout) ->
case catch ssl:connect(Host, Port, [{port, CurrentPort}|Options], Timeout) of
{ok, Socket} ->
Socket;
- {error, timeout} ->
+ {error, timeout} when Retries =< 1 ->
orber:dbg("[~p] orber_socket:multi_connect(ssl, ~p, ~p, ~p);~n"
"Timeout after ~p msec.",
[?LINE, Host, Port, [{port, CurrentPort}|Options],
@@ -162,10 +162,28 @@ multi_connect(CurrentPort, Max, ssl, Host, Port, Options, Timeout) ->
corba:raise(#'COMM_FAILURE'{minor=(?ORBER_VMCID bor 4),
completion_status=?COMPLETED_NO});
_ ->
- multi_connect(CurrentPort+1, Max, ssl, Host, Port, Options, Timeout)
+ multi_connect(Rest, Retries - 1, ssl, Host, Port, Options, Timeout)
end.
+get_port_sequence(Min, Max) ->
+ case orber_env:iiop_out_ports_random() of
+ true ->
+ {A1,A2,A3} = now(),
+ random:seed(A1, A2, A3),
+ Seq = lists:seq(Min, Max),
+ random_sequence((Max - Min) + 1, Seq, []);
+ _ ->
+ lists:seq(Min, Max)
+ end.
+
+random_sequence(0, _, Acc) ->
+ Acc;
+random_sequence(Length, Seq, Acc) ->
+ Nth = random:uniform(Length),
+ Value = lists:nth(Nth, Seq),
+ NewSeq = lists:delete(Value, Seq),
+ random_sequence(Length-1, NewSeq, [Value|Acc]).
%%-----------------------------------------------------------------
%% Create a listen socket at Port in CDR mode for
diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk
index b56172d7cf..d074bfb86c 100644
--- a/lib/orber/vsn.mk
+++ b/lib/orber/vsn.mk
@@ -4,7 +4,8 @@ ORBER_VSN = 3.6.15
TICKETS = OTP-8353 \
OTP-8354 \
OTP-8374 \
- OTP-8409
+ OTP-8409 \
+ OTP-8448
TICKETS_3.6.14 = OTP-8201
diff --git a/lib/reltool/doc/src/notes.xml b/lib/reltool/doc/src/notes.xml
index 293793e900..524d728901 100644
--- a/lib/reltool/doc/src/notes.xml
+++ b/lib/reltool/doc/src/notes.xml
@@ -38,6 +38,21 @@
section is the version number of Reltool.</p>
+ <section><title>Reltool 0.5.3</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Removed spurious documentation files.</p>
+ <p>
+ Own Id: OTP-8057</p>
+ </item>
+ </list>
+ </section>
+
+ </section>
+
<section><title>Reltool 0.5.2</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/reltool/vsn.mk b/lib/reltool/vsn.mk
index d5ca40619c..b0561a6110 100644
--- a/lib/reltool/vsn.mk
+++ b/lib/reltool/vsn.mk
@@ -1,24 +1,25 @@
# This is an -*-makefile-*- file.
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2009. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
-#
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
+#
# %CopyrightEnd%
-RELTOOL_VSN = 0.5.2
+RELTOOL_VSN = 0.5.3
-TICKETS = OTP-8254
+TICKETS = OTP-8057
+TICKETS_0_5_2 = OTP-8254
TICKETS_0_5_1 = OTP-8199
TICKETS_0_5 = OTP-7949
TICKETS_0_2_2 = OTP-7999
diff --git a/lib/sasl/doc/src/rb.xml b/lib/sasl/doc/src/rb.xml
index bb205c0554..f35ceb5777 100644
--- a/lib/sasl/doc/src/rb.xml
+++ b/lib/sasl/doc/src/rb.xml
@@ -4,23 +4,21 @@
<erlref>
<header>
<copyright>
- <year>1996</year>
- <year>2007</year>
- <holder>Ericsson AB, All Rights Reserved</holder>
+ <year>1996</year><year>2010</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
- The Initial Developer of the Original Code is Ericsson AB.
</legalnotice>
<title>rb</title>
diff --git a/lib/sasl/src/rb.erl b/lib/sasl/src/rb.erl
index 3299921cc9..332a99c6f9 100644
--- a/lib/sasl/src/rb.erl
+++ b/lib/sasl/src/rb.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
-module(rb).
diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl
index b2562c6169..05c42c24f0 100644
--- a/lib/stdlib/src/escript.erl
+++ b/lib/stdlib/src/escript.erl
@@ -63,7 +63,7 @@ script_name() ->
%% string()).
foldl(Fun, Acc0, File) when is_function(Fun, 4) ->
case parse_file(File, false) of
- {text, _, Forms, _Mode} when is_list(Forms) ->
+ {text, _, Forms, _HasRecs, _Mode} when is_list(Forms) ->
GetInfo = fun() -> file:read_file_info(File) end,
GetBin =
fun() ->
diff --git a/lib/tools/emacs/erlang-skels-old.el b/lib/tools/emacs/erlang-skels-old.el
new file mode 100644
index 0000000000..662590a1f3
--- /dev/null
+++ b/lib/tools/emacs/erlang-skels-old.el
@@ -0,0 +1,1267 @@
+;;
+;; %CopyrightBegin%
+;;
+;; Copyright Ericsson AB 2010. All Rights Reserved.
+;;
+;; The contents of this file are subject to the Erlang Public License,
+;; Version 1.1, (the "License"); you may not use this file except in
+;; compliance with the License. You should have received a copy of the
+;; Erlang Public License along with this software. If not, it can be
+;; retrieved online at http://www.erlang.org/.
+;;
+;; Software distributed under the License is distributed on an "AS IS"
+;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+;; the License for the specific language governing rights and limitations
+;; under the License.
+;;
+;; %CopyrightEnd%
+;;;
+;;; Purpose: Provide Erlang code skeletons.
+;;; See 'erlang-skel-file' variable.
+
+(defvar erlang-tempo-tags nil
+ "Tempo tags for erlang mode")
+
+(defvar erlang-skel
+ '(("If" "if" erlang-skel-if)
+ ("Case" "case" erlang-skel-case)
+ ("Receive" "receive" erlang-skel-receive)
+ ("Receive After" "after" erlang-skel-receive-after)
+ ("Receive Loop" "loop" erlang-skel-receive-loop)
+ ("Module" "module" erlang-skel-module)
+ ("Author" "author" erlang-skel-author)
+ ()
+ ("Small Header" "small-header"
+ erlang-skel-small-header erlang-skel-header)
+ ("Normal Header" "normal-header"
+ erlang-skel-normal-header erlang-skel-header)
+ ("Large Header" "large-header"
+ erlang-skel-large-header erlang-skel-header)
+ ()
+ ("Small Server" "small-server"
+ erlang-skel-small-server erlang-skel-header)
+ ()
+ ("Application" "application"
+ erlang-skel-application erlang-skel-header)
+ ("Supervisor" "supervisor"
+ erlang-skel-supervisor erlang-skel-header)
+ ("supervisor_bridge" "supervisor-bridge"
+ erlang-skel-supervisor-bridge erlang-skel-header)
+ ("gen_server" "generic-server"
+ erlang-skel-generic-server erlang-skel-header)
+ ("gen_event" "gen-event"
+ erlang-skel-gen-event erlang-skel-header)
+ ("gen_fsm" "gen-fsm"
+ erlang-skel-gen-fsm erlang-skel-header)
+ ("Library module" "gen-lib"
+ erlang-skel-lib erlang-skel-header)
+ ("Corba callback" "gen-corba-cb"
+ erlang-skel-corba-callback erlang-skel-header)
+ ("Small Common Test suite" "ct-test-suite-s"
+ erlang-skel-ct-test-suite-s erlang-skel-header)
+ ("Large Common Test suite" "ct-test-suite-l"
+ erlang-skel-ct-test-suite-l erlang-skel-header)
+ ("Erlang TS test suite" "ts-test-suite"
+ erlang-skel-ts-test-suite erlang-skel-header)
+ )
+ "*Description of all skeleton templates.
+Both functions and menu entries will be created.
+
+Each entry in `erlang-skel' should be a list with three or four
+elements, or the empty list.
+
+The first element is the name which shows up in the menu. The second
+is the `tempo' identifier (The string \"erlang-\" will be added in
+front of it). The third is the skeleton descriptor, a variable
+containing `tempo' attributes as described in the function
+`tempo-define-template'. The optional fourth elements denotes a
+function which should be called when the menu is selected.
+
+Functions corresponding to every template will be created. The name
+of the function will be `tempo-template-erlang-X' where `X' is the
+tempo identifier as specified in the second argument of the elements
+in this list.
+
+A list with zero elements means that the a horizontal line should
+be placed in the menu.")
+
+;; In XEmacs `user-mail-address' returns "[email protected] (Foo Bar)" ARGH!
+;; What's wrong with that? RFC 822 says it's legal. [sverkerw]
+;; This needs to use the customized value. If that's not sane, things like
+;; add-log will lose anyhow. Avoid it if there _is_ a paren.
+(defvar erlang-skel-mail-address
+ (if (or (not user-mail-address) (string-match "(" user-mail-address))
+ (concat (user-login-name) "@"
+ (or (and (boundp 'mail-host-address)
+ mail-host-address)
+ (system-name)))
+ user-mail-address)
+ "Mail address of the user.")
+
+;; Expression templates:
+(defvar erlang-skel-case
+ '((erlang-skel-skip-blank) o >
+ "case " p " of" n> p "_ ->" n> p "ok" n> "end" p)
+ "*The skeleton of a `case' expression.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-if
+ '((erlang-skel-skip-blank) o >
+ "if" n> p " ->" n> p "ok" n> "end" p)
+ "The skeleton of an `if' expression.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-receive
+ '((erlang-skel-skip-blank) o >
+ "receive" n> p "_ ->" n> p "ok" n> "end" p)
+ "*The skeleton of a `receive' expression.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-receive-after
+ '((erlang-skel-skip-blank) o >
+ "receive" n> p "_ ->" n> p "ok" n> "after " p "T ->" n>
+ p "ok" n> "end" p)
+ "*The skeleton of a `receive' expression with an `after' clause.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-receive-loop
+ '(& o "loop(" p ") ->" n> "receive" n> p "_ ->" n>
+ "loop(" p ")" n> "end.")
+ "*The skeleton of a simple `receive' loop.
+Please see the function `tempo-define-template'.")
+
+
+;; Attribute templates
+
+(defvar erlang-skel-module
+ '(& "-module("
+ (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
+ ")." n)
+ "*The skeleton of a `module' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-author
+ '(& "-author('" erlang-skel-mail-address "')." n)
+ "*The skeleton of a `author' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-vc nil
+ "*The skeleton template to generate a version control attribute.
+The default is to insert nothing. Example of usage:
+
+ (setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n)
+
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-export
+ '(& "-export([" n> "])." n)
+ "*The skeleton of an `export' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-import
+ '(& "%%-import(Module, [Function/Arity, ...])." n)
+ "*The skeleton of an `import' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-compile nil
+ ;; '(& "%%-compile(export_all)." n)
+ "*The skeleton of a `compile' attribute.
+Please see the function `tempo-define-template'.")
+
+
+;; Comment templates.
+
+(defvar erlang-skel-date-function 'erlang-skel-dd-mmm-yyyy
+ "*Function which returns date string.
+Look in the module `time-stamp' for a battery of functions.")
+
+(defvar erlang-skel-copyright-comment '()
+ "*The template for a copyright line in the header, normally empty.
+This variable should be bound to a `tempo' template, for example:
+ '(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n)
+
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-created-comment
+ '(& "%%% Created : " (funcall erlang-skel-date-function) " by "
+ (user-full-name) " <" erlang-skel-mail-address ">" n)
+ "*The template for the \"Created:\" comment line.")
+
+(defvar erlang-skel-author-comment
+ '(& "%%% Author : " (user-full-name) " <" erlang-skel-mail-address ">" n)
+ "*The template for creating the \"Author:\" line in the header.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-file-comment
+ '(& "%%% File : " (file-name-nondirectory buffer-file-name) n)
+"*The template for creating the \"Module:\" line in the header.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-small-header
+ '(o (erlang-skel-include erlang-skel-module)
+ ;; erlang-skel-author)
+ n
+ (erlang-skel-include erlang-skel-compile
+ ;; erlang-skel-export
+ erlang-skel-vc))
+ "*The template of a small header without any comments.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-normal-header
+ '(o (erlang-skel-include erlang-skel-copyright-comment
+ erlang-skel-file-comment
+ erlang-skel-author-comment)
+ "%%% Description : " p n
+ (erlang-skel-include erlang-skel-created-comment) n
+ (erlang-skel-include erlang-skel-small-header) n)
+ "*The template of a normal header.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-large-header
+ '(o (erlang-skel-separator)
+ (erlang-skel-include erlang-skel-copyright-comment
+ erlang-skel-file-comment
+ erlang-skel-author-comment)
+ "%%% Description : " p n
+ "%%%" n
+ (erlang-skel-include erlang-skel-created-comment)
+ (erlang-skel-separator)
+ (erlang-skel-include erlang-skel-small-header) )
+ "*The template of a large header.
+Please see the function `tempo-define-template'.")
+
+
+;; Server templates.
+
+(defvar erlang-skel-small-server
+ '((erlang-skel-include erlang-skel-large-header)
+ "-export([start/0,init/1])." n n n
+ "start() ->" n> "spawn(" (erlang-get-module-from-file-name)
+ ", init, [self()])." n n
+ "init(From) ->" n>
+ "loop(From)." n n
+ "loop(From) ->" n>
+ "receive" n>
+ p "_ ->" n>
+ "loop(From)" n>
+ "end."
+ )
+ "*Template of a small server.
+Please see the function `tempo-define-template'.")
+
+;; Behaviour templates.
+
+(defvar erlang-skel-application
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(application)." n n
+ "%% Application callbacks" n
+ "-export([start/2, stop/1])." n n
+ (erlang-skel-double-separator 2)
+ "%% Application callbacks" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: start(Type, StartArgs) -> {ok, Pid} |" n
+ "%% {ok, Pid, State} |" n
+ "%% {error, Reason}" n
+ "%% Description: This function is called whenever an application " n
+ "%% is started using application:start/1,2, and should start the processes" n
+ "%% of the application. If the application is structured according to the" n
+ "%% OTP design principles as a supervision tree, this means starting the" n
+ "%% top supervisor of the tree." n
+ (erlang-skel-separator 2)
+ "start(_Type, StartArgs) ->" n>
+ "case 'TopSupervisor':start_link(StartArgs) of" n>
+ "{ok, Pid} -> " n>
+ "{ok, Pid};" n>
+ "Error ->" n>
+ "Error" n>
+ "end." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: stop(State) -> void()" n
+ "%% Description: This function is called whenever an application" n
+ "%% has stopped. It is intended to be the opposite of Module:start/2 and" n
+ "%% should do any necessary cleaning up. The return value is ignored. "n
+ (erlang-skel-separator 2)
+ "stop(_State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% Internal functions" n
+ (erlang-skel-double-separator 2)
+ )
+ "*The template of an application behaviour.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-supervisor
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(supervisor)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% Supervisor callbacks" n
+ "-export([init/1])." n n
+
+ "-define(SERVER, ?MODULE)." n n
+
+ (erlang-skel-double-separator 2)
+ "%% API functions" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
+ "%% Description: Starts the supervisor" n
+ (erlang-skel-separator 2)
+ "start_link() ->" n>
+ "supervisor:start_link({local, ?SERVER}, ?MODULE, [])." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% Supervisor callbacks" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Func: init(Args) -> {ok, {SupFlags, [ChildSpec]}} |" n
+ "%% ignore |" n
+ "%% {error, Reason}" n
+ "%% Description: Whenever a supervisor is started using "n
+ "%% supervisor:start_link/[2,3], this function is called by the new process "n
+ "%% to find out about restart strategy, maximum restart frequency and child "n
+ "%% specifications." n
+ (erlang-skel-separator 2)
+ "init([]) ->" n>
+ "AChild = {'AName',{'AModule',start_link,[]}," n>
+ "permanent,2000,worker,['AModule']}," n>
+ "{ok,{{one_for_all,0,1}, [AChild]}}." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% Internal functions" n
+ (erlang-skel-double-separator 2)
+ )
+ "*The template of an supervisor behaviour.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-supervisor-bridge
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(supervisor_bridge)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% supervisor_bridge callbacks" n
+ "-export([init/1, terminate/2])." n n
+
+ "-define(SERVER, ?MODULE)." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator 2)
+ "%% API" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
+ "%% Description: Starts the supervisor bridge" n
+ (erlang-skel-separator 2)
+ "start_link() ->" n>
+ "supervisor_bridge:start_link({local, ?SERVER}, ?MODULE, [])." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% supervisor_bridge callbacks" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Funcion: init(Args) -> {ok, Pid, State} |" n
+ "%% ignore |" n
+ "%% {error, Reason} " n
+ "%% Description:Creates a supervisor_bridge process, linked to the calling" n
+ "%% process, which calls Module:init/1 to start the subsystem. To ensure a" n
+ "%% synchronized start-up procedure, this function does not return until" n
+ "%% Module:init/1 has returned. " n
+ (erlang-skel-separator 2)
+ "init([]) ->" n>
+ "case 'AModule':start_link() of" n>
+ "{ok, Pid} ->" n>
+ "{ok, Pid, #state{}};" n>
+ "Error ->" n>
+ "Error" n>
+ "end." n
+ n
+ (erlang-skel-separator 2)
+ "%% Func: terminate(Reason, State) -> void()" n
+ "%% Description:This function is called by the supervisor_bridge when it is"n
+ "%% about to terminate. It should be the opposite of Module:init/1 and stop"n
+ "%% the subsystem and do any necessary cleaning up.The return value is ignored."
+ (erlang-skel-separator 2)
+ "terminate(Reason, State) ->" n>
+ "'AModule':stop()," n>
+ "ok." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% Internal functions" n
+ (erlang-skel-double-separator 2)
+ )
+ "*The template of an supervisor_bridge behaviour.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-generic-server
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(gen_server)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% gen_server callbacks" n
+ "-export([init/1, handle_call/3, handle_cast/2, "
+ "handle_info/2," n>
+ "terminate/2, code_change/3])." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator 2)
+ "%% API" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
+ "%% Description: Starts the server" n
+ (erlang-skel-separator 2)
+ "start_link() ->" n>
+ "gen_server:start_link({local, ?SERVER}, ?MODULE, [], [])." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% gen_server callbacks" n
+ (erlang-skel-double-separator 2)
+ n
+ (erlang-skel-separator 2)
+ "%% Function: init(Args) -> {ok, State} |" n
+ "%% {ok, State, Timeout} |" n
+ "%% ignore |" n
+ "%% {stop, Reason}" n
+ "%% Description: Initiates the server" n
+ (erlang-skel-separator 2)
+ "init([]) ->" n>
+ "{ok, #state{}}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: "
+ "%% handle_call(Request, From, State) -> {reply, Reply, State} |" n
+ "%% {reply, Reply, State, Timeout} |" n
+ "%% {noreply, State} |" n
+ "%% {noreply, State, Timeout} |" n
+ "%% {stop, Reason, Reply, State} |" n
+ "%% {stop, Reason, State}" n
+ "%% Description: Handling call messages" n
+ (erlang-skel-separator 2)
+ "handle_call(_Request, _From, State) ->" n>
+ "Reply = ok," n>
+ "{reply, Reply, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: handle_cast(Msg, State) -> {noreply, State} |" n
+ "%% {noreply, State, Timeout} |" n
+ "%% {stop, Reason, State}" n
+ "%% Description: Handling cast messages" n
+
+ (erlang-skel-separator 2)
+ "handle_cast(_Msg, State) ->" n>
+ "{noreply, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: handle_info(Info, State) -> {noreply, State} |" n
+ "%% {noreply, State, Timeout} |" n
+ "%% {stop, Reason, State}" n
+ "%% Description: Handling all non call/cast messages" n
+ (erlang-skel-separator 2)
+ "handle_info(_Info, State) ->" n>
+ "{noreply, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: terminate(Reason, State) -> void()" n
+ "%% Description: This function is called by a gen_server when it is about to"n
+ "%% terminate. It should be the opposite of Module:init/1 and do any necessary"n
+ "%% cleaning up. When it returns, the gen_server terminates with Reason." n
+ "%% The return value is ignored." n
+
+ (erlang-skel-separator 2)
+ "terminate(_Reason, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator 2)
+ "%% Func: code_change(OldVsn, State, Extra) -> {ok, NewState}" n
+ "%% Description: Convert process state when code is changed" n
+ (erlang-skel-separator 2)
+ "code_change(_OldVsn, State, _Extra) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%%% Internal functions" n
+ (erlang-skel-separator 2)
+ )
+ "*The template of a generic server.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-gen-event
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(gen_event)." n
+
+ "%% API" n
+ "-export([start_link/0, add_handler/0])." n n
+
+ "%% gen_event callbacks" n
+ "-export([init/1, handle_event/2, handle_call/2, " n>
+ "handle_info/2, terminate/2, code_change/3])." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator 2)
+ "%% gen_event callbacks" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: start_link() -> {ok,Pid} | {error,Error} " n
+ "%% Description: Creates an event manager." n
+ (erlang-skel-separator 2)
+ "start_link() ->" n>
+ "gen_event:start_link({local, ?SERVER}). " n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: add_handler() -> ok | {'EXIT',Reason} | term()" n
+ "%% Description: Adds an event handler" n
+ (erlang-skel-separator 2)
+ "add_handler() ->" n>
+ "gen_event:add_handler(?SERVER, ?MODULE, [])." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% gen_event callbacks" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: init(Args) -> {ok, State}" n
+ "%% Description: Whenever a new event handler is added to an event manager,"n
+ "%% this function is called to initialize the event handler." n
+ (erlang-skel-separator 2)
+ "init([]) ->" n>
+ "{ok, #state{}}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: "n
+ "%% handle_event(Event, State) -> {ok, State} |" n
+ "%% {swap_handler, Args1, State1, Mod2, Args2} |"n
+ "%% remove_handler" n
+ "%% Description:Whenever an event manager receives an event sent using"n
+ "%% gen_event:notify/2 or gen_event:sync_notify/2, this function is called for"n
+ "%% each installed event handler to handle the event. "n
+ (erlang-skel-separator 2)
+ "handle_event(_Event, State) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: " n
+ "%% handle_call(Request, State) -> {ok, Reply, State} |" n
+ "%% {swap_handler, Reply, Args1, State1, "n
+ "%% Mod2, Args2} |" n
+ "%% {remove_handler, Reply}" n
+ "%% Description: Whenever an event manager receives a request sent using"n
+ "%% gen_event:call/3,4, this function is called for the specified event "n
+ "%% handler to handle the request."n
+ (erlang-skel-separator 2)
+ "handle_call(_Request, State) ->" n>
+ "Reply = ok," n>
+ "{ok, Reply, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: " n
+ "%% handle_info(Info, State) -> {ok, State} |" n
+ "%% {swap_handler, Args1, State1, Mod2, Args2} |" n
+ "%% remove_handler" n
+ "%% Description: This function is called for each installed event handler when"n
+ "%% an event manager receives any other message than an event or a synchronous"n
+ "%% request (or a system message)."n
+ (erlang-skel-separator 2)
+ "handle_info(_Info, State) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: terminate(Reason, State) -> void()" n
+ "%% Description:Whenever an event handler is deleted from an event manager,"n
+ "%% this function is called. It should be the opposite of Module:init/1 and "n
+ "%% do any necessary cleaning up. " n
+ (erlang-skel-separator 2)
+ "terminate(_Reason, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: code_change(OldVsn, State, Extra) -> {ok, NewState} " n
+ "%% Description: Convert process state when code is changed" n
+ (erlang-skel-separator 2)
+ "code_change(_OldVsn, State, _Extra) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%%% Internal functions" n
+ (erlang-skel-separator 2)
+ )
+ "*The template of a gen_event.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-gen-fsm
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(gen_fsm)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% gen_fsm callbacks" n
+ "-export([init/1, state_name/2, state_name/3, handle_event/3," n>
+ "handle_sync_event/4, handle_info/3, terminate/3, code_change/4])." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator 2)
+ "%% API" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: start_link() -> ok,Pid} | ignore | {error,Error}" n
+ "%% Description:Creates a gen_fsm process which calls Module:init/1 to"n
+ "%% initialize. To ensure a synchronized start-up procedure, this function" n
+ "%% does not return until Module:init/1 has returned. " n
+ (erlang-skel-separator 2)
+ "start_link() ->" n>
+ "gen_fsm:start_link({local, ?SERVER}, ?MODULE, [], [])." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% gen_fsm callbacks" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: init(Args) -> {ok, StateName, State} |" n
+ "%% {ok, StateName, State, Timeout} |" n
+ "%% ignore |" n
+ "%% {stop, StopReason} " n
+ "%% Description:Whenever a gen_fsm is started using gen_fsm:start/[3,4] or"n
+ "%% gen_fsm:start_link/3,4, this function is called by the new process to "n
+ "%% initialize. " n
+ (erlang-skel-separator 2)
+ "init([]) ->" n>
+ "{ok, state_name, #state{}}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: "n
+ "%% state_name(Event, State) -> {next_state, NextStateName, NextState}|" n
+ "%% {next_state, NextStateName, " n
+ "%% NextState, Timeout} |" n
+ "%% {stop, Reason, NewState}" n
+ "%% Description:There should be one instance of this function for each possible"n
+ "%% state name. Whenever a gen_fsm receives an event sent using" n
+ "%% gen_fsm:send_event/2, the instance of this function with the same name as"n
+ "%% the current state name StateName is called to handle the event. It is also "n
+ "%% called if a timeout occurs. " n
+ (erlang-skel-separator 2)
+ "state_name(_Event, State) ->" n>
+ "{next_state, state_name, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function:" n
+ "%% state_name(Event, From, State) -> {next_state, NextStateName, NextState} |"n
+ "%% {next_state, NextStateName, " n
+ "%% NextState, Timeout} |" n
+ "%% {reply, Reply, NextStateName, NextState}|"n
+ "%% {reply, Reply, NextStateName, " n
+ "%% NextState, Timeout} |" n
+ "%% {stop, Reason, NewState}|" n
+ "%% {stop, Reason, Reply, NewState}" n
+ "%% Description: There should be one instance of this function for each" n
+ "%% possible state name. Whenever a gen_fsm receives an event sent using" n
+ "%% gen_fsm:sync_send_event/2,3, the instance of this function with the same"n
+ "%% name as the current state name StateName is called to handle the event." n
+ (erlang-skel-separator 2)
+ "state_name(_Event, _From, State) ->" n>
+ "Reply = ok," n>
+ "{reply, Reply, state_name, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: " n
+ "%% handle_event(Event, StateName, State) -> {next_state, NextStateName, "n
+ "%% NextState} |" n
+ "%% {next_state, NextStateName, "n
+ "%% NextState, Timeout} |" n
+ "%% {stop, Reason, NewState}" n
+ "%% Description: Whenever a gen_fsm receives an event sent using"n
+ "%% gen_fsm:send_all_state_event/2, this function is called to handle"n
+ "%% the event." n
+ (erlang-skel-separator 2)
+ "handle_event(_Event, StateName, State) ->" n>
+ "{next_state, StateName, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: " n
+ "%% handle_sync_event(Event, From, StateName, "n
+ "%% State) -> {next_state, NextStateName, NextState} |" n
+ "%% {next_state, NextStateName, NextState, " n
+ "%% Timeout} |" n
+ "%% {reply, Reply, NextStateName, NextState}|" n
+ "%% {reply, Reply, NextStateName, NextState, " n
+ "%% Timeout} |" n
+ "%% {stop, Reason, NewState} |" n
+ "%% {stop, Reason, Reply, NewState}" n
+ "%% Description: Whenever a gen_fsm receives an event sent using"n
+ "%% gen_fsm:sync_send_all_state_event/2,3, this function is called to handle"n
+ "%% the event."n
+ (erlang-skel-separator 2)
+ "handle_sync_event(Event, From, StateName, State) ->" n>
+ "Reply = ok," n>
+ "{reply, Reply, StateName, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: " n
+ "%% handle_info(Info,StateName,State)-> {next_state, NextStateName, NextState}|" n
+ "%% {next_state, NextStateName, NextState, "n
+ "%% Timeout} |" n
+ "%% {stop, Reason, NewState}" n
+ "%% Description: This function is called by a gen_fsm when it receives any"n
+ "%% other message than a synchronous or asynchronous event"n
+ "%% (or a system message)." n
+ (erlang-skel-separator 2)
+ "handle_info(_Info, StateName, State) ->" n>
+ "{next_state, StateName, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: terminate(Reason, StateName, State) -> void()" n
+ "%% Description:This function is called by a gen_fsm when it is about"n
+ "%% to terminate. It should be the opposite of Module:init/1 and do any"n
+ "%% necessary cleaning up. When it returns, the gen_fsm terminates with"n
+ "%% Reason. The return value is ignored." n
+ (erlang-skel-separator 2)
+ "terminate(_Reason, _StateName, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function:" n
+ "%% code_change(OldVsn, StateName, State, Extra) -> {ok, StateName, NewState}" n
+ "%% Description: Convert process state when code is changed" n
+ (erlang-skel-separator 2)
+ "code_change(_OldVsn, StateName, State, _Extra) ->" n>
+ "{ok, StateName, State}." n
+ n
+ (erlang-skel-separator 2)
+ "%%% Internal functions" n
+ (erlang-skel-separator 2)
+ )
+ "*The template of a gen_fsm.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-lib
+ '((erlang-skel-include erlang-skel-large-header)
+
+ "%% API" n
+ "-export([])." n n
+
+ (erlang-skel-double-separator 2)
+ "%% API" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: " n
+ "%% Description:" n
+ (erlang-skel-separator 2)
+ n
+ (erlang-skel-double-separator 2)
+ "%% Internal functions" n
+ (erlang-skel-double-separator 2)
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-corba-callback
+ '((erlang-skel-include erlang-skel-large-header)
+ "%% Include files" n n
+
+ "%% API" n
+ "-export([])." n n
+
+ "%% Corba callbacks" n
+ "-export([init/1, terminate/2, code_change/3])." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator 2)
+ "%% Corba callbacks" n
+ (erlang-skel-double-separator 2)
+ (erlang-skel-separator 2)
+ "%% Function: init(Args) -> {ok, State} |" n
+ "%% {ok, State, Timeout} |" n
+ "%% ignore |" n
+ "%% {stop, Reason}" n
+ "%% Description: Initiates the server" n
+ (erlang-skel-separator 2)
+ "init([]) ->" n>
+ "{ok, #state{}}." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: terminate(Reason, State) -> void()" n
+ "%% Description: Shutdown the server" n
+ (erlang-skel-separator 2)
+ "terminate(_Reason, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator 2)
+ "%% Function: code_change(OldVsn, State, Extra) -> {ok, NewState} " n
+ "%% Description: Convert process state when code is changed" n
+ (erlang-skel-separator 2)
+ "code_change(_OldVsn, State, _Extra) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-double-separator 2)
+ "%% Internal functions" n
+ (erlang-skel-double-separator 2)
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-ts-test-suite
+ '((erlang-skel-include erlang-skel-large-header)
+ "%% Note: This directive should only be used in test suites." n
+ "-compile(export_all)." n n
+
+ "-include(\"test_server.hrl\")." n n
+
+ (erlang-skel-separator 2)
+ "%% TEST SERVER CALLBACK FUNCTIONS" n
+ (erlang-skel-separator 2)
+ n
+ (erlang-skel-separator 2)
+ "%% Function: init_per_suite(Config0) -> Config1 | {skip,Reason}" n
+ "%%" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%% Reason = term()" n
+ "%% The reason for skipping the suite." n
+ "%%" n
+ "%% Description: Initialization before the suite." n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ (erlang-skel-separator 2)
+ "init_per_suite(Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_suite(Config) -> void()" n
+ "%%" n
+ "%% Config = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Description: Cleanup after the suite." n
+ (erlang-skel-separator 2)
+ "end_per_suite(_Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: init_per_testcase(TestCase, Config0) -> Config1 |" n
+ "%% {skip,Reason}" n
+ "%% TestCase = atom()" n
+ "%% Name of the test case that is about to run." n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%% Reason = term()" n
+ "%% The reason for skipping the test case." n
+ "%%" n
+ "%% Description: Initialization before each test case." n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ (erlang-skel-separator 2)
+ "init_per_testcase(_TestCase, Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_testcase(TestCase, Config) -> void()" n
+ "%%" n
+ "%% TestCase = atom()" n
+ "%% Name of the test case that is finished." n
+ "%% Config = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Description: Cleanup after each test case." n
+ (erlang-skel-separator 2)
+ "end_per_testcase(_TestCase, _Config) ->" n >
+ "ok."n n
+
+ (erlang-skel-separator 2)
+ "%% Function: all(Clause) -> Descr | Spec | {skip,Reason}" n
+ "%%" n
+ "%% Clause = doc | suite" n
+ "%% Indicates expected return value." n
+ "%% Descr = [string()] | []" n
+ "%% String that describes the test suite." n
+ "%% Spec = [TestCase]" n
+ "%% A test specification." n
+ "%% TestCase = ConfCase | atom()" n
+ "%% Configuration case, or the name of a test case function." n
+ "%% ConfCase = {conf,Init,Spec,End} |" n
+ "%% {conf,Properties,Init,Spec,End}" n
+ "%% Init = End = {Mod,Func} | Func" n
+ "%% Initialization and cleanup function." n
+ "%% Mod = Func = atom()" n
+ "%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
+ "%% Execution properties of the test cases (may be combined)." n
+ "%% Shuffle = shuffle | {shuffle,Seed}" n
+ "%% To get cases executed in random order." n
+ "%% Seed = {integer(),integer(),integer()}" n
+ "%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
+ "%% repeat_until_any_ok | repeat_until_any_fail" n
+ "%% To get execution of cases repeated." n
+ "%% N = integer() | forever" n
+ "%% Reason = term()" n
+ "%% The reason for skipping the test suite." n
+ "%%" n
+ "%% Description: Returns a description of the test suite when" n
+ "%% Clause == doc, and a test specification (list" n
+ "%% of the conf and test cases in the suite) when" n
+ "%% Clause == suite." n
+ (erlang-skel-separator 2)
+ "all(doc) -> " n >
+ "[\"Describe the main purpose of this suite\"];" n n
+ "all(suite) -> " n >
+ "[a_test_case]." n n
+ n
+ (erlang-skel-separator 2)
+ "%% TEST CASES" n
+ (erlang-skel-separator 2)
+ n
+ (erlang-skel-separator 2)
+ "%% Function: TestCase(Arg) -> Descr | Spec | ok | exit() | {skip,Reason}" n
+ "%%" n
+ "%% Arg = doc | suite | Config" n
+ "%% Indicates expected behaviour and return value." n
+ "%% Config = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%% Descr = [string()] | []" n
+ "%% String that describes the test case." n
+ "%% Spec = [tuple()] | []" n
+ "%% A test specification, see all/1." n
+ "%% Reason = term()" n
+ "%% The reason for skipping the test case." n
+ "%%" n
+ "%% Description: Test case function. Returns a description of the test" n
+ "%% case (doc), then returns a test specification (suite)," n
+ "%% or performs the actual test (Config)." n
+ (erlang-skel-separator 2)
+ "a_test_case(doc) -> " n >
+ "[\"Describe the main purpose of this test case\"];" n n
+ "a_test_case(suite) -> " n >
+ "[];" n n
+ "a_test_case(Config) when is_list(Config) -> " n >
+ "ok." n
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-ct-test-suite-l
+ '((erlang-skel-include erlang-skel-large-header)
+ "%% Note: This directive should only be used in test suites." n
+ "-compile(export_all)." n n
+
+ "-include(\"ct.hrl\")." n n
+
+ (erlang-skel-separator 2)
+ "%% COMMON TEST CALLBACK FUNCTIONS" n
+ (erlang-skel-separator 2)
+ n
+ (erlang-skel-separator 2)
+ "%% Function: suite() -> Info" n
+ "%%" n
+ "%% Info = [tuple()]" n
+ "%% List of key/value pairs." n
+ "%%" n
+ "%% Description: Returns list of tuples to set default properties" n
+ "%% for the suite." n
+ "%%" n
+ "%% Note: The suite/0 function is only meant to be used to return" n
+ "%% default data values, not perform any other operations." n
+ (erlang-skel-separator 2)
+ "suite() ->" n >
+ "[{timetrap,{minutes,10}}]." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: init_per_suite(Config0) ->" n
+ "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
+ "%%" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%% Reason = term()" n
+ "%% The reason for skipping the suite." n
+ "%%" n
+ "%% Description: Initialization before the suite." n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ (erlang-skel-separator 2)
+ "init_per_suite(Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}" n
+ "%%" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Description: Cleanup after the suite." n
+ (erlang-skel-separator 2)
+ "end_per_suite(_Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: init_per_group(GroupName, Config0) ->" n
+ "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
+ "%%" n
+ "%% GroupName = atom()" n
+ "%% Name of the test case group that is about to run." n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding configuration data for the group." n
+ "%% Reason = term()" n
+ "%% The reason for skipping all test cases and subgroups in the group." n
+ "%%" n
+ "%% Description: Initialization before each test case group." n
+ (erlang-skel-separator 2)
+ "init_per_group(_GroupName, Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_group(GroupName, Config0) ->" n
+ "%% void() | {save_config,Config1}" n
+ "%%" n
+ "%% GroupName = atom()" n
+ "%% Name of the test case group that is finished." n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding configuration data for the group." n
+ "%%" n
+ "%% Description: Cleanup after each test case group." n
+ (erlang-skel-separator 2)
+ "end_per_group(_GroupName, _Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: init_per_testcase(TestCase, Config0) ->" n
+ "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
+ "%%" n
+ "%% TestCase = atom()" n
+ "%% Name of the test case that is about to run." n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%% Reason = term()" n
+ "%% The reason for skipping the test case." n
+ "%%" n
+ "%% Description: Initialization before each test case." n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ (erlang-skel-separator 2)
+ "init_per_testcase(_TestCase, Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_testcase(TestCase, Config0) ->" n
+ "%% void() | {save_config,Config1} | {fail,Reason}" n
+ "%%" n
+ "%% TestCase = atom()" n
+ "%% Name of the test case that is finished." n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%% Reason = term()" n
+ "%% The reason for failing the test case." n
+ "%%" n
+ "%% Description: Cleanup after each test case." n
+ (erlang-skel-separator 2)
+ "end_per_testcase(_TestCase, _Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: groups() -> [Group]" n
+ "%%" n
+ "%% Group = {GroupName,Properties,GroupsAndTestCases}" n
+ "%% GroupName = atom()" n
+ "%% The name of the group." n
+ "%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
+ "%% Group properties that may be combined." n
+ "%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]" n
+ "%% TestCase = atom()" n
+ "%% The name of a test case." n
+ "%% Shuffle = shuffle | {shuffle,Seed}" n
+ "%% To get cases executed in random order." n
+ "%% Seed = {integer(),integer(),integer()}" n
+ "%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
+ "%% repeat_until_any_ok | repeat_until_any_fail" n
+ "%% To get execution of cases repeated." n
+ "%% N = integer() | forever" n
+ "%%" n
+ "%% Description: Returns a list of test case group definitions." n
+ (erlang-skel-separator 2)
+ "groups() ->" n >
+ "[]." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: all() -> GroupsAndTestCases | {skip,Reason}" n
+ "%%" n
+ "%% GroupsAndTestCases = [{group,GroupName} | TestCase]" n
+ "%% GroupName = atom()" n
+ "%% Name of a test case group." n
+ "%% TestCase = atom()" n
+ "%% Name of a test case." n
+ "%% Reason = term()" n
+ "%% The reason for skipping all groups and test cases." n
+ "%%" n
+ "%% Description: Returns the list of groups and test cases that" n
+ "%% are to be executed." n
+ (erlang-skel-separator 2)
+ "all() -> " n >
+ "[my_test_case]." n n
+
+ n
+ (erlang-skel-separator 2)
+ "%% TEST CASES" n
+ (erlang-skel-separator 2)
+ n
+
+ (erlang-skel-separator 2)
+ "%% Function: TestCase() -> Info" n
+ "%%" n
+ "%% Info = [tuple()]" n
+ "%% List of key/value pairs." n
+ "%%" n
+ "%% Description: Test case info function - returns list of tuples to set" n
+ "%% properties for the test case." n
+ "%%" n
+ "%% Note: This function is only meant to be used to return a list of" n
+ "%% values, not perform any other operations." n
+ (erlang-skel-separator 2)
+ "my_test_case() -> " n >
+ "[]." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: TestCase(Config0) ->" n
+ "%% ok | exit() | {skip,Reason} | {comment,Comment} |" n
+ "%% {save_config,Config1} | {skip_and_save,Reason,Config1}" n
+ "%%" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%% Reason = term()" n
+ "%% The reason for skipping the test case." n
+ "%% Comment = term()" n
+ "%% A comment about the test case that will be printed in the html log." n
+ "%%" n
+ "%% Description: Test case function. (The name of it must be specified in" n
+ "%% the all/0 list or in a test case group for the test case" n
+ "%% to be executed)." n
+ (erlang-skel-separator 2)
+ "my_test_case(_Config) -> " n >
+ "ok." n
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-ct-test-suite-s
+ '((erlang-skel-include erlang-skel-large-header)
+ "-compile(export_all)." n n
+
+ "-include(\"ct.hrl\")." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: suite() -> Info" n
+ "%% Info = [tuple()]" n
+ (erlang-skel-separator 2)
+ "suite() ->" n >
+ "[{timetrap,{seconds,30}}]." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: init_per_suite(Config0) ->" n
+ "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% Reason = term()" n
+ (erlang-skel-separator 2)
+ "init_per_suite(Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}" n
+ "%% Config0 = Config1 = [tuple()]" n
+ (erlang-skel-separator 2)
+ "end_per_suite(_Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: init_per_group(GroupName, Config0) ->" n
+ "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
+ "%% GroupName = atom()" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% Reason = term()" n
+ (erlang-skel-separator 2)
+ "init_per_group(_GroupName, Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_group(GroupName, Config0) ->" n
+ "%% void() | {save_config,Config1}" n
+ "%% GroupName = atom()" n
+ "%% Config0 = Config1 = [tuple()]" n
+ (erlang-skel-separator 2)
+ "end_per_group(_GroupName, _Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: init_per_testcase(TestCase, Config0) ->" n
+ "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
+ "%% TestCase = atom()" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% Reason = term()" n
+ (erlang-skel-separator 2)
+ "init_per_testcase(_TestCase, Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: end_per_testcase(TestCase, Config0) ->" n
+ "%% void() | {save_config,Config1} | {fail,Reason}" n
+ "%% TestCase = atom()" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% Reason = term()" n
+ (erlang-skel-separator 2)
+ "end_per_testcase(_TestCase, _Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: groups() -> [Group]" n
+ "%% Group = {GroupName,Properties,GroupsAndTestCases}" n
+ "%% GroupName = atom()" n
+ "%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
+ "%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]" n
+ "%% TestCase = atom()" n
+ "%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}" n
+ "%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
+ "%% repeat_until_any_ok | repeat_until_any_fail" n
+ "%% N = integer() | forever" n
+ (erlang-skel-separator 2)
+ "groups() ->" n >
+ "[]." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: all() -> GroupsAndTestCases | {skip,Reason}" n
+ "%% GroupsAndTestCases = [{group,GroupName} | TestCase]" n
+ "%% GroupName = atom()" n
+ "%% TestCase = atom()" n
+ "%% Reason = term()" n
+ (erlang-skel-separator 2)
+ "all() -> " n >
+ "[my_test_case]." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: TestCase() -> Info" n
+ "%% Info = [tuple()]" n
+ (erlang-skel-separator 2)
+ "my_test_case() -> " n >
+ "[]." n n
+
+ (erlang-skel-separator 2)
+ "%% Function: TestCase(Config0) ->" n
+ "%% ok | exit() | {skip,Reason} | {comment,Comment} |" n
+ "%% {save_config,Config1} | {skip_and_save,Reason,Config1}" n
+ "%% Config0 = Config1 = [tuple()]" n
+ "%% Reason = term()" n
+ "%% Comment = term()" n
+ (erlang-skel-separator 2)
+ "my_test_case(_Config) -> " n >
+ "ok." n
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
diff --git a/lib/tools/emacs/erlang-skels.el b/lib/tools/emacs/erlang-skels.el
new file mode 100644
index 0000000000..f92f3f1aae
--- /dev/null
+++ b/lib/tools/emacs/erlang-skels.el
@@ -0,0 +1,1262 @@
+;;
+;; %CopyrightBegin%
+;;
+;; Copyright Ericsson AB 2010. All Rights Reserved.
+;;
+;; The contents of this file are subject to the Erlang Public License,
+;; Version 1.1, (the "License"); you may not use this file except in
+;; compliance with the License. You should have received a copy of the
+;; Erlang Public License along with this software. If not, it can be
+;; retrieved online at http://www.erlang.org/.
+;;
+;; Software distributed under the License is distributed on an "AS IS"
+;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+;; the License for the specific language governing rights and limitations
+;; under the License.
+;;
+;; %CopyrightEnd%
+;;;
+;;; Purpose: Provide Erlang code skeletons.
+;;; See 'erlang-skel-file' variable.
+
+(defvar erlang-tempo-tags nil
+ "Tempo tags for erlang mode")
+
+(defvar erlang-skel
+ '(("If" "if" erlang-skel-if)
+ ("Case" "case" erlang-skel-case)
+ ("Receive" "receive" erlang-skel-receive)
+ ("Receive After" "after" erlang-skel-receive-after)
+ ("Receive Loop" "loop" erlang-skel-receive-loop)
+ ("Module" "module" erlang-skel-module)
+ ("Author" "author" erlang-skel-author)
+ ("Function" "function" erlang-skel-function)
+ ()
+ ("Small Header" "small-header"
+ erlang-skel-small-header erlang-skel-header)
+ ("Normal Header" "normal-header"
+ erlang-skel-normal-header erlang-skel-header)
+ ("Large Header" "large-header"
+ erlang-skel-large-header erlang-skel-header)
+ ()
+ ("Small Server" "small-server"
+ erlang-skel-small-server erlang-skel-header)
+ ()
+ ("Application" "application"
+ erlang-skel-application erlang-skel-header)
+ ("Supervisor" "supervisor"
+ erlang-skel-supervisor erlang-skel-header)
+ ("supervisor_bridge" "supervisor-bridge"
+ erlang-skel-supervisor-bridge erlang-skel-header)
+ ("gen_server" "generic-server"
+ erlang-skel-generic-server erlang-skel-header)
+ ("gen_event" "gen-event"
+ erlang-skel-gen-event erlang-skel-header)
+ ("gen_fsm" "gen-fsm"
+ erlang-skel-gen-fsm erlang-skel-header)
+ ("Library module" "gen-lib"
+ erlang-skel-lib erlang-skel-header)
+ ("Corba callback" "gen-corba-cb"
+ erlang-skel-corba-callback erlang-skel-header)
+ ("Erlang test suite TS frontend" "ts-test-suite"
+ erlang-skel-ts-test-suite erlang-skel-header)
+ ("Erlang test suite CT frontend" "ct-test-suite"
+ erlang-skel-ct-test-suite erlang-skel-header)
+ )
+ "*Description of all skeleton templates.
+Both functions and menu entries will be created.
+
+Each entry in `erlang-skel' should be a list with three or four
+elements, or the empty list.
+
+The first element is the name which shows up in the menu. The second
+is the `tempo' identifier (The string \"erlang-\" will be added in
+front of it). The third is the skeleton descriptor, a variable
+containing `tempo' attributes as described in the function
+`tempo-define-template'. The optional fourth elements denotes a
+function which should be called when the menu is selected.
+
+Functions corresponding to every template will be created. The name
+of the function will be `tempo-template-erlang-X' where `X' is the
+tempo identifier as specified in the second argument of the elements
+in this list.
+
+A list with zero elements means that the a horizontal line should
+be placed in the menu.")
+
+(defvar erlang-skel-use-separators t
+ "A boolean than determines whether the skeletons include horizontal
+separators.
+
+Should this variable be nil, the documentation for functions will not
+include separators of the form %%--...")
+
+;; In XEmacs `user-mail-address' returns "[email protected] (Foo Bar)" ARGH!
+;; What's wrong with that? RFC 822 says it's legal. [sverkerw]
+;; This needs to use the customized value. If that's not sane, things like
+;; add-log will lose anyhow. Avoid it if there _is_ a paren.
+(defvar erlang-skel-mail-address
+ (if (or (not user-mail-address) (string-match "(" user-mail-address))
+ (concat (user-login-name) "@"
+ (or (and (boundp 'mail-host-address)
+ mail-host-address)
+ (system-name)))
+ user-mail-address)
+ "Mail address of the user.")
+
+;; Expression templates:
+(defvar erlang-skel-case
+ '((erlang-skel-skip-blank) o >
+ "case " p " of" n> p "_ ->" n> p "ok" n> "end" p)
+ "*The skeleton of a `case' expression.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-if
+ '((erlang-skel-skip-blank) o >
+ "if" n> p " ->" n> p "ok" n> "end" p)
+ "The skeleton of an `if' expression.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-receive
+ '((erlang-skel-skip-blank) o >
+ "receive" n> p "_ ->" n> p "ok" n> "end" p)
+ "*The skeleton of a `receive' expression.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-receive-after
+ '((erlang-skel-skip-blank) o >
+ "receive" n> p "_ ->" n> p "ok" n> "after " p "T ->" n>
+ p "ok" n> "end" p)
+ "*The skeleton of a `receive' expression with an `after' clause.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-receive-loop
+ '(& o "loop(" p ") ->" n> "receive" n> p "_ ->" n>
+ "loop(" p ")" n> "end.")
+ "*The skeleton of a simple `receive' loop.
+Please see the function `tempo-define-template'.")
+
+
+(defvar erlang-skel-function
+ '((erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% @spec" n
+ (erlang-skel-separator-end 2))
+ "*The template of a function skeleton.
+Please see the function `tempo-define-template'.")
+
+
+;; Attribute templates
+
+(defvar erlang-skel-module
+ '(& "-module("
+ (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
+ ")." n)
+ "*The skeleton of a `module' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-author
+ '(& "-author('" erlang-skel-mail-address "')." n)
+ "*The skeleton of a `author' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-vc nil
+ "*The skeleton template to generate a version control attribute.
+The default is to insert nothing. Example of usage:
+
+ (setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n)
+
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-export
+ '(& "-export([" n> "])." n)
+ "*The skeleton of an `export' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-import
+ '(& "%%-import(Module, [Function/Arity, ...])." n)
+ "*The skeleton of an `import' attribute.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-compile nil
+ ;; '(& "%%-compile(export_all)." n)
+ "*The skeleton of a `compile' attribute.
+Please see the function `tempo-define-template'.")
+
+
+;; Comment templates.
+
+(defvar erlang-skel-date-function 'erlang-skel-dd-mmm-yyyy
+ "*Function which returns date string.
+Look in the module `time-stamp' for a battery of functions.")
+
+(defvar erlang-skel-copyright-comment
+ (if (boundp '*copyright-organization*)
+ '(& "%%% @copyright (C) " (format-time-string "%Y") ", "
+ *copyright-organization* n)
+ '(& "%%% @copyright (C) " (format-time-string "%Y") ", "
+ (user-full-name) n))
+ "*The template for a copyright line in the header, normally empty.
+This variable should be bound to a `tempo' template, for example:
+ '(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n)
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-created-comment
+ '(& "%%% Created : " (funcall erlang-skel-date-function) " by "
+ (user-full-name) " <" erlang-skel-mail-address ">" n)
+ "*The template for the \"Created:\" comment line.")
+
+(defvar erlang-skel-author-comment
+ '(& "%%% @author " (user-full-name) " <" erlang-skel-mail-address ">" n)
+ "*The template for creating the \"Author:\" line in the header.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-small-header
+ '(o (erlang-skel-include erlang-skel-module)
+ n
+ (erlang-skel-include erlang-skel-compile erlang-skel-vc))
+ "*The template of a small header without any comments.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-normal-header
+ '(o (erlang-skel-include erlang-skel-author-comment)
+ (erlang-skel-include erlang-skel-copyright-comment)
+ "%%% @doc" n
+ "%%%" p n
+ "%%% @end" n
+ (erlang-skel-include erlang-skel-created-comment) n
+ (erlang-skel-include erlang-skel-small-header) n)
+ "*The template of a normal header.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-large-header
+ '(o (erlang-skel-separator)
+ (erlang-skel-include erlang-skel-author-comment)
+ (erlang-skel-include erlang-skel-copyright-comment)
+ "%%% @doc" n
+ "%%%" p n
+ "%%% @end" n
+ (erlang-skel-include erlang-skel-created-comment)
+ (erlang-skel-separator)
+ (erlang-skel-include erlang-skel-small-header) )
+ "*The template of a large header.
+Please see the function `tempo-define-template'.")
+
+
+ ;; Server templates.
+(defvar erlang-skel-small-server
+ '((erlang-skel-include erlang-skel-large-header)
+ "-export([start/0, init/1])." n n n
+ "start() ->" n> "spawn(" (erlang-get-module-from-file-name)
+ ", init, [self()])." n n
+ "init(From) ->" n>
+ "loop(From)." n n
+ "loop(From) ->" n>
+ "receive" n>
+ p "_ ->" n>
+ "loop(From)" n>
+ "end." n
+ )
+ "*Template of a small server.
+Please see the function `tempo-define-template'.")
+
+;; Behaviour templates.
+(defvar erlang-skel-application
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(application)." n n
+ "%% Application callbacks" n
+ "-export([start/2, stop/1])." n n
+ (erlang-skel-double-separator-start 3)
+ "%%% Application callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called whenever an application is started using" n
+ "%% application:start/[1,2], and should start the processes of the" n
+ "%% application. If the application is structured according to the OTP" n
+ "%% design principles as a supervision tree, this means starting the" n
+ "%% top supervisor of the tree." n
+ "%%" n
+ "%% @spec start(StartType, StartArgs) -> {ok, Pid} |" n
+ "%% {ok, Pid, State} |" n
+ "%% {error, Reason}" n
+ "%% StartType = normal | {takeover, Node} | {failover, Node}" n
+ "%% StartArgs = term()" n
+ (erlang-skel-separator-end 2)
+ "start(_StartType, _StartArgs) ->" n>
+ "case 'TopSupervisor':start_link() of" n>
+ "{ok, Pid} ->" n>
+ "{ok, Pid};" n>
+ "Error ->" n>
+ "Error" n>
+ "end." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called whenever an application has stopped. It" n
+ "%% is intended to be the opposite of Module:start/2 and should do" n
+ "%% any necessary cleaning up. The return value is ignored." n
+ "%%" n
+ "%% @spec stop(State) -> void()" n
+ (erlang-skel-separator-end 2)
+ "stop(_State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of an application behaviour.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-supervisor
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(supervisor)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% Supervisor callbacks" n
+ "-export([init/1])." n n
+
+ "-define(SERVER, ?MODULE)." n n
+
+ (erlang-skel-double-separator-start 3)
+ "%%% API functions" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Starts the supervisor" n
+ "%%" n
+ "%% @spec start_link() -> {ok, Pid} | ignore | {error, Error}" n
+ (erlang-skel-separator-end 2)
+ "start_link() ->" n>
+ "supervisor:start_link({local, ?SERVER}, ?MODULE, [])." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Supervisor callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever a supervisor is started using supervisor:start_link/[2,3]," n
+ "%% this function is called by the new process to find out about" n
+ "%% restart strategy, maximum restart frequency and child" n
+ "%% specifications." n
+ "%%" n
+ "%% @spec init(Args) -> {ok, {SupFlags, [ChildSpec]}} |" n
+ "%% ignore |" n
+ "%% {error, Reason}" n
+ (erlang-skel-separator-end 2)
+ "init([]) ->" n>
+ "RestartStrategy = one_for_one," n>
+ "MaxRestarts = 1000," n>
+ "MaxSecondsBetweenRestarts = 3600," n
+ "" n>
+ "SupFlags = {RestartStrategy, MaxRestarts, MaxSecondsBetweenRestarts}," n
+ "" n>
+ "Restart = permanent," n>
+ "Shutdown = 2000," n>
+ "Type = worker," n
+ "" n>
+ "AChild = {'AName', {'AModule', start_link, []}," n>
+ "Restart, Shutdown, Type, ['AModule']}," n
+ "" n>
+ "{ok, {SupFlags, [AChild]}}." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of an supervisor behaviour.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-supervisor-bridge
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(supervisor_bridge)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% supervisor_bridge callbacks" n
+ "-export([init/1, terminate/2])." n n
+
+ "-define(SERVER, ?MODULE)." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator-start 3)
+ "%%% API" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Starts the supervisor bridge" n
+ "%%" n
+ "%% @spec start_link() -> {ok, Pid} | ignore | {error, Error}" n
+ (erlang-skel-separator-end 2)
+ "start_link() ->" n>
+ "supervisor_bridge:start_link({local, ?SERVER}, ?MODULE, [])." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% supervisor_bridge callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Creates a supervisor_bridge process, linked to the calling process," n
+ "%% which calls Module:init/1 to start the subsystem. To ensure a" n
+ "%% synchronized start-up procedure, this function does not return" n
+ "%% until Module:init/1 has returned." n
+ "%%" n
+ "%% @spec init(Args) -> {ok, Pid, State} |" n
+ "%% ignore |" n
+ "%% {error, Reason}" n
+ (erlang-skel-separator-end 2)
+ "init([]) ->" n>
+ "case 'AModule':start_link() of" n>
+ "{ok, Pid} ->" n>
+ "{ok, Pid, #state{}};" n>
+ "Error ->" n>
+ "Error" n>
+ "end." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called by the supervisor_bridge when it is about" n
+ "%% to terminate. It should be the opposite of Module:init/1 and stop" n
+ "%% the subsystem and do any necessary cleaning up.The return value is" n
+ "%% ignored." n
+ "%%" n
+ "%% @spec terminate(Reason, State) -> void()" n
+ (erlang-skel-separator-end 2)
+ "terminate(Reason, State) ->" n>
+ "'AModule':stop()," n>
+ "ok." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of an supervisor_bridge behaviour.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-generic-server
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(gen_server)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% gen_server callbacks" n
+ "-export([init/1, handle_call/3, handle_cast/2, "
+ "handle_info/2," n>
+ "terminate/2, code_change/3])." n n
+
+ "-define(SERVER, ?MODULE). " n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator-start 3)
+ "%%% API" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Starts the server" n
+ "%%" n
+ "%% @spec start_link() -> {ok, Pid} | ignore | {error, Error}" n
+ (erlang-skel-separator-end 2)
+ "start_link() ->" n>
+ "gen_server:start_link({local, ?SERVER}, ?MODULE, [], [])." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% gen_server callbacks" n
+ (erlang-skel-double-separator-end 3)
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Initiates the server" n
+ "%%" n
+ "%% @spec init(Args) -> {ok, State} |" n
+ "%% {ok, State, Timeout} |" n
+ "%% ignore |" n
+ "%% {stop, Reason}" n
+ (erlang-skel-separator-end 2)
+ "init([]) ->" n>
+ "{ok, #state{}}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Handling call messages" n
+ "%%" n
+ "%% @spec handle_call(Request, From, State) ->" n
+ "%% {reply, Reply, State} |" n
+ "%% {reply, Reply, State, Timeout} |" n
+ "%% {noreply, State} |" n
+ "%% {noreply, State, Timeout} |" n
+ "%% {stop, Reason, Reply, State} |" n
+ "%% {stop, Reason, State}" n
+ (erlang-skel-separator-end 2)
+ "handle_call(_Request, _From, State) ->" n>
+ "Reply = ok," n>
+ "{reply, Reply, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Handling cast messages" n
+ "%%" n
+ "%% @spec handle_cast(Msg, State) -> {noreply, State} |" n
+ "%% {noreply, State, Timeout} |" n
+ "%% {stop, Reason, State}" n
+ (erlang-skel-separator-end 2)
+ "handle_cast(_Msg, State) ->" n>
+ "{noreply, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Handling all non call/cast messages" n
+ "%%" n
+ "%% @spec handle_info(Info, State) -> {noreply, State} |" n
+ "%% {noreply, State, Timeout} |" n
+ "%% {stop, Reason, State}" n
+ (erlang-skel-separator-end 2)
+ "handle_info(_Info, State) ->" n>
+ "{noreply, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called by a gen_server when it is about to" n
+ "%% terminate. It should be the opposite of Module:init/1 and do any" n
+ "%% necessary cleaning up. When it returns, the gen_server terminates" n
+ "%% with Reason. The return value is ignored." n
+ "%%" n
+ "%% @spec terminate(Reason, State) -> void()" n
+ (erlang-skel-separator-end 2)
+ "terminate(_Reason, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Convert process state when code is changed" n
+ "%%" n
+ "%% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}" n
+ (erlang-skel-separator-end 2)
+ "code_change(_OldVsn, State, _Extra) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of a generic server.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-gen-event
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(gen_event)." n n
+
+ "%% API" n
+ "-export([start_link/0, add_handler/0])." n n
+
+ "%% gen_event callbacks" n
+ "-export([init/1, handle_event/2, handle_call/2, " n>
+ "handle_info/2, terminate/2, code_change/3])." n n
+
+ "-define(SERVER, ?MODULE). " n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator-start 3)
+ "%%% gen_event callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Creates an event manager" n
+ "%%" n
+ "%% @spec start_link() -> {ok, Pid} | {error, Error}" n
+ (erlang-skel-separator-end 2)
+ "start_link() ->" n>
+ "gen_event:start_link({local, ?SERVER})." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Adds an event handler" n
+ "%%" n
+ "%% @spec add_handler() -> ok | {'EXIT', Reason} | term()" n
+ (erlang-skel-separator-end 2)
+ "add_handler() ->" n>
+ "gen_event:add_handler(?SERVER, ?MODULE, [])." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% gen_event callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever a new event handler is added to an event manager," n
+ "%% this function is called to initialize the event handler." n
+ "%%" n
+ "%% @spec init(Args) -> {ok, State}" n
+ (erlang-skel-separator-end 2)
+ "init([]) ->" n>
+ "{ok, #state{}}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever an event manager receives an event sent using" n
+ "%% gen_event:notify/2 or gen_event:sync_notify/2, this function is" n
+ "%% called for each installed event handler to handle the event." n
+ "%%" n
+ "%% @spec handle_event(Event, State) ->" n
+ "%% {ok, State} |" n
+ "%% {swap_handler, Args1, State1, Mod2, Args2} |"n
+ "%% remove_handler" n
+ (erlang-skel-separator-end 2)
+ "handle_event(_Event, State) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever an event manager receives a request sent using" n
+ "%% gen_event:call/3,4, this function is called for the specified" n
+ "%% event handler to handle the request." n
+ "%%" n
+ "%% @spec handle_call(Request, State) ->" n
+ "%% {ok, Reply, State} |" n
+ "%% {swap_handler, Reply, Args1, State1, Mod2, Args2} |" n
+ "%% {remove_handler, Reply}" n
+ (erlang-skel-separator-end 2)
+ "handle_call(_Request, State) ->" n>
+ "Reply = ok," n>
+ "{ok, Reply, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called for each installed event handler when" n
+ "%% an event manager receives any other message than an event or a" n
+ "%% synchronous request (or a system message)." n
+ "%%" n
+ "%% @spec handle_info(Info, State) ->" n
+ "%% {ok, State} |" n
+ "%% {swap_handler, Args1, State1, Mod2, Args2} |" n
+ "%% remove_handler" n
+ (erlang-skel-separator-end 2)
+ "handle_info(_Info, State) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever an event handler is deleted from an event manager, this" n
+ "%% function is called. It should be the opposite of Module:init/1 and" n
+ "%% do any necessary cleaning up." n
+ "%%" n
+ "%% @spec terminate(Reason, State) -> void()" n
+ (erlang-skel-separator-end 2)
+ "terminate(_Reason, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Convert process state when code is changed" n
+ "%%" n
+ "%% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}" n
+ (erlang-skel-separator-end 2)
+ "code_change(_OldVsn, State, _Extra) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of a gen_event.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-gen-fsm
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(gen_fsm)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n n
+
+ "%% gen_fsm callbacks" n
+ "-export([init/1, state_name/2, state_name/3, handle_event/3," n>
+ "handle_sync_event/4, handle_info/3, terminate/3, code_change/4])." n n
+
+ "-define(SERVER, ?MODULE)." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator-start 3)
+ "%%% API" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Creates a gen_fsm process which calls Module:init/1 to" n
+ "%% initialize. To ensure a synchronized start-up procedure, this" n
+ "%% function does not return until Module:init/1 has returned." n
+ "%%" n
+ "%% @spec start_link() -> {ok, Pid} | ignore | {error, Error}" n
+ (erlang-skel-separator-end 2)
+ "start_link() ->" n>
+ "gen_fsm:start_link({local, ?SERVER}, ?MODULE, [], [])." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% gen_fsm callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever a gen_fsm is started using gen_fsm:start/[3,4] or" n
+ "%% gen_fsm:start_link/[3,4], this function is called by the new" n
+ "%% process to initialize." n
+ "%%" n
+ "%% @spec init(Args) -> {ok, StateName, State} |" n
+ "%% {ok, StateName, State, Timeout} |" n
+ "%% ignore |" n
+ "%% {stop, StopReason}" n
+ (erlang-skel-separator-end 2)
+ "init([]) ->" n>
+ "{ok, state_name, #state{}}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% There should be one instance of this function for each possible" n
+ "%% state name. Whenever a gen_fsm receives an event sent using" n
+ "%% gen_fsm:send_event/2, the instance of this function with the same" n
+ "%% name as the current state name StateName is called to handle" n
+ "%% the event. It is also called if a timeout occurs." n
+ "%%" n
+ "%% @spec state_name(Event, State) ->" n
+ "%% {next_state, NextStateName, NextState} |" n
+ "%% {next_state, NextStateName, NextState, Timeout} |" n
+ "%% {stop, Reason, NewState}" n
+ (erlang-skel-separator-end 2)
+ "state_name(_Event, State) ->" n>
+ "{next_state, state_name, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% There should be one instance of this function for each possible" n
+ "%% state name. Whenever a gen_fsm receives an event sent using" n
+ "%% gen_fsm:sync_send_event/[2,3], the instance of this function with" n
+ "%% the same name as the current state name StateName is called to" n
+ "%% handle the event." n
+ "%%" n
+ "%% @spec state_name(Event, From, State) ->" n
+ "%% {next_state, NextStateName, NextState} |"n
+ "%% {next_state, NextStateName, NextState, Timeout} |" n
+ "%% {reply, Reply, NextStateName, NextState} |" n
+ "%% {reply, Reply, NextStateName, NextState, Timeout} |" n
+ "%% {stop, Reason, NewState} |" n
+ "%% {stop, Reason, Reply, NewState}" n
+ (erlang-skel-separator-end 2)
+ "state_name(_Event, _From, State) ->" n>
+ "Reply = ok," n>
+ "{reply, Reply, state_name, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever a gen_fsm receives an event sent using" n
+ "%% gen_fsm:send_all_state_event/2, this function is called to handle" n
+ "%% the event." n
+ "%%" n
+ "%% @spec handle_event(Event, StateName, State) ->" n
+ "%% {next_state, NextStateName, NextState} |" n
+ "%% {next_state, NextStateName, NextState, Timeout} |" n
+ "%% {stop, Reason, NewState}" n
+ (erlang-skel-separator-end 2)
+ "handle_event(_Event, StateName, State) ->" n>
+ "{next_state, StateName, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever a gen_fsm receives an event sent using" n
+ "%% gen_fsm:sync_send_all_state_event/[2,3], this function is called" n
+ "%% to handle the event." n
+ "%%" n
+ "%% @spec handle_sync_event(Event, From, StateName, State) ->" n
+ "%% {next_state, NextStateName, NextState} |" n
+ "%% {next_state, NextStateName, NextState, Timeout} |" n
+ "%% {reply, Reply, NextStateName, NextState} |" n
+ "%% {reply, Reply, NextStateName, NextState, Timeout} |" n
+ "%% {stop, Reason, NewState} |" n
+ "%% {stop, Reason, Reply, NewState}" n
+ (erlang-skel-separator-end 2)
+ "handle_sync_event(_Event, _From, StateName, State) ->" n>
+ "Reply = ok," n>
+ "{reply, Reply, StateName, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called by a gen_fsm when it receives any" n
+ "%% message other than a synchronous or asynchronous event" n
+ "%% (or a system message)." n
+ "%%" n
+ "%% @spec handle_info(Info,StateName,State)->" n
+ "%% {next_state, NextStateName, NextState} |" n
+ "%% {next_state, NextStateName, NextState, Timeout} |" n
+ "%% {stop, Reason, NewState}" n
+ (erlang-skel-separator-end 2)
+ "handle_info(_Info, StateName, State) ->" n>
+ "{next_state, StateName, State}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called by a gen_fsm when it is about to" n
+ "%% terminate. It should be the opposite of Module:init/1 and do any" n
+ "%% necessary cleaning up. When it returns, the gen_fsm terminates with" n
+ "%% Reason. The return value is ignored." n
+ "%%" n
+ "%% @spec terminate(Reason, StateName, State) -> void()" n
+ (erlang-skel-separator-end 2)
+ "terminate(_Reason, _StateName, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Convert process state when code is changed" n
+ "%%" n
+ "%% @spec code_change(OldVsn, StateName, State, Extra) ->" n
+ "%% {ok, StateName, NewState}" n
+ (erlang-skel-separator-end 2)
+ "code_change(_OldVsn, StateName, State, _Extra) ->" n>
+ "{ok, StateName, State}." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of a gen_fsm.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-lib
+ '((erlang-skel-include erlang-skel-large-header)
+
+ "%% API" n
+ "-export([])." n n
+
+ (erlang-skel-double-separator-start 3)
+ "%%% API" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% @spec" n
+ (erlang-skel-separator-end 2)
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-corba-callback
+ '((erlang-skel-include erlang-skel-large-header)
+ "%% Include files" n n
+
+ "%% API" n
+ "-export([])." n n
+
+ "%% Corba callbacks" n
+ "-export([init/1, terminate/2, code_change/3])." n n
+
+ "-record(state, {})." n n
+
+ (erlang-skel-double-separator-start 3)
+ "%%% Corba callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Initiates the server" n
+ "%%" n
+ "%% @spec init(Args) -> {ok, State} |" n
+ "%% {ok, State, Timeout} |" n
+ "%% ignore |" n
+ "%% {stop, Reason}" n
+ (erlang-skel-separator-end 2)
+ "init([]) ->" n>
+ "{ok, #state{}}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Shutdown the server" n
+ "%%" n
+ "%% @spec terminate(Reason, State) -> void()" n
+ (erlang-skel-separator-end 2)
+ "terminate(_Reason, _State) ->" n>
+ "ok." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Convert process state when code is changed" n
+ "%%" n
+ "%% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}" n
+ (erlang-skel-separator-end 2)
+ "code_change(_OldVsn, State, _Extra) ->" n>
+ "{ok, State}." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-ts-test-suite
+ '((erlang-skel-include erlang-skel-large-header)
+ "%% Note: This directive should only be used in test suites." n
+ "-compile(export_all)." n n
+
+ "-include(\"test_server.hrl\")." n n
+
+ "%% Test server callback functions" n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Initiation before the whole suite" n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ "%%" n
+ "%% @spec init_per_suite(Config) -> Config" n
+ (erlang-skel-separator-end 2)
+ "init_per_suite(Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Cleanup after the whole suite" n
+ "%%" n
+ "%% @spec end_per_suite(Config) -> _" n
+ (erlang-skel-separator-end 2)
+ "end_per_suite(_Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Case - atom()" n
+ "%% Name of the test case that is about to be run." n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Initiation before each test case" n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ "%%" n
+ "%% @spec init_per_testcase(TestCase, Config) -> Config" n
+ (erlang-skel-separator-end 2)
+ "init_per_testcase(_TestCase, Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Case - atom()" n
+ "%% Name of the test case that is about to be run." n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Cleanup after each test case" n
+ "%%" n
+ "%% @spec end_per_testcase(TestCase, Config) -> _" n
+ (erlang-skel-separator-end 2)
+ "end_per_testcase(_TestCase, _Config) ->" n >
+ "ok."n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Clause - atom() - suite | doc" n
+ "%% TestCases - [Case]" n
+ "%% Case - atom()" n
+ "%% Name of a test case." n
+ "%%" n
+ "%% Returns a list of all test cases in this test suite" n
+ "%%" n
+ "%% @spec all(Clause) -> TestCases" n
+ (erlang-skel-separator-end 2)
+ "all(doc) ->" n >
+ "[\"Describe the main purpose of this suite\"];" n n
+ "all(suite) ->" n >
+ "[]." n n
+
+ "%% Test cases starts here." n
+ (erlang-skel-separator-start 2)
+ "test_case(doc) ->" n >
+ "[\"Describe the main purpose of test case\"];" n n
+ "test_case(suite) ->" n >
+ "[];" n n
+ "test_case(Config) when is_list(Config) ->" n >
+ "ok." n
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+(defvar erlang-skel-ct-test-suite
+ '((erlang-skel-include erlang-skel-large-header)
+ "-suite_defaults([{timetrap, {minutes, 10}}])." n n
+
+ "%% Note: This directive should only be used in test suites." n
+ "-compile(export_all)." n n
+
+ "-include(\"ct.hrl\")." n n
+
+ "%% Test server callback functions" n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Initiation before the whole suite" n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ "%%" n
+ "%% @spec init_per_suite(Config) -> Config" n
+ (erlang-skel-separator-end 2)
+ "init_per_suite(Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Cleanup after the whole suite" n
+ "%%" n
+ "%% @spec end_per_suite(Config) -> _" n
+ (erlang-skel-separator-end 2)
+ "end_per_suite(_Config) ->" n >
+ "ok." n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Case - atom()" n
+ "%% Name of the test case that is about to be run." n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Initiation before each test case" n
+ "%%" n
+ "%% Note: This function is free to add any key/value pairs to the Config" n
+ "%% variable, but should NOT alter/remove any existing entries." n
+ "%% Initiation before each test case" n
+ "%%" n
+ "%% @spec init_per_testcase(TestCase, Config) -> Config" n
+ (erlang-skel-separator-end 2)
+ "init_per_testcase(_TestCase, Config) ->" n >
+ "Config." n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Case - atom()" n
+ "%% Name of the test case that is about to be run." n
+ "%% Config - [tuple()]" n
+ "%% A list of key/value pairs, holding the test case configuration." n
+ "%%" n
+ "%% Cleanup after each test case" n
+ "%%" n
+ "%% @spec end_per_testcase(TestCase, Config) -> _" n
+ (erlang-skel-separator-end 2)
+ "end_per_testcase(_TestCase, _Config) ->" n >
+ "ok."n n
+
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% TestCases - [Case]" n
+ "%% Case - atom()" n
+ "%% Name of a test case." n
+ "%%" n
+ "%% Returns a list of all test cases in this test suite" n
+ "%%" n
+ "%% @spec all() -> TestCases" n
+ (erlang-skel-separator-end 2)
+ "all() ->" n >
+ "[]." n n
+
+ "%% Test cases starts here." n
+ (erlang-skel-separator-start 2)
+ "test_case() ->" n >
+ "[{doc, \"Describe the main purpose of this test case\"}]." n n
+ "test_case(Config) when is_list(Config) ->" n >
+ "ok." n
+ )
+ "*The template of a library module.
+Please see the function `tempo-define-template'.")
+
+;; Skeleton code:
+
+;; This code is based on the package `tempo' which is part of modern
+;; Emacsen. (GNU Emacs 19.25 (?) and XEmacs 19.14.)
+
+(defun erlang-skel-init ()
+ "Generate the skeleton functions and menu items.
+The variable `erlang-skel' contains the name and descriptions of
+all skeletons.
+
+The skeleton routines are based on the `tempo' package. Should this
+package not be present, this function does nothing."
+ (interactive)
+ (condition-case nil
+ (require 'tempo)
+ (error t))
+ (if (featurep 'tempo)
+ (let ((skel erlang-skel)
+ (menu '()))
+ (while skel
+ (cond ((null (car skel))
+ (setq menu (cons nil menu)))
+ (t
+ (funcall (symbol-function 'tempo-define-template)
+ (concat "erlang-" (nth 1 (car skel)))
+ ;; The tempo template used contains an `include'
+ ;; function call only, hence changes to the
+ ;; variables describing the templates take effect
+ ;; immdiately.
+ (list (list 'erlang-skel-include (nth 2 (car skel))))
+ (nth 1 (car skel)))
+ (setq menu (cons (erlang-skel-make-menu-item
+ (car skel)) menu))))
+ (setq skel (cdr skel)))
+ (setq erlang-menu-skel-items
+ (list nil (list "Skeletons" (nreverse menu))))
+ (setq erlang-menu-items
+ (erlang-menu-add-above 'erlang-menu-skel-items
+ 'erlang-menu-version-items
+ erlang-menu-items))
+ (erlang-menu-init))))
+
+(defun erlang-skel-make-menu-item (skel)
+ (let ((func (intern (concat "tempo-template-erlang-" (nth 1 skel)))))
+ (cond ((null (nth 3 skel))
+ (list (car skel) func))
+ (t
+ (list (car skel)
+ (list 'lambda '()
+ '(interactive)
+ (list 'funcall
+ (list 'quote (nth 3 skel))
+ (list 'quote func))))))))
+
+;; Functions designed to be added to the skeleton menu.
+;; (Not normally used)
+(defun erlang-skel-insert (func)
+ "Insert skeleton generated by FUNC and goto first tempo mark."
+ (save-excursion (funcall func))
+ (funcall (symbol-function 'tempo-forward-mark)))
+
+(defun erlang-skel-header (func)
+ "Insert the header generated by FUNC at the beginning of the buffer."
+ (goto-char (point-min))
+ (save-excursion (funcall func))
+ (funcall (symbol-function 'tempo-forward-mark)))
+
+
+;; Functions used inside the skeleton descriptions.
+(defun erlang-skel-skip-blank ()
+ (skip-chars-backward " \t")
+ nil)
+
+(defun erlang-skel-include (&rest args)
+ "Include a template inside another template.
+
+Example of use, assuming that `erlang-skel-func' is defined:
+
+ (defvar foo-skeleton '(\"%%% New function:\"
+ (erlang-skel-include erlang-skel-func)))
+
+Technically, this function returns the `tempo' attribute`(l ...)' which
+can contain other `tempo' attributes. Please see the function
+`tempo-define-template' for a description of the `(l ...)' attribute."
+ (let ((res '())
+ entry)
+ (while args
+ (setq entry (car args))
+ (while entry
+ (setq res (cons (car entry) res))
+ (setq entry (cdr entry)))
+ (setq args (cdr args)))
+ (cons 'l (nreverse res))))
+
+(defun erlang-skel-separator (&optional percent)
+ "Return a comment separator."
+ (let ((percent (or percent 3)))
+ (concat (make-string percent ?%)
+ (make-string (- 70 percent) ?-)
+ "\n")))
+
+(defun erlang-skel-separator-start (&optional percent)
+ "Return a comment separator or an empty string if separators
+are configured off."
+ (if erlang-skel-use-separators
+ (erlang-skel-separator percent)
+ ""))
+
+(defun erlang-skel-separator-end (&optional percent)
+ "Return a comment separator to end a function comment block or an
+empty string if separators are configured off."
+ (if erlang-skel-use-separators
+ (concat "%% @end\n" (erlang-skel-separator percent))
+ ""))
+
+(defun erlang-skel-double-separator (&optional percent)
+ "Return a double line (equals sign) comment separator."
+ (let ((percent (or percent 3)))
+ (concat (make-string percent ?%)
+ (make-string (- 70 percent) ?=)
+ "\n")))
+
+(defun erlang-skel-double-separator-start (&optional percent)
+ "Return a double separator or a newline if separators are configured off."
+ (if erlang-skel-use-separators
+ (erlang-skel-double-separator percent)
+ "\n"))
+
+(defun erlang-skel-double-separator-end (&optional percent)
+ "Return a double separator or an empty string if separators are
+configured off."
+ (if erlang-skel-use-separators
+ (erlang-skel-double-separator percent)
+ ""))
+
+(defun erlang-skel-dd-mmm-yyyy ()
+ "Return the current date as a string in \"DD Mon YYYY\" form.
+The first character of DD is space if the value is less than 10."
+ (let ((date (current-time-string)))
+ (format "%2d %s %s"
+ (string-to-int (substring date 8 10))
+ (substring date 4 7)
+ (substring date -4))))
+
+;; Local variables:
+;; coding: iso-8859-1
+;; End:
+
+;;; erlang-skels.el ends here
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index 4fc4826238..da586ee09a 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -1,19 +1,19 @@
;; erlang.el --- Major modes for editing and running Erlang
;; %CopyrightBegin%
-;;
-;; Copyright Ericsson AB 1996-2009. All Rights Reserved.
-;;
+;;
+;; Copyright Ericsson AB 1996-2010. All Rights Reserved.
+;;
;; The contents of this file are subject to the Erlang Public License,
;; Version 1.1, (the "License"); you may not use this file except in
;; compliance with the License. You should have received a copy of the
;; Erlang Public License along with this software. If not, it can be
;; retrieved online at http://www.erlang.org/.
-;;
+;;
;; Software distributed under the License is distributed on an "AS IS"
;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
;; the License for the specific language governing rights and limitations
;; under the License.
-;;
+;;
;; %CopyrightEnd%
;;
;; Copyright (C) 2004 Free Software Foundation, Inc.
@@ -72,7 +72,7 @@
;; Variables:
-(defconst erlang-version "2.6.2"
+(defconst erlang-version "2.7"
"The version number of Erlang mode.")
(defvar erlang-root-dir nil
@@ -895,1254 +895,16 @@ behaviour.")
(defconst inferior-erlang-use-cmm (boundp 'minor-mode-overriding-map-alist)
"Non-nil means use `compilation-minor-mode' in Erlang shell.")
-;; Tempo skeleton templates:
-
-(defvar erlang-tempo-tags nil
- "Tempo tags for erlang mode")
-
-(defvar erlang-skel
- '(("If" "if" erlang-skel-if)
- ("Case" "case" erlang-skel-case)
- ("Receive" "receive" erlang-skel-receive)
- ("Receive After" "after" erlang-skel-receive-after)
- ("Receive Loop" "loop" erlang-skel-receive-loop)
- ("Module" "module" erlang-skel-module)
- ("Author" "author" erlang-skel-author)
- ()
- ("Small Header" "small-header"
- erlang-skel-small-header erlang-skel-header)
- ("Normal Header" "normal-header"
- erlang-skel-normal-header erlang-skel-header)
- ("Large Header" "large-header"
- erlang-skel-large-header erlang-skel-header)
- ()
- ("Small Server" "small-server"
- erlang-skel-small-server erlang-skel-header)
- ()
- ("Application" "application"
- erlang-skel-application erlang-skel-header)
- ("Supervisor" "supervisor"
- erlang-skel-supervisor erlang-skel-header)
- ("supervisor_bridge" "supervisor-bridge"
- erlang-skel-supervisor-bridge erlang-skel-header)
- ("gen_server" "generic-server"
- erlang-skel-generic-server erlang-skel-header)
- ("gen_event" "gen-event"
- erlang-skel-gen-event erlang-skel-header)
- ("gen_fsm" "gen-fsm"
- erlang-skel-gen-fsm erlang-skel-header)
- ("Library module" "gen-lib"
- erlang-skel-lib erlang-skel-header)
- ("Corba callback" "gen-corba-cb"
- erlang-skel-corba-callback erlang-skel-header)
- ("Small Common Test suite" "ct-test-suite-s"
- erlang-skel-ct-test-suite-s erlang-skel-header)
- ("Large Common Test suite" "ct-test-suite-l"
- erlang-skel-ct-test-suite-l erlang-skel-header)
- ("Erlang TS test suite" "ts-test-suite"
- erlang-skel-ts-test-suite erlang-skel-header)
- )
- "*Description of all skeleton templates.
-Both functions and menu entries will be created.
-
-Each entry in `erlang-skel' should be a list with three or four
-elements, or the empty list.
-
-The first element is the name which shows up in the menu. The second
-is the `tempo' identifier (The string \"erlang-\" will be added in
-front of it). The third is the skeleton descriptor, a variable
-containing `tempo' attributes as described in the function
-`tempo-define-template'. The optional fourth elements denotes a
-function which should be called when the menu is selected.
-
-Functions corresponding to every template will be created. The name
-of the function will be `tempo-template-erlang-X' where `X' is the
-tempo identifier as specified in the second argument of the elements
-in this list.
-
-A list with zero elements means that the a horizontal line should
-be placed in the menu.")
-
-;; In XEmacs `user-mail-address' returns "[email protected] (Foo Bar)" ARGH!
-;; What's wrong with that? RFC 822 says it's legal. [sverkerw]
-;; This needs to use the customized value. If that's not sane, things like
-;; add-log will lose anyhow. Avoid it if there _is_ a paren.
-(defvar erlang-skel-mail-address
- (if (or (not user-mail-address) (string-match "(" user-mail-address))
- (concat (user-login-name) "@"
- (or (and (boundp 'mail-host-address)
- mail-host-address)
- (system-name)))
- user-mail-address)
- "Mail address of the user.")
-
-;; Expression templates:
-(defvar erlang-skel-case
- '((erlang-skel-skip-blank) o >
- "case " p " of" n> p "_ ->" n> p "ok" n> "end" p)
- "*The skeleton of a `case' expression.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-if
- '((erlang-skel-skip-blank) o >
- "if" n> p " ->" n> p "ok" n> "end" p)
- "The skeleton of an `if' expression.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-receive
- '((erlang-skel-skip-blank) o >
- "receive" n> p "_ ->" n> p "ok" n> "end" p)
- "*The skeleton of a `receive' expression.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-receive-after
- '((erlang-skel-skip-blank) o >
- "receive" n> p "_ ->" n> p "ok" n> "after " p "T ->" n>
- p "ok" n> "end" p)
- "*The skeleton of a `receive' expression with an `after' clause.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-receive-loop
- '(& o "loop(" p ") ->" n> "receive" n> p "_ ->" n>
- "loop(" p ")" n> "end.")
- "*The skeleton of a simple `receive' loop.
-Please see the function `tempo-define-template'.")
-
-
-;; Attribute templates
-
-(defvar erlang-skel-module
- '(& "-module("
- (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
- ")." n)
- "*The skeleton of a `module' attribute.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-author
- '(& "-author('" erlang-skel-mail-address "')." n)
- "*The skeleton of a `author' attribute.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-vc nil
- "*The skeleton template to generate a version control attribute.
-The default is to insert nothing. Example of usage:
-
- (setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n)
-
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-export
- '(& "-export([" n> "])." n)
- "*The skeleton of an `export' attribute.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-import
- '(& "%%-import(Module, [Function/Arity, ...])." n)
- "*The skeleton of an `import' attribute.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-compile nil
- ;; '(& "%%-compile(export_all)." n)
- "*The skeleton of a `compile' attribute.
-Please see the function `tempo-define-template'.")
-
-
-;; Comment templates.
-
-(defvar erlang-skel-date-function 'erlang-skel-dd-mmm-yyyy
- "*Function which returns date string.
-Look in the module `time-stamp' for a battery of functions.")
-
-(defvar erlang-skel-copyright-comment '()
- "*The template for a copyright line in the header, normally empty.
-This variable should be bound to a `tempo' template, for example:
- '(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n)
-
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-created-comment
- '(& "%%% Created : " (funcall erlang-skel-date-function) " by "
- (user-full-name) " <" erlang-skel-mail-address ">" n)
- "*The template for the \"Created:\" comment line.")
-
-(defvar erlang-skel-author-comment
- '(& "%%% Author : " (user-full-name) " <" erlang-skel-mail-address ">" n)
- "*The template for creating the \"Author:\" line in the header.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-file-comment
- '(& "%%% File : " (file-name-nondirectory buffer-file-name) n)
-"*The template for creating the \"Module:\" line in the header.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-small-header
- '(o (erlang-skel-include erlang-skel-module)
- ;; erlang-skel-author)
- n
- (erlang-skel-include erlang-skel-compile
- ;; erlang-skel-export
- erlang-skel-vc))
- "*The template of a small header without any comments.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-normal-header
- '(o (erlang-skel-include erlang-skel-copyright-comment
- erlang-skel-file-comment
- erlang-skel-author-comment)
- "%%% Description : " p n
- (erlang-skel-include erlang-skel-created-comment) n
- (erlang-skel-include erlang-skel-small-header) n)
- "*The template of a normal header.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-large-header
- '(o (erlang-skel-separator)
- (erlang-skel-include erlang-skel-copyright-comment
- erlang-skel-file-comment
- erlang-skel-author-comment)
- "%%% Description : " p n
- "%%%" n
- (erlang-skel-include erlang-skel-created-comment)
- (erlang-skel-separator)
- (erlang-skel-include erlang-skel-small-header) )
- "*The template of a large header.
-Please see the function `tempo-define-template'.")
-
-
-;; Server templates.
-
-(defvar erlang-skel-small-server
- '((erlang-skel-include erlang-skel-large-header)
- "-export([start/0,init/1])." n n n
- "start() ->" n> "spawn(" (erlang-get-module-from-file-name)
- ", init, [self()])." n n
- "init(From) ->" n>
- "loop(From)." n n
- "loop(From) ->" n>
- "receive" n>
- p "_ ->" n>
- "loop(From)" n>
- "end."
- )
- "*Template of a small server.
-Please see the function `tempo-define-template'.")
-
-;; Behaviour templates.
-
-(defvar erlang-skel-application
- '((erlang-skel-include erlang-skel-large-header)
- "-behaviour(application)." n n
- "%% Application callbacks" n
- "-export([start/2, stop/1])." n n
- (erlang-skel-double-separator 2)
- "%% Application callbacks" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: start(Type, StartArgs) -> {ok, Pid} |" n
- "%% {ok, Pid, State} |" n
- "%% {error, Reason}" n
- "%% Description: This function is called whenever an application " n
- "%% is started using application:start/1,2, and should start the processes" n
- "%% of the application. If the application is structured according to the" n
- "%% OTP design principles as a supervision tree, this means starting the" n
- "%% top supervisor of the tree." n
- (erlang-skel-separator 2)
- "start(_Type, StartArgs) ->" n>
- "case 'TopSupervisor':start_link(StartArgs) of" n>
- "{ok, Pid} -> " n>
- "{ok, Pid};" n>
- "Error ->" n>
- "Error" n>
- "end." n
- n
- (erlang-skel-separator 2)
- "%% Function: stop(State) -> void()" n
- "%% Description: This function is called whenever an application" n
- "%% has stopped. It is intended to be the opposite of Module:start/2 and" n
- "%% should do any necessary cleaning up. The return value is ignored. "n
- (erlang-skel-separator 2)
- "stop(_State) ->" n>
- "ok." n
- n
- (erlang-skel-double-separator 2)
- "%% Internal functions" n
- (erlang-skel-double-separator 2)
- )
- "*The template of an application behaviour.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-supervisor
- '((erlang-skel-include erlang-skel-large-header)
- "-behaviour(supervisor)." n n
- "%% API" n
- "-export([start_link/0])." n n
+(defvar erlang-skel-file "erlang-skels"
+ "The type of erlang-skeletons that should be used, default
+ uses edoc type, for the old type, standard comments,
+ set \"erlang-skels-old\" in your .emacs and restart.
- "%% Supervisor callbacks" n
- "-export([init/1])." n n
+ Or define your own and set the variable to that file.")
- "-define(SERVER, ?MODULE)." n n
-
- (erlang-skel-double-separator 2)
- "%% API functions" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
- "%% Description: Starts the supervisor" n
- (erlang-skel-separator 2)
- "start_link() ->" n>
- "supervisor:start_link({local, ?SERVER}, ?MODULE, [])." n
- n
- (erlang-skel-double-separator 2)
- "%% Supervisor callbacks" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Func: init(Args) -> {ok, {SupFlags, [ChildSpec]}} |" n
- "%% ignore |" n
- "%% {error, Reason}" n
- "%% Description: Whenever a supervisor is started using "n
- "%% supervisor:start_link/[2,3], this function is called by the new process "n
- "%% to find out about restart strategy, maximum restart frequency and child "n
- "%% specifications." n
- (erlang-skel-separator 2)
- "init([]) ->" n>
- "AChild = {'AName',{'AModule',start_link,[]}," n>
- "permanent,2000,worker,['AModule']}," n>
- "{ok,{{one_for_all,0,1}, [AChild]}}." n
- n
- (erlang-skel-double-separator 2)
- "%% Internal functions" n
- (erlang-skel-double-separator 2)
- )
- "*The template of an supervisor behaviour.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-supervisor-bridge
- '((erlang-skel-include erlang-skel-large-header)
- "-behaviour(supervisor_bridge)." n n
-
- "%% API" n
- "-export([start_link/0])." n n
-
- "%% supervisor_bridge callbacks" n
- "-export([init/1, terminate/2])." n n
-
- "-define(SERVER, ?MODULE)." n n
-
- "-record(state, {})." n n
-
- (erlang-skel-double-separator 2)
- "%% API" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
- "%% Description: Starts the supervisor bridge" n
- (erlang-skel-separator 2)
- "start_link() ->" n>
- "supervisor_bridge:start_link({local, ?SERVER}, ?MODULE, [])." n
- n
- (erlang-skel-double-separator 2)
- "%% supervisor_bridge callbacks" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Funcion: init(Args) -> {ok, Pid, State} |" n
- "%% ignore |" n
- "%% {error, Reason} " n
- "%% Description:Creates a supervisor_bridge process, linked to the calling" n
- "%% process, which calls Module:init/1 to start the subsystem. To ensure a" n
- "%% synchronized start-up procedure, this function does not return until" n
- "%% Module:init/1 has returned. " n
- (erlang-skel-separator 2)
- "init([]) ->" n>
- "case 'AModule':start_link() of" n>
- "{ok, Pid} ->" n>
- "{ok, Pid, #state{}};" n>
- "Error ->" n>
- "Error" n>
- "end." n
- n
- (erlang-skel-separator 2)
- "%% Func: terminate(Reason, State) -> void()" n
- "%% Description:This function is called by the supervisor_bridge when it is"n
- "%% about to terminate. It should be the opposite of Module:init/1 and stop"n
- "%% the subsystem and do any necessary cleaning up.The return value is ignored."
- (erlang-skel-separator 2)
- "terminate(Reason, State) ->" n>
- "'AModule':stop()," n>
- "ok." n
- n
- (erlang-skel-double-separator 2)
- "%% Internal functions" n
- (erlang-skel-double-separator 2)
- )
- "*The template of an supervisor_bridge behaviour.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-generic-server
- '((erlang-skel-include erlang-skel-large-header)
- "-behaviour(gen_server)." n n
-
- "%% API" n
- "-export([start_link/0])." n n
-
- "%% gen_server callbacks" n
- "-export([init/1, handle_call/3, handle_cast/2, "
- "handle_info/2," n>
- "terminate/2, code_change/3])." n n
-
- "-record(state, {})." n n
-
- (erlang-skel-double-separator 2)
- "%% API" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
- "%% Description: Starts the server" n
- (erlang-skel-separator 2)
- "start_link() ->" n>
- "gen_server:start_link({local, ?SERVER}, ?MODULE, [], [])." n
- n
- (erlang-skel-double-separator 2)
- "%% gen_server callbacks" n
- (erlang-skel-double-separator 2)
- n
- (erlang-skel-separator 2)
- "%% Function: init(Args) -> {ok, State} |" n
- "%% {ok, State, Timeout} |" n
- "%% ignore |" n
- "%% {stop, Reason}" n
- "%% Description: Initiates the server" n
- (erlang-skel-separator 2)
- "init([]) ->" n>
- "{ok, #state{}}." n
- n
- (erlang-skel-separator 2)
- "%% Function: "
- "%% handle_call(Request, From, State) -> {reply, Reply, State} |" n
- "%% {reply, Reply, State, Timeout} |" n
- "%% {noreply, State} |" n
- "%% {noreply, State, Timeout} |" n
- "%% {stop, Reason, Reply, State} |" n
- "%% {stop, Reason, State}" n
- "%% Description: Handling call messages" n
- (erlang-skel-separator 2)
- "handle_call(_Request, _From, State) ->" n>
- "Reply = ok," n>
- "{reply, Reply, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: handle_cast(Msg, State) -> {noreply, State} |" n
- "%% {noreply, State, Timeout} |" n
- "%% {stop, Reason, State}" n
- "%% Description: Handling cast messages" n
-
- (erlang-skel-separator 2)
- "handle_cast(_Msg, State) ->" n>
- "{noreply, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: handle_info(Info, State) -> {noreply, State} |" n
- "%% {noreply, State, Timeout} |" n
- "%% {stop, Reason, State}" n
- "%% Description: Handling all non call/cast messages" n
- (erlang-skel-separator 2)
- "handle_info(_Info, State) ->" n>
- "{noreply, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: terminate(Reason, State) -> void()" n
- "%% Description: This function is called by a gen_server when it is about to"n
- "%% terminate. It should be the opposite of Module:init/1 and do any necessary"n
- "%% cleaning up. When it returns, the gen_server terminates with Reason." n
- "%% The return value is ignored." n
-
- (erlang-skel-separator 2)
- "terminate(_Reason, _State) ->" n>
- "ok." n
- n
- (erlang-skel-separator 2)
- "%% Func: code_change(OldVsn, State, Extra) -> {ok, NewState}" n
- "%% Description: Convert process state when code is changed" n
- (erlang-skel-separator 2)
- "code_change(_OldVsn, State, _Extra) ->" n>
- "{ok, State}." n
- n
- (erlang-skel-separator 2)
- "%%% Internal functions" n
- (erlang-skel-separator 2)
- )
- "*The template of a generic server.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-gen-event
- '((erlang-skel-include erlang-skel-large-header)
- "-behaviour(gen_event)." n
-
- "%% API" n
- "-export([start_link/0, add_handler/0])." n n
-
- "%% gen_event callbacks" n
- "-export([init/1, handle_event/2, handle_call/2, " n>
- "handle_info/2, terminate/2, code_change/3])." n n
-
- "-record(state, {})." n n
-
- (erlang-skel-double-separator 2)
- "%% gen_event callbacks" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: start_link() -> {ok,Pid} | {error,Error} " n
- "%% Description: Creates an event manager." n
- (erlang-skel-separator 2)
- "start_link() ->" n>
- "gen_event:start_link({local, ?SERVER}). " n
- n
- (erlang-skel-separator 2)
- "%% Function: add_handler() -> ok | {'EXIT',Reason} | term()" n
- "%% Description: Adds an event handler" n
- (erlang-skel-separator 2)
- "add_handler() ->" n>
- "gen_event:add_handler(?SERVER, ?MODULE, [])." n
- n
- (erlang-skel-double-separator 2)
- "%% gen_event callbacks" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: init(Args) -> {ok, State}" n
- "%% Description: Whenever a new event handler is added to an event manager,"n
- "%% this function is called to initialize the event handler." n
- (erlang-skel-separator 2)
- "init([]) ->" n>
- "{ok, #state{}}." n
- n
- (erlang-skel-separator 2)
- "%% Function: "n
- "%% handle_event(Event, State) -> {ok, State} |" n
- "%% {swap_handler, Args1, State1, Mod2, Args2} |"n
- "%% remove_handler" n
- "%% Description:Whenever an event manager receives an event sent using"n
- "%% gen_event:notify/2 or gen_event:sync_notify/2, this function is called for"n
- "%% each installed event handler to handle the event. "n
- (erlang-skel-separator 2)
- "handle_event(_Event, State) ->" n>
- "{ok, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: " n
- "%% handle_call(Request, State) -> {ok, Reply, State} |" n
- "%% {swap_handler, Reply, Args1, State1, "n
- "%% Mod2, Args2} |" n
- "%% {remove_handler, Reply}" n
- "%% Description: Whenever an event manager receives a request sent using"n
- "%% gen_event:call/3,4, this function is called for the specified event "n
- "%% handler to handle the request."n
- (erlang-skel-separator 2)
- "handle_call(_Request, State) ->" n>
- "Reply = ok," n>
- "{ok, Reply, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: " n
- "%% handle_info(Info, State) -> {ok, State} |" n
- "%% {swap_handler, Args1, State1, Mod2, Args2} |" n
- "%% remove_handler" n
- "%% Description: This function is called for each installed event handler when"n
- "%% an event manager receives any other message than an event or a synchronous"n
- "%% request (or a system message)."n
- (erlang-skel-separator 2)
- "handle_info(_Info, State) ->" n>
- "{ok, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: terminate(Reason, State) -> void()" n
- "%% Description:Whenever an event handler is deleted from an event manager,"n
- "%% this function is called. It should be the opposite of Module:init/1 and "n
- "%% do any necessary cleaning up. " n
- (erlang-skel-separator 2)
- "terminate(_Reason, _State) ->" n>
- "ok." n
- n
- (erlang-skel-separator 2)
- "%% Function: code_change(OldVsn, State, Extra) -> {ok, NewState} " n
- "%% Description: Convert process state when code is changed" n
- (erlang-skel-separator 2)
- "code_change(_OldVsn, State, _Extra) ->" n>
- "{ok, State}." n
- n
- (erlang-skel-separator 2)
- "%%% Internal functions" n
- (erlang-skel-separator 2)
- )
- "*The template of a gen_event.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-gen-fsm
- '((erlang-skel-include erlang-skel-large-header)
- "-behaviour(gen_fsm)." n n
-
- "%% API" n
- "-export([start_link/0])." n n
-
- "%% gen_fsm callbacks" n
- "-export([init/1, state_name/2, state_name/3, handle_event/3," n>
- "handle_sync_event/4, handle_info/3, terminate/3, code_change/4])." n n
-
- "-record(state, {})." n n
-
- (erlang-skel-double-separator 2)
- "%% API" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: start_link() -> ok,Pid} | ignore | {error,Error}" n
- "%% Description:Creates a gen_fsm process which calls Module:init/1 to"n
- "%% initialize. To ensure a synchronized start-up procedure, this function" n
- "%% does not return until Module:init/1 has returned. " n
- (erlang-skel-separator 2)
- "start_link() ->" n>
- "gen_fsm:start_link({local, ?SERVER}, ?MODULE, [], [])." n
- n
- (erlang-skel-double-separator 2)
- "%% gen_fsm callbacks" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: init(Args) -> {ok, StateName, State} |" n
- "%% {ok, StateName, State, Timeout} |" n
- "%% ignore |" n
- "%% {stop, StopReason} " n
- "%% Description:Whenever a gen_fsm is started using gen_fsm:start/[3,4] or"n
- "%% gen_fsm:start_link/3,4, this function is called by the new process to "n
- "%% initialize. " n
- (erlang-skel-separator 2)
- "init([]) ->" n>
- "{ok, state_name, #state{}}." n
- n
- (erlang-skel-separator 2)
- "%% Function: "n
- "%% state_name(Event, State) -> {next_state, NextStateName, NextState}|" n
- "%% {next_state, NextStateName, " n
- "%% NextState, Timeout} |" n
- "%% {stop, Reason, NewState}" n
- "%% Description:There should be one instance of this function for each possible"n
- "%% state name. Whenever a gen_fsm receives an event sent using" n
- "%% gen_fsm:send_event/2, the instance of this function with the same name as"n
- "%% the current state name StateName is called to handle the event. It is also "n
- "%% called if a timeout occurs. " n
- (erlang-skel-separator 2)
- "state_name(_Event, State) ->" n>
- "{next_state, state_name, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function:" n
- "%% state_name(Event, From, State) -> {next_state, NextStateName, NextState} |"n
- "%% {next_state, NextStateName, " n
- "%% NextState, Timeout} |" n
- "%% {reply, Reply, NextStateName, NextState}|"n
- "%% {reply, Reply, NextStateName, " n
- "%% NextState, Timeout} |" n
- "%% {stop, Reason, NewState}|" n
- "%% {stop, Reason, Reply, NewState}" n
- "%% Description: There should be one instance of this function for each" n
- "%% possible state name. Whenever a gen_fsm receives an event sent using" n
- "%% gen_fsm:sync_send_event/2,3, the instance of this function with the same"n
- "%% name as the current state name StateName is called to handle the event." n
- (erlang-skel-separator 2)
- "state_name(_Event, _From, State) ->" n>
- "Reply = ok," n>
- "{reply, Reply, state_name, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: " n
- "%% handle_event(Event, StateName, State) -> {next_state, NextStateName, "n
- "%% NextState} |" n
- "%% {next_state, NextStateName, "n
- "%% NextState, Timeout} |" n
- "%% {stop, Reason, NewState}" n
- "%% Description: Whenever a gen_fsm receives an event sent using"n
- "%% gen_fsm:send_all_state_event/2, this function is called to handle"n
- "%% the event." n
- (erlang-skel-separator 2)
- "handle_event(_Event, StateName, State) ->" n>
- "{next_state, StateName, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: " n
- "%% handle_sync_event(Event, From, StateName, "n
- "%% State) -> {next_state, NextStateName, NextState} |" n
- "%% {next_state, NextStateName, NextState, " n
- "%% Timeout} |" n
- "%% {reply, Reply, NextStateName, NextState}|" n
- "%% {reply, Reply, NextStateName, NextState, " n
- "%% Timeout} |" n
- "%% {stop, Reason, NewState} |" n
- "%% {stop, Reason, Reply, NewState}" n
- "%% Description: Whenever a gen_fsm receives an event sent using"n
- "%% gen_fsm:sync_send_all_state_event/2,3, this function is called to handle"n
- "%% the event."n
- (erlang-skel-separator 2)
- "handle_sync_event(Event, From, StateName, State) ->" n>
- "Reply = ok," n>
- "{reply, Reply, StateName, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: " n
- "%% handle_info(Info,StateName,State)-> {next_state, NextStateName, NextState}|" n
- "%% {next_state, NextStateName, NextState, "n
- "%% Timeout} |" n
- "%% {stop, Reason, NewState}" n
- "%% Description: This function is called by a gen_fsm when it receives any"n
- "%% other message than a synchronous or asynchronous event"n
- "%% (or a system message)." n
- (erlang-skel-separator 2)
- "handle_info(_Info, StateName, State) ->" n>
- "{next_state, StateName, State}." n
- n
- (erlang-skel-separator 2)
- "%% Function: terminate(Reason, StateName, State) -> void()" n
- "%% Description:This function is called by a gen_fsm when it is about"n
- "%% to terminate. It should be the opposite of Module:init/1 and do any"n
- "%% necessary cleaning up. When it returns, the gen_fsm terminates with"n
- "%% Reason. The return value is ignored." n
- (erlang-skel-separator 2)
- "terminate(_Reason, _StateName, _State) ->" n>
- "ok." n
- n
- (erlang-skel-separator 2)
- "%% Function:" n
- "%% code_change(OldVsn, StateName, State, Extra) -> {ok, StateName, NewState}" n
- "%% Description: Convert process state when code is changed" n
- (erlang-skel-separator 2)
- "code_change(_OldVsn, StateName, State, _Extra) ->" n>
- "{ok, StateName, State}." n
- n
- (erlang-skel-separator 2)
- "%%% Internal functions" n
- (erlang-skel-separator 2)
- )
- "*The template of a gen_fsm.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-lib
- '((erlang-skel-include erlang-skel-large-header)
-
- "%% API" n
- "-export([])." n n
-
- (erlang-skel-double-separator 2)
- "%% API" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: " n
- "%% Description:" n
- (erlang-skel-separator 2)
- n
- (erlang-skel-double-separator 2)
- "%% Internal functions" n
- (erlang-skel-double-separator 2)
- )
- "*The template of a library module.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-corba-callback
- '((erlang-skel-include erlang-skel-large-header)
- "%% Include files" n n
-
- "%% API" n
- "-export([])." n n
-
- "%% Corba callbacks" n
- "-export([init/1, terminate/2, code_change/3])." n n
-
- "-record(state, {})." n n
-
- (erlang-skel-double-separator 2)
- "%% Corba callbacks" n
- (erlang-skel-double-separator 2)
- (erlang-skel-separator 2)
- "%% Function: init(Args) -> {ok, State} |" n
- "%% {ok, State, Timeout} |" n
- "%% ignore |" n
- "%% {stop, Reason}" n
- "%% Description: Initiates the server" n
- (erlang-skel-separator 2)
- "init([]) ->" n>
- "{ok, #state{}}." n
- n
- (erlang-skel-separator 2)
- "%% Function: terminate(Reason, State) -> void()" n
- "%% Description: Shutdown the server" n
- (erlang-skel-separator 2)
- "terminate(_Reason, _State) ->" n>
- "ok." n
- n
- (erlang-skel-separator 2)
- "%% Function: code_change(OldVsn, State, Extra) -> {ok, NewState} " n
- "%% Description: Convert process state when code is changed" n
- (erlang-skel-separator 2)
- "code_change(_OldVsn, State, _Extra) ->" n>
- "{ok, State}." n
- n
- (erlang-skel-double-separator 2)
- "%% Internal functions" n
- (erlang-skel-double-separator 2)
- )
- "*The template of a library module.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-ts-test-suite
- '((erlang-skel-include erlang-skel-large-header)
- "%% Note: This directive should only be used in test suites." n
- "-compile(export_all)." n n
-
- "-include(\"test_server.hrl\")." n n
-
- (erlang-skel-separator 2)
- "%% TEST SERVER CALLBACK FUNCTIONS" n
- (erlang-skel-separator 2)
- n
- (erlang-skel-separator 2)
- "%% Function: init_per_suite(Config0) -> Config1 | {skip,Reason}" n
- "%%" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%% Reason = term()" n
- "%% The reason for skipping the suite." n
- "%%" n
- "%% Description: Initialization before the suite." n
- "%%" n
- "%% Note: This function is free to add any key/value pairs to the Config" n
- "%% variable, but should NOT alter/remove any existing entries." n
- (erlang-skel-separator 2)
- "init_per_suite(Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_suite(Config) -> void()" n
- "%%" n
- "%% Config = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%%" n
- "%% Description: Cleanup after the suite." n
- (erlang-skel-separator 2)
- "end_per_suite(_Config) ->" n >
- "ok." n n
-
- (erlang-skel-separator 2)
- "%% Function: init_per_testcase(TestCase, Config0) -> Config1 |" n
- "%% {skip,Reason}" n
- "%% TestCase = atom()" n
- "%% Name of the test case that is about to run." n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%% Reason = term()" n
- "%% The reason for skipping the test case." n
- "%%" n
- "%% Description: Initialization before each test case." n
- "%%" n
- "%% Note: This function is free to add any key/value pairs to the Config" n
- "%% variable, but should NOT alter/remove any existing entries." n
- (erlang-skel-separator 2)
- "init_per_testcase(_TestCase, Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_testcase(TestCase, Config) -> void()" n
- "%%" n
- "%% TestCase = atom()" n
- "%% Name of the test case that is finished." n
- "%% Config = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%%" n
- "%% Description: Cleanup after each test case." n
- (erlang-skel-separator 2)
- "end_per_testcase(_TestCase, _Config) ->" n >
- "ok."n n
-
- (erlang-skel-separator 2)
- "%% Function: all(Clause) -> Descr | Spec | {skip,Reason}" n
- "%%" n
- "%% Clause = doc | suite" n
- "%% Indicates expected return value." n
- "%% Descr = [string()] | []" n
- "%% String that describes the test suite." n
- "%% Spec = [TestCase]" n
- "%% A test specification." n
- "%% TestCase = ConfCase | atom()" n
- "%% Configuration case, or the name of a test case function." n
- "%% ConfCase = {conf,Init,Spec,End} |" n
- "%% {conf,Properties,Init,Spec,End}" n
- "%% Init = End = {Mod,Func} | Func" n
- "%% Initialization and cleanup function." n
- "%% Mod = Func = atom()" n
- "%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
- "%% Execution properties of the test cases (may be combined)." n
- "%% Shuffle = shuffle | {shuffle,Seed}" n
- "%% To get cases executed in random order." n
- "%% Seed = {integer(),integer(),integer()}" n
- "%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
- "%% repeat_until_any_ok | repeat_until_any_fail" n
- "%% To get execution of cases repeated." n
- "%% N = integer() | forever" n
- "%% Reason = term()" n
- "%% The reason for skipping the test suite." n
- "%%" n
- "%% Description: Returns a description of the test suite when" n
- "%% Clause == doc, and a test specification (list" n
- "%% of the conf and test cases in the suite) when" n
- "%% Clause == suite." n
- (erlang-skel-separator 2)
- "all(doc) -> " n >
- "[\"Describe the main purpose of this suite\"];" n n
- "all(suite) -> " n >
- "[a_test_case]." n n
- n
- (erlang-skel-separator 2)
- "%% TEST CASES" n
- (erlang-skel-separator 2)
- n
- (erlang-skel-separator 2)
- "%% Function: TestCase(Arg) -> Descr | Spec | ok | exit() | {skip,Reason}" n
- "%%" n
- "%% Arg = doc | suite | Config" n
- "%% Indicates expected behaviour and return value." n
- "%% Config = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%% Descr = [string()] | []" n
- "%% String that describes the test case." n
- "%% Spec = [tuple()] | []" n
- "%% A test specification, see all/1." n
- "%% Reason = term()" n
- "%% The reason for skipping the test case." n
- "%%" n
- "%% Description: Test case function. Returns a description of the test" n
- "%% case (doc), then returns a test specification (suite)," n
- "%% or performs the actual test (Config)." n
- (erlang-skel-separator 2)
- "a_test_case(doc) -> " n >
- "[\"Describe the main purpose of this test case\"];" n n
- "a_test_case(suite) -> " n >
- "[];" n n
- "a_test_case(Config) when is_list(Config) -> " n >
- "ok." n
- )
- "*The template of a library module.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-ct-test-suite-l
- '((erlang-skel-include erlang-skel-large-header)
- "%% Note: This directive should only be used in test suites." n
- "-compile(export_all)." n n
-
- "-include(\"ct.hrl\")." n n
-
- (erlang-skel-separator 2)
- "%% COMMON TEST CALLBACK FUNCTIONS" n
- (erlang-skel-separator 2)
- n
- (erlang-skel-separator 2)
- "%% Function: suite() -> Info" n
- "%%" n
- "%% Info = [tuple()]" n
- "%% List of key/value pairs." n
- "%%" n
- "%% Description: Returns list of tuples to set default properties" n
- "%% for the suite." n
- "%%" n
- "%% Note: The suite/0 function is only meant to be used to return" n
- "%% default data values, not perform any other operations." n
- (erlang-skel-separator 2)
- "suite() ->" n >
- "[{timetrap,{minutes,10}}]." n n
-
- (erlang-skel-separator 2)
- "%% Function: init_per_suite(Config0) ->" n
- "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
- "%%" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%% Reason = term()" n
- "%% The reason for skipping the suite." n
- "%%" n
- "%% Description: Initialization before the suite." n
- "%%" n
- "%% Note: This function is free to add any key/value pairs to the Config" n
- "%% variable, but should NOT alter/remove any existing entries." n
- (erlang-skel-separator 2)
- "init_per_suite(Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}" n
- "%%" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%%" n
- "%% Description: Cleanup after the suite." n
- (erlang-skel-separator 2)
- "end_per_suite(_Config) ->" n >
- "ok." n n
-
- (erlang-skel-separator 2)
- "%% Function: init_per_group(GroupName, Config0) ->" n
- "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
- "%%" n
- "%% GroupName = atom()" n
- "%% Name of the test case group that is about to run." n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding configuration data for the group." n
- "%% Reason = term()" n
- "%% The reason for skipping all test cases and subgroups in the group." n
- "%%" n
- "%% Description: Initialization before each test case group." n
- (erlang-skel-separator 2)
- "init_per_group(_GroupName, Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_group(GroupName, Config0) ->" n
- "%% void() | {save_config,Config1}" n
- "%%" n
- "%% GroupName = atom()" n
- "%% Name of the test case group that is finished." n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding configuration data for the group." n
- "%%" n
- "%% Description: Cleanup after each test case group." n
- (erlang-skel-separator 2)
- "end_per_group(_GroupName, _Config) ->" n >
- "ok." n n
-
- (erlang-skel-separator 2)
- "%% Function: init_per_testcase(TestCase, Config0) ->" n
- "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
- "%%" n
- "%% TestCase = atom()" n
- "%% Name of the test case that is about to run." n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%% Reason = term()" n
- "%% The reason for skipping the test case." n
- "%%" n
- "%% Description: Initialization before each test case." n
- "%%" n
- "%% Note: This function is free to add any key/value pairs to the Config" n
- "%% variable, but should NOT alter/remove any existing entries." n
- (erlang-skel-separator 2)
- "init_per_testcase(_TestCase, Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_testcase(TestCase, Config0) ->" n
- "%% void() | {save_config,Config1} | {fail,Reason}" n
- "%%" n
- "%% TestCase = atom()" n
- "%% Name of the test case that is finished." n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%% Reason = term()" n
- "%% The reason for failing the test case." n
- "%%" n
- "%% Description: Cleanup after each test case." n
- (erlang-skel-separator 2)
- "end_per_testcase(_TestCase, _Config) ->" n >
- "ok." n n
-
- (erlang-skel-separator 2)
- "%% Function: groups() -> [Group]" n
- "%%" n
- "%% Group = {GroupName,Properties,GroupsAndTestCases}" n
- "%% GroupName = atom()" n
- "%% The name of the group." n
- "%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
- "%% Group properties that may be combined." n
- "%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]" n
- "%% TestCase = atom()" n
- "%% The name of a test case." n
- "%% Shuffle = shuffle | {shuffle,Seed}" n
- "%% To get cases executed in random order." n
- "%% Seed = {integer(),integer(),integer()}" n
- "%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
- "%% repeat_until_any_ok | repeat_until_any_fail" n
- "%% To get execution of cases repeated." n
- "%% N = integer() | forever" n
- "%%" n
- "%% Description: Returns a list of test case group definitions." n
- (erlang-skel-separator 2)
- "groups() ->" n >
- "[]." n n
-
- (erlang-skel-separator 2)
- "%% Function: all() -> GroupsAndTestCases | {skip,Reason}" n
- "%%" n
- "%% GroupsAndTestCases = [{group,GroupName} | TestCase]" n
- "%% GroupName = atom()" n
- "%% Name of a test case group." n
- "%% TestCase = atom()" n
- "%% Name of a test case." n
- "%% Reason = term()" n
- "%% The reason for skipping all groups and test cases." n
- "%%" n
- "%% Description: Returns the list of groups and test cases that" n
- "%% are to be executed." n
- (erlang-skel-separator 2)
- "all() -> " n >
- "[my_test_case]." n n
-
- n
- (erlang-skel-separator 2)
- "%% TEST CASES" n
- (erlang-skel-separator 2)
- n
-
- (erlang-skel-separator 2)
- "%% Function: TestCase() -> Info" n
- "%%" n
- "%% Info = [tuple()]" n
- "%% List of key/value pairs." n
- "%%" n
- "%% Description: Test case info function - returns list of tuples to set" n
- "%% properties for the test case." n
- "%%" n
- "%% Note: This function is only meant to be used to return a list of" n
- "%% values, not perform any other operations." n
- (erlang-skel-separator 2)
- "my_test_case() -> " n >
- "[]." n n
-
- (erlang-skel-separator 2)
- "%% Function: TestCase(Config0) ->" n
- "%% ok | exit() | {skip,Reason} | {comment,Comment} |" n
- "%% {save_config,Config1} | {skip_and_save,Reason,Config1}" n
- "%%" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% A list of key/value pairs, holding the test case configuration." n
- "%% Reason = term()" n
- "%% The reason for skipping the test case." n
- "%% Comment = term()" n
- "%% A comment about the test case that will be printed in the html log." n
- "%%" n
- "%% Description: Test case function. (The name of it must be specified in" n
- "%% the all/0 list or in a test case group for the test case" n
- "%% to be executed)." n
- (erlang-skel-separator 2)
- "my_test_case(_Config) -> " n >
- "ok." n
- )
- "*The template of a library module.
-Please see the function `tempo-define-template'.")
-
-(defvar erlang-skel-ct-test-suite-s
- '((erlang-skel-include erlang-skel-large-header)
- "-compile(export_all)." n n
-
- "-include(\"ct.hrl\")." n n
-
- (erlang-skel-separator 2)
- "%% Function: suite() -> Info" n
- "%% Info = [tuple()]" n
- (erlang-skel-separator 2)
- "suite() ->" n >
- "[{timetrap,{seconds,30}}]." n n
-
- (erlang-skel-separator 2)
- "%% Function: init_per_suite(Config0) ->" n
- "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% Reason = term()" n
- (erlang-skel-separator 2)
- "init_per_suite(Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}" n
- "%% Config0 = Config1 = [tuple()]" n
- (erlang-skel-separator 2)
- "end_per_suite(_Config) ->" n >
- "ok." n n
-
- (erlang-skel-separator 2)
- "%% Function: init_per_group(GroupName, Config0) ->" n
- "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
- "%% GroupName = atom()" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% Reason = term()" n
- (erlang-skel-separator 2)
- "init_per_group(_GroupName, Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_group(GroupName, Config0) ->" n
- "%% void() | {save_config,Config1}" n
- "%% GroupName = atom()" n
- "%% Config0 = Config1 = [tuple()]" n
- (erlang-skel-separator 2)
- "end_per_group(_GroupName, _Config) ->" n >
- "ok." n n
-
- (erlang-skel-separator 2)
- "%% Function: init_per_testcase(TestCase, Config0) ->" n
- "%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
- "%% TestCase = atom()" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% Reason = term()" n
- (erlang-skel-separator 2)
- "init_per_testcase(_TestCase, Config) ->" n >
- "Config." n n
-
- (erlang-skel-separator 2)
- "%% Function: end_per_testcase(TestCase, Config0) ->" n
- "%% void() | {save_config,Config1} | {fail,Reason}" n
- "%% TestCase = atom()" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% Reason = term()" n
- (erlang-skel-separator 2)
- "end_per_testcase(_TestCase, _Config) ->" n >
- "ok." n n
-
- (erlang-skel-separator 2)
- "%% Function: groups() -> [Group]" n
- "%% Group = {GroupName,Properties,GroupsAndTestCases}" n
- "%% GroupName = atom()" n
- "%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
- "%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]" n
- "%% TestCase = atom()" n
- "%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}" n
- "%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
- "%% repeat_until_any_ok | repeat_until_any_fail" n
- "%% N = integer() | forever" n
- (erlang-skel-separator 2)
- "groups() ->" n >
- "[]." n n
-
- (erlang-skel-separator 2)
- "%% Function: all() -> GroupsAndTestCases | {skip,Reason}" n
- "%% GroupsAndTestCases = [{group,GroupName} | TestCase]" n
- "%% GroupName = atom()" n
- "%% TestCase = atom()" n
- "%% Reason = term()" n
- (erlang-skel-separator 2)
- "all() -> " n >
- "[my_test_case]." n n
-
- (erlang-skel-separator 2)
- "%% Function: TestCase() -> Info" n
- "%% Info = [tuple()]" n
- (erlang-skel-separator 2)
- "my_test_case() -> " n >
- "[]." n n
-
- (erlang-skel-separator 2)
- "%% Function: TestCase(Config0) ->" n
- "%% ok | exit() | {skip,Reason} | {comment,Comment} |" n
- "%% {save_config,Config1} | {skip_and_save,Reason,Config1}" n
- "%% Config0 = Config1 = [tuple()]" n
- "%% Reason = term()" n
- "%% Comment = term()" n
- (erlang-skel-separator 2)
- "my_test_case(_Config) -> " n >
- "ok." n
- )
- "*The template of a library module.
-Please see the function `tempo-define-template'.")
+;; Tempo skeleton templates:
+(load erlang-skel-file)
;; Font-lock variables
diff --git a/system/doc/installation_guide/Makefile b/system/doc/installation_guide/Makefile
index ec60105ae0..53a02a1edf 100644
--- a/system/doc/installation_guide/Makefile
+++ b/system/doc/installation_guide/Makefile
@@ -54,10 +54,12 @@ XML_FILES = \
$(XML_PART_FILES)
# ----------------------------------------------------
-# Readme for X-compiling
+# Install readme files
# ----------------------------------------------------
-XCOMP_README_FILE = $(ERL_TOP)/xcomp/README.md
-README_FILE = $(ERL_TOP)/README
+INSTALL_READMES = \
+ $(ERL_TOP)/INSTALL.html \
+ $(ERL_TOP)/INSTALL-CROSS.html \
+ $(ERL_TOP)/INSTALL-WIN32.html
# ----------------------------------------------------
@@ -98,10 +100,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
$(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(README_FILE) $(GIF_FILES) $(HTMLDIR)/*.html \
+ $(INSTALL_DATA) $(INSTALL_READMES) $(GIF_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/xcomp
- $(INSTALL_DATA) $(XCOMP_README_FILE) $(RELSYSDIR)/xcomp
release_spec:
diff --git a/system/doc/installation_guide/install.xml b/system/doc/installation_guide/install.xml
index 2e37ff35e9..027b3c49a0 100644
--- a/system/doc/installation_guide/install.xml
+++ b/system/doc/installation_guide/install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Installation</title>
@@ -33,6 +33,23 @@
</header>
<section>
+ <title>Source</title>
+ <p>This document describes installation procedures for
+ binary releases. Documentation of the build and installation
+ procedures for the source release can be found in the source
+ tree at the following locations:</p>
+ <taglist>
+ <tag>Building and Installing Erlang/OTP</tag>
+ <item><url href="INSTALL.html"><c>$ERL_TOP/INSTALL.md</c></url></item>
+ <tag>Cross Compiling Erlang/OTP</tag>
+ <item><url href="INSTALL-CROSS.html"><c>$ERL_TOP/INSTALL-CROSS.md</c></url></item>
+ <tag>How to Build Erlang/OTP on Windows</tag>
+ <item><url href="INSTALL-WIN32.html"><c>$ERL_TOP/INSTALL-WIN32.md</c></url></item>
+ </taglist>
+ <p>Where <c>$ERL_TOP</c> is the top directory in the source tree.</p>
+ </section>
+
+ <section>
<title>UNIX</title>
<section>
diff --git a/xcomp/README.md b/xcomp/README.md
index e97b26e605..19a692143a 100644
--- a/xcomp/README.md
+++ b/xcomp/README.md
@@ -2,25 +2,38 @@ Cross Compiling Erlang/OTP
==========================
This document describes how to cross compile Erlang/OTP. Note that the support
-for cross compiling Erlang/OTP is in its early stage of development, and
-should be considered as experimental. You are encouraged to read the whole
-document before attempting to cross compile Erlang/OTP.
+for cross compiling Erlang/OTP should be considered as experimental. As far as
+we know, the R13B04 release should cross compile fine, but since we currently
+have a very limited set of cross compilation environments to test with we
+cannot be sure. The cross compile support will stay in an experimental state
+until we get a lot more cross compilation environments to test with.
+
+You are encouraged to read the whole document before attempting to cross
+compile Erlang/OTP. Before reading this document you should read the
+[`$ERL_TOP/INSTALL.md`] [1] document which describes building Erlang/OTP in
+general. `$ERL_TOP` is the top directory in the source tree.
+
+`otp_build` Versus `configure`/`make`
+------------------------------------
Building Erlang/OTP can be done either by using the `$ERL_TOP/otp_build`
-script, or by invoking `$ERL_TOP/configure` and `make` directly (where
-`$ERL_TOP` is the top directory in the source tree). Building using `otp_build`
-is easier since it involves fewer steps, but the `otp_build` build procedure
-is not as flexible as the `configure`/`make` build procedure. The binary
-releases that we deliver are built using `otp_build`. Also note that
-`otp_build configure` will produce a default configuration that differs from
-what `configure` will produce by default. For example, currently
+script, or by invoking `$ERL_TOP/configure` and `make` directly. Building using
+`otp_build` is easier since it involves fewer steps, but the `otp_build` build
+procedure is not as flexible as the `configure`/`make` build procedure. Note
+that `otp_build configure` will produce a default configuration that differs
+from what `configure` will produce by default. For example, currently
`--disable-dynamic-ssl-lib` is added to the `configure` command line arguments
-unless `--enable-dynamic-ssl-lib` has been explicitly passed. The defaults
-used by `otp_build configure` may change at any time without prior notice.
+unless `--enable-dynamic-ssl-lib` has been explicitly passed. The binary
+releases that we deliver are built using `otp_build`. The defaults used by
+`otp_build configure` may change at any time without prior notice.
+
+Cross Configuration
+-------------------
The `$ERL_TOP/xcomp/erl-xcomp.conf.template` file contains all available cross
configuration variables and can be used as a template when creating a cross
-compilation configuration. For examples of working cross configurations see
+compilation configuration. All cross configuration variables are also listed
+at the end of this document. For examples of working cross configurations see
the `$ERL_TOP/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf` file and the
`$ERL_TOP/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf` file. If the default
behavior of a variable is satisfactory, the variable does not need to be set.
@@ -38,10 +51,16 @@ invoking `make`; otherwise, the environment variables might set make variables
in some applications, or parts of some applications, and you may end up with
an erroneously configured build.
+What can be Cross Compiled?
+---------------------------
+
All Erlang/OTP applications except the `wx` application can be cross compiled.
The build of the `wx` driver will currently be automatically disabled when
cross compiling.
+Compatibility
+-------------
+
The build system, including cross compilation configuration variables used,
may be subject to non backward compatible changes without prior notice.
Current cross build system has been tested when cross compiling some Linux/GNU
@@ -49,6 +68,9 @@ systems, but has only been partly tested for more esoteric platforms. The
VxWorks example file is highly dependent on our environment and is here more
or less only for internal use.
+Patches
+-------
+
Please submit any patches for cross compiling in a way consistent with this
system. All input is welcome as we have a very limited set of cross compiling
environments to test with. If a new configuration variable is needed, add it
@@ -66,24 +88,23 @@ Note that this might be an incomplete list of files that need to be updated.
General information on how to submit patches can be found at:
<http://wiki.github.com/erlang/otp/submitting-patches>
-If you are building in a `git` working directory, the `configure` scripts need
-to be generated before you can start building. This is done by invoking
-`./otp_build autoconf` in the `$ERL_TOP` directory. The `configure` scripts
-also have to be regenerated when a `configure.in` or `aclocal.m4` file is
-modified. Note that this is *not* needed when building an unmodified version
-of the released source.
+Build and Install Procedure
+---------------------------
+
+If you are building in Git you want to read the "Building in Git" section
+of [`$ERL_TOP/INSTALL.md`] [1] before proceeding.
-Build and Install
------------------
+We will first go through the `configure`/`make` build procedure which people
+probably are most familiar with.
- [1]
+### Building With `configure`/`make` Directly ###
+
+ (1)
Change directory into the top directory of the Erlang/OTP source tree.
$ cd $ERL_TOP
-### Build ###
-
In order to compile Erlang code, a small Erlang bootstrap system has to be
built, or an Erlang/OTP system of the same release as the one being built
has to be provided in the `$PATH`. The Erlang/OTP for the target system will
@@ -91,11 +112,11 @@ be built using this Erlang system, together with the cross compilation tools
provided.
If you want to build using a compatible Erlang/OTP system in the `$PATH`,
-jump to [3].
+jump to (3).
#### Building a Bootstrap System ####
- [2]
+ (2)
$ ./configure --enable-bootstrap-only
$ make
@@ -109,7 +130,7 @@ be built.
#### Cross Building the System ####
- [3]
+ (3)
$ ./configure --host=<HOST> --build=<BUILD> [Other Config Args]
$ make
@@ -139,9 +160,11 @@ silently produce suboptimal code, or silently produce erroneous code.
#### Installing ####
You can either install using the installation paths determined by `configure`
-[4], or install manually using [5].
+(4), or install manually using (5).
- [4]
+##### Installing Using Paths Determined by `configure` #####
+
+ (4)
$ make install DESTDIR=<TEMPORARY_PREFIX>
@@ -149,8 +172,8 @@ You can either install using the installation paths determined by `configure`
`configure` arguments specifying where the installation should reside are for
example: `--prefix`, `--exec-prefix`, `--libdir`, `--bindir`, etc. By default
it will install under `/usr/local`. You typically do not want to install your
-cross build under `/usr/local` on your build machine. Using `DESTDIR` will
-cause the installation paths to be prefixed by `$DESTDIR`. This makes it
+cross build under `/usr/local` on your build machine. Using [`DESTDIR`] [2]
+will cause the installation paths to be prefixed by `$DESTDIR`. This makes it
possible to install and package the installation on the build machine without
having to place the installation in the same directory on the build machine as
it should be executed from on the target machine.
@@ -160,9 +183,9 @@ the system, move it to the target machine, and unpack it. Note that the
installation will only be working on the target machine at the location
determined by `configure`.
-Installing manually:
+##### Installing Manually #####
- [5]
+ (5)
$ make release RELEASE_ROOT=<RELEASE_DIR>
@@ -181,50 +204,51 @@ currently be invoked as follows in the directory where it resides
where:
- * `-minimal` - Creates an installation that starts up a minimal
- amount of applications, i.e., only `kernel` and
- `stdlib` are started. The minimal system is normally
- enough, and is what `make install` uses.
- * `-sasl` - Creates an installation that also starts up the
- `sasl` application.
- * `-cross` - For cross compilation. Informs the install script
- that it is run on the build machine.
- * `<ERL_ROOT>` - The absolute path to the Erlang installation to use
- at run time. This is often the same as the current
- working directory, but does not have to be. It can
- follow any other path through the file system to the
- same directory.
+* `-minimal` Creates an installation that starts up a minimal amount
+ of applications, i.e., only `kernel` and `stdlib` are started. The
+ minimal system is normally enough, and is what `make install` uses.
+* `-sasl` Creates an installation that also starts up the `sasl`
+ application.
+* `-cross` For cross compilation. Informs the install script that it
+ is run on the build machine.
+* `<ERL_ROOT>` - The absolute path to the Erlang installation to use
+ at run time. This is often the same as the current working directory,
+ but does not have to be. It can follow any other path through the file
+ system to the same directory.
If neither `-minimal`, nor `-sasl` is passed as argument you will be
prompted.
-You can now either do [6] or [7]:
+You can now either do:
+
+ (6)
- [6]
+* Decide where the installation should be located on the target machine,
+ run the `Install` script on the build machine, and package the installed
+ installation. The installation just need to be unpacked at the right
+ location on the target machine:
-Decide where the installation should be located on the target machine, run
-the `Install` script on the build machine, and package the installed
-installation. The installation just need to be unpacked at the right location
-on the target machine:
+ $ cd <RELEASE_DIR>
+ $ ./Install -cross [-minimal|-sasl] <ABSOLUTE_INSTALL_DIR_ON_TARGET>
- $ cd <RELEASE_DIR>
- $ ./Install -cross [-minimal|-sasl] <ABSOLUTE_INSTALL_DIR_ON_TARGET>
+or:
- [7]
+ (7)
-Package the installation in <RELEASE_DIR>, place it wherever you want on your
-target machine, and run the `Install` script on your target machine:
+* Package the installation in `<RELEASE_DIR>`, place it wherever you want
+ on your target machine, and run the `Install` script on your target
+ machine:
- $ cd <ABSOLUTE_INSTALL_DIR_ON_TARGET>
- $ ./Install [-minimal|-sasl] <ABSOLUTE_INSTALL_DIR_ON_TARGET>
+ $ cd <ABSOLUTE_INSTALL_DIR_ON_TARGET>
+ $ ./Install [-minimal|-sasl] <ABSOLUTE_INSTALL_DIR_ON_TARGET>
-#### Building With the `otp_build` Script ####
+### Building With the `otp_build` Script ###
- [8]
+ (8)
$ cd $ERL_TOP
- [9]
+ (9)
$ ./otp_build configure --xcomp-conf=<FILE> [Other Config Args]
@@ -235,7 +259,7 @@ alternatively:
If you have your cross compilation configuration in a file, pass it using the
`--xcomp-conf=<FILE>` command line argument. If not, pass `--host=<HOST>`,
`--build=<BUILD>`, and the configuration variables using a `<VARIABLE>=<VALUE>`
-syntax on the command line (same as in [3]). Note that `<HOST>` and `<BUILD>`
+syntax on the command line (same as in (3)). Note that `<HOST>` and `<BUILD>`
have to be passed one way or the other; either by using `erl_xcomp_host=<HOST>`
and `erl_xcomp_build=<BUILD>` in the configuration file, or by using the
`--host=<HOST>`, and `--build=<BUILD>` command line arguments.
@@ -243,19 +267,19 @@ and `erl_xcomp_build=<BUILD>` in the configuration file, or by using the
`otp_build configure` will configure both for the boostrap system on the
build machine and the cross host system.
- [10]
+ (10)
$ ./otp_build boot -a
`otp_build boot -a` will first build a bootstrap system for the build machine
and then do the cross build of the system.
- [11]
+ (11)
$ ./otp_build release -a <RELEASE_DIR>
-`otp_build release -a` will do the same as [5], and you will after this have
-to do a manual install either by doing [6], or [7].
+`otp_build release -a` will do the same as (5), and you will after this have
+to do a manual install either by doing (6), or (7).
Currently Used Configuration Variables
--------------------------------------
@@ -274,22 +298,22 @@ cross compilation using `$ERL_TOP/otp_build configure`.
*NOTE*! These variables currently have *no* effect if you configure using
the `configure` script directly.
-* `erl_xcomp_build` - The build system used. This value will be passed as
- `--build=$erl_xcomp_build` argument to the `configure` script. It does
- not have to be a full `CPU-VENDOR-OS` triplet, but can be. The full
- `CPU-VENDOR-OS` triplet will be created by
- `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build`.
- If set to `guess`, the build system will be guessed using
- `$ERL_TOP/erts/autoconf/config.guess`.
+* `erl_xcomp_build` - The build system used. This value will be passed as
+ `--build=$erl_xcomp_build` argument to the `configure` script. It does
+ not have to be a full `CPU-VENDOR-OS` triplet, but can be. The full
+ `CPU-VENDOR-OS` triplet will be created by
+ `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build`. If set to `guess`,
+ the build system will be guessed using
+ `$ERL_TOP/erts/autoconf/config.guess`.
-* `erl_xcomp_host` - Cross host/target system to build for. This value will
- be passed as `--host=$erl_xcomp_host` argument to the `configure` script.
- It does not have to be a full `CPU-VENDOR-OS` triplet, but can be. The
- full `CPU-VENDOR-OS` triplet will be created by:
- `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host`
+* `erl_xcomp_host` - Cross host/target system to build for. This value will
+ be passed as `--host=$erl_xcomp_host` argument to the `configure` script.
+ It does not have to be a full `CPU-VENDOR-OS` triplet, but can be. The
+ full `CPU-VENDOR-OS` triplet will be created by
+ `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host`.
-* `erl_xcomp_configure_flags` - Extra configure flags to pass to the
- `configure` script.
+* `erl_xcomp_configure_flags` - Extra configure flags to pass to the
+ `configure` script.
### Cross Compiler and Other Tools ###
@@ -299,75 +323,75 @@ not need to set these variables (where `<HOST>` is what has been passed as
All variables in this section can also be used when native compiling.
-* `CC` - C compiler.
+* `CC` - C compiler.
-* `CFLAGS` - C compiler flags.
+* `CFLAGS` - C compiler flags.
-* `STATIC_CFLAGS` - Static C compiler flags.
+* `STATIC_CFLAGS` - Static C compiler flags.
-* `CFLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
- search path for the shared libraries. Note that this actually is a
- linker flag, but it needs to be passed via the compiler.
+* `CFLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
+ search path for the shared libraries. Note that this actually is a
+ linker flag, but it needs to be passed via the compiler.
-* `CPP` - C pre-processor.
+* `CPP` - C pre-processor.
-* `CPPFLAGS` - C pre-processor flags.
+* `CPPFLAGS` - C pre-processor flags.
-* `CXX` - C++ compiler.
+* `CXX` - C++ compiler.
-* `CXXFLAGS` - C++ compiler flags.
+* `CXXFLAGS` - C++ compiler flags.
-* `LD` - Linker.
+* `LD` - Linker.
-* `LDFLAGS` - Linker flags.
+* `LDFLAGS` - Linker flags.
-* `LIBS` - Libraries.
+* `LIBS` - Libraries.
#### *D*ynamic *E*rlang *D*river Linking ####
*NOTE*! Either set all or none of the `DED_LD*` variables.
-* `DED_LD` - Linker for Dynamically loaded Erlang Drivers.
+* `DED_LD` - Linker for Dynamically loaded Erlang Drivers.
-* `DED_LDFLAGS` - Linker flags to use with `DED_LD`.
+* `DED_LDFLAGS` - Linker flags to use with `DED_LD`.
-* `DED_LD_FLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
- search path for shared libraries when linking with `DED_LD`.
+* `DED_LD_FLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
+ search path for shared libraries when linking with `DED_LD`.
#### Large File Support ####
*NOTE*! Either set all or none of the `LFS_*` variables.
-* `LFS_CFLAGS` - Large file support C compiler flags.
+* `LFS_CFLAGS` - Large file support C compiler flags.
-* `LFS_LDFLAGS` - Large file support linker flags.
+* `LFS_LDFLAGS` - Large file support linker flags.
-* `LFS_LIBS` - Large file support libraries.
+* `LFS_LIBS` - Large file support libraries.
#### Other Tools ####
-* `RANLIB` - `ranlib` archive index tool.
+* `RANLIB` - `ranlib` archive index tool.
-* `AR` - `ar` archiving tool.
+* `AR` - `ar` archiving tool.
-* `GETCONF` - `getconf` system configuration inspection tool. `getconf` is
- currently used for finding out large file support flags to use, and
- on Linux systems for finding out if we have an NPTL thread library or
- not.
+* `GETCONF` - `getconf` system configuration inspection tool. `getconf` is
+ currently used for finding out large file support flags to use, and
+ on Linux systems for finding out if we have an NPTL thread library or
+ not.
### Cross System Root Locations ###
-* `erl_xcomp_sysroot` - The absolute path to the system root of the cross
- compilation environment. Currently, the `crypto`, `odbc`, `ssh` and
- `ssl` applications need the system root. These applications will be
- skipped if the system root has not been set. The system root might be
- needed for other things too. If this is the case and the system root
- has not been set, `configure` will fail and request you to set it.
+* `erl_xcomp_sysroot` - The absolute path to the system root of the cross
+ compilation environment. Currently, the `crypto`, `odbc`, `ssh` and
+ `ssl` applications need the system root. These applications will be
+ skipped if the system root has not been set. The system root might be
+ needed for other things too. If this is the case and the system root
+ has not been set, `configure` will fail and request you to set it.
-* `erl_xcomp_isysroot` - The absolute path to the system root for includes
- of the cross compilation environment. If not set, this value defaults
- to `$erl_xcomp_sysroot`, i.e., only set this value if the include system
- root path is not the same as the system root path.
+* `erl_xcomp_isysroot` - The absolute path to the system root for includes
+ of the cross compilation environment. If not set, this value defaults
+ to `$erl_xcomp_sysroot`, i.e., only set this value if the include system
+ root path is not the same as the system root path.
### Optional Feature, and Bug Tests ###
@@ -382,72 +406,72 @@ it cannot figure the result out.
The `configure` script will issue a warning when a default value is used.
When a variable has been set, no warning will be issued.
-* `erl_xcomp_after_morecore_hook` - `yes|no`. Defaults to `no`. If `yes`, the
- target system must have a working `__after_morecore_hook` that can be
- used for tracking used `malloc()` implementations core memory usage.
- This is currently only used by unsupported features.
-
-* `erl_xcomp_bigendian` - `yes|no`. No default. If `yes`, the target system
- must be big endian. If `no`, little endian. This can often be
- automatically detected, but not always. If not automatically detected,
- `configure` will fail unless this variable is set. Since no default
- value is used, `configure` will try to figure this out automatically.
-
-* `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
- the target system must have a working `clock_gettime()` implementation
- that can be used for retrieving process CPU time.
-
-* `erl_xcomp_getaddrinfo` - `yes|no`. Defaults to `no`. If `yes`, the target
- system must have a working `getaddrinfo()` implementation that can
- handle both IPv4 and IPv6.
-
-* `erl_xcomp_gethrvtime_procfs_ioctl` - `yes|no`. Defaults to `no`. If `yes`,
- the target system must have a working `gethrvtime()` implementation and
- is used with procfs `ioctl()`.
-
-* `erl_xcomp_dlsym_brk_wrappers` - `yes|no`. Defaults to `no`. If `yes`, the
- target system must have a working `dlsym(RTLD_NEXT, <S>)` implementation
- that can be used on `brk` and `sbrk` symbols used by the `malloc()`
- implementation in use, and by this track the `malloc()` implementations
- core memory usage. This is currently only used by unsupported features.
-
-* `erl_xcomp_kqueue` - `yes|no`. Defaults to `no`. If `yes`, the target system
- must have a working `kqueue()` implementation that returns a file
- descriptor which can be used by `poll()` and/or `select()`. If `no` and
- the target system has not got `epoll()` or `/dev/poll`, the kernel-poll
- feature will be disabled.
-
-* `erl_xcomp_linux_clock_gettime_correction` - `yes|no`. Defaults to `yes` on
- Linux; otherwise, `no`. If `yes`, `clock_gettime(CLOCK_MONOTONIC, _)` on
- the target system must work. This variable is recommended to be set to
- `no` on Linux systems with kernel versions less than 2.6.
-
-* `erl_xcomp_linux_nptl` - `yes|no`. Defaults to `yes` on Linux; otherwise,
- `no`. If `yes`, the target system must have NPTL (Native POSIX Thread
- Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
- kernel versions typically less than 2.6).
-
-* `erl_xcomp_linux_usable_sigaltstack` - `yes|no`. Defaults to `yes` on Linux;
- otherwise, `no`. If `yes`, `sigaltstack()` must be usable on the target
- system. `sigaltstack()` on Linux kernel versions less than 2.4 are
- broken.
-
-* `erl_xcomp_linux_usable_sigusrx` - `yes|no`. Defaults to `yes`. If `yes`,
- the `SIGUSR1` and `SIGUSR2` signals must be usable by the ERTS. Old
- LinuxThreads thread libraries (Linux kernel versions typically less than
- 2.2) used these signals and made them unusable by the ERTS.
-
-* `erl_xcomp_poll` - `yes|no`. Defaults to `no` on Darwin/MacOSX; otherwise,
- `yes`. If `yes`, the target system must have a working `poll()`
- implementation that also can handle devices. If `no`, `select()` will be
- used instead of `poll()`.
-
-* `erl_xcomp_putenv_copy` - `yes|no`. Defaults to `no`. If `yes`, the target
- system must have a `putenv()` implementation that stores a copy of the
- key/value pair.
-
-* `erl_xcomp_reliable_fpe` - `yes|no`. Defaults to `no`. If `yes`, the target
- system must have reliable floating point exceptions.
+* `erl_xcomp_after_morecore_hook` - `yes|no`. Defaults to `no`. If `yes`,
+ the target system must have a working `__after_morecore_hook` that can be
+ used for tracking used `malloc()` implementations core memory usage.
+ This is currently only used by unsupported features.
+
+* `erl_xcomp_bigendian` - `yes|no`. No default. If `yes`, the target system
+ must be big endian. If `no`, little endian. This can often be
+ automatically detected, but not always. If not automatically detected,
+ `configure` will fail unless this variable is set. Since no default
+ value is used, `configure` will try to figure this out automatically.
+
+* `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
+ the target system must have a working `clock_gettime()` implementation
+ that can be used for retrieving process CPU time.
+
+* `erl_xcomp_getaddrinfo` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have a working `getaddrinfo()` implementation that can
+ handle both IPv4 and IPv6.
+
+* `erl_xcomp_gethrvtime_procfs_ioctl` - `yes|no`. Defaults to `no`. If `yes`,
+ the target system must have a working `gethrvtime()` implementation and
+ is used with procfs `ioctl()`.
+
+* `erl_xcomp_dlsym_brk_wrappers` - `yes|no`. Defaults to `no`. If `yes`, the
+ target system must have a working `dlsym(RTLD_NEXT, <S>)` implementation
+ that can be used on `brk` and `sbrk` symbols used by the `malloc()`
+ implementation in use, and by this track the `malloc()` implementations
+ core memory usage. This is currently only used by unsupported features.
+
+* `erl_xcomp_kqueue` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have a working `kqueue()` implementation that returns a file
+ descriptor which can be used by `poll()` and/or `select()`. If `no` and
+ the target system has not got `epoll()` or `/dev/poll`, the kernel-poll
+ feature will be disabled.
+
+* `erl_xcomp_linux_clock_gettime_correction` - `yes|no`. Defaults to `yes` on
+ Linux; otherwise, `no`. If `yes`, `clock_gettime(CLOCK_MONOTONIC, _)` on
+ the target system must work. This variable is recommended to be set to
+ `no` on Linux systems with kernel versions less than 2.6.
+
+* `erl_xcomp_linux_nptl` - `yes|no`. Defaults to `yes` on Linux; otherwise,
+ `no`. If `yes`, the target system must have NPTL (Native POSIX Thread
+ Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+ kernel versions typically less than 2.6).
+
+* `erl_xcomp_linux_usable_sigaltstack` - `yes|no`. Defaults to `yes` on Linux;
+ otherwise, `no`. If `yes`, `sigaltstack()` must be usable on the target
+ system. `sigaltstack()` on Linux kernel versions less than 2.4 are
+ broken.
+
+* `erl_xcomp_linux_usable_sigusrx` - `yes|no`. Defaults to `yes`. If `yes`,
+ the `SIGUSR1` and `SIGUSR2` signals must be usable by the ERTS. Old
+ LinuxThreads thread libraries (Linux kernel versions typically less than
+ 2.2) used these signals and made them unusable by the ERTS.
+
+* `erl_xcomp_poll` - `yes|no`. Defaults to `no` on Darwin/MacOSX; otherwise,
+ `yes`. If `yes`, the target system must have a working `poll()`
+ implementation that also can handle devices. If `no`, `select()` will be
+ used instead of `poll()`.
+
+* `erl_xcomp_putenv_copy` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have a `putenv()` implementation that stores a copy of the
+ key/value pair.
+
+* `erl_xcomp_reliable_fpe` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have reliable floating point exceptions.
Copyright and License
---------------------
@@ -470,16 +494,6 @@ Copyright and License
> %CopyrightEnd%
-<!--
-
-Modifying This Document
------------------------
-
-This document has been written using Markdown notation. This makes it possible
-to easily generate a nice looking HTML version of this file. When modifying
-this file, make sure that the modifications are made using valid Markdown
-notation. For more information on Markdown see:
- <http://daringfireball.net/projects/markdown/>.
-
--->
+ [1]: INSTALL.html "$ERL_TOP/INSTALL.md"
+ [2]: http://www.gnu.org/prep/standards/html_node/DESTDIR.html "DESTDIR"
diff --git a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
index 9379739744..f9fff0fa8e 100644
--- a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
+++ b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
@@ -1,258 +1,258 @@
-#### -*-shell-script-*-
-####
-#### %CopyrightBegin%
-####
-#### Copyright Ericsson AB 2009-2010. All Rights Reserved.
-####
-#### The contents of this file are subject to the Erlang Public License,
-#### Version 1.1, (the "License"); you may not use this file except in
-#### compliance with the License. You should have received a copy of the
-#### Erlang Public License along with this software. If not, it can be
-#### retrieved online at http://www.erlang.org/.
-####
-#### Software distributed under the License is distributed on an "AS IS"
-#### basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-#### the License for the specific language governing rights and limitations
-#### under the License.
-####
-#### %CopyrightEnd%
-####
-#### File: erl-xcomp-TileraMDE2.0-tilepro.conf
-#### Author: Rickard Green
-####
-#### --------------------------------------------------------------------------
-#### When cross compiling Erlang/OTP using `otp_build`, copy this file and set
-#### the variables needed below. Then pass the path to the copy of this file as
-#### an argument to `otp_build` in the configure stage:
-#### `otp_build configure --xcomp-conf=<FILE>`
-#### --------------------------------------------------------------------------
-
-### Note that you cannot define arbitrary variables in a cross compilation
-### configuration file. Only the ones listed below will be guaranteed to be
-### visible throughout the whole execution of all `configure` scripts. Other
-### variables needs to be defined as arguments to `configure` or exported in
-### the environment.
-
-### ### Variables for `otp_build` Only ###
-
-### Variables in this section are only used, when configuring Erlang/OTP for
-### cross compilation using `$ERL_TOP/otp_build configure`.
-
-### *NOTE*! These variables currently have *no* effect if you configure using
-### the `configure` script directly.
-
-## `erl_xcomp_build` - The build system used. This value will be passed as
-## `--build=$erl_xcomp_build` argument to the `configure` script. It does
-## not have to be a full `CPU-VENDOR-OS` triplet, but can be. The full
-## `CPU-VENDOR-OS` triplet will be created by
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build`.
-## If set to `guess`, the build system will be guessed using
-## `$ERL_TOP/erts/autoconf/config.guess`.
+## -*-shell-script-*-
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2009-2010. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## File: erl-xcomp-TileraMDE2.0-tilepro.conf
+## Author: Rickard Green
+##
+## -----------------------------------------------------------------------------
+## When cross compiling Erlang/OTP using `otp_build', copy this file and set
+## the variables needed below. Then pass the path to the copy of this file as
+## an argument to `otp_build' in the configure stage:
+## `otp_build configure --xcomp-conf=<FILE>'
+## -----------------------------------------------------------------------------
+
+## Note that you cannot define arbitrary variables in a cross compilation
+## configuration file. Only the ones listed below will be guaranteed to be
+## visible throughout the whole execution of all `configure' scripts. Other
+## variables needs to be defined as arguments to `configure' or exported in
+## the environment.
+
+## -- Variables for `otp_build' Only -------------------------------------------
+
+## Variables in this section are only used, when configuring Erlang/OTP for
+## cross compilation using `$ERL_TOP/otp_build configure'.
+
+## *NOTE*! These variables currently have *no* effect if you configure using
+## the `configure' script directly.
+
+# * `erl_xcomp_build' - The build system used. This value will be passed as
+# `--build=$erl_xcomp_build' argument to the `configure' script. It does
+# not have to be a full `CPU-VENDOR-OS' triplet, but can be. The full
+# `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build'. If set to `guess',
+# the build system will be guessed using
+# `$ERL_TOP/erts/autoconf/config.guess'.
erl_xcomp_build=guess
-## `erl_xcomp_host` - Cross host/target system to build for. This value will
-## be passed as `--host=$erl_xcomp_host` argument to the `configure` script.
-## It does not have to be a full `CPU-VENDOR-OS` triplet, but can be. The
-## full `CPU-VENDOR-OS` triplet will be created by:
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host`
+# * `erl_xcomp_host' - Cross host/target system to build for. This value will
+# be passed as `--host=$erl_xcomp_host' argument to the `configure' script.
+# It does not have to be a full `CPU-VENDOR-OS' triplet, but can be. The
+# full `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host'.
erl_xcomp_host=tile
-## `erl_xcomp_configure_flags` - Extra configure flags to pass to the
-## `configure` script.
+# * `erl_xcomp_configure_flags' - Extra configure flags to pass to the
+# `configure' script.
erl_xcomp_configure_flags="--without-termcap"
-### ### Cross Compiler and Other Tools ###
+## -- Cross Compiler and Other Tools -------------------------------------------
-### If the cross compilation tools are prefixed by `<HOST>-` you probably do
-### not need to set these variables (where `<HOST>` is what has been passed as
-### `--host=<HOST>` argument to `configure`).
+## If the cross compilation tools are prefixed by `<HOST>-' you probably do
+## not need to set these variables (where `<HOST>' is what has been passed as
+## `--host=<HOST>' argument to `configure').
-### All variables in this section can also be used when native compiling.
+## All variables in this section can also be used when native compiling.
-## `CC` - C compiler.
+# * `CC' - C compiler.
#CC=
-## `CFLAGS` - C compiler flags.
+# * `CFLAGS' - C compiler flags.
#CFLAGS=
-## `STATIC_CFLAGS` - Static C compiler flags.
+# * `STATIC_CFLAGS' - Static C compiler flags.
#STATIC_CFLAGS=
-## `CFLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for the shared libraries. Note that this actually is a
-## linker flag, but it needs to be passed via the compiler.
+# * `CFLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for the shared libraries. Note that this actually is a
+# linker flag, but it needs to be passed via the compiler.
#CFLAG_RUNTIME_LIBRARY_PATH=
-## `CPP` - C pre-processor.
+# * `CPP' - C pre-processor.
#CPP=
-## `CPPFLAGS` - C pre-processor flags.
+# * `CPPFLAGS' - C pre-processor flags.
#CPPFLAGS=
-## `CXX` - C++ compiler.
+# * `CXX' - C++ compiler.
#CXX=
-## `CXXFLAGS` - C++ compiler flags.
+# * `CXXFLAGS' - C++ compiler flags.
#CXXFLAGS=
-## `LD` - Linker.
+# * `LD' - Linker.
#LD=
-## `LDFLAGS` - Linker flags.
+# * `LDFLAGS' - Linker flags.
#LDFLAGS=
-## `LIBS` - Libraries.
+# * `LIBS' - Libraries.
#LIBS=
-### #### *D*ynamic *E*rlang *D*river Linking ####
+## -- *D*ynamic *E*rlang *D*river Linking --
-### *NOTE*! Either set all or none of the `DED_LD*` variables.
+## *NOTE*! Either set all or none of the `DED_LD*' variables.
-## `DED_LD` - Linker for Dynamically loaded Erlang Drivers.
+# * `DED_LD' - Linker for Dynamically loaded Erlang Drivers.
#DED_LD=
-## `DED_LDFLAGS` - Linker flags to use with `DED_LD`.
+# * `DED_LDFLAGS' - Linker flags to use with `DED_LD'.
#DED_LDFLAGS=
-## `DED_LD_FLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for shared libraries when linking with `DED_LD`.
+# * `DED_LD_FLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for shared libraries when linking with `DED_LD'.
#DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
-### #### Large File Support ####
+## -- Large File Support --
-### *NOTE*! Either set all or none of the `LFS_*` variables.
+## *NOTE*! Either set all or none of the `LFS_*' variables.
-## `LFS_CFLAGS` - Large file support C compiler flags.
+# * `LFS_CFLAGS' - Large file support C compiler flags.
#LFS_CFLAGS=
-## `LFS_LDFLAGS` - Large file support linker flags.
+# * `LFS_LDFLAGS' - Large file support linker flags.
#LFS_LDFLAGS=
-## `LFS_LIBS` - Large file support libraries.
+# * `LFS_LIBS' - Large file support libraries.
#LFS_LIBS=
-### #### Other Tools ####
+## -- Other Tools --
-## `RANLIB` - `ranlib` archive index tool.
+# * `RANLIB' - `ranlib' archive index tool.
#RANLIB=
-## `AR` - `ar` archiving tool.
+# * `AR' - `ar' archiving tool.
#AR=
-## `GETCONF` - `getconf` system configuration inspection tool. `getconf` is
-## currently used for finding out large file support flags to use, and
-## on Linux systems for finding out if we have an NPTL thread library or
-## not.
+# * `GETCONF' - `getconf' system configuration inspection tool. `getconf' is
+# currently used for finding out large file support flags to use, and
+# on Linux systems for finding out if we have an NPTL thread library or
+# not.
#GETCONF=
-### ### Cross System Root Locations ###
+## -- Cross System Root Locations ----------------------------------------------
-## `erl_xcomp_sysroot` - The absolute path to the system root of the cross
-## compilation environment. Currently, the `crypto`, `odbc`, `ssh` and
-## `ssl` applications need the system root. These applications will be
-## skipped if the system root has not been set. The system root might be
-## needed for other things too. If this is the case and the system root
-## has not been set, `configure` will fail and request you to set it.
+# * `erl_xcomp_sysroot' - The absolute path to the system root of the cross
+# compilation environment. Currently, the `crypto', `odbc', `ssh' and
+# `ssl' applications need the system root. These applications will be
+# skipped if the system root has not been set. The system root might be
+# needed for other things too. If this is the case and the system root
+# has not been set, `configure' will fail and request you to set it.
erl_xcomp_sysroot="$TILERA_ROOT/tile"
-## `erl_xcomp_isysroot` - The absolute path to the system root for includes
-## of the cross compilation environment. If not set, this value defaults
-## to `$erl_xcomp_sysroot`, i.e., only set this value if the include system
-## root path is not the same as the system root path.
+# * `erl_xcomp_isysroot' - The absolute path to the system root for includes
+# of the cross compilation environment. If not set, this value defaults
+# to `$erl_xcomp_sysroot', i.e., only set this value if the include system
+# root path is not the same as the system root path.
#erl_xcomp_isysroot=
-### ### Optional Feature, and Bug Tests ###
+## -- Optional Feature, and Bug Tests ------------------------------------------
-### These tests cannot (always) be done automatically when cross compiling. You
-### usually do not need to set these variables. Only set these if you really
-### know what you are doing.
+## These tests cannot (always) be done automatically when cross compiling. You
+## usually do not need to set these variables. Only set these if you really
+## know what you are doing.
-### Note that some of these values will override results of tests performed
-### by `configure`, and some will not be used until `configure` is sure that
-### it cannot figure the result out.
+## Note that some of these values will override results of tests performed
+## by `configure', and some will not be used until `configure' is sure that
+## it cannot figure the result out.
-### The `configure` script will issue a warning when a default value is used.
-### When a variable has been set, no warning will be issued.
+## The `configure' script will issue a warning when a default value is used.
+## When a variable has been set, no warning will be issued.
-## `erl_xcomp_after_morecore_hook` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `__after_morecore_hook` that can be
-## used for tracking used `malloc()` implementations core memory usage.
-## This is currently only used by unsupported features.
+# * `erl_xcomp_after_morecore_hook' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `__after_morecore_hook' that can be
+# used for tracking used `malloc()' implementations core memory usage.
+# This is currently only used by unsupported features.
#erl_xcomp_after_morecore_hook=
-## `erl_xcomp_bigendian` - `yes|no`. No default. If `yes`, the target system
-## must be big endian. If `no`, little endian. This can often be
-## automatically detected, but not always. If not automatically detected,
-## `configure` will fail unless this variable is set. Since no default
-## value is used, `configure` will try to figure this out automatically.
+# * `erl_xcomp_bigendian' - `yes|no'. No default. If `yes', the target system
+# must be big endian. If `no', little endian. This can often be
+# automatically detected, but not always. If not automatically detected,
+# `configure' will fail unless this variable is set. Since no default
+# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
-## `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `clock_gettime()` implementation
-## that can be used for retrieving process CPU time.
+# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `clock_gettime()' implementation
+# that can be used for retrieving process CPU time.
#erl_xcomp_clock_gettime_cpu_time=
-## `erl_xcomp_getaddrinfo` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a working `getaddrinfo()` implementation that can
-## handle both IPv4 and IPv6.
+# * `erl_xcomp_getaddrinfo' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `getaddrinfo()' implementation that can
+# handle both IPv4 and IPv6.
erl_xcomp_getaddrinfo=yes
-## `erl_xcomp_gethrvtime_procfs_ioctl` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `gethrvtime()` implementation and
-## is used with procfs `ioctl()`.
+# * `erl_xcomp_gethrvtime_procfs_ioctl' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `gethrvtime()' implementation and
+# is used with procfs `ioctl()'.
#erl_xcomp_gethrvtime_procfs_ioctl=
-## `erl_xcomp_dlsym_brk_wrappers` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `dlsym(RTLD_NEXT, <S>)` implementation
-## that can be used on `brk` and `sbrk` symbols used by the `malloc()`
-## implementation in use, and by this track the `malloc()` implementations
-## core memory usage. This is currently only used by unsupported features.
+# * `erl_xcomp_dlsym_brk_wrappers' - `yes|no'. Defaults to `no'. If `yes', the
+# target system must have a working `dlsym(RTLD_NEXT, <S>)' implementation
+# that can be used on `brk' and `sbrk' symbols used by the `malloc()'
+# implementation in use, and by this track the `malloc()' implementations
+# core memory usage. This is currently only used by unsupported features.
#erl_xcomp_dlsym_brk_wrappers=
-## `erl_xcomp_kqueue` - `yes|no`. Defaults to `no`. If `yes`, the target system
-## must have a working `kqueue()` implementation that returns a file
-## descriptor which can be used by `poll()` and/or `select()`. If `no` and
-## the target system has not got `epoll()` or `/dev/poll`, the kernel-poll
-## feature will be disabled.
+# * `erl_xcomp_kqueue' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `kqueue()' implementation that returns a file
+# descriptor which can be used by `poll()' and/or `select()'. If `no' and
+# the target system has not got `epoll()' or `/dev/poll', the kernel-poll
+# feature will be disabled.
#erl_xcomp_kqueue=
-## `erl_xcomp_linux_clock_gettime_correction` - `yes|no`. Defaults to `yes` on
-## Linux; otherwise, `no`. If `yes`, `clock_gettime(CLOCK_MONOTONIC, _)` on
-## the target system must work. This variable is recommended to be set to
-## `no` on Linux systems with kernel versions less than 2.6.
+# * `erl_xcomp_linux_clock_gettime_correction' - `yes|no'. Defaults to `yes' on
+# Linux; otherwise, `no'. If `yes', `clock_gettime(CLOCK_MONOTONIC, _)' on
+# the target system must work. This variable is recommended to be set to
+# `no' on Linux systems with kernel versions less than 2.6.
#erl_xcomp_linux_clock_gettime_correction=
-## `erl_xcomp_linux_nptl` - `yes|no`. Defaults to `yes` on Linux; otherwise,
-## `no`. If `yes`, the target system must have NPTL (Native POSIX Thread
-## Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
-## kernel versions typically less than 2.6).
+# * `erl_xcomp_linux_nptl' - `yes|no'. Defaults to `yes' on Linux; otherwise,
+# `no'. If `yes', the target system must have NPTL (Native POSIX Thread
+# Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+# kernel versions typically less than 2.6).
#erl_xcomp_linux_nptl=
-## `erl_xcomp_linux_usable_sigaltstack` - `yes|no`. Defaults to `yes` on Linux;
-## otherwise, `no`. If `yes`, `sigaltstack()` must be usable on the target
-## system. `sigaltstack()` on Linux kernel versions less than 2.4 are
-## broken.
+# * `erl_xcomp_linux_usable_sigaltstack' - `yes|no'. Defaults to `yes' on Linux;
+# otherwise, `no'. If `yes', `sigaltstack()' must be usable on the target
+# system. `sigaltstack()' on Linux kernel versions less than 2.4 are
+# broken.
#erl_xcomp_linux_usable_sigaltstack=
-## `erl_xcomp_linux_usable_sigusrx` - `yes|no`. Defaults to `yes`. If `yes`,
-## the `SIGUSR1` and `SIGUSR2` signals must be usable by the ERTS. Old
-## LinuxThreads thread libraries (Linux kernel versions typically less than
-## 2.2) used these signals and made them unusable by the ERTS.
+# * `erl_xcomp_linux_usable_sigusrx' - `yes|no'. Defaults to `yes'. If `yes',
+# the `SIGUSR1' and `SIGUSR2' signals must be usable by the ERTS. Old
+# LinuxThreads thread libraries (Linux kernel versions typically less than
+# 2.2) used these signals and made them unusable by the ERTS.
#erl_xcomp_linux_usable_sigusrx=
-## `erl_xcomp_poll` - `yes|no`. Defaults to `no` on Darwin/MacOSX; otherwise,
-## `yes`. If `yes`, the target system must have a working `poll()`
-## implementation that also can handle devices. If `no`, `select()` will be
-## used instead of `poll()`.
+# * `erl_xcomp_poll' - `yes|no'. Defaults to `no' on Darwin/MacOSX; otherwise,
+# `yes'. If `yes', the target system must have a working `poll()'
+# implementation that also can handle devices. If `no', `select()' will be
+# used instead of `poll()'.
#erl_xcomp_poll=
-## `erl_xcomp_putenv_copy` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a `putenv()` implementation that stores a copy of the
-## key/value pair.
+# * `erl_xcomp_putenv_copy' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a `putenv()' implementation that stores a copy of the
+# key/value pair.
#erl_xcomp_putenv_copy=
-## `erl_xcomp_reliable_fpe` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have reliable floating point exceptions.
+# * `erl_xcomp_reliable_fpe' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have reliable floating point exceptions.
#erl_xcomp_reliable_fpe=
-####
+## -----------------------------------------------------------------------------
diff --git a/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf b/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf
index 11ffce2085..f691c6cfd1 100644
--- a/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf
+++ b/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf
@@ -1,262 +1,261 @@
-#### -*-shell-script-*-
-####
-#### %CopyrightBegin%
-####
-#### Copyright Ericsson AB 2010. All Rights Reserved.
-####
-#### The contents of this file are subject to the Erlang Public License,
-#### Version 1.1, (the "License"); you may not use this file except in
-#### compliance with the License. You should have received a copy of the
-#### Erlang Public License along with this software. If not, it can be
-#### retrieved online at http://www.erlang.org/.
-####
-#### Software distributed under the License is distributed on an "AS IS"
-#### basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-#### the License for the specific language governing rights and limitations
-#### under the License.
-####
-#### %CopyrightEnd%
-####
-#### File: erl-xcomp-avr32-atmel-linux-gnu.conf
-#### Author: Winston Smith <[email protected]>
-####
-#### --------------------------------------------------------------------------
-#### When cross compiling Erlang/OTP using `otp_build', copy this file and set
-#### the variables needed below. Then pass the path to the copy of this file as
-#### an argument to `otp_build' in the configure stage:
-#### `otp_build configure --xcomp-conf=<FILE>'
-#### --------------------------------------------------------------------------
-
-### Note that you cannot define arbitrary variables in a cross compilation
-### configuration file. Only the ones listed below will be guaranteed to be
-### visible throughout the whole execution of all `configure' scripts. Other
-### variables needs to be defined as arguments to `configure' or exported in
-### the environment.
-
-### ---- `otp_build' only variables -------------------------------------------
-
-### Variables in this section are only used, when configuring Erlang/OTP for
-### cross compilation using `$ERL_TOP/otp_build configure'.
-
-### NOTE! These variables currently have *no* effect if you configure using the
-### `configure' script directly.
-
-## erl_xcomp_build - Build system.
-## This value will be passed as `--build=$erl_xcomp_build' argument to the
-## `configure' script. It does not have to be a full CPU-VENDOR-OS triplet,
-## but can be. The full CPU-VENDOR-OS triplet will be created by:
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build'
-## If `erl_xcomp_build=guess', the build system will be guessed using:
-## `$ERL_TOP/erts/autoconf/config.guess'.
+## -*-shell-script-*-
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2010. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## File: erl-xcomp-avr32-atmel-linux-gnu.conf
+## Author: Winston Smith <[email protected]>
+##
+## -----------------------------------------------------------------------------
+## When cross compiling Erlang/OTP using `otp_build', copy this file and set
+## the variables needed below. Then pass the path to the copy of this file as
+## an argument to `otp_build' in the configure stage:
+## `otp_build configure --xcomp-conf=<FILE>'
+## -----------------------------------------------------------------------------
+
+## Note that you cannot define arbitrary variables in a cross compilation
+## configuration file. Only the ones listed below will be guaranteed to be
+## visible throughout the whole execution of all `configure' scripts. Other
+## variables needs to be defined as arguments to `configure' or exported in
+## the environment.
+
+## -- Variables for `otp_build' Only -------------------------------------------
+
+## Variables in this section are only used, when configuring Erlang/OTP for
+## cross compilation using `$ERL_TOP/otp_build configure'.
+
+## *NOTE*! These variables currently have *no* effect if you configure using
+## the `configure' script directly.
+
+# * `erl_xcomp_build' - The build system used. This value will be passed as
+# `--build=$erl_xcomp_build' argument to the `configure' script. It does
+# not have to be a full `CPU-VENDOR-OS' triplet, but can be. The full
+# `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build'. If set to `guess',
+# the build system will be guessed using
+# `$ERL_TOP/erts/autoconf/config.guess'.
erl_xcomp_build=guess
-## erl_xcomp_host - Cross host system.
-## This value will be passed as `--host=$erl_xcomp_host' argument to the
-## `configure' script. It does not have to be a full CPU-VENDOR-OS triplet,
-## but can be. The full CPU-VENDOR-OS triplet will be created by:
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host'
+# * `erl_xcomp_host' - Cross host/target system to build for. This value will
+# be passed as `--host=$erl_xcomp_host' argument to the `configure' script.
+# It does not have to be a full `CPU-VENDOR-OS' triplet, but can be. The
+# full `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host'.
erl_xcomp_host=avr32-atmel-linux-gnu
-## erl_xcomp_configure_flags - Extra configure flags.
-## Extra flags to pass to the `configure' script.
+# * `erl_xcomp_configure_flags' - Extra configure flags to pass to the
+# `configure' script.
#erl_xcomp_configure_flags=
-### ---- Cross compiler and other tools to use --------------------------------
+## -- Cross Compiler and Other Tools -------------------------------------------
-### If the cross compilation tools are prefixed by `<HOST>-' you probably do
-### not need to set these variables (where `<HOST>' is what has been passed as
-### `--host=<HOST>' argument to `configure').
+## If the cross compilation tools are prefixed by `<HOST>-' you probably do
+## not need to set these variables (where `<HOST>' is what has been passed as
+## `--host=<HOST>' argument to `configure').
-## CC - C compiler.
+## All variables in this section can also be used when native compiling.
+
+# * `CC' - C compiler.
CC=avr32-linux-gcc
-## CFLAGS - C compiler flags.
+# * `CFLAGS' - C compiler flags.
#CFLAGS=
-## STATIC_CFLAGS - Static C compiler flags.
+# * `STATIC_CFLAGS' - Static C compiler flags.
#STATIC_CFLAGS=
-## CFLAG_RUNTIME_LIBRARY_PATH - C compiler runtime library path flag.
-## This flag should set a specific runtime library path for the shared
-## library at link time. Note that this is actually a linker flag, but it
-## needs to be passed via the compiler.
+# * `CFLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for the shared libraries. Note that this actually is a
+# linker flag, but it needs to be passed via the compiler.
#CFLAG_RUNTIME_LIBRARY_PATH=
-## CPP - C pre-processor.
+# * `CPP' - C pre-processor.
#CPP=
-## CPPFLAGS - C pre-processor flags.
+# * `CPPFLAGS' - C pre-processor flags.
#CPPFLAGS=
-## CXX - C++ compiler.
+# * `CXX' - C++ compiler.
CXX=avr32-linux-g++
-## CXXFLAGS - C++ compiler flags.
+# * `CXXFLAGS' - C++ compiler flags.
#CXXFLAGS=
-## LD - Linker.
+# * `LD' - Linker.
LD=avr32-linux-ld
-## LDFLAGS - Linker flags.
+# * `LDFLAGS' - Linker flags.
#LDFLAGS=
-## LIBS - Libraries.
+# * `LIBS' - Libraries.
#LIBS=
-### -- Dynamic Erlang Driver linker flags --
+## -- *D*ynamic *E*rlang *D*river Linking --
-### NOTE! Either set all or non of the DED_LD* variables.
+## *NOTE*! Either set all or none of the `DED_LD*' variables.
-## DED_LD - Linker.
+# * `DED_LD' - Linker for Dynamically loaded Erlang Drivers.
#DED_LD=
-## DED_LDFLAGS - Linker flags.
+# * `DED_LDFLAGS' - Linker flags to use with `DED_LD'.
#DED_LDFLAGS=
-## DED_LD_FLAG_RUNTIME_LIBRARY_PATH - Linker runtime library path flag.
-## This flag should set a specific runtime library path for the shared
-## library at link time.
+# * `DED_LD_FLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for shared libraries when linking with `DED_LD'.
#DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
-### -- Large file support --
+## -- Large File Support --
-### NOTE! Either set all or non of the LFS_* variables.
+## *NOTE*! Either set all or none of the `LFS_*' variables.
-## LFS_CFLAGS - Large file support C compiler flags.
+# * `LFS_CFLAGS' - Large file support C compiler flags.
#LFS_CFLAGS=
-## LFS_LDFLAGS - Large file support linker flags.
+# * `LFS_LDFLAGS' - Large file support linker flags.
#LFS_LDFLAGS=
-## LFS_LIBS - Large file support libraries.
+# * `LFS_LIBS' - Large file support libraries.
#LFS_LIBS=
-### -- Other tools --
+## -- Other Tools --
-## RANLIB - `ranlib' archive index tool.
+# * `RANLIB' - `ranlib' archive index tool.
RANLIB=avr32-linux-ranlib
-## AR - `ar' archiving tool.
+# * `AR' - `ar' archiving tool.
AR=avr32-linux-ar
-## GETCONF - `getconf' system configuration inspection tool.
+# * `GETCONF' - `getconf' system configuration inspection tool. `getconf' is
+# currently used for finding out large file support flags to use, and
+# on Linux systems for finding out if we have an NPTL thread library or
+# not.
#GETCONF=
-### ---- Cross System Root Locations ------------------------------------------
-
-## erl_xcomp_sysroot - Absolute cross system root path.
-## The absolute path to the system root of the cross compilation
-## environment. Currently, the `crypto', `odbc', `ssh' and `ssl'
-## applications need the system root. These applications will be skipped
-## if the system root has not been set. The system root might be needed
-## for other things too. If this is the case and the system root has not
-## been set, `configure' will fail and request you to set it.
-##
-## NOTE: For AVR32, this should be set to the build_avr32/staging_dir
-## subdirectory within the buildroot tree.
+## -- Cross System Root Locations ----------------------------------------------
+
+# * `erl_xcomp_sysroot' - The absolute path to the system root of the cross
+# compilation environment. Currently, the `crypto', `odbc', `ssh' and
+# `ssl' applications need the system root. These applications will be
+# skipped if the system root has not been set. The system root might be
+# needed for other things too. If this is the case and the system root
+# has not been set, `configure' will fail and request you to set it.
+#
+# NOTE: For AVR32, this should be set to the build_avr32/staging_dir
+# subdirectory within the buildroot tree.
erl_xcomp_sysroot="$ATMEL_SYSROOT_AVR32"
-## erl_xcomp_isysroot - Absolute cross include system root path.
-## The absolute path to the system root for includes of the cross
-## compilation environment. If not set, this value defaults to
-## `$erl_xcomp_sysroot', i.e., only set this value if the include system
-## root path is not the same as the system root path.
+# * `erl_xcomp_isysroot' - The absolute path to the system root for includes
+# of the cross compilation environment. If not set, this value defaults
+# to `$erl_xcomp_sysroot', i.e., only set this value if the include system
+# root path is not the same as the system root path.
#erl_xcomp_isysroot=
-### ---- Optional feature, or bug tests ---------------------------------------
+## -- Optional Feature, and Bug Tests ------------------------------------------
-### These tests cannot (always) be done automatically when cross compiling. You
-### usually does not need to set these variables. Only set these if you really
-### know what you are doing.
+## These tests cannot (always) be done automatically when cross compiling. You
+## usually do not need to set these variables. Only set these if you really
+## know what you are doing.
-### Note that some of these values will override results of tests performed
-### by `configure', and some will not be used until `configure' is sure that
-### it cannot figure the result out.
+## Note that some of these values will override results of tests performed
+## by `configure', and some will not be used until `configure' is sure that
+## it cannot figure the result out.
-### The `configure' script will issue a warning when a default value is used.
-### When a variable has been set, no warning will be issued.
+## The `configure' script will issue a warning when a default value is used.
+## When a variable has been set, no warning will be issued.
-## erl_xcomp_bigendian - yes|no
-## If `yes', the target system must be big endian. If `no', little endian.
-## This can often be automatically detected, but not always. If not
-## automatically detected, `configure' will fail unless this variable is
-## set. No default value is used, i.e., `configure' will try to figure
-## this out automatically.
-#erl_xcomp_bigendian=
+# * `erl_xcomp_after_morecore_hook' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `__after_morecore_hook' that can be
+# used for tracking used `malloc()' implementations core memory usage.
+# This is currently only used by unsupported features.
+#erl_xcomp_after_morecore_hook=
-## erl_xcomp_linux_clock_gettime_correction - yes|no (defaults to `yes' on
-## Linux; otherwise, `no')
-## If `yes', `clock_gettime(CLOCK_MONOTONIC, _)' on the target system must
-## work. This variable is recommended to be set to `no' on Linux systems
-## with kernel versions less than 2.6.
-#erl_xcomp_linux_clock_gettime_correction=
+# * `erl_xcomp_bigendian' - `yes|no'. No default. If `yes', the target system
+# must be big endian. If `no', little endian. This can often be
+# automatically detected, but not always. If not automatically detected,
+# `configure' will fail unless this variable is set. Since no default
+# value is used, `configure' will try to figure this out automatically.
+#erl_xcomp_bigendian=
-## erl_xcomp_linux_nptl - yes|no (defaults to `yes' on Linux; otherwise, `no')
-## If `yes', the target system must have NPTL (Native POSIX Thread Library).
-## Older Linux systems have LinuxThreads instead of NPTL (Linux kernel
-## versions typically less than 2.6).
-#erl_xcomp_linux_nptl=
+# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `clock_gettime()' implementation
+# that can be used for retrieving process CPU time.
+erl_xcomp_clock_gettime_cpu_time=yes
-## erl_xcomp_linux_usable_sigusrx - yes|no (defaults to `yes')
-## If `yes', the `SIGUSR1' and `SIGUSR2' signals must be usable by the ERTS.
-## Old LinuxThreads thread libraries (Linux kernel versions less than 2.2)
-## used these signals and made them unusable by the ERTS.
-#erl_xcomp_linux_usable_sigusrx=
+# * `erl_xcomp_getaddrinfo' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `getaddrinfo()' implementation that can
+# handle both IPv4 and IPv6.
+erl_xcomp_getaddrinfo=yes
-## erl_xcomp_linux_usable_sigaltstack - yes|no (defaults to `yes' on Linux;
-## otherwise, `no')
-## If `yes', `sigaltstack()' must be usable on the target system.
-## `sigaltstack()' on Linux kernel versions less than 2.4 are broken.
-#erl_xcomp_linux_usable_sigaltstack=
+# * `erl_xcomp_gethrvtime_procfs_ioctl' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `gethrvtime()' implementation and
+# is used with procfs `ioctl()'.
+#erl_xcomp_gethrvtime_procfs_ioctl=
-## erl_xcomp_poll - yes|no (defaults to `no' on Darwin/MacOSX; otherwise, `yes')
-## If `yes', the target system must have a working `poll()' implementation
-## that also can handle devices. If `no', `select()' will be used instead of
-## `poll()'.
-#erl_xcomp_poll=
+# * `erl_xcomp_dlsym_brk_wrappers' - `yes|no'. Defaults to `no'. If `yes', the
+# target system must have a working `dlsym(RTLD_NEXT, <S>)' implementation
+# that can be used on `brk' and `sbrk' symbols used by the `malloc()'
+# implementation in use, and by this track the `malloc()' implementations
+# core memory usage. This is currently only used by unsupported features.
+erl_xcomp_dlsym_brk_wrappers=yes
-## erl_xcomp_kqueue - yes|no (defaults to `no')
-## If `yes', the target system must have a working `kqueue()' implementation
-## that returns a file descriptor which can be used by `poll()' and/or
-## `select()'. If `no' and the target system has not got `epoll()' or
-## `/dev/poll', the kernel-poll feature will be disabled.
+# * `erl_xcomp_kqueue' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `kqueue()' implementation that returns a file
+# descriptor which can be used by `poll()' and/or `select()'. If `no' and
+# the target system has not got `epoll()' or `/dev/poll', the kernel-poll
+# feature will be disabled.
#erl_xcomp_kqueue=
-## erl_xcomp_putenv_copy - yes|no (defaults to `no')
-## If `yes', the target system must have a `putenv()' implementation that
-## stores a copy of the key/value pair.
-#erl_xcomp_putenv_copy=
+# * `erl_xcomp_linux_clock_gettime_correction' - `yes|no'. Defaults to `yes' on
+# Linux; otherwise, `no'. If `yes', `clock_gettime(CLOCK_MONOTONIC, _)' on
+# the target system must work. This variable is recommended to be set to
+# `no' on Linux systems with kernel versions less than 2.6.
+#erl_xcomp_linux_clock_gettime_correction=
-## erl_xcomp_reliable_fpe - yes|no (defaults to `no')
-## If `yes', the target system must have reliable floating point exceptions.
-#erl_xcomp_reliable_fpe=
+# * `erl_xcomp_linux_nptl' - `yes|no'. Defaults to `yes' on Linux; otherwise,
+# `no'. If `yes', the target system must have NPTL (Native POSIX Thread
+# Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+# kernel versions typically less than 2.6).
+#erl_xcomp_linux_nptl=
-## erl_xcomp_getaddrinfo - yes|no (defaults to `no')
-## If `yes', the target system must have a working `getaddrinfo()'
-## implementation that can handle both IPv4 and IPv6.
-erl_xcomp_getaddrinfo=yes
+# * `erl_xcomp_linux_usable_sigaltstack' - `yes|no'. Defaults to `yes' on Linux;
+# otherwise, `no'. If `yes', `sigaltstack()' must be usable on the target
+# system. `sigaltstack()' on Linux kernel versions less than 2.4 are
+# broken.
+#erl_xcomp_linux_usable_sigaltstack=
-## erl_xcomp_gethrvtime_procfs_ioctl - yes|no (defaults to `no')
-## If `yes', the target system must have a working `gethrvtime()'
-## implementation and is used with procfs `ioctl()'.
-#erl_xcomp_gethrvtime_procfs_ioctl=
+# * `erl_xcomp_linux_usable_sigusrx' - `yes|no'. Defaults to `yes'. If `yes',
+# the `SIGUSR1' and `SIGUSR2' signals must be usable by the ERTS. Old
+# LinuxThreads thread libraries (Linux kernel versions typically less than
+# 2.2) used these signals and made them unusable by the ERTS.
+#erl_xcomp_linux_usable_sigusrx=
-## erl_xcomp_clock_gettime_cpu_time - yes|no (defaults to `no')
-## If `yes', the target system must have a working `clock_gettime()'
-## implementation that can be used for retrieving process CPU time.
-erl_xcomp_clock_gettime_cpu_time=yes
+# * `erl_xcomp_poll' - `yes|no'. Defaults to `no' on Darwin/MacOSX; otherwise,
+# `yes'. If `yes', the target system must have a working `poll()'
+# implementation that also can handle devices. If `no', `select()' will be
+# used instead of `poll()'.
+#erl_xcomp_poll=
-## erl_xcomp_after_morecore_hook - yes|no (defaults to `no')
-## If `yes', the target system must have a working `__after_morecore_hook'
-## that can be used for tracking used `malloc()' implementations core memory
-## usage.
-#erl_xcomp_after_morecore_hook=
+# * `erl_xcomp_putenv_copy' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a `putenv()' implementation that stores a copy of the
+# key/value pair.
+#erl_xcomp_putenv_copy=
-## erl_xcomp_dlsym_brk_wrappers - yes|no (defaults to `no')
-## If `yes', the target system must have a working `dlsym(RTLD_NEXT, <S>)'
-## implementation that can be used on `brk' and `sbrk' symbols used by the
-## `malloc()' implementation in use, and by this track the `malloc()'
-## implementations core memory usage.
-erl_xcomp_dlsym_brk_wrappers=yes
+# * `erl_xcomp_reliable_fpe' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have reliable floating point exceptions.
+#erl_xcomp_reliable_fpe=
-#### --------------------------------------------------------------------------
+## -----------------------------------------------------------------------------
diff --git a/xcomp/erl-xcomp-vxworks_ppc32.conf b/xcomp/erl-xcomp-vxworks_ppc32.conf
index b75c7444bb..ed8305ea93 100644
--- a/xcomp/erl-xcomp-vxworks_ppc32.conf
+++ b/xcomp/erl-xcomp-vxworks_ppc32.conf
@@ -1,258 +1,258 @@
-#### -*-shell-script-*-
-####
-#### %CopyrightBegin%
-####
-#### Copyright Ericsson AB 2009-2010. All Rights Reserved.
-####
-#### The contents of this file are subject to the Erlang Public License,
-#### Version 1.1, (the "License"); you may not use this file except in
-#### compliance with the License. You should have received a copy of the
-#### Erlang Public License along with this software. If not, it can be
-#### retrieved online at http://www.erlang.org/.
-####
-#### Software distributed under the License is distributed on an "AS IS"
-#### basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-#### the License for the specific language governing rights and limitations
-#### under the License.
-####
-#### %CopyrightEnd%
-####
-#### File: erl-xcomp-vxworks_ppc32.conf
-#### Author: Rickard Green/Patrik Nyblom
-####
-#### --------------------------------------------------------------------------
-#### When cross compiling Erlang/OTP using `otp_build`, copy this file and set
-#### the variables needed below. Then pass the path to the copy of this file as
-#### an argument to `otp_build` in the configure stage:
-#### `otp_build configure --xcomp-conf=<FILE>`
-#### --------------------------------------------------------------------------
-
-### Note that you cannot define arbitrary variables in a cross compilation
-### configuration file. Only the ones listed below will be guaranteed to be
-### visible throughout the whole execution of all `configure` scripts. Other
-### variables needs to be defined as arguments to `configure` or exported in
-### the environment.
-
-### ### Variables for `otp_build` Only ###
-
-### Variables in this section are only used, when configuring Erlang/OTP for
-### cross compilation using `$ERL_TOP/otp_build configure`.
-
-### *NOTE*! These variables currently have *no* effect if you configure using
-### the `configure` script directly.
-
-## `erl_xcomp_build` - The build system used. This value will be passed as
-## `--build=$erl_xcomp_build` argument to the `configure` script. It does
-## not have to be a full `CPU-VENDOR-OS` triplet, but can be. The full
-## `CPU-VENDOR-OS` triplet will be created by
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build`.
-## If set to `guess`, the build system will be guessed using
-## `$ERL_TOP/erts/autoconf/config.guess`.
+## -*-shell-script-*-
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2009-2010. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## File: erl-xcomp-vxworks_ppc32.conf
+## Author: Rickard Green/Patrik Nyblom
+##
+## -----------------------------------------------------------------------------
+## When cross compiling Erlang/OTP using `otp_build', copy this file and set
+## the variables needed below. Then pass the path to the copy of this file as
+## an argument to `otp_build' in the configure stage:
+## `otp_build configure --xcomp-conf=<FILE>'
+## -----------------------------------------------------------------------------
+
+## Note that you cannot define arbitrary variables in a cross compilation
+## configuration file. Only the ones listed below will be guaranteed to be
+## visible throughout the whole execution of all `configure' scripts. Other
+## variables needs to be defined as arguments to `configure' or exported in
+## the environment.
+
+## -- Variables for `otp_build' Only -------------------------------------------
+
+## Variables in this section are only used, when configuring Erlang/OTP for
+## cross compilation using `$ERL_TOP/otp_build configure'.
+
+## *NOTE*! These variables currently have *no* effect if you configure using
+## the `configure' script directly.
+
+# * `erl_xcomp_build' - The build system used. This value will be passed as
+# `--build=$erl_xcomp_build' argument to the `configure' script. It does
+# not have to be a full `CPU-VENDOR-OS' triplet, but can be. The full
+# `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build'. If set to `guess',
+# the build system will be guessed using
+# `$ERL_TOP/erts/autoconf/config.guess'.
erl_xcomp_build=guess
-## `erl_xcomp_host` - Cross host/target system to build for. This value will
-## be passed as `--host=$erl_xcomp_host` argument to the `configure` script.
-## It does not have to be a full `CPU-VENDOR-OS` triplet, but can be. The
-## full `CPU-VENDOR-OS` triplet will be created by:
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host`
+# * `erl_xcomp_host' - Cross host/target system to build for. This value will
+# be passed as `--host=$erl_xcomp_host' argument to the `configure' script.
+# It does not have to be a full `CPU-VENDOR-OS' triplet, but can be. The
+# full `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host'.
erl_xcomp_host=powerpc-wrs-vxworks
-## `erl_xcomp_configure_flags` - Extra configure flags to pass to the
-## `configure` script.
+# * `erl_xcomp_configure_flags' - Extra configure flags to pass to the
+# `configure' script.
erl_xcomp_configure_flags="--disable-threads --without-termcap"
-### ### Cross Compiler and Other Tools ###
+## -- Cross Compiler and Other Tools -------------------------------------------
-### If the cross compilation tools are prefixed by `<HOST>-` you probably do
-### not need to set these variables (where `<HOST>` is what has been passed as
-### `--host=<HOST>` argument to `configure`).
+## If the cross compilation tools are prefixed by `<HOST>-' you probably do
+## not need to set these variables (where `<HOST>' is what has been passed as
+## `--host=<HOST>' argument to `configure').
-### All variables in this section can also be used when native compiling.
+## All variables in this section can also be used when native compiling.
-## `CC` - C compiler.
+# * `CC' - C compiler.
CC="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/ccppc"
-## `CFLAGS` - C compiler flags.
+# * `CFLAGS' - C compiler flags.
CFLAGS="-DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -DWANT_NONBLOCKING -DHAVE_SENS -DHAVE_MEMMOVE -DVXWORKS -I$WIND_BASE/vxworks-6.3/target/h -I$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/lib/gcc/powerpc-wrs-vxworks/3.4.4/include -I$WIND_BASE/vxworks-6.3/target/h/wrn/coreip -I$WIND_BASE/vxworks-6.3/target/h -mstrict-align -fvolatile -fno-builtin -mlongcall"
-## `STATIC_CFLAGS` - Static C compiler flags.
+# * `STATIC_CFLAGS' - Static C compiler flags.
#STATIC_CFLAGS=
-## `CFLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for the shared libraries. Note that this actually is a
-## linker flag, but it needs to be passed via the compiler.
+# * `CFLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for the shared libraries. Note that this actually is a
+# linker flag, but it needs to be passed via the compiler.
#CFLAG_RUNTIME_LIBRARY_PATH=
-## `CPP` - C pre-processor.
+# * `CPP' - C pre-processor.
CPP="$CC $CFLAGS -E"
-## `CPPFLAGS` - C pre-processor flags.
+# * `CPPFLAGS' - C pre-processor flags.
#CPPFLAGS=
-## `CXX` - C++ compiler.
+# * `CXX' - C++ compiler.
#CXX=
-## `CXXFLAGS` - C++ compiler flags.
+# * `CXXFLAGS' - C++ compiler flags.
#CXXFLAGS=
-## `LD` - Linker.
+# * `LD' - Linker.
LD="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/ldppc"
-## `LDFLAGS` - Linker flags.
+# * `LDFLAGS' - Linker flags.
LDFLAGS="-mlongcall"
-## `LIBS` - Libraries.
+# * `LIBS' - Libraries.
#LIBS=
-### #### *D*ynamic *E*rlang *D*river Linking ####
+## -- *D*ynamic *E*rlang *D*river Linking --
-### *NOTE*! Either set all or none of the `DED_LD*` variables.
+## *NOTE*! Either set all or none of the `DED_LD*' variables.
-## `DED_LD` - Linker for Dynamically loaded Erlang Drivers.
+# * `DED_LD' - Linker for Dynamically loaded Erlang Drivers.
#DED_LD=
-## `DED_LDFLAGS` - Linker flags to use with `DED_LD`.
+# * `DED_LDFLAGS' - Linker flags to use with `DED_LD'.
#DED_LDFLAGS=
-## `DED_LD_FLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for shared libraries when linking with `DED_LD`.
+# * `DED_LD_FLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for shared libraries when linking with `DED_LD'.
#DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
-### #### Large File Support ####
+## -- Large File Support --
-### *NOTE*! Either set all or none of the `LFS_*` variables.
+## *NOTE*! Either set all or none of the `LFS_*' variables.
-## `LFS_CFLAGS` - Large file support C compiler flags.
+# * `LFS_CFLAGS' - Large file support C compiler flags.
#LFS_CFLAGS=
-## `LFS_LDFLAGS` - Large file support linker flags.
+# * `LFS_LDFLAGS' - Large file support linker flags.
#LFS_LDFLAGS=
-## `LFS_LIBS` - Large file support libraries.
+# * `LFS_LIBS' - Large file support libraries.
#LFS_LIBS=
-### #### Other Tools ####
+## -- Other Tools --
-## `RANLIB` - `ranlib` archive index tool.
+# * `RANLIB' - `ranlib' archive index tool.
RANLIB="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/ranlibppc"
-## `AR` - `ar` archiving tool.
+# * `AR' - `ar' archiving tool.
AR="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/arppc"
-## `GETCONF` - `getconf` system configuration inspection tool. `getconf` is
-## currently used for finding out large file support flags to use, and
-## on Linux systems for finding out if we have an NPTL thread library or
-## not.
+# * `GETCONF' - `getconf' system configuration inspection tool. `getconf' is
+# currently used for finding out large file support flags to use, and
+# on Linux systems for finding out if we have an NPTL thread library or
+# not.
#GETCONF=
-### ### Cross System Root Locations ###
+## -- Cross System Root Locations ----------------------------------------------
-## `erl_xcomp_sysroot` - The absolute path to the system root of the cross
-## compilation environment. Currently, the `crypto`, `odbc`, `ssh` and
-## `ssl` applications need the system root. These applications will be
-## skipped if the system root has not been set. The system root might be
-## needed for other things too. If this is the case and the system root
-## has not been set, `configure` will fail and request you to set it.
+# * `erl_xcomp_sysroot' - The absolute path to the system root of the cross
+# compilation environment. Currently, the `crypto', `odbc', `ssh' and
+# `ssl' applications need the system root. These applications will be
+# skipped if the system root has not been set. The system root might be
+# needed for other things too. If this is the case and the system root
+# has not been set, `configure' will fail and request you to set it.
#erl_xcomp_sysroot=
-## `erl_xcomp_isysroot` - The absolute path to the system root for includes
-## of the cross compilation environment. If not set, this value defaults
-## to `$erl_xcomp_sysroot`, i.e., only set this value if the include system
-## root path is not the same as the system root path.
+# * `erl_xcomp_isysroot' - The absolute path to the system root for includes
+# of the cross compilation environment. If not set, this value defaults
+# to `$erl_xcomp_sysroot', i.e., only set this value if the include system
+# root path is not the same as the system root path.
#erl_xcomp_isysroot=
-### ### Optional Feature, and Bug Tests ###
+## -- Optional Feature, and Bug Tests ------------------------------------------
-### These tests cannot (always) be done automatically when cross compiling. You
-### usually do not need to set these variables. Only set these if you really
-### know what you are doing.
+## These tests cannot (always) be done automatically when cross compiling. You
+## usually do not need to set these variables. Only set these if you really
+## know what you are doing.
-### Note that some of these values will override results of tests performed
-### by `configure`, and some will not be used until `configure` is sure that
-### it cannot figure the result out.
+## Note that some of these values will override results of tests performed
+## by `configure', and some will not be used until `configure' is sure that
+## it cannot figure the result out.
-### The `configure` script will issue a warning when a default value is used.
-### When a variable has been set, no warning will be issued.
+## The `configure' script will issue a warning when a default value is used.
+## When a variable has been set, no warning will be issued.
-## `erl_xcomp_after_morecore_hook` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `__after_morecore_hook` that can be
-## used for tracking used `malloc()` implementations core memory usage.
-## This is currently only used by unsupported features.
+# * `erl_xcomp_after_morecore_hook' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `__after_morecore_hook' that can be
+# used for tracking used `malloc()' implementations core memory usage.
+# This is currently only used by unsupported features.
#erl_xcomp_after_morecore_hook=
-## `erl_xcomp_bigendian` - `yes|no`. No default. If `yes`, the target system
-## must be big endian. If `no`, little endian. This can often be
-## automatically detected, but not always. If not automatically detected,
-## `configure` will fail unless this variable is set. Since no default
-## value is used, `configure` will try to figure this out automatically.
+# * `erl_xcomp_bigendian' - `yes|no'. No default. If `yes', the target system
+# must be big endian. If `no', little endian. This can often be
+# automatically detected, but not always. If not automatically detected,
+# `configure' will fail unless this variable is set. Since no default
+# value is used, `configure' will try to figure this out automatically.
erl_xcomp_bigendian=yes
-## `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `clock_gettime()` implementation
-## that can be used for retrieving process CPU time.
+# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `clock_gettime()' implementation
+# that can be used for retrieving process CPU time.
#erl_xcomp_clock_gettime_cpu_time=
-## `erl_xcomp_getaddrinfo` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a working `getaddrinfo()` implementation that can
-## handle both IPv4 and IPv6.
+# * `erl_xcomp_getaddrinfo' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `getaddrinfo()' implementation that can
+# handle both IPv4 and IPv6.
#erl_xcomp_getaddrinfo=
-## `erl_xcomp_gethrvtime_procfs_ioctl` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `gethrvtime()` implementation and
-## is used with procfs `ioctl()`.
+# * `erl_xcomp_gethrvtime_procfs_ioctl' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `gethrvtime()' implementation and
+# is used with procfs `ioctl()'.
#erl_xcomp_gethrvtime_procfs_ioctl=
-## `erl_xcomp_dlsym_brk_wrappers` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `dlsym(RTLD_NEXT, <S>)` implementation
-## that can be used on `brk` and `sbrk` symbols used by the `malloc()`
-## implementation in use, and by this track the `malloc()` implementations
-## core memory usage. This is currently only used by unsupported features.
+# * `erl_xcomp_dlsym_brk_wrappers' - `yes|no'. Defaults to `no'. If `yes', the
+# target system must have a working `dlsym(RTLD_NEXT, <S>)' implementation
+# that can be used on `brk' and `sbrk' symbols used by the `malloc()'
+# implementation in use, and by this track the `malloc()' implementations
+# core memory usage. This is currently only used by unsupported features.
#erl_xcomp_dlsym_brk_wrappers=
-## `erl_xcomp_kqueue` - `yes|no`. Defaults to `no`. If `yes`, the target system
-## must have a working `kqueue()` implementation that returns a file
-## descriptor which can be used by `poll()` and/or `select()`. If `no` and
-## the target system has not got `epoll()` or `/dev/poll`, the kernel-poll
-## feature will be disabled.
+# * `erl_xcomp_kqueue' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `kqueue()' implementation that returns a file
+# descriptor which can be used by `poll()' and/or `select()'. If `no' and
+# the target system has not got `epoll()' or `/dev/poll', the kernel-poll
+# feature will be disabled.
#erl_xcomp_kqueue=
-## `erl_xcomp_linux_clock_gettime_correction` - `yes|no`. Defaults to `yes` on
-## Linux; otherwise, `no`. If `yes`, `clock_gettime(CLOCK_MONOTONIC, _)` on
-## the target system must work. This variable is recommended to be set to
-## `no` on Linux systems with kernel versions less than 2.6.
+# * `erl_xcomp_linux_clock_gettime_correction' - `yes|no'. Defaults to `yes' on
+# Linux; otherwise, `no'. If `yes', `clock_gettime(CLOCK_MONOTONIC, _)' on
+# the target system must work. This variable is recommended to be set to
+# `no' on Linux systems with kernel versions less than 2.6.
#erl_xcomp_linux_clock_gettime_correction=
-## `erl_xcomp_linux_nptl` - `yes|no`. Defaults to `yes` on Linux; otherwise,
-## `no`. If `yes`, the target system must have NPTL (Native POSIX Thread
-## Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
-## kernel versions typically less than 2.6).
+# * `erl_xcomp_linux_nptl' - `yes|no'. Defaults to `yes' on Linux; otherwise,
+# `no'. If `yes', the target system must have NPTL (Native POSIX Thread
+# Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+# kernel versions typically less than 2.6).
#erl_xcomp_linux_nptl=
-## `erl_xcomp_linux_usable_sigaltstack` - `yes|no`. Defaults to `yes` on Linux;
-## otherwise, `no`. If `yes`, `sigaltstack()` must be usable on the target
-## system. `sigaltstack()` on Linux kernel versions less than 2.4 are
-## broken.
+# * `erl_xcomp_linux_usable_sigaltstack' - `yes|no'. Defaults to `yes' on Linux;
+# otherwise, `no'. If `yes', `sigaltstack()' must be usable on the target
+# system. `sigaltstack()' on Linux kernel versions less than 2.4 are
+# broken.
#erl_xcomp_linux_usable_sigaltstack=
-## `erl_xcomp_linux_usable_sigusrx` - `yes|no`. Defaults to `yes`. If `yes`,
-## the `SIGUSR1` and `SIGUSR2` signals must be usable by the ERTS. Old
-## LinuxThreads thread libraries (Linux kernel versions typically less than
-## 2.2) used these signals and made them unusable by the ERTS.
+# * `erl_xcomp_linux_usable_sigusrx' - `yes|no'. Defaults to `yes'. If `yes',
+# the `SIGUSR1' and `SIGUSR2' signals must be usable by the ERTS. Old
+# LinuxThreads thread libraries (Linux kernel versions typically less than
+# 2.2) used these signals and made them unusable by the ERTS.
#erl_xcomp_linux_usable_sigusrx=
-## `erl_xcomp_poll` - `yes|no`. Defaults to `no` on Darwin/MacOSX; otherwise,
-## `yes`. If `yes`, the target system must have a working `poll()`
-## implementation that also can handle devices. If `no`, `select()` will be
-## used instead of `poll()`.
+# * `erl_xcomp_poll' - `yes|no'. Defaults to `no' on Darwin/MacOSX; otherwise,
+# `yes'. If `yes', the target system must have a working `poll()'
+# implementation that also can handle devices. If `no', `select()' will be
+# used instead of `poll()'.
#erl_xcomp_poll=
-## `erl_xcomp_putenv_copy` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a `putenv()` implementation that stores a copy of the
-## key/value pair.
+# * `erl_xcomp_putenv_copy' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a `putenv()' implementation that stores a copy of the
+# key/value pair.
#erl_xcomp_putenv_copy=
-## `erl_xcomp_reliable_fpe` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have reliable floating point exceptions.
+# * `erl_xcomp_reliable_fpe' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have reliable floating point exceptions.
#erl_xcomp_reliable_fpe=
-####
+## -----------------------------------------------------------------------------
diff --git a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
index a0dd7c9115..f645ddbd96 100644
--- a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
+++ b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
@@ -1,258 +1,258 @@
-#### -*-shell-script-*-
-####
-#### %CopyrightBegin%
-####
-#### Copyright Ericsson AB 2010. All Rights Reserved.
-####
-#### The contents of this file are subject to the Erlang Public License,
-#### Version 1.1, (the "License"); you may not use this file except in
-#### compliance with the License. You should have received a copy of the
-#### Erlang Public License along with this software. If not, it can be
-#### retrieved online at http://www.erlang.org/.
-####
-#### Software distributed under the License is distributed on an "AS IS"
-#### basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-#### the License for the specific language governing rights and limitations
-#### under the License.
-####
-#### %CopyrightEnd%
-####
-#### File: erl-xcomp-x86_64-saf-linux-gnu.conf
-#### Author: Rickard Green
-####
-#### --------------------------------------------------------------------------
-#### When cross compiling Erlang/OTP using `otp_build`, copy this file and set
-#### the variables needed below. Then pass the path to the copy of this file as
-#### an argument to `otp_build` in the configure stage:
-#### `otp_build configure --xcomp-conf=<FILE>`
-#### --------------------------------------------------------------------------
-
-### Note that you cannot define arbitrary variables in a cross compilation
-### configuration file. Only the ones listed below will be guaranteed to be
-### visible throughout the whole execution of all `configure` scripts. Other
-### variables needs to be defined as arguments to `configure` or exported in
-### the environment.
-
-### ### Variables for `otp_build` Only ###
-
-### Variables in this section are only used, when configuring Erlang/OTP for
-### cross compilation using `$ERL_TOP/otp_build configure`.
-
-### *NOTE*! These variables currently have *no* effect if you configure using
-### the `configure` script directly.
-
-## `erl_xcomp_build` - The build system used. This value will be passed as
-## `--build=$erl_xcomp_build` argument to the `configure` script. It does
-## not have to be a full `CPU-VENDOR-OS` triplet, but can be. The full
-## `CPU-VENDOR-OS` triplet will be created by
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build`.
-## If set to `guess`, the build system will be guessed using
-## `$ERL_TOP/erts/autoconf/config.guess`.
+## -*-shell-script-*-
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2010. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## File: erl-xcomp-x86_64-saf-linux-gnu.conf
+## Author: Rickard Green
+##
+## -----------------------------------------------------------------------------
+## When cross compiling Erlang/OTP using `otp_build', copy this file and set
+## the variables needed below. Then pass the path to the copy of this file as
+## an argument to `otp_build' in the configure stage:
+## `otp_build configure --xcomp-conf=<FILE>'
+## -----------------------------------------------------------------------------
+
+## Note that you cannot define arbitrary variables in a cross compilation
+## configuration file. Only the ones listed below will be guaranteed to be
+## visible throughout the whole execution of all `configure' scripts. Other
+## variables needs to be defined as arguments to `configure' or exported in
+## the environment.
+
+## -- Variables for `otp_build' Only -------------------------------------------
+
+## Variables in this section are only used, when configuring Erlang/OTP for
+## cross compilation using `$ERL_TOP/otp_build configure'.
+
+## *NOTE*! These variables currently have *no* effect if you configure using
+## the `configure' script directly.
+
+# * `erl_xcomp_build' - The build system used. This value will be passed as
+# `--build=$erl_xcomp_build' argument to the `configure' script. It does
+# not have to be a full `CPU-VENDOR-OS' triplet, but can be. The full
+# `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build'. If set to `guess',
+# the build system will be guessed using
+# `$ERL_TOP/erts/autoconf/config.guess'.
erl_xcomp_build=guess
-## `erl_xcomp_host` - Cross host/target system to build for. This value will
-## be passed as `--host=$erl_xcomp_host` argument to the `configure` script.
-## It does not have to be a full `CPU-VENDOR-OS` triplet, but can be. The
-## full `CPU-VENDOR-OS` triplet will be created by:
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host`
+# * `erl_xcomp_host' - Cross host/target system to build for. This value will
+# be passed as `--host=$erl_xcomp_host' argument to the `configure' script.
+# It does not have to be a full `CPU-VENDOR-OS' triplet, but can be. The
+# full `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host'.
erl_xcomp_host=x86_64-saf-linux-gnu
-## `erl_xcomp_configure_flags` - Extra configure flags to pass to the
-## `configure` script.
+# * `erl_xcomp_configure_flags' - Extra configure flags to pass to the
+# `configure' script.
#erl_xcomp_configure_flags=
-### ### Cross Compiler and Other Tools ###
+## -- Cross Compiler and Other Tools -------------------------------------------
-### If the cross compilation tools are prefixed by `<HOST>-` you probably do
-### not need to set these variables (where `<HOST>` is what has been passed as
-### `--host=<HOST>` argument to `configure`).
+## If the cross compilation tools are prefixed by `<HOST>-' you probably do
+## not need to set these variables (where `<HOST>' is what has been passed as
+## `--host=<HOST>' argument to `configure').
-### All variables in this section can also be used when native compiling.
+## All variables in this section can also be used when native compiling.
-## `CC` - C compiler.
+# * `CC' - C compiler.
CC=x86_64-saf-gcc
-## `CFLAGS` - C compiler flags.
+# * `CFLAGS' - C compiler flags.
#CFLAGS=
-## `STATIC_CFLAGS` - Static C compiler flags.
+# * `STATIC_CFLAGS' - Static C compiler flags.
#STATIC_CFLAGS=
-## `CFLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for the shared libraries. Note that this actually is a
-## linker flag, but it needs to be passed via the compiler.
+# * `CFLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for the shared libraries. Note that this actually is a
+# linker flag, but it needs to be passed via the compiler.
#CFLAG_RUNTIME_LIBRARY_PATH=
-## `CPP` - C pre-processor.
+# * `CPP' - C pre-processor.
#CPP=
-## `CPPFLAGS` - C pre-processor flags.
+# * `CPPFLAGS' - C pre-processor flags.
#CPPFLAGS=
-## `CXX` - C++ compiler.
+# * `CXX' - C++ compiler.
CXX=x86_64-saf-g++
-## `CXXFLAGS` - C++ compiler flags.
+# * `CXXFLAGS' - C++ compiler flags.
#CXXFLAGS=
-## `LD` - Linker.
+# * `LD' - Linker.
LD=x86_64-saf-ld
-## `LDFLAGS` - Linker flags.
+# * `LDFLAGS' - Linker flags.
#LDFLAGS=
-## `LIBS` - Libraries.
+# * `LIBS' - Libraries.
#LIBS=
-### #### *D*ynamic *E*rlang *D*river Linking ####
+## -- *D*ynamic *E*rlang *D*river Linking --
-### *NOTE*! Either set all or none of the `DED_LD*` variables.
+## *NOTE*! Either set all or none of the `DED_LD*' variables.
-## `DED_LD` - Linker for Dynamically loaded Erlang Drivers.
+# * `DED_LD' - Linker for Dynamically loaded Erlang Drivers.
#DED_LD=
-## `DED_LDFLAGS` - Linker flags to use with `DED_LD`.
+# * `DED_LDFLAGS' - Linker flags to use with `DED_LD'.
#DED_LDFLAGS=
-## `DED_LD_FLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for shared libraries when linking with `DED_LD`.
+# * `DED_LD_FLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for shared libraries when linking with `DED_LD'.
#DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
-### #### Large File Support ####
+## -- Large File Support --
-### *NOTE*! Either set all or none of the `LFS_*` variables.
+## *NOTE*! Either set all or none of the `LFS_*' variables.
-## `LFS_CFLAGS` - Large file support C compiler flags.
+# * `LFS_CFLAGS' - Large file support C compiler flags.
#LFS_CFLAGS=
-## `LFS_LDFLAGS` - Large file support linker flags.
+# * `LFS_LDFLAGS' - Large file support linker flags.
#LFS_LDFLAGS=
-## `LFS_LIBS` - Large file support libraries.
+# * `LFS_LIBS' - Large file support libraries.
#LFS_LIBS=
-### #### Other Tools ####
+## -- Other Tools --
-## `RANLIB` - `ranlib` archive index tool.
+# * `RANLIB' - `ranlib' archive index tool.
RANLIB=x86_64-saf-ranlib
-## `AR` - `ar` archiving tool.
+# * `AR' - `ar' archiving tool.
AR=x86_64-saf-ar
-## `GETCONF` - `getconf` system configuration inspection tool. `getconf` is
-## currently used for finding out large file support flags to use, and
-## on Linux systems for finding out if we have an NPTL thread library or
-## not.
+# * `GETCONF' - `getconf' system configuration inspection tool. `getconf' is
+# currently used for finding out large file support flags to use, and
+# on Linux systems for finding out if we have an NPTL thread library or
+# not.
#GETCONF=
-### ### Cross System Root Locations ###
+## -- Cross System Root Locations ----------------------------------------------
-## `erl_xcomp_sysroot` - The absolute path to the system root of the cross
-## compilation environment. Currently, the `crypto`, `odbc`, `ssh` and
-## `ssl` applications need the system root. These applications will be
-## skipped if the system root has not been set. The system root might be
-## needed for other things too. If this is the case and the system root
-## has not been set, `configure` will fail and request you to set it.
+# * `erl_xcomp_sysroot' - The absolute path to the system root of the cross
+# compilation environment. Currently, the `crypto', `odbc', `ssh' and
+# `ssl' applications need the system root. These applications will be
+# skipped if the system root has not been set. The system root might be
+# needed for other things too. If this is the case and the system root
+# has not been set, `configure' will fail and request you to set it.
erl_xcomp_sysroot="$SAF_SYSROOT_X86_64"
-## `erl_xcomp_isysroot` - The absolute path to the system root for includes
-## of the cross compilation environment. If not set, this value defaults
-## to `$erl_xcomp_sysroot`, i.e., only set this value if the include system
-## root path is not the same as the system root path.
+# * `erl_xcomp_isysroot' - The absolute path to the system root for includes
+# of the cross compilation environment. If not set, this value defaults
+# to `$erl_xcomp_sysroot', i.e., only set this value if the include system
+# root path is not the same as the system root path.
#erl_xcomp_isysroot=
-### ### Optional Feature, and Bug Tests ###
+## -- Optional Feature, and Bug Tests ------------------------------------------
-### These tests cannot (always) be done automatically when cross compiling. You
-### usually do not need to set these variables. Only set these if you really
-### know what you are doing.
+## These tests cannot (always) be done automatically when cross compiling. You
+## usually do not need to set these variables. Only set these if you really
+## know what you are doing.
-### Note that some of these values will override results of tests performed
-### by `configure`, and some will not be used until `configure` is sure that
-### it cannot figure the result out.
+## Note that some of these values will override results of tests performed
+## by `configure', and some will not be used until `configure' is sure that
+## it cannot figure the result out.
-### The `configure` script will issue a warning when a default value is used.
-### When a variable has been set, no warning will be issued.
+## The `configure' script will issue a warning when a default value is used.
+## When a variable has been set, no warning will be issued.
-## `erl_xcomp_after_morecore_hook` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `__after_morecore_hook` that can be
-## used for tracking used `malloc()` implementations core memory usage.
-## This is currently only used by unsupported features.
+# * `erl_xcomp_after_morecore_hook' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `__after_morecore_hook' that can be
+# used for tracking used `malloc()' implementations core memory usage.
+# This is currently only used by unsupported features.
erl_xcomp_after_morecore_hook=yes
-## `erl_xcomp_bigendian` - `yes|no`. No default. If `yes`, the target system
-## must be big endian. If `no`, little endian. This can often be
-## automatically detected, but not always. If not automatically detected,
-## `configure` will fail unless this variable is set. Since no default
-## value is used, `configure` will try to figure this out automatically.
+# * `erl_xcomp_bigendian' - `yes|no'. No default. If `yes', the target system
+# must be big endian. If `no', little endian. This can often be
+# automatically detected, but not always. If not automatically detected,
+# `configure' will fail unless this variable is set. Since no default
+# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
-## `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `clock_gettime()` implementation
-## that can be used for retrieving process CPU time.
+# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `clock_gettime()' implementation
+# that can be used for retrieving process CPU time.
#erl_xcomp_clock_gettime_cpu_time=
-## `erl_xcomp_getaddrinfo` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a working `getaddrinfo()` implementation that can
-## handle both IPv4 and IPv6.
+# * `erl_xcomp_getaddrinfo' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `getaddrinfo()' implementation that can
+# handle both IPv4 and IPv6.
erl_xcomp_getaddrinfo=yes
-## `erl_xcomp_gethrvtime_procfs_ioctl` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `gethrvtime()` implementation and
-## is used with procfs `ioctl()`.
+# * `erl_xcomp_gethrvtime_procfs_ioctl' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `gethrvtime()' implementation and
+# is used with procfs `ioctl()'.
#erl_xcomp_gethrvtime_procfs_ioctl=
-## `erl_xcomp_dlsym_brk_wrappers` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `dlsym(RTLD_NEXT, <S>)` implementation
-## that can be used on `brk` and `sbrk` symbols used by the `malloc()`
-## implementation in use, and by this track the `malloc()` implementations
-## core memory usage. This is currently only used by unsupported features.
+# * `erl_xcomp_dlsym_brk_wrappers' - `yes|no'. Defaults to `no'. If `yes', the
+# target system must have a working `dlsym(RTLD_NEXT, <S>)' implementation
+# that can be used on `brk' and `sbrk' symbols used by the `malloc()'
+# implementation in use, and by this track the `malloc()' implementations
+# core memory usage. This is currently only used by unsupported features.
#erl_xcomp_dlsym_brk_wrappers=
-## `erl_xcomp_kqueue` - `yes|no`. Defaults to `no`. If `yes`, the target system
-## must have a working `kqueue()` implementation that returns a file
-## descriptor which can be used by `poll()` and/or `select()`. If `no` and
-## the target system has not got `epoll()` or `/dev/poll`, the kernel-poll
-## feature will be disabled.
+# * `erl_xcomp_kqueue' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `kqueue()' implementation that returns a file
+# descriptor which can be used by `poll()' and/or `select()'. If `no' and
+# the target system has not got `epoll()' or `/dev/poll', the kernel-poll
+# feature will be disabled.
#erl_xcomp_kqueue=
-## `erl_xcomp_linux_clock_gettime_correction` - `yes|no`. Defaults to `yes` on
-## Linux; otherwise, `no`. If `yes`, `clock_gettime(CLOCK_MONOTONIC, _)` on
-## the target system must work. This variable is recommended to be set to
-## `no` on Linux systems with kernel versions less than 2.6.
+# * `erl_xcomp_linux_clock_gettime_correction' - `yes|no'. Defaults to `yes' on
+# Linux; otherwise, `no'. If `yes', `clock_gettime(CLOCK_MONOTONIC, _)' on
+# the target system must work. This variable is recommended to be set to
+# `no' on Linux systems with kernel versions less than 2.6.
#erl_xcomp_linux_clock_gettime_correction=
-## `erl_xcomp_linux_nptl` - `yes|no`. Defaults to `yes` on Linux; otherwise,
-## `no`. If `yes`, the target system must have NPTL (Native POSIX Thread
-## Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
-## kernel versions typically less than 2.6).
+# * `erl_xcomp_linux_nptl' - `yes|no'. Defaults to `yes' on Linux; otherwise,
+# `no'. If `yes', the target system must have NPTL (Native POSIX Thread
+# Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+# kernel versions typically less than 2.6).
#erl_xcomp_linux_nptl=
-## `erl_xcomp_linux_usable_sigaltstack` - `yes|no`. Defaults to `yes` on Linux;
-## otherwise, `no`. If `yes`, `sigaltstack()` must be usable on the target
-## system. `sigaltstack()` on Linux kernel versions less than 2.4 are
-## broken.
+# * `erl_xcomp_linux_usable_sigaltstack' - `yes|no'. Defaults to `yes' on Linux;
+# otherwise, `no'. If `yes', `sigaltstack()' must be usable on the target
+# system. `sigaltstack()' on Linux kernel versions less than 2.4 are
+# broken.
#erl_xcomp_linux_usable_sigaltstack=
-## `erl_xcomp_linux_usable_sigusrx` - `yes|no`. Defaults to `yes`. If `yes`,
-## the `SIGUSR1` and `SIGUSR2` signals must be usable by the ERTS. Old
-## LinuxThreads thread libraries (Linux kernel versions typically less than
-## 2.2) used these signals and made them unusable by the ERTS.
+# * `erl_xcomp_linux_usable_sigusrx' - `yes|no'. Defaults to `yes'. If `yes',
+# the `SIGUSR1' and `SIGUSR2' signals must be usable by the ERTS. Old
+# LinuxThreads thread libraries (Linux kernel versions typically less than
+# 2.2) used these signals and made them unusable by the ERTS.
#erl_xcomp_linux_usable_sigusrx=
-## `erl_xcomp_poll` - `yes|no`. Defaults to `no` on Darwin/MacOSX; otherwise,
-## `yes`. If `yes`, the target system must have a working `poll()`
-## implementation that also can handle devices. If `no`, `select()` will be
-## used instead of `poll()`.
+# * `erl_xcomp_poll' - `yes|no'. Defaults to `no' on Darwin/MacOSX; otherwise,
+# `yes'. If `yes', the target system must have a working `poll()'
+# implementation that also can handle devices. If `no', `select()' will be
+# used instead of `poll()'.
#erl_xcomp_poll=
-## `erl_xcomp_putenv_copy` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a `putenv()` implementation that stores a copy of the
-## key/value pair.
+# * `erl_xcomp_putenv_copy' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a `putenv()' implementation that stores a copy of the
+# key/value pair.
#erl_xcomp_putenv_copy=
-## `erl_xcomp_reliable_fpe` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have reliable floating point exceptions.
+# * `erl_xcomp_reliable_fpe' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have reliable floating point exceptions.
#erl_xcomp_reliable_fpe=
-####
+## -----------------------------------------------------------------------------
diff --git a/xcomp/erl-xcomp.conf.template b/xcomp/erl-xcomp.conf.template
index 090f92c15f..eb331ffe92 100644
--- a/xcomp/erl-xcomp.conf.template
+++ b/xcomp/erl-xcomp.conf.template
@@ -1,258 +1,258 @@
-#### -*-shell-script-*-
-####
-#### %CopyrightBegin%
-####
-#### Copyright Ericsson AB 2009-2010. All Rights Reserved.
-####
-#### The contents of this file are subject to the Erlang Public License,
-#### Version 1.1, (the "License"); you may not use this file except in
-#### compliance with the License. You should have received a copy of the
-#### Erlang Public License along with this software. If not, it can be
-#### retrieved online at http://www.erlang.org/.
-####
-#### Software distributed under the License is distributed on an "AS IS"
-#### basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-#### the License for the specific language governing rights and limitations
-#### under the License.
-####
-#### %CopyrightEnd%
-####
-#### File: erl-xcomp.conf.template
-#### Author: Rickard Green
-####
-#### --------------------------------------------------------------------------
-#### When cross compiling Erlang/OTP using `otp_build`, copy this file and set
-#### the variables needed below. Then pass the path to the copy of this file as
-#### an argument to `otp_build` in the configure stage:
-#### `otp_build configure --xcomp-conf=<FILE>`
-#### --------------------------------------------------------------------------
-
-### Note that you cannot define arbitrary variables in a cross compilation
-### configuration file. Only the ones listed below will be guaranteed to be
-### visible throughout the whole execution of all `configure` scripts. Other
-### variables needs to be defined as arguments to `configure` or exported in
-### the environment.
-
-### ### Variables for `otp_build` Only ###
-
-### Variables in this section are only used, when configuring Erlang/OTP for
-### cross compilation using `$ERL_TOP/otp_build configure`.
-
-### *NOTE*! These variables currently have *no* effect if you configure using
-### the `configure` script directly.
-
-## `erl_xcomp_build` - The build system used. This value will be passed as
-## `--build=$erl_xcomp_build` argument to the `configure` script. It does
-## not have to be a full `CPU-VENDOR-OS` triplet, but can be. The full
-## `CPU-VENDOR-OS` triplet will be created by
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build`.
-## If set to `guess`, the build system will be guessed using
-## `$ERL_TOP/erts/autoconf/config.guess`.
+## -*-shell-script-*-
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2009-2010. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## File: erl-xcomp.conf.template
+## Author: Rickard Green
+##
+## -----------------------------------------------------------------------------
+## When cross compiling Erlang/OTP using `otp_build', copy this file and set
+## the variables needed below. Then pass the path to the copy of this file as
+## an argument to `otp_build' in the configure stage:
+## `otp_build configure --xcomp-conf=<FILE>'
+## -----------------------------------------------------------------------------
+
+## Note that you cannot define arbitrary variables in a cross compilation
+## configuration file. Only the ones listed below will be guaranteed to be
+## visible throughout the whole execution of all `configure' scripts. Other
+## variables needs to be defined as arguments to `configure' or exported in
+## the environment.
+
+## -- Variables for `otp_build' Only -------------------------------------------
+
+## Variables in this section are only used, when configuring Erlang/OTP for
+## cross compilation using `$ERL_TOP/otp_build configure'.
+
+## *NOTE*! These variables currently have *no* effect if you configure using
+## the `configure' script directly.
+
+# * `erl_xcomp_build' - The build system used. This value will be passed as
+# `--build=$erl_xcomp_build' argument to the `configure' script. It does
+# not have to be a full `CPU-VENDOR-OS' triplet, but can be. The full
+# `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build'. If set to `guess',
+# the build system will be guessed using
+# `$ERL_TOP/erts/autoconf/config.guess'.
#erl_xcomp_build=
-## `erl_xcomp_host` - Cross host/target system to build for. This value will
-## be passed as `--host=$erl_xcomp_host` argument to the `configure` script.
-## It does not have to be a full `CPU-VENDOR-OS` triplet, but can be. The
-## full `CPU-VENDOR-OS` triplet will be created by:
-## `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host`
+# * `erl_xcomp_host' - Cross host/target system to build for. This value will
+# be passed as `--host=$erl_xcomp_host' argument to the `configure' script.
+# It does not have to be a full `CPU-VENDOR-OS' triplet, but can be. The
+# full `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host'.
#erl_xcomp_host=
-## `erl_xcomp_configure_flags` - Extra configure flags to pass to the
-## `configure` script.
+# * `erl_xcomp_configure_flags' - Extra configure flags to pass to the
+# `configure' script.
#erl_xcomp_configure_flags=
-### ### Cross Compiler and Other Tools ###
+## -- Cross Compiler and Other Tools -------------------------------------------
-### If the cross compilation tools are prefixed by `<HOST>-` you probably do
-### not need to set these variables (where `<HOST>` is what has been passed as
-### `--host=<HOST>` argument to `configure`).
+## If the cross compilation tools are prefixed by `<HOST>-' you probably do
+## not need to set these variables (where `<HOST>' is what has been passed as
+## `--host=<HOST>' argument to `configure').
-### All variables in this section can also be used when native compiling.
+## All variables in this section can also be used when native compiling.
-## `CC` - C compiler.
+# * `CC' - C compiler.
#CC=
-## `CFLAGS` - C compiler flags.
+# * `CFLAGS' - C compiler flags.
#CFLAGS=
-## `STATIC_CFLAGS` - Static C compiler flags.
+# * `STATIC_CFLAGS' - Static C compiler flags.
#STATIC_CFLAGS=
-## `CFLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for the shared libraries. Note that this actually is a
-## linker flag, but it needs to be passed via the compiler.
+# * `CFLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for the shared libraries. Note that this actually is a
+# linker flag, but it needs to be passed via the compiler.
#CFLAG_RUNTIME_LIBRARY_PATH=
-## `CPP` - C pre-processor.
+# * `CPP' - C pre-processor.
#CPP=
-## `CPPFLAGS` - C pre-processor flags.
+# * `CPPFLAGS' - C pre-processor flags.
#CPPFLAGS=
-## `CXX` - C++ compiler.
+# * `CXX' - C++ compiler.
#CXX=
-## `CXXFLAGS` - C++ compiler flags.
+# * `CXXFLAGS' - C++ compiler flags.
#CXXFLAGS=
-## `LD` - Linker.
+# * `LD' - Linker.
#LD=
-## `LDFLAGS` - Linker flags.
+# * `LDFLAGS' - Linker flags.
#LDFLAGS=
-## `LIBS` - Libraries.
+# * `LIBS' - Libraries.
#LIBS=
-### #### *D*ynamic *E*rlang *D*river Linking ####
+## -- *D*ynamic *E*rlang *D*river Linking --
-### *NOTE*! Either set all or none of the `DED_LD*` variables.
+## *NOTE*! Either set all or none of the `DED_LD*' variables.
-## `DED_LD` - Linker for Dynamically loaded Erlang Drivers.
+# * `DED_LD' - Linker for Dynamically loaded Erlang Drivers.
#DED_LD=
-## `DED_LDFLAGS` - Linker flags to use with `DED_LD`.
+# * `DED_LDFLAGS' - Linker flags to use with `DED_LD'.
#DED_LDFLAGS=
-## `DED_LD_FLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
-## search path for shared libraries when linking with `DED_LD`.
+# * `DED_LD_FLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for shared libraries when linking with `DED_LD'.
#DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
-### #### Large File Support ####
+## -- Large File Support --
-### *NOTE*! Either set all or none of the `LFS_*` variables.
+## *NOTE*! Either set all or none of the `LFS_*' variables.
-## `LFS_CFLAGS` - Large file support C compiler flags.
+# * `LFS_CFLAGS' - Large file support C compiler flags.
#LFS_CFLAGS=
-## `LFS_LDFLAGS` - Large file support linker flags.
+# * `LFS_LDFLAGS' - Large file support linker flags.
#LFS_LDFLAGS=
-## `LFS_LIBS` - Large file support libraries.
+# * `LFS_LIBS' - Large file support libraries.
#LFS_LIBS=
-### #### Other Tools ####
+## -- Other Tools --
-## `RANLIB` - `ranlib` archive index tool.
+# * `RANLIB' - `ranlib' archive index tool.
#RANLIB=
-## `AR` - `ar` archiving tool.
+# * `AR' - `ar' archiving tool.
#AR=
-## `GETCONF` - `getconf` system configuration inspection tool. `getconf` is
-## currently used for finding out large file support flags to use, and
-## on Linux systems for finding out if we have an NPTL thread library or
-## not.
+# * `GETCONF' - `getconf' system configuration inspection tool. `getconf' is
+# currently used for finding out large file support flags to use, and
+# on Linux systems for finding out if we have an NPTL thread library or
+# not.
#GETCONF=
-### ### Cross System Root Locations ###
+## -- Cross System Root Locations ----------------------------------------------
-## `erl_xcomp_sysroot` - The absolute path to the system root of the cross
-## compilation environment. Currently, the `crypto`, `odbc`, `ssh` and
-## `ssl` applications need the system root. These applications will be
-## skipped if the system root has not been set. The system root might be
-## needed for other things too. If this is the case and the system root
-## has not been set, `configure` will fail and request you to set it.
+# * `erl_xcomp_sysroot' - The absolute path to the system root of the cross
+# compilation environment. Currently, the `crypto', `odbc', `ssh' and
+# `ssl' applications need the system root. These applications will be
+# skipped if the system root has not been set. The system root might be
+# needed for other things too. If this is the case and the system root
+# has not been set, `configure' will fail and request you to set it.
#erl_xcomp_sysroot=
-## `erl_xcomp_isysroot` - The absolute path to the system root for includes
-## of the cross compilation environment. If not set, this value defaults
-## to `$erl_xcomp_sysroot`, i.e., only set this value if the include system
-## root path is not the same as the system root path.
+# * `erl_xcomp_isysroot' - The absolute path to the system root for includes
+# of the cross compilation environment. If not set, this value defaults
+# to `$erl_xcomp_sysroot', i.e., only set this value if the include system
+# root path is not the same as the system root path.
#erl_xcomp_isysroot=
-### ### Optional Feature, and Bug Tests ###
+## -- Optional Feature, and Bug Tests ------------------------------------------
-### These tests cannot (always) be done automatically when cross compiling. You
-### usually do not need to set these variables. Only set these if you really
-### know what you are doing.
+## These tests cannot (always) be done automatically when cross compiling. You
+## usually do not need to set these variables. Only set these if you really
+## know what you are doing.
-### Note that some of these values will override results of tests performed
-### by `configure`, and some will not be used until `configure` is sure that
-### it cannot figure the result out.
+## Note that some of these values will override results of tests performed
+## by `configure', and some will not be used until `configure' is sure that
+## it cannot figure the result out.
-### The `configure` script will issue a warning when a default value is used.
-### When a variable has been set, no warning will be issued.
+## The `configure' script will issue a warning when a default value is used.
+## When a variable has been set, no warning will be issued.
-## `erl_xcomp_after_morecore_hook` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `__after_morecore_hook` that can be
-## used for tracking used `malloc()` implementations core memory usage.
-## This is currently only used by unsupported features.
+# * `erl_xcomp_after_morecore_hook' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `__after_morecore_hook' that can be
+# used for tracking used `malloc()' implementations core memory usage.
+# This is currently only used by unsupported features.
#erl_xcomp_after_morecore_hook=
-## `erl_xcomp_bigendian` - `yes|no`. No default. If `yes`, the target system
-## must be big endian. If `no`, little endian. This can often be
-## automatically detected, but not always. If not automatically detected,
-## `configure` will fail unless this variable is set. Since no default
-## value is used, `configure` will try to figure this out automatically.
+# * `erl_xcomp_bigendian' - `yes|no'. No default. If `yes', the target system
+# must be big endian. If `no', little endian. This can often be
+# automatically detected, but not always. If not automatically detected,
+# `configure' will fail unless this variable is set. Since no default
+# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
-## `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `clock_gettime()` implementation
-## that can be used for retrieving process CPU time.
+# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `clock_gettime()' implementation
+# that can be used for retrieving process CPU time.
#erl_xcomp_clock_gettime_cpu_time=
-## `erl_xcomp_getaddrinfo` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a working `getaddrinfo()` implementation that can
-## handle both IPv4 and IPv6.
+# * `erl_xcomp_getaddrinfo' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `getaddrinfo()' implementation that can
+# handle both IPv4 and IPv6.
#erl_xcomp_getaddrinfo=
-## `erl_xcomp_gethrvtime_procfs_ioctl` - `yes|no`. Defaults to `no`. If `yes`,
-## the target system must have a working `gethrvtime()` implementation and
-## is used with procfs `ioctl()`.
+# * `erl_xcomp_gethrvtime_procfs_ioctl' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `gethrvtime()' implementation and
+# is used with procfs `ioctl()'.
#erl_xcomp_gethrvtime_procfs_ioctl=
-## `erl_xcomp_dlsym_brk_wrappers` - `yes|no`. Defaults to `no`. If `yes`, the
-## target system must have a working `dlsym(RTLD_NEXT, <S>)` implementation
-## that can be used on `brk` and `sbrk` symbols used by the `malloc()`
-## implementation in use, and by this track the `malloc()` implementations
-## core memory usage. This is currently only used by unsupported features.
+# * `erl_xcomp_dlsym_brk_wrappers' - `yes|no'. Defaults to `no'. If `yes', the
+# target system must have a working `dlsym(RTLD_NEXT, <S>)' implementation
+# that can be used on `brk' and `sbrk' symbols used by the `malloc()'
+# implementation in use, and by this track the `malloc()' implementations
+# core memory usage. This is currently only used by unsupported features.
#erl_xcomp_dlsym_brk_wrappers=
-## `erl_xcomp_kqueue` - `yes|no`. Defaults to `no`. If `yes`, the target system
-## must have a working `kqueue()` implementation that returns a file
-## descriptor which can be used by `poll()` and/or `select()`. If `no` and
-## the target system has not got `epoll()` or `/dev/poll`, the kernel-poll
-## feature will be disabled.
+# * `erl_xcomp_kqueue' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `kqueue()' implementation that returns a file
+# descriptor which can be used by `poll()' and/or `select()'. If `no' and
+# the target system has not got `epoll()' or `/dev/poll', the kernel-poll
+# feature will be disabled.
#erl_xcomp_kqueue=
-## `erl_xcomp_linux_clock_gettime_correction` - `yes|no`. Defaults to `yes` on
-## Linux; otherwise, `no`. If `yes`, `clock_gettime(CLOCK_MONOTONIC, _)` on
-## the target system must work. This variable is recommended to be set to
-## `no` on Linux systems with kernel versions less than 2.6.
+# * `erl_xcomp_linux_clock_gettime_correction' - `yes|no'. Defaults to `yes' on
+# Linux; otherwise, `no'. If `yes', `clock_gettime(CLOCK_MONOTONIC, _)' on
+# the target system must work. This variable is recommended to be set to
+# `no' on Linux systems with kernel versions less than 2.6.
#erl_xcomp_linux_clock_gettime_correction=
-## `erl_xcomp_linux_nptl` - `yes|no`. Defaults to `yes` on Linux; otherwise,
-## `no`. If `yes`, the target system must have NPTL (Native POSIX Thread
-## Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
-## kernel versions typically less than 2.6).
+# * `erl_xcomp_linux_nptl' - `yes|no'. Defaults to `yes' on Linux; otherwise,
+# `no'. If `yes', the target system must have NPTL (Native POSIX Thread
+# Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+# kernel versions typically less than 2.6).
#erl_xcomp_linux_nptl=
-## `erl_xcomp_linux_usable_sigaltstack` - `yes|no`. Defaults to `yes` on Linux;
-## otherwise, `no`. If `yes`, `sigaltstack()` must be usable on the target
-## system. `sigaltstack()` on Linux kernel versions less than 2.4 are
-## broken.
+# * `erl_xcomp_linux_usable_sigaltstack' - `yes|no'. Defaults to `yes' on Linux;
+# otherwise, `no'. If `yes', `sigaltstack()' must be usable on the target
+# system. `sigaltstack()' on Linux kernel versions less than 2.4 are
+# broken.
#erl_xcomp_linux_usable_sigaltstack=
-## `erl_xcomp_linux_usable_sigusrx` - `yes|no`. Defaults to `yes`. If `yes`,
-## the `SIGUSR1` and `SIGUSR2` signals must be usable by the ERTS. Old
-## LinuxThreads thread libraries (Linux kernel versions typically less than
-## 2.2) used these signals and made them unusable by the ERTS.
+# * `erl_xcomp_linux_usable_sigusrx' - `yes|no'. Defaults to `yes'. If `yes',
+# the `SIGUSR1' and `SIGUSR2' signals must be usable by the ERTS. Old
+# LinuxThreads thread libraries (Linux kernel versions typically less than
+# 2.2) used these signals and made them unusable by the ERTS.
#erl_xcomp_linux_usable_sigusrx=
-## `erl_xcomp_poll` - `yes|no`. Defaults to `no` on Darwin/MacOSX; otherwise,
-## `yes`. If `yes`, the target system must have a working `poll()`
-## implementation that also can handle devices. If `no`, `select()` will be
-## used instead of `poll()`.
+# * `erl_xcomp_poll' - `yes|no'. Defaults to `no' on Darwin/MacOSX; otherwise,
+# `yes'. If `yes', the target system must have a working `poll()'
+# implementation that also can handle devices. If `no', `select()' will be
+# used instead of `poll()'.
#erl_xcomp_poll=
-## `erl_xcomp_putenv_copy` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have a `putenv()` implementation that stores a copy of the
-## key/value pair.
+# * `erl_xcomp_putenv_copy' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a `putenv()' implementation that stores a copy of the
+# key/value pair.
#erl_xcomp_putenv_copy=
-## `erl_xcomp_reliable_fpe` - `yes|no`. Defaults to `no`. If `yes`, the target
-## system must have reliable floating point exceptions.
+# * `erl_xcomp_reliable_fpe' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have reliable floating point exceptions.
#erl_xcomp_reliable_fpe=
-####
+## -----------------------------------------------------------------------------