Notes for Windows Maintainers
=============================

1) fixed/h/config.h can be made automatically.  Some of this is
achieved by overrides in the configure script.

You will need a copy of sh.exe in /bin.  Then with the R sources in
/R/R-2.6.0, I used in /TEMP/R (any other directory will do, except the
sources).  For MinGW 4.2.1 you will need to set

CC=gcc-sjlj
F77=gfortran-sjlj
CXX=g++-sjlj

in the environment (or copy the executables to gcc.exe, gfortran.exe
and g++.exe).

To test trio and iconv, set

LIBS='RHOME/src/extra/trio/libtrio.a -LRHOME/src/gnuwin32/unicode'

and put fixed/h/iconv.h in your C_INCLUDE_PATH.

sh /R/R-2.6.0/configure --build=i386-pc-mingw32 --with-readline=no --with-x=no

This ran fairly slowly, currently producing a src/include/config.h
that differs only in that

 - it does not find the declarations of siglongjmp/sigsetjmp (in
   psignal.[ch])

 - SUPPORT_UTF8 is defined, but that is not true on Windows.

 - MinGW gcc 4.2.1 supports pthreads, but I left that undefined.

Also, watch out for versions of the header files.  For example,
<strings.h> was in mingw-runtime-1.2 and later, but not in the
Mingw-1.1 bundle.  These days we insist on a current MinGW.

BDR 2002-04-15, 2003-02-10, 2004-06-28, 2005-11-25, 2006-07-06, 2007-08-09


2) The Makefiles for building a distribution have been reorganized.  Now
all of the decisions about what files go into the distributables are made
in installer/Makefile; the decisions about which component of the setup
program each file goes into are made in installer/JRins.pl.

DJM 2003-02-25


3) Making Tcl/Tk.

See the directory R-Tcl-win in the R-packages SVN repository.


4) Linking to DLLs.

Mingw's ld.exe takes the internal name of the DLL as the object to
link to, and hence for DLLs which are to be linked to (rather than
loaded), the internal names need to be dllname.dll.  This was not being
done by the %.dll rule used in 2.2.1, which builds via a .def file
with first line

LIBRARY $*

[The example in ld.info is

LIBRARY "xyz.dll"

whereas that in the MSDN documentation
(http://msdn2.microsoft.com/en-us/library/d91k01sh.aspx) is

LIBRARY BTREE

so MinGW is inconsistent with MSDN here.]

It would seem that this should just be replaced by $*.dll, but there
is another problem: ld.exe rejects .def files whose LIBRARY name
contains more than one dot, and so this is unable to cope with
packages with a dot in their name.  (We already document that two or
more dots are not allowed.)  So we have had to treat separately the
DLLs which are designed to be linked to.  These are

R.dll : is special-cased, and as it wants to export entry points from
static libraries and exports variables, nothing else we tried worked.

Rblas.dll : has a .def file, and the name was changed to Rblas.dll
there.

Rlapack.dll : is simple, so gcc -shared with no .def file works.

Rproxy.dll : is special-cased.  (Linked against by rcom package.)

The other DLLs which were in R_HOME/bin, Rbitmap.dll and Rchtml.dll,
have been moved to R_HOME/modules.  They are now made directly with
gcc -shared.  Rchtml.dll needs an import library as you cannot link
directly to a .ocx.

However, whereas MSDN says there must be a LIBRARY statement, it seems
not to be required for ld.exe.  So the %.dll rule in MkRules as from
2.3.0 does not have a LIBRARY statement, which circumvents the 'at
most one dot' rule.

BDR 2006-02-15, 2006-02-24


5) Rdll.hide

AllDevicesKilled
RConsole
RFrame
Rf_runcmd
RgetMDIheight
RgetMDIwidth
RguiMDI
Ri18n_wcwidth
Riconv
Riconv_close
Riconv_open
Rwin_graphicsx
Rwin_graphicsy
UserBreak
locale2charset
optclosefile
optfile
optline
optopenfile
optread

for grDevices


R_deferred_default_method
R_do_MAKE_CLASS
R_do_new_object
R_do_slot
R_do_slot_assign
R_execMethod
R_primitive_generic
R_primitive_methods
R_set_prim_method
R_set_quick_method_check
R_set_standardGeneric_ptr
R_subassign3_dflt
do_set_prim_method

for methods


R_gl_tab_set
cmdlineoptions
getDLLVersion
gl_hist_init
gl_loadhistory
readconsolecfg
saveConsoleTitle
setupui

for rgui/rterm/Rscript


crc32
deflate
deflateEnd
deflateInit2_
deflateReset
inflateReset

for Rbitmap.dll


Rf_mbrtowc
Rf_strchr
localeCP

for graphapp.dll


R_cumsum

for package DCluster

deflate
deflateEnd
deflateInit_
inflate
inflateEnd
inflateInit_

for package GRASS

fft_factor
fft_work

for package RandomFields

setup_term_ui

for package Rserve

Brent_fmin
R_tabulate
R_zeroin

for package ape

findInterval

for package eco

chol_
optif9
rs_

for package nlme

balanc_
balbak_
elmhes_
eltran_
hqr2_

for package panel


BDR 2007-08-20