diff --git a/doc/manual/R-admin.texi b/doc/manual/R-admin.texi index 522453b4bbe..d748e170bc9 100644 --- a/doc/manual/R-admin.texi +++ b/doc/manual/R-admin.texi @@ -991,10 +991,10 @@ You need @code{libpng} and @code{jpeg} sources (available, e.g., from Working in the directory @file{@var{R_HOME}/src/gnuwin32/bitmap}, install the @code{libpng} and @code{jpeg} sources in sub-directories. The @code{jpeg} sub-directory for version 7 is named @file{jpeg-7}; if -you use a different version (e.g.@: @file{jpeg-6b}), edit -@file{src/gnuwin32/MkRules} and change the definition of @code{JPEGDIR}: -the names of the @file{libpng} and @file{libtiff} directories can also -be set there. +you use a different version (e.g.@: @file{jpeg-6b} or @file{jpeg-8}), +edit @file{src/gnuwin32/MkRules} and change the definition of +@code{JPEGDIR}: the names of the @file{libpng} and @file{libtiff} +directories can also be set there. Example: diff --git a/src/gnuwin32/MkRules b/src/gnuwin32/MkRules index 3f921ca2ebe..63b09d46c6a 100644 --- a/src/gnuwin32/MkRules +++ b/src/gnuwin32/MkRules @@ -1,6 +1,6 @@ #-*- Makefile -*- ## This file contains tabs: make sure your editor leaves them unchanged. -## As from R 2.9.0 it is only used when building R itself. +## As from R 2.9.0 it is only used when building R itself (and not packages) ## ===== configuration macros for building R =============== @@ -23,6 +23,8 @@ ATLAS_PATH=/R/ATLAS/lib/WinNT_P4SSE2 # Support for the ACML and Goto BLASes has been withdrawn: see R-admin.html # Where does Tcl/Tk live? Spaces allowed. +# If you alter this you cannot build the installer and will need to set +# MY_TCLTK to use the package. TCL_HOME = $(RHOME)/Tcl TCL_VERSION = 85 @@ -30,14 +32,15 @@ TCL_VERSION = 85 # checkout with no modifications). # USE_SVNVERSION = YES -# We normally link against DLLs, but this macro forces the use of import libs -# Needed if using other compilers, including Mingw64 +# We normally link directly against DLLs, +# but this macro forces the use of import libs +# Needed if using other compilers, including _some_ versions of Mingw64 # USE_IMPLIBS = YES -# Some of the Mingw64 compilers are in fact cross-compilers and have prefixes +# Some of the 64-bit compilers are in fact cross-compilers and have prefixes BINPREF= -# 32- or 64-bit Windows? For experiments with Mingw64. +# 32- or 64-bit Windows? For MinGW-w64. WIN=32 ifeq ($(strip $(WIN)),64) USE_IMPLIBS = YES @@ -58,7 +61,7 @@ ICU_PATH=/sources/icu ## ====== configuration macros for building installer =========== -# location where Inno Setup 5.[123].x was installed. Spaces allowed. +# location where Inno Setup 5.3.x was installed. Spaces allowed. ISDIR=C:/packages/Inno ## ====== configuration macros for building MSI installer =========== @@ -70,14 +73,13 @@ WIXDIR=C:/packages/WiX ## c99 would force __STRICT_ANSI__ disabling strdup etc, and also alloca C99FLAG=-std=gnu99 +## for mingw-runtime <= 3.11 +# C99FLAG=-std=gnu99 -fgnu89-inline ifeq ($(strip $(BUILD)),GCC4) F77=$(BINPREF)gfortran$(GCC4_SUFF) FLIBS=-lgfortran -## for mingw-runtime <= 3.11 -# C99FLAG=-std=gnu99 -fgnu89-inline -## earlier Rtools needs -sjlj -## an alternative is -dw2, which currently fails building R. +## earlier Rtools needs -sjlj; the alternative is -dw2, which fails building R. GCC4_SUFF= endif diff --git a/src/gnuwin32/bitmap/Makefile b/src/gnuwin32/bitmap/Makefile index 4dcd8dacbfb..d7b08ab4d76 100644 --- a/src/gnuwin32/bitmap/Makefile +++ b/src/gnuwin32/bitmap/Makefile @@ -1,6 +1,6 @@ ## These can be overridden in MkRules -## must be jpeg-6b or jpeg-7 +## must be jpeg-6b or jpeg-7 or jpeg-8 JPEGDIR = jpeg-7 PNGDIR = libpng TIFFDIR = libtiff @@ -23,16 +23,13 @@ buildzlib: ## Neither the makefile.{mingw,std} build pnggccrd.c but it is needed if ## the compiler defines __MMX__ , which the win64 gcc does. ## So we need to explicitly disable it. +## prefix=foo shuts up a warning buildpng: @$(MAKE) CC='$(CC)' \ CFLAGS="-O3 -I../../../extra/zlib -DPNG_NO_MMX_CODE" \ RANLIB=$(RANLIB) ZLIBLIB=../../../extra/zlib -C $(PNGDIR) \ -f scripts/makefile.std libpng.a -# jconfig.h and Makefile obtained running 'CC="gcc -mno-cygwin" ./configure' -# under CYGWIN. They are here since the configure script doesn't run -# (I suspect) using the reduced set of tools we distribute. -## 2006-01-15 checked under current tools buildjpeg: $(JPEGDIR)/jconfig.h Makefile.jpeg $(MAKE) CC='$(CC)' AR='$(AR) rc' RANLIB=$(RANLIB) JPEGDIR=$(JPEGDIR) -C $(JPEGDIR) \ -f ../Makefile.jpeg libjpeg.a diff --git a/src/gnuwin32/bitmap/Makefile.jpeg b/src/gnuwin32/bitmap/Makefile.jpeg index c2a2208cfdd..30fe3cbb522 100644 --- a/src/gnuwin32/bitmap/Makefile.jpeg +++ b/src/gnuwin32/bitmap/Makefile.jpeg @@ -1,3 +1,11 @@ +#-*- Makefile -*- + +## comment from Guido's original version in the 1990's +# jconfig.h and Makefile obtained running 'CC="gcc -mno-cygwin" ./configure' +# under CYGWIN. They are here since the configure script doesn't run +# (I suspect) using the reduced set of tools we distribute. +## 2006-01-15 checked under current tools. + CC= gcc CFLAGS= -O3 -I. @@ -7,16 +15,7 @@ CFLAGS= -O3 -I. SYSDEPMEM= jmemnobs.o # source files: JPEG library proper -ifeq ($(strip $(JPEGDIR)),jpeg-7) -LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ - jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ - jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ - jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ - jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ - jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ - jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ - jquant2.c jutils.c jmemmgr.c -else +ifeq ($(strip $(JPEGDIR)),jpeg-6b) LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \ jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \ jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \ @@ -25,6 +24,15 @@ LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \ jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \ jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \ jquant2.c jutils.c jmemmgr.c +else +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c endif # These objectfiles are included in libjpeg.a diff --git a/src/gnuwin32/bitmap/Makefile.tiff b/src/gnuwin32/bitmap/Makefile.tiff index 3c69e5e9c12..87ede105d0e 100644 --- a/src/gnuwin32/bitmap/Makefile.tiff +++ b/src/gnuwin32/bitmap/Makefile.tiff @@ -1,4 +1,5 @@ #-*- Makefile -*- +## may be overridden in MkRules JPEGDIR = jpeg-7 include ../../MkRules diff --git a/src/gnuwin32/bitmap/rbitmap.c b/src/gnuwin32/bitmap/rbitmap.c index b8b2911d307..8341dd21310 100644 --- a/src/gnuwin32/bitmap/rbitmap.c +++ b/src/gnuwin32/bitmap/rbitmap.c @@ -65,7 +65,11 @@ static void my_png_error(png_structp png_ptr, png_const_charp msg) { R_ShowMessage((char *) msg); +#if PNG_LIBPNG_VER < 10400 longjmp(png_ptr->jmpbuf,1); +#else + longjmp(png_jmpbuf(png_ptr),1); +#endif } static void my_png_warning(png_structp png_ptr, png_const_charp msg) @@ -115,7 +119,12 @@ int R_SaveAsPng(void *d, int width, int height, /* Set error handling. REQUIRED if you aren't supplying your own * error handling functions in the png_create_write_struct() call. */ - if (setjmp(png_ptr->jmpbuf)) { +#if PNG_LIBPNG_VER < 10400 + if (setjmp(png_ptr->jmpbuf)) +#else + if (setjmp(png_jmpbuf(png_ptr))) +#endif +{ /* If we get here, we had a problem writing the file */ free(scanline); png_destroy_write_struct(&png_ptr, &info_ptr);