1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
|
Installation notes to build Unison on Windows systems, with Cygwin GNU C
(unison-help@cis.upenn.edu)
[The following instructions were tested for Unison 2.32.52 on a Windows
XP machine running OCaml 3.08.]
Since OCaml is now included in Cygwin, things have gotten pretty
simple (at least for the text user interface).
- Download and run the cygwin installer
- make sure to select the make (from Devel)
and ocaml (from Interpreters) packages; you may also
want the subversion package, if you intend to check out
the latest unison sources from the live subversion
repository.
- Download the desired version of the Unison source tarball
from the Unison home page and unpack it, or else grab the sources
using svn. Make sure the directory path name has no space in it or
the OCaml compiler will get confused later.
- In the main directory, type "make".
- If a text-only version is desired, build with "make UISTYLE=text"
regardless of whether the graphics libraries are installed or not.
- The result should be an executable file called "unison" (or, if
you grabbed the whole svn repository, perhaps "src/unison"). Put this
somewhere on your search path and you should be good to go. (You'll
need to do something about setting up ssh, etc., but that's beyond the
scope of this document.)
- The text-only version can be run on any system that has cygwin installed:
$ cygcheck ./unison.exe
C:\cygwin\tmp\unison-2.32.52\unison.exe
C:\cygwin\bin\cygwin1.dll
C:\WINDOWS\system32\ADVAPI32.DLL
C:\WINDOWS\system32\KERNEL32.dll
C:\WINDOWS\system32\ntdll.dll
C:\WINDOWS\system32\RPCRT4.dll
C:\WINDOWS\system32\Secur32.dll
- For this to build with a graphical user interface under Cygwin you
need obviously X windows installed, together with some other
not-so-common packages (from Gnome, versions 2.0 as of the time of
this writing):
libgtk2.0-devel: Multi-platform GUI toolkit (development)
liblgtk2: OCaml interface to GTK2
Installing these packages with the Cygwin setup program will force the
installation of a large slew of other gnome and graphics packages.
- Then build Unison with "make UISTYLE=gtk2", or just "make"
since by default "make" builds with a graphics interface if the
necessary graphics libraries are installed.
- The graphics version needs many more libraries to run and hence is a
lot less portable:
$ cygcheck ./unison.exe
C:\cygwin\tmp\unison-2.32.52\unison.exe
C:\cygwin\bin\cygwin1.dll
C:\WINDOWS\system32\ADVAPI32.DLL
C:\WINDOWS\system32\KERNEL32.dll
C:\WINDOWS\system32\ntdll.dll
C:\WINDOWS\system32\RPCRT4.dll
C:\WINDOWS\system32\Secur32.dll
C:\cygwin\bin\cyggdk-x11-2.0-0.dll
C:\cygwin\bin\cyggdk_pixbuf-2.0-0.dll
C:\cygwin\bin\cyggcc_s-1.dll
C:\cygwin\bin\cyggio-2.0-0.dll
C:\cygwin\bin\cygglib-2.0-0.dll
C:\cygwin\bin\cygiconv-2.dll
C:\cygwin\bin\cygintl-8.dll
C:\cygwin\bin\cygpcre-0.dll
C:\cygwin\bin\cyggmodule-2.0-0.dll
C:\cygwin\bin\cyggobject-2.0-0.dll
C:\cygwin\bin\cygX11-6.dll
C:\cygwin\bin\cygxcb-1.dll
C:\cygwin\bin\cygXau-6.dll
C:\cygwin\bin\cygXdmcp-6.dll
C:\cygwin\bin\cygXcomposite-1.dll
C:\cygwin\bin\cygXcursor-1.dll
C:\cygwin\bin\cygXfixes-3.dll
C:\cygwin\bin\cygXrender-1.dll
C:\cygwin\bin\cygXdamage-1.dll
C:\cygwin\bin\cygXext-6.dll
C:\cygwin\bin\cygXi-6.dll
C:\cygwin\bin\cygXinerama-1.dll
C:\cygwin\bin\cygXrandr-2.dll
C:\cygwin\bin\cygcairo-2.dll
C:\cygwin\bin\cygfontconfig-1.dll
C:\cygwin\bin\cygexpat-1.dll
C:\cygwin\bin\cygfreetype-6.dll
C:\cygwin\bin\cygz.dll
C:\cygwin\bin\cygglitz-1.dll
C:\cygwin\bin\cygpixman-1-0.dll
C:\cygwin\bin\cygpng12.dll
C:\cygwin\bin\cygxcb-render-util-0.dll
C:\cygwin\bin\cygxcb-render-0.dll
C:\cygwin\bin\cygpango-1.0-0.dll
C:\cygwin\bin\cygpangocairo-1.0-0.dll
C:\cygwin\bin\cygpangoft2-1.0-0.dll
C:\cygwin\bin\cyggtk-x11-2.0-0.dll
C:\cygwin\bin\cygatk-1.0-0.dll
-------------------------------------------------------------------------
AN OLDER VERSION:
[The following instructions were tested for Unison 2.9.1 on a Windows
2000 machine running OCaml 3.04.]
Contents
1.Setting up the Windows system
1.1 General requirements
1.2 A Unix-like layer: CygWin and GNU C compiler
1.3 The OCaml compiler
2.Compiling Unison
2.1 Text user interface
2.2 Gtk user interface
Section 1 - Setting up the Windows system
1.1 General requirements
We will assume your are logged in as a regular user. We will mention cases
when you need to be granted administrator permissions.
We will work in your home directory.
For a complete installation from scratch, you will need about 300 Mb.
A Unix-like layer such as CygWin is needed to be able to use a few
GNU tools like 'bash', 'make', 'sed', 'patch', etc, and in particular
the GNU C compiler.
The CygWin port of OCaml distribution version 3.04 is required.
.2 A Unix-like layer: CygWin
Download CygWin from 'http://www.cygwin.com/':
* click "install cygwin now" and follow the instruction to set up cygwin.
install the essential packages such as "gcc", "make", "fileutil",
"openssh", etc.
set the root directory (e.g. 'd:\cygwin')
Setup 'bash':
* click on 'bash'.
* enter 'export HOME=/home/<username>', make the directory, then 'cd'.
* create a '.bashrc' in CygWin's root directory to suit your
needs (see Appendix B of file "INSTALL.win32-msvc" for an example).
* add 'export OSCOMP=cygwingnuc' to the '.bashrc' file. This variable
helps the unison Makefile (project file) to understand that we are
compiling under Windows platform using Cygwin GNU C.
Remember you can access the whole Windows filesystem with a Unix
path through '/cygdrive/<drive letter>/<path>' (e.g. '/cygdrive/c/winnt'
stands for 'C:\WinNT')
1.3 The OCaml compiler (CygWin port)
NB: Unison doesn't use Tcl/Tk support. If you wish to use Tcl/Tk
for your other Ocaml applications, download it separately before
proceeding.
Download the OCaml 3.04 source tarball from
'http://caml.inria.fr/ocaml/distrib.html'. Unpack it into a
directory (using, e.g., winzip, or "tar xzvf ocaml-3.04.tar.gz"
Enter the ocaml directory, and type:
$ ./configure
# or "./configure -prefix <install-prefix>".
# For other options, see INSTALL
$ make world
$ make opt
$ make install
To check your installation, use 'bash' and enter 'ocamlc -v'
If something goes wrong :
* your path must contain the OCaml 'bin' directory; you may have to enter
something like 'export PATH=$PATH:/usr/local/ocaml/bin'.
* 'ocamlc -v' must report the OCaml 'lib' directory; you may have to enter
something like 'export CAMLLIB=/usr/local/ocaml/lib/ocaml/'
Section 2 - Compiling Unison
2.1 Text user interface
Unpack the Unison sources.
Using 'bash', enter 'make clean', then 'make UISTYLE=text' to compile.
If something goes wrong :
* if 'make' reports 'missing separator', be sure the makefiles are in
Unix text format (see Appendix A).
* if .depend is not provided, create one using
'ocamldep *.mli *.ml > .depend'; you will have to convert this file
to Unix text format (see Appendix A).
* the minor 'etags' error is reported when 'emacs' is missing; you may
want to install it.
2.2 Gtk user interface
2.2.1 Install LablGtk 1.2.3 (cygwin port)
Download the patched LablGtk 1.2.3 (bundled with the Gtk libraries):
get the 'lablgtk-1.2.3-cygwin.tar.gz' tar ball from the 'resources'
directory of the Unison web site and unpack it. This will create a
'lablgtk-1.2.3-cygwin' directory. Enter the directory
'lablgtk-1.2.3-cygwin/lablgtk', and type:
$ make
$ make opt
$ make install
Finally, add the result of running
echo `ocamlc -where`/lablgtk/dlls
to the environment variable PATH.*
* Under Windows menu: Start -> Settings -> Control Panel -> System ->
Advanced -> Environment Variables.
OPTIONAL: At this stage, you can test the installation of lablgtk by
$ cd lablgtk-1.2.3-cygwin/lablgtk-1.2.3/examples
$ lablgtk <a program>.ml
2.2.2 Compiling Unison
To compile the gtk version of Unison, enter the Unison sources
directory, enter "make clean" and then "make UISTYLE=gtk".
The resulting executable is dynamically linked against the CygWin
runtime and the Gtk DLLs. If you would like to distribute this
executable, you should provide the following DLLs (found in /bin under
the cygwin root directory and the lablgtk/dlls directory obtained at
the end of the lablgtk installation (Section 2.2.1), and ask the users
to include them in the PATH.
cygwin1.dll, gdk-1.3.dll, glib-1.3.dll, gtk-1.3.dll
* The way to find out which DLL are used under windows:
objdump -p <executable name> | grep "DLL Name"
|