forked from Mercury-Language/mercury
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.MinGW
120 lines (85 loc) · 4.97 KB
/
README.MinGW
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
-----------------------------------------------------------------------------
BUILDING WITH MINGW
It is possible to build the Mercury compiler using the MinGW version of GCC.
The advantage of using MinGW is that the generated executables will run
natively on Windows without the need for any support environments like Cygwin.
A Unix like environment is however still required to build the Mercury
compiler. MSYS or Cygwin can be used for this purpose.
-----------------------------------------------------------------------------
BUILDING A MINGW COMPILER UNDER MSYS
To build the source distribution under MSYS follow these steps:
1. Download and install MinGW and MSYS
(available from <http://www.mingw.org>).
The simplest installation method for MinGW and MSYS is to download and
run the MinGW GUI installer. In order to build and install Mercury you
will require at least the following components:
- MinGW Compiler Suite (C compiler)
- MSYS Basic System
- MinGW Developer Toolkit
Details of alternative MinGW and MSYS installation methods may be found
on the MinGW website.
To build the Erlang grade with MinGW and MSYS you will require the Windows
version of the Erlang/OTP distribution to be installed on your system.
The Erlang compiler (erlc) and runtime (erl) needs to be in the MSYS
PATH, for example do the following in the MSYS shell (with the version
number modified if necessary):
export PATH=/c/Program\ Files/erl5.8.2/bin/:$PATH
See README.Erlang for further details.
To build the java grade with MinGW and MSYS you will require the Windows
version of the JDK to be installed on your system.
The Java compiler (javac), Java archive tool (jar), and Java runtime (java)
needs to be in the MSYS PATH, for example do the following in the MSYS
shell (with the version number modified if necessary):
export PATH=/c/Program\ Files/Java/jdk1.6.0_23/bin/:$PATH
See README.Java for further details.
To build the C# grade with MinGW, MSYS and .NET, you will need Visual C#
compiler installed on your system.
The C# compiler (csc.exe) needs to be in the MSYS PATH, for example do the
following in the MSYS shell (with the version number modified if
necessary):
export PATH=/c/WINDOWS/Microsoft.NET/Framework/v4.0.30319/:$PATH
See README.CSharp for further details.
2. Unpack the source distribution with a command like:
tar -xvzf mercury-compiler-<VERSION>.tar.gz
3. cd into the new directory and run configure:
./configure --prefix=c:/mercury
It is important to specify the installation prefix as a full windows
path with a drive letter (except use `/' instead of `\').
Do not use a path like `/mercury', because that
will be interpreted differently by the MSYS shell than by the generated
executables, resulting in a broken installation.
If you get a dialog from the "Microsoft Management Console" with the
message "The selected file cannot be found." simply dismiss it.
This is because configure looks for a program called "mmc".
4. run: `make' and then `make install'.
Add /c/mercury/bin (or whatever path you installed Mercury to) to the MSYS
PATH (you cannot add `c:/mercury/bin' to the MSYS PATH because `:' is used to
separate directories in the MSYS PATH).
NOTE TO DEVELOPERS: the tools/bootcheck script does not work properly
on MSYS at the moment -- it will build stage 3, but will not run the tests
correctly. To run the tests you should first install the compiler and add
it to the PATH. Next set the DIFF_OPTS environment variable to "-c -b". This
will cause the test scripts to ignore the extra carriage return character that
gets added to the end of each line under MinGW. Then run mmake from the tests
directory.
-----------------------------------------------------------------------------
BUILDING A CYGWIN COMPILER WHICH TARGETS MINGW
NOTE: recent versions of Cygwin no longer support the -mno-cygwin option.
Unfortunately the Cygwin documentation is silent on the matter of how
exactly you are now supposed to invoke the MinGW compiler from Cygwin;
until it is updated we recommend using MinGW/MSYS to build a MinGW
targeted compiler rather than Cygwin.
To build a compiler which targets MinGW from Cygwin do the following:
- First, install the Cygwin version of Mercury, and put it in your PATH.
- Second, configure the source distribution of Mercury using
--with-cc="gcc -mno-cygwin".
- Third, run "make" and "make install".
- Fourth, replace the following files in the installed Mingw Mercury
directories with copies of the corresponding file from the installed
Cygwin Mercury directories:
mercury_compile.exe (in <prefix>/lib/mercury/bin/<config>)
mercury_profile.exe (in <prefix>/lib/mercury/bin/<config>)
mdemangle.exe (in <prefix>/bin)
mfiltercc.exe (in <prefix>/bin)
mkinit.exe (in <prefix>/bin)
-----------------------------------------------------------------------------