Permalink
Fetching contributors…
Cannot retrieve contributors at this time
202 lines (134 sloc) 4.74 KB
BUILDING WINGS 3D ON WINDOWS
============================
This guide describes how you can build Wings 3D from the
sources on a Windows system.
Required software
=================
Wings can be built on Windows using only free/open-source software.
The following software is needed:
- The Wings source. http://www.wings3d.com
- MinGW, http://www.mingw.org, including MSYS, http://www.mingw.org/wiki/msys,
to compile the source code.
- Erlang/Opt R14B01 or later. http://www.erlang.org
Include the vcredist packaged with Erlang, in your installation.
(It is easiest to download the pre-built binaries for Windows.)
- ESDL 1.0.1 or later. http://esdl.sf.net
It is easiest to download the pre-built binary.
Optional software
=================
- libjpeg for build the jpeg plug-in.
http://www.ijg.org
- res2coff. Can be found in the mingw-utils package
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=61599
- NSIS 2.02 or higher, an installer/uninstaller maker.
http://nsis.sf.net.
Installing the software
=======================
In general, you should follow the instructions for each package.
Setting up the environment
==========================
A few environment variables need to be set. They can be set
for Windows globally from "My Computer".
ESDL_PATH needs to be set to the path of the directory where you installed ESDL.
WINGS_VCREDIST needs to be set to point at vcredist.exe in your Erlang
installation. (c:\erl5.8.1.1\vcredist_x86.exe)
Modify the PATH environment variable so that the following programs
are runnable from an Msys (bash) shell.
erlc.exe (Erlang/OTP)
mingw32-gcc (MinGW)
makensis.exe (NSIS)
An easy way to check that the programs are runnable is to use the
"which" command in a shell like this:
$ which make
/usr/bin/make
$
Unpacking the Wings source code
===============================
Give the "j" flag to the "tar" program to tell it to decompress using
the "bunzip2" program.
Example:
$ tar jxf wings-1.3.1.tar.bz2
The build steps that follow assume that you are in the wings source
directory.
Example:
$ cd wings-1.3.1.tar.bz2
Basic build
===========
To build a minimal Wings that can be used for development purposes,
all you need is to run make from inside the directory where the
sources where unpacked.
Example:
$ pwd
c:/wings-1.3.1
$ make
.
.
.
<A lot of output follows>
.
.
.
$
Running Wings
============
To run the Wings you have just build, you'll need to write a command line
similar to this:
werl -smp disable -pa $ESDL_PATH/ebin -pa <MY_WINGS_PATH>/ebin -run wings_start start_halt -extra <MY_APP_DATA_DIRECTORY>
where you should substitute <MY_WINGS_PATH> with the path to the Wings
source directory and <MY_APP_DATA_DIRECTORY> with the path to the
local settings folder.
Example:
$ werl -smp disable -pa $ESDL_PATH/ebin -pa c:/cygwin/home/bjorng/wings-1.0/ebin -run wings_start start_halt -extra "c:/Documents and Settings/bjorng/Application Data"
$
An Erlang console should appear, followed by the Wings window.
It should work OK except that there will be no file dialog boxes
if you try File|Open or File|Save. (See the next section on how
to remedy that.)
Instead of writing the command line every time you want to start Wings,
you can package it in a script like this:
#!/bin/bash
exec werl -smp disable -pa $ESDL_PATH/ebin -pa c:/cygwin/home/bjorng/wings-1.0/ebin -run wings_start start_halt ${1+"$@"}
Notes:
[1] "exec" kills the shell process running the script, saving a
tiny amount of system memory.
[2] The "${1+"$@"}" thing passes along any arguments (or none) to Wings,
allowing Wings to open up a wings file when it starts.
[3] The "-smp disable" flag is necessary in R12B if you have a multi-core/
multi-CPU computer. Wings will only work with the single-thread Erlang
emulator.
You could also package the command line into a standard windows shortcut.
Building the file dialog plug-in
================================
To get native Windows file dialog boxes, you'll need to compile
the file dialog plug-in the "plugins_src/win32_file" directory.
$ cd plugins_src/win32_file
$ make
<Some output>
$
Building all
============
Make sure that your current directory is the directory in which the
sources were unpacked.
Example:
$ pwd
c:/wings-1.3.1
$
To build all (including the installer), run the following command:
$ make win32
.
.
.
<A lot of output follows>
.
.
.
$
When everything is done, there should be a file named like
wings-1.3.1.exe
in the current directory.
------------
NOTE:
msysgit, http://code.google.com/p/msysgit/, is needed if you want the proper
version number to be output with your build. Wings uses Git for version
control, and <git describe> is used to generate the version number.
Git is also good if you want to contribute code ;)