The R Project SVN R

Rev

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