Rev 44421 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
Notes for Windows Maintainers=============================1) fixed/h/config.h can be made automatically. Some of this isachieved 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 thesources). For MinGW 4.2.1 you will need to setCC=gcc-sjljF77=gfortran-sjljCXX=g++-sjljin the environment (or copy the executables to gcc.exe, gfortran.exeand g++.exe).To test trio and iconv, setLIBS='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=noThis ran fairly slowly, currently producing a src/include/config.hthat differs only in that- it does not find the declarations of siglongjmp/sigsetjmp (inpsignal.[ch])- 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 theMingw-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-092) The Makefiles for building a distribution have been reorganized. Nowall of the decisions about what files go into the distributables are madein installer/Makefile; the decisions about which component of the setupprogram each file goes into are made in installer/JRins.pl.DJM 2003-02-253) 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 tolink to, and hence for DLLs which are to be linked to (rather thanloaded), the internal names need to be dllname.dll. This was not beingdone by the %.dll rule used in 2.2.1, which builds via a .def filewith first lineLIBRARY $*[The example in ld.info isLIBRARY "xyz.dll"whereas that in the MSDN documentation(http://msdn2.microsoft.com/en-us/library/d91k01sh.aspx) isLIBRARY BTREEso MinGW is inconsistent with MSDN here.]It would seem that this should just be replaced by $*.dll, but thereis another problem: ld.exe rejects .def files whose LIBRARY namecontains more than one dot, and so this is unable to cope withpackages with a dot in their name. (We already document that two ormore dots are not allowed.) So we have had to treat separately theDLLs which are designed to be linked to. These areR.dll : is special-cased, and as it wants to export entry points fromstatic libraries and exports variables, nothing else we tried worked.Rblas.dll : has a .def file, and the name was changed to Rblas.dllthere.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 withgcc -shared. Rchtml.dll needs an import library as you cannot linkdirectly to a .ocx.However, whereas MSDN says there must be a LIBRARY statement, it seemsnot to be required for ld.exe. So the %.dll rule in MkRules as from2.3.0 does not have a LIBRARY statement, which circumvents the 'atmost one dot' rule.BDR 2006-02-15, 2006-02-245) Rdll.hideAllDevicesKilledRConsoleRFrameRf_runcmdRgetMDIheightRgetMDIwidthRguiMDIRi18n_wcwidthRiconvRiconv_closeRiconv_openRwin_graphicsxRwin_graphicsyUserBreaklocale2charsetoptclosefileoptfileoptlineoptopenfileoptreadfor grDevicesR_deferred_default_methodR_do_MAKE_CLASSR_do_new_objectR_do_slotR_do_slot_assignR_execMethodR_primitive_genericR_primitive_methodsR_set_prim_methodR_set_quick_method_checkR_set_standardGeneric_ptrR_subassign3_dfltdo_set_prim_methodfor methodsR_gl_tab_setcmdlineoptionsgetDLLVersiongl_hist_initgl_loadhistoryreadconsolecfgsaveConsoleTitlesetupuifor rgui/rterm/Rscriptcrc32deflatedeflateEnddeflateInit2_deflateResetinflateResetfor Rbitmap.dllRf_mbrtowcRf_strchrlocaleCPfor graphapp.dllR_cumsumfor package DClusterfft_factorfft_workfor package RandomFieldssetup_term_uifor package RserveBrent_fminR_tabulateR_zeroinfor package apefindIntervalfor package ecochol_optif9rs_for package nlmebalanc_balbak_elmhes_eltran_hqr2_for package panelBDR 2007-08-206) Conversion to Unicode/UTF-8.[Notes are a work in progress. This has been discussed since 2003.]As from R 2.7.0, Rgui works internally in UCS-2. Currently key strokes arerecorded as bytes, but that could easily be changed if we had testers with CJKkeyboards. Input/output is converted to/from the current locale inR_ReadConsole/R_WriteConsole.The internal pager works in UCS-2.History files are currently written in the locale's charset, forcompatibility with Rterm and past versions of R. We could perhapsalleviate this by using a BOM when writing in UCS-2, and detectingthat when loading history files.Chris Jackson's script editor is still MBCS. Quite a bit of work willbe needed to convert it, since e.g. GA_gettext() expects to work withchar *.The only bar to converting Rterm to UCS-2 is the lack of CJK keyboardsto test on, but there would be little advantage in doing so.6.1 Internal use of UTF-8- Internal mbcs<->wchar/UCS translations would need to be modified touse UTF-8 and not the locale charset. Several places(e.g. Riconv_open) already have support for this. Thegettext-runtime (src/extra/intl) does not.*All* I/O would need to be translated. This includes- Rprintf and allies, error messaging.[This one is really tricky: we don't want to be writing UTF-8 fileswhen sink() is in use, for example, and rterm/some embedded usesrun in environments that probably do not support UCS-2.The current compromise is to encode UTF-8 character vector elementsin EncodeString, at least when called from printing and from cat(),and if outputting to the Rgui console. This is done by surroundingthem by 3-byte escape sequences starting with STX/ETX.]- file names. Since Windows NTFS can have file names not valid in thecurrent locale, this needs to use wfopen and similar interfaces, aswell as GetFullPathNameW ... also _w* versions of mkdir, rmdir,unlink, open, popen, stat, system. Use with care, as not all filesystems use UCS-2 file names. [Done]This needs to include bzlib and zlib, as well as file/folderselection widgets. [Done]- environment variables. Both values and names, since _wputenv isneeded to set name=value strings. It would be better to use wmainand only ever use _wgetenv and _wputenv to avoid maintainingparallel environments. [Done]- graphics devices. Calls to text() and points() (with pch as astring) need either to be translated or, preferably, the deviceadjusted to accept UTF-8 (and we would need a flag to know if itcould). Note that this impacts third-party devices.[Done for windows() family, postscript, pdf.]- GetUserName, GetComputerName, [GS]etCurrentDirectory. [Done]Also:- There would be compatibility issues with saved workspaces, althoughfew for those working in CP1252 locales.- It is not clear what to do with strings passed to packages. Wecould force conversion in .C and .Fortran, but mostcharacter-manipulation packages are likely to be using .Call.BDR 2008-01-067) Changing the parserBy default the parser in gram.y is only processed in maintainer mode,which isn't supported in Windows builds. Defining RUN_BISON willcause src/main/Makefile.win to process it (and correct for the erroneousline number records caused by our renaming of the output).