The R Project SVN R

Rev

Rev 61660 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18687 ripley 1
Notes for Windows Maintainers
2
=============================
3
 
18786 ripley 4
1) fixed/h/config.h can be made automatically.  Some of this is
5
achieved by overrides in the configure script.
18687 ripley 6
 
23122 ripley 7
You will need a copy of sh.exe in /bin.  Then with the R sources in
48915 ripley 8
/R/R-2.10.0, I used in /TEMP/R (any other directory will do, except the
47862 ripley 9
sources).
18687 ripley 10
 
48915 ripley 11
To test trio set
42565 ripley 12
 
48915 ripley 13
LIBS='<RHOME>/src/extra/trio/libtrio.a'
42565 ripley 14
 
48915 ripley 15
sh /R/R-2.10.0/configure --build=i386-pc-mingw32 --with-readline=no --with-x=no
18687 ripley 16
 
36479 ripley 17
This ran fairly slowly, currently producing a src/include/config.h
18
that differs only in that
18687 ripley 19
 
36479 ripley 20
 - it does not find the declarations of siglongjmp/sigsetjmp (in
42628 ripley 21
   psignal.[ch])
19323 ripley 22
 
42451 ripley 23
 - MinGW gcc 4.2.1 supports pthreads, but I left that undefined.
38504 ripley 24
 
23122 ripley 25
Also, watch out for versions of the header files.  For example,
51157 ripley 26
<strings.h> was in mingw-runtime-1.2 and later, but not (long ago) in
27
the mingw-1.1 bundle.  These days we insist on a current MinGW.
18687 ripley 28
 
48915 ripley 29
BDR 2002-04-15, 2003-02-10, 2004-06-28, 2005-11-25, 2006-07-06, 2007-08-09, 
30
    2009-07-08
23357 murdoch 31
 
38504 ripley 32
 
23357 murdoch 33
2) The Makefiles for building a distribution have been reorganized.  Now
34
all of the decisions about what files go into the distributables are made
35
in installer/Makefile; the decisions about which component of the setup
36
program each file goes into are made in installer/JRins.pl.
37
 
27942 ripley 38
DJM 2003-02-25
39
 
38504 ripley 40
 
27942 ripley 41
3) Making Tcl/Tk.
42
 
70701 murdoch 43
See https://github.com/waddella/Tclbuild.
27942 ripley 44
 
45
 
37364 ripley 46
4) Linking to DLLs.
47
 
51157 ripley 48
MinGW's ld.exe takes the internal name of the DLL as the object to
37364 ripley 49
link to, and hence for DLLs which are to be linked to (rather than
37433 ripley 50
loaded), the internal names need to be dllname.dll.  This was not being
37364 ripley 51
done by the %.dll rule used in 2.2.1, which builds via a .def file
52
with first line
53
 
54
LIBRARY $*
55
 
37433 ripley 56
[The example in ld.info is
57
 
58
LIBRARY "xyz.dll"
59
 
60
whereas that in the MSDN documentation
61
(http://msdn2.microsoft.com/en-us/library/d91k01sh.aspx) is
62
 
63
LIBRARY BTREE
64
 
65
so MinGW is inconsistent with MSDN here.]
66
 
37364 ripley 67
It would seem that this should just be replaced by $*.dll, but there
68
is another problem: ld.exe rejects .def files whose LIBRARY name
69
contains more than one dot, and so this is unable to cope with
70
packages with a dot in their name.  (We already document that two or
37433 ripley 71
more dots are not allowed.)  So we have had to treat separately the
72
DLLs which are designed to be linked to.  These are
37364 ripley 73
 
74
R.dll : is special-cased, and as it wants to export entry points from
75
static libraries and exports variables, nothing else we tried worked.
76
 
77
Rblas.dll : has a .def file, and the name was changed to Rblas.dll
78
there.
79
 
80
Rlapack.dll : is simple, so gcc -shared with no .def file works.
81
 
82
Rproxy.dll : is special-cased.  (Linked against by rcom package.)
83
 
84
The other DLLs which were in R_HOME/bin, Rbitmap.dll and Rchtml.dll,
85
have been moved to R_HOME/modules.  They are now made directly with
86
gcc -shared.  Rchtml.dll needs an import library as you cannot link
87
directly to a .ocx.
88
 
37433 ripley 89
However, whereas MSDN says there must be a LIBRARY statement, it seems
37437 ripley 90
not to be required for ld.exe.  So the %.dll rule in MkRules as from
91
2.3.0 does not have a LIBRARY statement, which circumvents the 'at
92
most one dot' rule.
37433 ripley 93
 
94
BDR 2006-02-15, 2006-02-24
41065 ripley 95
 
96
 
42567 ripley 97
5) Rdll.hide
41065 ripley 98
 
42567 ripley 99
AllDevicesKilled
100
RConsole
101
RFrame
102
Rf_runcmd
103
RgetMDIheight
104
RgetMDIwidth
105
RguiMDI
106
Ri18n_wcwidth
107
Riconv
108
Riconv_close
109
Riconv_open
110
Rwin_graphicsx
111
Rwin_graphicsy
112
UserBreak
113
locale2charset
114
optclosefile
115
optfile
116
optline
117
optopenfile
118
optread
41065 ripley 119
 
42567 ripley 120
for grDevices
41065 ripley 121
 
122
 
42567 ripley 123
R_deferred_default_method
124
R_do_MAKE_CLASS
125
R_do_new_object
126
R_do_slot
127
R_do_slot_assign
128
R_execMethod
129
R_primitive_generic
130
R_primitive_methods
131
R_set_prim_method
132
R_set_quick_method_check
133
R_set_standardGeneric_ptr
134
R_subassign3_dflt
135
do_set_prim_method
41065 ripley 136
 
42567 ripley 137
for methods
138
 
139
 
48443 ripley 140
set_R_Tcldo
141
unset_R_Tcldo
61660 ripley 142
Rf_wtransChar
48443 ripley 143
 
144
for tcltk
145
 
61660 ripley 146
R_fixbackslash
147
consolefn
148
freeConsoleData
149
freemenuitems
150
lzma_crc64
151
orderVector1
152
wgl_histadd etc
48443 ripley 153
 
61660 ripley 154
for utils
155
 
156
 
42567 ripley 157
R_gl_tab_set
158
cmdlineoptions
159
getDLLVersion
160
gl_hist_init
161
gl_loadhistory
162
readconsolecfg
163
saveConsoleTitle
164
setupui
165
 
166
for rgui/rterm/Rscript
167
 
168
 
169
Rf_mbrtowc
170
Rf_strchr
171
localeCP
172
 
173
for graphapp.dll
174
 
42569 ripley 175
setup_term_ui
176
 
177
for package Rserve
178
 
179
optif9
180
 
181
for package nlme
182
 
183
 
42636 ripley 184
BDR 2007-08-20
43890 ripley 185
 
186
 
187
6) Conversion to Unicode/UTF-8.
188
 
189
[Notes are a work in progress.  This has been discussed since 2003.]
190
 
191
As from R 2.7.0, Rgui works internally in UCS-2.  Currently key strokes are
192
recorded as bytes, but that could easily be changed if we had testers with CJK
193
keyboards.  Input/output is converted to/from the current locale in
194
R_ReadConsole/R_WriteConsole.
195
 
196
The internal pager works in UCS-2.
197
 
198
History files are currently written in the locale's charset, for
199
compatibility with Rterm and past versions of R.  We could perhaps
200
alleviate this by using a BOM when writing in UCS-2, and detecting
201
that when loading history files.
202
 
203
Chris Jackson's script editor is still MBCS.  Quite a bit of work will
204
be needed to convert it, since e.g. GA_gettext() expects to work with
205
char *.
206
 
207
The only bar to converting Rterm to UCS-2 is the lack of CJK keyboards
208
to test on, but there would be little advantage in doing so.
209
 
210
6.1 Internal use of UTF-8
211
 
212
- Internal mbcs<->wchar/UCS translations would need to be modified to
213
  use UTF-8 and not the locale charset.  Several places
214
  (e.g. Riconv_open) already have support for this.  The
215
  gettext-runtime (src/extra/intl) does not.
216
 
217
*All* I/O would need to be translated.  This includes
218
 
219
- Rprintf and allies, error messaging.
220
 
44027 ripley 221
  [This one is really tricky: we don't want to be writing UTF-8 files
222
   when sink() is in use, for example, and rterm/some embedded uses
223
   run in environments that probably do not support UCS-2.
224
 
225
   The current compromise is to encode UTF-8 character vector elements
226
   in EncodeString, at least when called from printing and from cat(),
227
   and if outputting to the Rgui console. This is done by surrounding
228
   them by 3-byte escape sequences starting with STX/ETX.]
229
 
43890 ripley 230
- file names.  Since Windows NTFS can have file names not valid in the
231
  current locale, this needs to use wfopen and similar interfaces, as
232
  well as GetFullPathNameW ... also _w* versions of mkdir, rmdir,
233
  unlink, open, popen, stat, system.  Use with care, as not all file
44059 ripley 234
  systems use UCS-2 file names.  [Done]
43890 ripley 235
 
236
  This needs to include bzlib and zlib, as well as file/folder
44059 ripley 237
  selection widgets. [Done]
43890 ripley 238
 
239
- environment variables.  Both values and names, since _wputenv is
240
  needed to set name=value strings.  It would be better to use wmain
241
  and only ever use _wgetenv and _wputenv to avoid maintaining
44027 ripley 242
  parallel environments.  [Done]
43890 ripley 243
 
244
- graphics devices.  Calls to text() and points() (with pch as a
245
  string) need either to be translated or, preferably, the device
246
  adjusted to accept UTF-8 (and we would need a flag to know if it
247
  could).  Note that this impacts third-party devices.
44059 ripley 248
  [Done for windows() family, postscript, pdf.]
43890 ripley 249
 
44059 ripley 250
- GetUserName, GetComputerName, [GS]etCurrentDirectory. [Done]
43890 ripley 251
 
252
Also:
253
 
254
- There would be compatibility issues with saved workspaces, although
255
  few for those working in CP1252 locales.
256
 
257
- It is not clear what to do with strings passed to packages.  We
258
  could force conversion in .C and .Fortran, but most
259
  character-manipulation packages are likely to be using .Call.
260
 
261
BDR 2008-01-06
44470 murdoch 262
 
47863 ripley 263
 
44470 murdoch 264
7) Changing the parser
265
 
266
By default the parser in gram.y is only processed in maintainer mode, 
267
which isn't supported in Windows builds.  Defining RUN_BISON will 
268
cause src/main/Makefile.win to process it (and correct for the erroneous
269
line number records caused by our renaming of the output).
47863 ripley 270
 
271
 
272
8) Making iconv.dll
273
 
274
In the past this was done from the libiconv sources using VC++ 6, but
275
as from version 1.12 that is no longer supported.  It does not build
276
easily with MinGW (due to the overuse of libtool), but we used
277
 
47942 ripley 278
setenv INSTALL cp
47863 ripley 279
setenv INSTALL_DATA cp
280
sh configure --build=i386-pc-mingw32 --disable-nls
281
cd libcharset; make
282
cp include/localcharset.h ../lib
283
cd ../lib
284
make
47869 ripley 285
gcc -shared  .libs/iconv.o .libs/localcharset.o .libs/relocatable.o \
47926 ripley 286
  .libs/iconv-exports.o -export-all-symbols -o Riconv.dll
47863 ripley 287
 
47869 ripley 288
We now use a modified version of win-iconv, but the libiconv version
51157 ripley 289
can still be used by replacing bin/Riconv.dll.
47863 ripley 290
 
47869 ripley 291
 
292
BDR 2009-02-08