Permalink
Browse files

Fix unix installer scripts and update instructions

  • Loading branch information...
1 parent 72540c0 commit da22e9e1402c09691ba863b654cb492b89c4e3af @dgud dgud committed Mar 22, 2011
Showing with 70 additions and 20 deletions.
  1. +20 −9 BUILD.unix
  2. +10 −7 BUILD.win32
  3. +1 −1 src/wings_wm.erl
  4. +1 −1 unix/install_wings.src
  5. +38 −2 unix/make_installer
View
@@ -17,12 +17,14 @@ run all plug-ins and to build an installation package.
- The Wings source files. http://www.wings3d.com
-- Erlang/OTP R14B01 or later. http://www.erlang.org
+- Erlang/OTP R14B01 (R14B02 for MacOSX) or later. http://www.erlang.org
- SDL development library. http://www.libsdl.org.
(There are pre-built libraries for most platforms.)
-- ESDL 1.0.1 or later. http://esdl.sf.net
+- ESDL 1.2 or later. http://esdl.sf.net
+
+- CL 1.1 or later. http://github.com/tonyrog/cl
- A GNU compatible "make" program. Included with most unix-like
systems; otherwise get it from http://www.gnu.org.
@@ -42,7 +44,8 @@ The following is a quick summary of the build process.
* Download and install SDL.
* Install OpenGL header files (if needed).
* Download and install ESDL.
-* Download and upnpack the Wings source file.
+* Download and build cl.
+* Download and unpack the Wings source file.
* Run "make".
Installing Erlang/OTP
@@ -112,7 +115,15 @@ sdl-config --libs
Compile by running "make" from the source directory of ESDL.
Set the environment variable ESDL_PATH to point to top of the
-compiled ESDL installation.
+compiled ESDL installation, or point the ERL_LIBS environment variable
+to the library below.
+
+Installing CL
+===============
+
+Download cl and unpack it to $ERL_LIBS.
+
+Compile by running "make" from the source directory of cl.
Unpacking the Wings source code
===============================
@@ -157,21 +168,21 @@ $
To run the Wings you have just build, you'll need to write a command line
similar to this:
- erl -smp disable -pa $ESDL_PATH/ebin -pa <MY_WINGS_PATH>/ebin -run wings_start start_halt
+ erl -smp -pa $ESDL_PATH/ebin -pa <MY_WINGS_PATH>/ebin -run wings_start start_halt
where you should substitute <MY_WINGS_PATH> with the path to the Wings
source directory.
Example:
-$ erl -smp disable -pa $ESDL_PATH/ebin -pa /home/bjorng/wings-1.0/ebin -run wings_start start_halt
+$ erl -smp -pa $ESDL_PATH/ebin -pa /home/bjorng/wings-1.0/ebin -run wings_start start_halt
$
Instead of writing the command line every time you want to start Wings,
you can package it in a script like this:
#!/bin/sh
-exec erl -smp disable -pa $ESDL_PATH/ebin -pa /home/bjorng/wings-1.0/ebin -run wings_start start_halt ${1+"$@"}
+exec erl -smp -pa $ESDL_PATH/ebin -pa /home/bjorng/wings-1.0/ebin -run wings_start start_halt ${1+"$@"}
Notes:
@@ -181,8 +192,8 @@ Notes:
[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 if you have a multi-core/multi-CPU
- computer. Wings will only work with the single-threaded Erlang emulator.
+[3] The "-smp " flag is necessary if you don't have a multi-core/multi-CPU
+ computer and wants to use OpenCL functionality.
Building an installation package for MacOS X
View
@@ -20,10 +20,10 @@ The following software is needed:
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
+- ESDL 1.2 or later. http://esdl.sf.net
It is easiest to download the pre-built binary.
-
+- CL 1.1 or later. http://github.com/tonyrog/cl
Optional software
=================
@@ -50,6 +50,10 @@ 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.
+ERL_LIBS needs to be set to the directory below ESDL and CL, i.e.
+$ERL_LIBS\esdl-1.2\ebin and $ERL_LIBS\cl-1.1\ebin
+or if you got the src from github:
+$ERL_LIBS\esdl\ebin and $ERL_LIBS\cl\ebin
WINGS_VCREDIST needs to be set to point at vcredist.exe in your Erlang
installation. (c:\erl5.8.1.1\vcredist_x86.exe)
@@ -122,7 +126,7 @@ 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"
+$ werl -smp -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.
@@ -134,7 +138,7 @@ 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+"$@"}
+exec werl -smp -pa $ESDL_PATH/ebin -pa c:/cygwin/home/bjorng/wings-1.0/ebin -run wings_start start_halt ${1+"$@"}
Notes:
@@ -144,9 +148,8 @@ Notes:
[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.
+[3] The "-smp" flag is necessary if you don't have a multi-core/
+ multi-CPU computer and wants to use OpenCL.
You could also package the command line into a standard windows shortcut.
View
@@ -106,7 +106,7 @@ init() ->
init_opengl(),
case wings_pref:get_value(win32_start_maximized) of
true -> wings_io:maximize();
- false -> ignore
+ _ -> ignore
end,
dirty_mode(back),
View
@@ -25,7 +25,7 @@ export LD_LIBRARY_PATH
export LD_PRELOAD
LD_LIBRARY_PATH=$ESDL_DIR/priv
LD_PRELOAD=$ESDL_DIR/priv/%LIB_SDL_NAME%
-exec $BINDIR/erlexec -noinput -smp disable -run wings_start start_halt ${1+"$@"}
+exec $BINDIR/erlexec -noinput -smp -run wings_start start_halt ${1+"$@"}
EOF
chmod +x $INSTALL_DIR/wings
View
@@ -13,14 +13,24 @@ if [ -z "$ESDL_PATH" ]; then
fi
ESDL_NAME=`basename $ESDL_PATH`
-ERLANG_PATH=`echo 'io:format("~s~n",[code:root_dir()]),halt().' | erl | awk 'NR==2 {print $2}'`
+if [ X$ESDL_NAME == Xesdl ]; then
+ echo $ESDL_NAME without version
+ source $ESDL_PATH/vsn.mk
+ ESDL_NAME=$ESDL_VSN
+ echo Install esdl to $ESDL_NAME
+fi
+
+ERLANG_PATH=`erl -noshell -eval "io:format([126,115,126,110],[code:root_dir()])" -s erlang halt`
# End of configurable stuff.
# Copy the Wings application.
WINGS_DIR="`pwd`"
WINGS_APP=`basename "$WINGS_DIR"`
WINGS_VSN=`echo "$WINGS_APP" | sed -e 's/.*wings-//'`
+if [ X$WINGS_VSN == Xwings ]; then
+ WINGS_VSN=`sed -n "/WINGS_VSN/s/^WINGS_VSN[^0-9]*//p" vsn.mk`
+fi
OS_NAME=`uname -s | perl -pe 'tr/[A-Z]/[a-z]/'`
DEST_ROOT="wings-$WINGS_VSN-$OS_NAME"
@@ -74,7 +84,7 @@ $INSTALL -c -m 644 "$src"/lib/stdlib-*/ebin/* "$dest/lib/$stdlib/ebin"
$INSTALL -c -m 644 "$src"/lib/xmerl-*/ebin/* "$dest/lib/$xmerl/ebin"
$INSTALL -c "$erts_src/bin/erlexec" "$dest/bin/erlexec"
-$INSTALL -c "$erts_src/bin/beam" "$dest/bin/beam"
+$INSTALL -c "$erts_src/bin/beam.smp" "$dest/bin/beam.smp"
$INSTALL -c "$erts_src/bin/child_setup" "$dest/bin/child_setup"
$INSTALL -c "$erts_src/bin/inet_gethost" "$dest/bin/inet_gethost"
strip --strip-debug "$dest/bin/erlexec"
@@ -105,6 +115,32 @@ else
(cd $dest/priv; ln -s $linkname $sdl_lib_name)
fi
+# Copy the relevant parts of wx (we use opengl from it)
+WX_PATH=`erl -noshell -eval "io:format([126,115,126,110],[code:lib_dir(wx)])" -s erlang halt`
+WX_NAME=`basename $WX_PATH`
+dest="$DEST_ROOT/lib/$WX_NAME"
+$INSTALL -d "$dest/ebin" "$dest/priv"
+$INSTALL -c -m 644 "$WX_PATH"/ebin/gl.beam "$dest/ebin"
+$INSTALL -c -m 644 "$WX_PATH"/ebin/glu.beam "$dest/ebin"
+$INSTALL -c -m 644 "$WX_PATH"/priv/erl_gl.so "$dest/priv"
+strip --strip-debug --strip-unneeded "$dest/priv/erl_gl.so"
+
+# OpenCL
+CL_PATH=`erl -noshell -eval "io:format([126,115,126,110],[code:lib_dir(cl)])" -s erlang halt`
+CL_NAME=`basename $CL_PATH`
+if [ X$CL_NAME == Xcl ]; then
+ echo $CL_NAME without version
+ CL_VSN=`sed -n "/CL_VSN/s/^CL_VSN[^0-9]*//p" $CL_PATH/vsn.mk`
+ CL_NAME="cl-$CL_VSN"
+ echo Install cl to $CL_NAME
+fi
+dest="$DEST_ROOT/lib/$CL_NAME"
+$INSTALL -d "$dest/ebin" "$dest/lib/release/32"
+$INSTALL -c -m 644 "$CL_PATH"/ebin/cl.beam "$dest/ebin"
+$INSTALL -c -m 644 "$CL_PATH"/ebin/clu.beam "$dest/ebin"
+$INSTALL -c -m 644 "$CL_PATH"/lib/release/32/cl_nif.so "$dest/lib/release/32"
+strip --strip-debug --strip-unneeded "$dest/lib/release/32/cl_nif.so"
+
#
# Remove files from OTP not needed.
#

0 comments on commit da22e9e

Please sign in to comment.