Commits

Anonymous committed 2275e5e

- Sync HEAD with GD_2_0
- Begin 2.1.0 work (mark it as 2.1.0 :)

Comments (0)

Files changed (41)

src/CMakeLists.txt

 	ENABLE_TESTING()
 endif(BUILD_TEST)
 
-if (WIN32)
-	SET(BGDWIN32 1)
-	ADD_DEFINITIONS(-DBGDWIN32)
-endif (WIN32)
-
 if (USE_EXT_GD)
 	message("Using GD at: ${USE_EXT_GD}")
 	INCLUDE_DIRECTORIES(BEFORE ${GD_INCLUDE_DIR})
 	endif (GD_FOUND)
 else (USE_EXT_GD)
 	SET(GD_VERSION_MAJOR "2")
-	SET(GD_VERSION_MINOR "0x0")
-	SET(GD_VERSION_PATCH "34")
+	SET(GD_VERSION_MINOR "1")
+	SET(GD_VERSION_PATCH "0")
 	SET(GD_VERSION "${GD_VERSION_MAJOR}.${GD_VERSION_MINOR}.${GD_VERSION_PATCH}")
 	SET(GD_VERSION_STRING "${GD_VERSION}")
 
 	include(CheckIncludeFiles)
 	include(CheckIncludeFile)
 
-
 	include(AC_HEADER_STDC)
 	include(CheckPrototypeExists)
+	SET(FONTCONFIG_FIND_QUIETLY, 1)
 
 	FIND_PACKAGE(PNG REQUIRED)
 	FIND_PACKAGE(ZLIB)
 	FIND_PACKAGE(JPEG)
+IF (NOT WIN32)
 	FIND_PACKAGE(PTHREAD)
+ENDIF (NOT WIN32)
 	FIND_PACKAGE(Freetype)
 	FIND_PACKAGE(XPM)
 	FIND_PACKAGE(Fontconfig)
 
 	if (FREETYPE_FOUND)
 		INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR})
-		SET(HAVE_LIBFREETYPE 1)
 		SET(HAVE_FT2BUILD_H 1)
+		SET(HAVE_LIBFREETYPE 1)
 	ENDIF(FREETYPE_FOUND)
 
 	IF(ZLIB_FOUND)
 	IF(FONTCONFIG_FOUND)
 		INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR})
 		SET(HAVE_LIBFONTCONFIG 1)
+	ELSE (FONTCONFIG_FOUND)
+		SET(FONTCONFIG_LIBRARIES "")
 	ENDIF(FONTCONFIG_FOUND)
 
 	SET(HAVE_CONFIG_H 1)
 
 	if (WIN32)
 		SET(GD_LIB bgd)
-		ADD_DEFINITIONS(/nodefaultlib:library)
+		ADD_DEFINITIONS( -DWIN32 -D_WIN32 -DMSWIN32 -DBGDWIN32)
 	else(WIN32)
 		SET(GD_LIB gd)
 	endif(WIN32)
 
 	add_library(${GD_LIB} ${LIBGD_SRC_FILES})
+
+	if (WIN32)
+		SET_TARGET_PROPERTIES(${GD_LIB} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:msvcrt.lib")
+	ENDIF(WIN32)
+
 	target_link_libraries(${GD_LIB} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARIES})
 
 endif (USE_EXT_GD)
+2007-04-09 18:21  pajoye
+
+	* NEWS: - #72 entry
+
+2007-04-09 18:18  pajoye
+
+	* gd.c, tests/gdimageline/bug00072.c,
+	  tests/gdimageline/bug00072_exp.png: - #72, gdImageAALine draws
+	  axis aligned lines two pixels large  . add gdImageVLine and
+	  HLine, not exported (will be 2.1.0)
+
+2007-04-09 16:00  pajoye
+
+	* tests/: gdimageline/gdimageline_aa.c, gdtest/gdtest.c,
+	  gif/bug00005.c: - always store image diff files in the build dir
+	  - store the output result as well - remove c++ comment - be more
+	  verbose in the error messages
+
+2007-04-04 14:04  pajoye
+
+	* tests/gif/: CMakeLists.txt, bug00060.c, bug00066.c, bug00066.gif,
+	  bug00066_exp.png: - add test for #66 - fix leak in test #60
+
+2007-04-04 13:38  pajoye
+
+	* NEWS: - #70 entry
+
+2007-04-04 13:33  pajoye
+
+	* gd_gif_in.c: - #70, do not try to use the global color map if
+	  none exists - free im on error
+
+2007-04-03 19:03  pajoye
+
+	* NEWS: - update NEWS entries for the last commits
+
+2007-04-03 18:38  pajoye
+
+	* gdft.c: - we already lock it earlier, prevent deadlock/double
+	  lock
+
+2007-04-01 22:41  pajoye
+
+	* gd.c, gd_png.c, gdft.c: - #67,  Preferable calls of gdFree() in
+	  libg (tabe at fixedpoint dot jp)
+
+2007-04-01 22:12  pajoye
+
+	* tests/gdtest/test_config.h.cmake: - add configuration file
+
+2007-04-01 21:54  pajoye
+
+	* gd_gif_in.c: - #52, #60, #66	 - a frame size must be confined to
+	  the screen defition	      - consider 00005_2 as invalid (65k x
+	  65k frame size for a 400x312 screen)	     - be sure to always
+	  read the dimensions in the frame and does not use	the screen
+	  size (see #66 for a side effect)
+
+2007-04-01 21:48  pajoye
+
+	* tests/: gd2/gd2_empty_file.c, gd2/gd2_read.c,
+	  gdimagecopyrotated/bug00020.c, gdimagefill/bug00002_1.c,
+	  gdimagefill/bug00002_2.c, gdimagefill/bug00002_3.c,
+	  gdimagefill/bug00002_4.c, gdimagefilledellipse/bug00010.c,
+	  gdimageline/gdimageline_aa.c, gdtest/CMakeLists.txt,
+	  gdtest/gdtest.c, gif/CMakeLists.txt, gif/bug00005.c,
+	  gif/bug00060.c, gif/bug00060.gif, jpeg/jpeg_empty_file.c,
+	  jpeg/jpeg_read.c, png/bug00011.c, png/bug00033.c: - allow tests
+	  to be launched outside the src tree - #60, add test case for #60
+
+2007-03-31 19:24  pajoye
+
+	* entities.h: - update from entities.tcl
+
+2007-03-31 16:26  pajoye
+
+	* gd_gif_in.c: - #52, #60   - local Pallette are read twice   - Use
+	  the local dimension when available   - Rely on the global
+	  dimension when the local dimension are invalid and	 the format
+	  is GIF87 (no animation)   NB: The #52 TS patch must be applied
+	  first
+
+2007-03-15 23:25  nlopess
+
+	* tests/gif/bug00005_2.c: MFB: fix leak in test
+
+2007-03-15 23:23  nlopess
+
+	* tests/gif/bug00005_2.c: fix leak in test
+
+2007-03-12 17:05  pajoye
+
+	* CMakeLists.txt: -MFB:  - generate config.h in the BUIL_DIR
+	  instead of the SOURCE_DIR  - drop old commented lines
+
+2007-03-12 17:01  pajoye
+
+	* CMakeLists.txt: - generate config.h in the BUIL_DIR instead of
+	  the SOURCE_DIR - drop old commented lines
+
+2007-03-08 21:02  nlopess
+
+	* gd_gif_in.c: MFB: fix bug #52: Reading GIF images is not thread
+	  safe (static usage in private functions)
+
+2007-03-08 20:59  nlopess
+
+	* NEWS: fix news, sorry
+
+2007-03-08 20:56  nlopess
+
+	* NEWS, gd_gif_in.c: fix bug #52: Reading GIF images is not thread
+	  safe (static usage in private functions)
+
+2007-03-08 20:52  pajoye
+
+	* ISSUES: - we use NEWS now
+
+2007-03-07 20:30  nlopess
+
+	* CMakeLists.txt: set HAVE_FT2BUILD_H when ft2build.h file is found
+
+2007-03-07 16:53  pajoye
+
+	* CMakeLists.txt: - fix windows cmake support - use BGDWIN32 for
+	  now, static build and other windows options will follow shortly
+
+2007-03-07 16:52  pajoye
+
+	* cmake/modules/FindFreetype.cmake: - windows may have
+	  freetype2.lib
+
+2007-03-05 16:42  pajoye
+
+	* Makefile.am, NEWS, windows/Makefile: - #51  - revert Ilia's patch
+	  (was not required)  - Remove strlcpy, we don't need it now (I
+	  keep it in cvs just in case	 but it will not be distributed or
+	  used in the binaries)
+
+2007-03-02 23:02  nlopess
+
+	* gd_gif_in.c: MFB
+
+2007-03-02 22:59  nlopess
+
+	* cmake/modules/FindPTHREAD.cmake: fix pthread support in cmake
+	  toolchain
+
+2007-03-02 22:59  nlopess
+
+	* gd_gif_in.c: merge with php tree: fix access to unitialized
+	  memory (introduced with the strlcpy usage) # now gd_strlcpy()
+	  becomes useless again :P
+
+2007-03-02 15:36  edink
+
+	* windows/Makefile: Add new file compilation
+
+2007-02-27 21:32  pajoye
+
+	* windows/Makefile: - MFH: fix new lines, vc7 does not like
+	  makefile with both unix and windows line ending
+
+2007-02-27 21:32  pajoye
+
+	* windows/Makefile: - fix new lines, vc7 does not like makefile
+	  with both unix and windows line ending
+
+2007-02-27 01:38  pajoye
+
+	* NEWS: - andersrum..
+
+2007-02-27 00:55  pajoye
+
+	* ChangeLog: - update Changelog
+
+2007-02-27 00:55  pajoye
+
+	* NEWS: - update NEWS for 2.0.35RC1
+
+2007-02-27 00:46  pajoye
+
+	* gd.c: - #41, fix possible overrun (detected with valgrind) (Nuno
+	  Lopes)
+
+2007-02-27 00:39  pajoye
+
+	* CMakeLists.txt, Makefile.am, gd.h, gd_gif_in.c, strlcpy.c: - #51,
+	  Use strlcpy instead of strncpy in gd_gif_c   - fix off-by-one
+
+2007-02-26 20:59  pajoye
+
+	* gdft.c: - #48, Race condition in gdImageStringFTEx   It is safe
+	  to destroy a unlocked mutex, not a locked one (Nuno Lopes)
+
+2007-02-26 20:58  pajoye
+
+	* gdft.c: - #48, Race condition in gdImageStringFTEx   it is safe
+	  to destroy an unlocked mutex, not a locked one (Nuno Lopes)
+
+2007-02-26 20:30  pajoye
+
+	* gdft.c: - MFB: #48, Race condition in gdImageStringFTEx (cache)
+
+2007-02-26 20:30  pajoye
+
+	* gdft.c: - #48, Race condition in gdImageStringFTEx (cache)
+
+2007-02-07 01:32  pajoye
+
+	* ChangeLog: - sync
+
+2007-02-07 01:27  pajoye
+
+	* NEWS: - add CVE ref.
+
+2007-02-07 01:26  pajoye
+
+	* ChangeLog: - sync changelog
+
+2007-02-07 01:26  pajoye
+
+	* gd.h: - go for 2.0.34
+
+2007-02-07 01:24  pajoye
+
+	* gd.c: - MFB: ansi/windows build fix, all declarations must be on
+	  top (Edin)
+
+2007-02-07 01:21  pajoye
+
+	* gd.c: - ansi/windows build fix, all declarations must be on top
+	  (Edin)
+
+2007-02-07 01:14  pajoye
+
+	* NEWS: - #40
+
+2007-02-07 01:12  pajoye
+
+	* gdft.c: - #40 — possible Buffer overflow in the
+	  gdImageStringFTEx   function in gdft.c (patch by Kees Kook)
+
+2007-02-06 23:29  pajoye
+
+	* windows/libgd.rc: - update dll rc
+
+2007-02-06 23:24  pajoye
+
+	* ChangeLog: - sync Changelog
+
+2007-02-03 02:34  pajoye
+
+	* NEWS: - updates
+
+2007-02-03 02:18  pajoye
+
+	* ChangeLog: - update changelog
+
+2007-02-03 02:16  pajoye
+
+	* Makefile.am, configure.ac: - MFB: #31 — Shared library support
+	  on cygwin (Dr. Volker Zell)
+
+2007-02-03 02:15  pajoye
+
+	* Makefile.am, configure.ac: - #31 Shared library support on cygwin
+	  (Dr. Volker Zell)
+
+2007-02-03 02:11  pajoye
+
+	* gd.h, gdft.c, index.html: - MFB: #30, restores the ability to
+	  recognize and handle a font with	  Adobe-specific character
+	  encoding
+
+2007-02-03 02:03  pajoye
+
+	* gd.c: - MFB: #14, sanity check
+
+2007-02-03 02:00  pajoye
+
+	* gd.c: - #14, sanity check
+
+2007-02-01 12:01  pajoye
+
+	* gdft.c: - #30, do not extend sign (restores the ability to
+	  recognize and handle a   font with Adobe-specific character
+	  encoding (Adobe custom) ).
+
+2007-02-01 00:31  pajoye
+
+	* gd.h, gdft.c, index.html: - #30, restores the ability to
+	  recognize and handle a font with   Adobe-specific character
+	  encoding (Adobe custom) - Fix proto in index.html
+
+2007-01-30 10:11  pajoye
+
+	* NEWS: - 2.0.34RC1 news
+
+2007-01-29 23:22  pajoye
+
+	* ChangeLog: - update
+
 2007-01-29 22:56  pajoye
 
 	* gd.c: - #32, Pattern-fill works incorrectly if tile is created
+'GD                                                                         NEWS
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+GD 2.0.35RC3 (2007-04-??)
+41, Fix valgrind error in gdImageFillTiled (Nuno Lopes) 
+45, Add missing custom cmake macros (required for the tests suite)
+51, Avoid signature buffer copy  in gd_gif_c (Nuno Lopes)
+48, Race condition in gdImageStringFTEx (Antony Dogval, Pierre 
+    Scott MacVicar)
+52, Reading GIF images is not thread safe (static usage in private
+    functions) (Roman Nemecek, Nuno Lopes, Pierre)
+60, GIF Local palette is read twice
+66, GIF, Use local frame dimension when possible instead of the 
+    logical screen size
+68, OpenVMS build support, see VMS/README.VMS for the details 
+    (Alexey Chupahin)
+70, GIF, do not try to use the global colmap if it does not exist
+    (Nuno Lopes, Pierre)
+72, gdImageAALine draws axis lines with two pixels width
+73, TTF usage doesn't work properly on Netware (Guenter Knauf, Scott MacVicar)
+74, gdImageArc CPU usage with large angles
+
+GD 2.0.34 (2007-02-07)
  3, Initialize variables in tweenColorTest, fix cache
  4, gdImageFill, multiple segfaults with patterns or invalid arguments
  5, gdImageRectangle draws corners twice
  6, GIF Output does use the transparent color with truecolor images
  7, Multiple security issues in GIF loader
  8, gdIimageCopy doen't use the alpha channel
- 9, Add autogen and and misc configure/makefile
+ 9, Add autogen and and misc configure/makefile (Lars Hecking)
 10, gdImageFilledEllipse does not respect transparency
 11, gdImageCreateFromPng*  crashes with empty file
 12, gdImageCreateFromPngCrx, initialize the signature buffer not the
 13, leak in jinit_2pass_quantizer (gd_topal.c)
 14, Added santiy checks for possible memory allocation errors
 15, gdImageCreatePaletteFromTrueColor, later color allocations overwrite
-    the palette colors
+    the palette colors (Rob Leslie)
 16, Obscure error on Sun's compiler in entities.tcl
+    (John Ellson/Graphviz)
 17, gdImageCreate, invalid gdFree call when overflow2 fails
 18, HWB_Diff, invalid usage of abs instead of fabs
+    (Nick Atty)
 19, Fixed gdImageCopyMergeGray when used with a true color image
 20, transparency preservation in gdImageCopyRotated
 21, Out of range checks in gdImageSetAAPixelColor
 22, gdFontCacheSetup does not stop on error
 23, Errors when gdImageStringFTEx is called with an empty string
+    (Kevin Scaldeferri)
 24, gdft.c, uninitialized variable "charmap" and avoid divide-by-zero
+    (John Ellson/Graphviz)
 25, DISABLE_THREADS to permit disabling of thread support
+    (John Ellson/Graphviz)
 26, dynamicGetbuf, sourceGetbuf must return 0 for errors and EOF
 27, gdSeek declaration is wrong
-29, Windows native makefile
-31, Shared library support on cygwin (patch)
+29, Windows native makefile (Edin Kadribašić)
+30, restores the ability to recognize and handle a font with
+    Adobe-specific character encoding. Added gdFTEX_Adobe_Custom.
+31, Shared library support on cygwin (Dr. Volker Zell)
 32, Pattern-fill works incorrectly if tile is created via
-    gdImageCreateTruecolor
+    gdImageCreateTruecolor (Ethan Merritt)
 33, malformed PNG image crashes  (CRC error)
 34, reading some gif images creates infinite loop
-36, gdImageFillToBorder crashes when used with alpha
+36, gdImageFillToBorder crashes when used with alpha
+40, possible Buffer overflow in the gdImageStringFTEx function
+    in gdft.c (CVE-2007-0455) (Kees Cook)

src/VMS/CONFIGURE.COM

+$! (c) Alexey Chupahin  18-APR-2006
+$! GNU
+$!
+$!
+$DEF SYS$ERROR _NL0:
+$ SET NOON
+$WRITE SYS$OUTPUT " "
+$WRITE SYS$OUTPUT "Configuring GD library for OpenVMS"
+$WRITE SYS$OUTPUT "(c) Alexey Chupahin "
+$! Checking architecture
+$! Checking architecture
+$    IF F$GETSYI("ARCH_TYPE").EQ.1 THEN CPU = "VAX"
+$    IF F$GETSYI("ARCH_TYPE").EQ.2 THEN CPU = "Alpha"
+$    IF F$GETSYI("ARCH_TYPE").EQ.3 THEN CPU = "I64"
+$WRITE SYS$OUTPUT "Checking architecture   ...  ", CPU
+$SHARED=0
+$IF ( (CPU.EQS."Alpha").OR.(CPU.EQS."I64") )
+$  THEN
+$       SHARED=64
+$  ELSE
+$       SHARED=32
+$ENDIF
+$DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. ""
+$IF (DECC) THEN $WRITE SYS$OUTPUT  "Compiler		...  DEC C"
+$IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT  "BAD compiler" GOTO EXIT
+$MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. ""
+$MMK = F$TYPE(MMK) 
+$IF (MMS .OR. MMK) THEN GOTO TEST_LIBRARIES
+$! I cant find any make tool
+$GOTO EXIT
+$!
+$!
+$TEST_LIBRARIES:
+$!   Setting as MAKE utility one of MMS or MMK. I prefer MMS.
+$IF (MMK) THEN MAKE="MMK/IGN=WAR"
+$IF (MMS) THEN MAKE="MMS/IGN=WAR"
+$WRITE SYS$OUTPUT "Checking build utility	...  ''MAKE'"
+$WRITE SYS$OUTPUT " "
+$!
+$IF (P1.EQS."STATIC") .OR. (P1.EQS."static")
+$ THEN
+$       WRITE SYS$OUTPUT "Configuring for static only"
+$       SHARED=0
+$ENDIF
+$!
+$! Is it package root directory? If no, go to [-]
+$ IF (F$SEARCH("[]VMS.DIR").EQS."") .AND. (F$SEARCH("[]vms.dir").EQS."")
+$  THEN
+$	SET DEF [-]
+$ ENDIF
+$!
+$!Checking for iconv
+$!
+$ DEFINE SYS$OUTPUT _NLA0:
+$ CC/OBJECT=TEST.OBJ SYS$INPUT
+      #include <iconv.h>
+   int main()
+     {
+        iconv_t cd;
+	cd = iconv_open ((const char *)0, (const char *)0);
+     }
+$TMP = $STATUS
+$DEAS  SYS$OUTPUT
+$IF (TMP .NE. %X10B90001)
+$  THEN
+$       HAVE_ICONV=0
+$ENDIF
+$DEFINE SYS$OUTPUT _NLA0:
+$LINK/EXE=TEST TEST
+$TMP = $STATUS
+$!WRITE SYS$OUTPUT TMP
+$IF (TMP .NE. %X10000001)
+$  THEN
+$       HAVE_ICONV=0
+$  ELSE
+$       HAVE_ICONV=1
+$ENDIF
+$DEAS  SYS$OUTPUT
+$IF (HAVE_ICONV.EQ.1)
+$  THEN
+$       WRITE SYS$OUTPUT "Checking for system iconv library...   Yes"
+$  ELSE
+$       WRITE SYS$OUTPUT "Checking for system iconv library...   No"
+$ENDIF
+$!
+$!"Checking for correct zlib library    "
+$ ZLIB_STATIC=0
+$ DEFINE SYS$OUTPUT _NLA0:
+$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT
+      #include <stdlib.h>
+      #include <stdio.h>
+      #include <zlib.h>
+   int main()
+     {
+        printf("checking version zlib:  %s\n",zlibVersion());
+     }
+$TMP = $STATUS
+$DEAS  SYS$OUTPUT
+$IF (TMP .NE. %X10B90001)
+$  THEN
+$       HAVE_ZLIB=0
+$       GOTO EXIT
+$ENDIF
+$DEFINE SYS$OUTPUT _NLA0:
+$!Testing for shared ZLIB
+$COPY SYS$INPUT OPT.OPT
+SYS$SHARE:LIBZSHR/SHARE
+$LINK/EXE=TEST TEST,OPT/OPT
+$TMP = $STATUS
+$DEL OPT.OPT;*
+$!WRITE SYS$OUTPUT TMP
+$IF (TMP .NE. %X10000001)
+$  THEN
+$	LINK/EXE=TEST TEST,ZLIB:LIBZ/LIB
+$	TMP = $STATUS
+$	IF (TMP .NE. %X10000001)
+$	  THEN
+$       	HAVE_ZLIB=0
+$	  ELSE
+$		HAVE_ZLIB=1
+$		ZLIB_STATIC=1
+$	ENDIF
+$  ELSE
+$       HAVE_ZLIB=1
+$ENDIF
+$DEAS  SYS$OUTPUT
+$IF (HAVE_ZLIB.EQ.1)
+$  THEN
+$       WRITE SYS$OUTPUT "Checking for correct zlib library ...   Yes"
+$  ELSE
+$       WRITE SYS$OUTPUT "Checking for correct zlib library ...   No"
+$       WRITE SYS$OUTPUT "This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html"
+$	GOTO EXIT
+$ENDIF
+$RUN TEST
+$!
+$!
+$FREETYPE_STATIC=0
+$!"Checking for correct Freetype2 library"
+$ DEFINE SYS$OUTPUT _NLA0:
+$ CC/OBJECT=TEST.OBJ/INCLUDE=(FREETYPE2) SYS$INPUT
+#include <ft2build.h>
+#include <freetype/freetype.h>
+int main(int argc, char *argv[])
+{
+
+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR <= 1 
+        printf("This version is too old. Please get newest\n");
+        printf("From fafner.dyndns.org/~alexey/libsdl/required.html\n");
+	exit(2);
+#endif
+        printf("checking version FreeType  : %d.%d.%d\n",
+                        FREETYPE_MAJOR,
+                        FREETYPE_MINOR,
+                        FREETYPE_PATCH);
+        return(0);
+}
+$TMP = $STATUS
+$DEAS  SYS$OUTPUT
+$IF (TMP .NE. %X10B90001)
+$  THEN
+$       HAVE_FREETYPE=0
+$       GOTO NEXT0
+$ENDIF
+$DEAS  SYS$OUTPUT
+$DEFINE SYS$OUTPUT _NLA0:
+$LINK/EXE=TEST TEST,FREETYPE2:FREETYPE/OPT
+$TMP = $STATUS
+$IF (TMP .NE. %X10000001)
+$  THEN
+$	LINK/EXE=TEST TEST,FREETYPE2:FREETYPE/LIB,ZLIB:LIBZ/LIB
+$	TMP = $STATUS
+$	IF (TMP .NE. %X10000001)
+$  	  THEN
+$		TMP = $STATUS
+$       	HAVE_FREETYPE=0
+$       	GOTO NEXT0
+$	  ELSE
+$		FREETYPE_STATIC=1
+$	ENDIF
+$ENDIF
+$!
+$RUN TEST
+$IF ($STATUS .NE. %X00000001)
+$  THEN
+$       HAVE_FREETYPE=0
+$	GOTO NEXT0
+$  ELSE
+$        HAVE_FREETYPE=1
+$ENDIF
+$NEXT0:
+$DEAS  SYS$OUTPUT
+$IF (HAVE_FREETYPE.EQ.1)
+$  THEN
+$       WRITE SYS$OUTPUT "Checking for correct FreeType  ...   Yes"
+$	RUN TEST
+$  ELSE
+$       WRITE SYS$OUTPUT "Checking for correct FreeType  ...   No"
+$	WRITE SYS$OUTPUT "This is required library "
+$	WRITE SYS$OUTPUT "install it first from fafner.dyndns.org/~alexey/libsdl/required.html"
+$	GOTO EXIT
+$ENDIF
+$!
+$!
+$HAVE_LIBTIFF=0
+$!"Checking for libPNG "
+$ DEFINE SYS$OUTPUT _NLA0:
+$ CC/OBJECT=TEST.OBJ/INCLUDE=(PNG,ZLIB) SYS$INPUT
+	#include <stdlib.h>
+        #include  <png.h>
+        int main()
+        {
+	 png_uint_32 n,n1,n2,n3;
+	 n=png_access_version_number();
+	 n3=n%100; n=n/100;
+	 n2=n%100; n=n/100;
+	 n1=n%100; 
+	if ( (n1<=1)&&(n2<2) ) 
+		{ printf("checking version  libPNG:  %d.%d.%d\n",n1,n2,n3);
+		  printf("This version is too old. Please get newest\n");
+		  printf("From fafner.dyndns.org/~alexey/libsdl/public.html\n");
+		  exit(2);
+		}
+	printf("checking version  libPNG:  %d.%d.%d\n",n1,n2,n3);
+        }
+$!
+$TMP = $STATUS
+$DEAS  SYS$OUTPUT
+$IF (TMP .NE. %X10B90001)
+$  THEN
+$       HAVE_LIBPNG=0
+$       GOTO NEXT2
+$ENDIF
+$DEFINE SYS$OUTPUT _NLA0:
+$LINK/EXE=TEST TEST,PNG:LIBPNG$SHR/OPT,ZLIB:LIBZ/LIB
+$TMP = $STATUS
+$!WRITE SYS$OUTPUT TMP
+$IF (TMP .NE. %X10000001)
+$  THEN
+$!	Trying for static libpng
+$	LINK/EXE=TEST TEST,PNG:LIBPNG/LIB,ZLIB:LIBZ/LIB
+$	TMP = $STATUS
+$	IF (TMP .NE. %X10000001)
+$	 THEN
+$		LIBPNG_STATIC=0
+$       	HAVE_LIBPNG=0
+$       	GOTO NEXT2
+$	 ELSE
+$		HAVE_LIBPNG=1 
+$		LIBPNG_STATIC=1
+$       ENDIF
+$  ELSE
+$        HAVE_LIBPNG=1
+$      	 LIBPNG_STATIC=0
+$ENDIF
+$!
+$RUN TEST
+$IF ($STATUS .NE. %X00000001)
+$  THEN
+$	HAVE_LIBPNG=0
+$  ELSE
+$	 HAVE_LIBPNG=1
+$ENDIF
+$NEXT2:
+$DEAS  SYS$OUTPUT
+$IF (HAVE_LIBPNG.EQ.1)
+$  THEN
+$       WRITE SYS$OUTPUT "Checking for correct  libPNG ...   Yes"
+$	RUN TEST
+$  ELSE
+$       WRITE SYS$OUTPUT "Checking for correct  libPNG ...   No"
+$       WRITE SYS$OUTPUT "This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html"
+$	GOTO EXIT
+$ENDIF
+$!
+$!
+$!
+$! Checking for JPEG ...
+$ DEFINE SYS$OUTPUT _NLA0:
+$ CC/OBJECT=TEST.OBJ/INCLUDE=(JPEG) SYS$INPUT
+      #include <stdlib.h>
+      #include <stdio.h>
+      #include <jpeglib.h>
+      #include <jversion.h>	
+   int main()
+     {
+	printf("checking version jpeg:  %s\n",JVERSION);
+	jpeg_quality_scaling(0);
+        return 0;
+     }
+$TMP = $STATUS
+$DEAS  SYS$OUTPUT
+$!WRITE SYS$OUTPUT TMP
+$IF (TMP .NE. %X10B90001)
+$  THEN
+$	HAVE_JPEG=0
+$       GOTO EXIT
+$ENDIF
+$DEFINE SYS$OUTPUT _NLA0:
+$LINK/EXE=TEST TEST,JPEG:LIBJPEG$SHR/OPT
+$TMP = $STATUS
+$DEAS  SYS$OUTPUT
+$!WRITE SYS$OUTPUT TMP
+$IF (TMP .NE. %X10000001)
+$  THEN
+$	LINK/EXE=TEST TEST,JPEG:LIBJPEG/OPT
+$	TMP = $STATUS
+$	IF (TMP .NE. %X10000001)
+$	  THEN
+$		HAVE_JPEG=0
+$		JPEG_STATIC=0
+$		GOTO EXIT
+$	  ELSE
+$		HAVE_JPEG=1
+$		JPEG_STATIC=1
+$	ENDIF
+$  ELSE
+$	HAVE_JPEG=1
+$	JPEG_STATIC=0
+$ENDIF
+$!
+$IF (HAVE_JPEG.EQ.1)
+$  THEN
+$       WRITE SYS$OUTPUT "Checking for correct jpeg library ...   Yes"
+$  ELSE
+$       WRITE SYS$OUTPUT "Checking for correct jpeg library ...   No"
+$       WRITE SYS$OUTPUT "This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html"
+$       GOTO EXIT
+$ENDIF
+$RUN TEST
+$!
+$!
+$!WRITING BUILD FILES
+$!
+$IF (SHARED.EQ.64)
+$ THEN
+$	COPY SYS$INPUT LIBGD$DEF.OPT
+SYMBOL_VECTOR= (-
+gdAlphaBlend=PROCEDURE,-
+gdImageCreate=PROCEDURE,-
+gdImageCreateTrueColor=PROCEDURE,-
+gdImageCreateFromPng=PROCEDURE,-
+gdImageCreateFromPngCtx=PROCEDURE,-
+gdImageCreateFromPngPtr=PROCEDURE,-
+gdImageCreateFromGif=PROCEDURE,-
+gdImageCreateFromGifCtx=PROCEDURE,-
+gdImageCreateFromGifPtr=PROCEDURE,-
+gdImageCreateFromWBMP=PROCEDURE,-
+gdImageCreateFromWBMPCtx=PROCEDURE,-
+gdImageCreateFromWBMPPtr=PROCEDURE,-
+gdImageCreateFromJpeg=PROCEDURE,-
+gdImageCreateFromJpegCtx=PROCEDURE,-
+gdImageCreateFromJpegPtr=PROCEDURE,-
+gdImageCreateFromPngSource=PROCEDURE,-
+gdImageCreateFromGd=PROCEDURE,-
+gdImageCreateFromGdCtx=PROCEDURE,-
+gdImageCreateFromGdPtr=PROCEDURE,-
+gdImageCreateFromGd2=PROCEDURE,-
+gdImageCreateFromGd2Ctx=PROCEDURE,-
+gdImageCreateFromGd2Ptr=PROCEDURE,-
+gdImageCreateFromGd2Part=PROCEDURE,-
+gdImageCreateFromGd2PartCtx=PROCEDURE,-
+gdImageCreateFromGd2PartPtr=PROCEDURE,-
+gdImageCreateFromXbm=PROCEDURE,-
+gdImageCreateFromXpm=PROCEDURE,-
+gdImageStringFTCircle=PROCEDURE,-
+gdImageDestroy=PROCEDURE,-
+gdImageSetPixel=PROCEDURE,-
+gdImageGetPixel=PROCEDURE,-
+gdImageGetTrueColorPixel=PROCEDURE,-
+gdImageAABlend=PROCEDURE,-
+gdImageLine=PROCEDURE,-
+gdImageDashedLine=PROCEDURE,-
+gdImageRectangle=PROCEDURE,-
+gdImageFilledRectangle=PROCEDURE,-
+gdImageSetClip=PROCEDURE,-
+gdImageGetClip=PROCEDURE,-
+gdImageBoundsSafe=PROCEDURE,-
+gdImageChar=PROCEDURE,-
+gdImageCharUp=PROCEDURE,-
+gdImageString=PROCEDURE,-
+gdImageStringUp=PROCEDURE,-
+gdImageString16=PROCEDURE,-
+gdImageStringUp16=PROCEDURE,-
+gdFontCacheSetup=PROCEDURE,-
+gdFontCacheShutdown=PROCEDURE,-
+gdFreeFontCache=PROCEDURE,-
+gdImageStringTTF=PROCEDURE,-
+gdImageStringFT=PROCEDURE,-
+gdFTUseFontConfig=PROCEDURE,-
+gdImageStringFTEx=PROCEDURE,-
+gdImagePolygon=PROCEDURE,-
+gdImageOpenPolygon=PROCEDURE,-
+gdImageFilledPolygon=PROCEDURE,-
+gdImageColorAllocate=PROCEDURE,-
+gdImageColorAllocateAlpha=PROCEDURE,-
+gdImageColorClosest=PROCEDURE,-
+gdImageColorClosestAlpha=PROCEDURE,-
+gdImageColorClosestHWB=PROCEDURE,-
+gdImageColorExact=PROCEDURE,-
+gdImageColorExactAlpha=PROCEDURE,-
+gdImageColorResolve=PROCEDURE,-
+gdImageColorResolveAlpha=PROCEDURE,-
+gdImageColorDeallocate=PROCEDURE,-
+gdImageCreatePaletteFromTrueCol=PROCEDURE,-
+gdImageTrueColorToPalette=PROCEDURE,-
+gdImageColorTransparent=PROCEDURE,-
+gdImagePaletteCopy=PROCEDURE,-
+gdImageGif=PROCEDURE,-
+gdImagePng=PROCEDURE,-
+gdImagePngCtx=PROCEDURE,-
+gdImageGifCtx=PROCEDURE,-
+gdImagePngEx=PROCEDURE,-
+gdImagePngCtxEx=PROCEDURE,-
+gdImageWBMP=PROCEDURE,-
+gdImageWBMPCtx=PROCEDURE,-
+gdFree=PROCEDURE,-
+gdImageWBMPPtr=PROCEDURE,-
+gdImageJpeg=PROCEDURE,-
+gdImageJpegCtx=PROCEDURE,-
+gdImageJpegPtr=PROCEDURE,-
+gdImageGifAnimBegin=PROCEDURE,-
+gdImageGifAnimAdd=PROCEDURE,-
+gdImageGifAnimEnd=PROCEDURE,-
+gdImageGifAnimBeginCtx=PROCEDURE,-
+gdImageGifAnimAddCtx=PROCEDURE,-
+gdImageGifAnimEndCtx=PROCEDURE,-
+gdImageGifAnimBeginPtr=PROCEDURE,-
+gdImageGifAnimAddPtr=PROCEDURE,-
+gdImageGifAnimEndPtr=PROCEDURE,-
+gdImagePngToSink=PROCEDURE,-
+gdImageGd=PROCEDURE,-
+gdImageGd2=PROCEDURE,-
+gdImageGifPtr=PROCEDURE,-
+gdImagePngPtr=PROCEDURE,-
+gdImagePngPtrEx=PROCEDURE,-
+gdImageGdPtr=PROCEDURE,-
+gdImageGd2Ptr=PROCEDURE,-
+gdImageFilledArc=PROCEDURE,-
+gdImageArc=PROCEDURE,-
+gdImageFilledEllipse=PROCEDURE,-
+gdImageFillToBorder=PROCEDURE,-
+gdImageFill=PROCEDURE,-
+gdImageCopy=PROCEDURE,-
+gdImageCopyMerge=PROCEDURE,-
+gdImageCopyMergeGray=PROCEDURE,-
+gdImageCopyResized=PROCEDURE,-
+gdImageCopyResampled=PROCEDURE,-
+gdImageCopyRotated=PROCEDURE,-
+gdImageSetBrush=PROCEDURE,-
+gdImageSetTile=PROCEDURE,-
+gdImageSetAntiAliased=PROCEDURE,-
+gdImageSetAntiAliasedDontBlend=PROCEDURE,-
+gdImageSetStyle=PROCEDURE,-
+gdImageSetThickness=PROCEDURE,-
+gdImageInterlace=PROCEDURE,-
+gdImageAlphaBlending=PROCEDURE,-
+gdImageSaveAlpha=PROCEDURE,-
+gdNewFileCtx=PROCEDURE,-
+gdNewDynamicCtx=PROCEDURE,-
+gdNewDynamicCtxEx=PROCEDURE,-
+gdNewSSCtx=PROCEDURE,-
+gdDPExtractData=PROCEDURE,-
+gdFontGetGiant=PROCEDURE,-
+gdFontGetLarge=PROCEDURE,-
+gdFontGetMediumBold=PROCEDURE,-
+gdFontGetSmall=PROCEDURE,-
+gdFontGetTiny=PROCEDURE,-
+gdImageCompare=PROCEDURE,-
+gdFontGiant=DATA,-
+GDFONTLARGE=DATA,-
+GDFONTMEDIUMBOLD=DATA,-
+GDFONTSMALL=DATA,-
+GDFONTTINY=DATA-
+)
+$ENDIF
+$!
+$IF (SHARED.EQ.32)
+$ THEN
+$	COPY SYS$INPUT LIBGD$DEF.OPT
+UNIVERSAL=gdAlphaBlend
+UNIVERSAL=gdImageCreate
+UNIVERSAL=gdImageCreateTrueColor
+UNIVERSAL=gdImageCreateFromPng
+UNIVERSAL=gdImageCreateFromPngCtx
+UNIVERSAL=gdImageCreateFromPngPtr
+UNIVERSAL=gdImageCreateFromGif
+UNIVERSAL=gdImageCreateFromGifCtx
+UNIVERSAL=gdImageCreateFromGifPtr
+UNIVERSAL=gdImageCreateFromWBMP
+UNIVERSAL=gdImageCreateFromWBMPCtx
+UNIVERSAL=gdImageCreateFromWBMPPtr
+UNIVERSAL=gdImageCreateFromJpeg
+UNIVERSAL=gdImageStringFTCircle
+UNIVERSAL=gdImageCreateFromJpegCtx
+UNIVERSAL=gdImageCreateFromJpegPtr
+UNIVERSAL=gdImageCreateFromPngSource
+UNIVERSAL=gdImageCreateFromGd
+UNIVERSAL=gdImageCreateFromGdCtx
+UNIVERSAL=gdImageCreateFromGdPtr
+UNIVERSAL=gdImageCreateFromGd2
+UNIVERSAL=gdImageCreateFromGd2Ctx
+UNIVERSAL=gdImageCreateFromGd2Ptr
+UNIVERSAL=gdImageCreateFromGd2Part
+UNIVERSAL=gdImageCreateFromGd2PartCtx
+UNIVERSAL=gdImageCreateFromGd2PartPtr
+UNIVERSAL=gdImageCreateFromXbm
+UNIVERSAL=gdImageCreateFromXpm
+UNIVERSAL=gdImageDestroy
+UNIVERSAL=gdImageSetPixel
+UNIVERSAL=gdImageGetPixel
+UNIVERSAL=gdImageGetTrueColorPixel
+UNIVERSAL=gdImageAABlend
+UNIVERSAL=gdImageLine
+UNIVERSAL=gdImageDashedLine
+UNIVERSAL=gdImageRectangle
+UNIVERSAL=gdImageFilledRectangle
+UNIVERSAL=gdImageSetClip
+UNIVERSAL=gdImageGetClip
+UNIVERSAL=gdImageBoundsSafe
+UNIVERSAL=gdImageChar
+UNIVERSAL=gdImageCharUp
+UNIVERSAL=gdImageString
+UNIVERSAL=gdImageStringUp
+UNIVERSAL=gdImageString16
+UNIVERSAL=gdImageStringUp16
+UNIVERSAL=gdFontCacheSetup
+UNIVERSAL=gdFontCacheShutdown
+UNIVERSAL=gdFreeFontCache
+UNIVERSAL=gdImageStringTTF
+UNIVERSAL=gdImageStringFT
+UNIVERSAL=gdFTUseFontConfig
+UNIVERSAL=gdImageStringFTEx
+UNIVERSAL=gdImagePolygon
+UNIVERSAL=gdImageOpenPolygon
+UNIVERSAL=gdImageFilledPolygon
+UNIVERSAL=gdImageColorAllocate
+UNIVERSAL=gdImageColorAllocateAlpha
+UNIVERSAL=gdImageColorClosest
+UNIVERSAL=gdImageColorClosestAlpha
+UNIVERSAL=gdImageColorClosestHWB
+UNIVERSAL=gdImageColorExact
+UNIVERSAL=gdImageColorExactAlpha
+UNIVERSAL=gdImageColorResolve
+UNIVERSAL=gdImageColorResolveAlpha
+UNIVERSAL=gdImageColorDeallocate
+UNIVERSAL=gdImageCreatePaletteFromTrueCol
+UNIVERSAL=gdImageTrueColorToPalette
+UNIVERSAL=gdImageColorTransparent
+UNIVERSAL=gdImagePaletteCopy
+UNIVERSAL=gdImageGif
+UNIVERSAL=gdImagePng
+UNIVERSAL=gdImagePngCtx
+UNIVERSAL=gdImageGifCtx
+UNIVERSAL=gdImagePngEx
+UNIVERSAL=gdImagePngCtxEx
+UNIVERSAL=gdImageWBMP
+UNIVERSAL=gdImageWBMPCtx
+UNIVERSAL=gdFree
+UNIVERSAL=gdImageWBMPPtr
+UNIVERSAL=gdImageJpeg
+UNIVERSAL=gdImageJpegCtx
+UNIVERSAL=gdImageJpegPtr
+UNIVERSAL=gdImageGifAnimBegin
+UNIVERSAL=gdImageGifAnimAdd
+UNIVERSAL=gdImageGifAnimEnd
+UNIVERSAL=gdImageGifAnimBeginCtx
+UNIVERSAL=gdImageGifAnimAddCtx
+UNIVERSAL=gdImageGifAnimEndCtx
+UNIVERSAL=gdImageGifAnimBeginPtr
+UNIVERSAL=gdImageGifAnimAddPtr
+UNIVERSAL=gdImageGifAnimEndPtr
+UNIVERSAL=gdImagePngToSink
+UNIVERSAL=gdImageGd
+UNIVERSAL=gdImageGd2
+UNIVERSAL=gdImageGifPtr
+UNIVERSAL=gdImagePngPtr
+UNIVERSAL=gdImagePngPtrEx
+UNIVERSAL=gdImageGdPtr
+UNIVERSAL=gdImageGd2Ptr
+UNIVERSAL=gdImageFilledArc
+UNIVERSAL=gdImageArc
+UNIVERSAL=gdImageFilledEllipse
+UNIVERSAL=gdImageFillToBorder
+UNIVERSAL=gdImageFill
+UNIVERSAL=gdImageCopy
+UNIVERSAL=gdImageCopyMerge
+UNIVERSAL=gdImageCopyMergeGray
+UNIVERSAL=gdImageCopyResized
+UNIVERSAL=gdImageCopyResampled
+UNIVERSAL=gdImageCopyRotated
+UNIVERSAL=gdImageSetBrush
+UNIVERSAL=gdImageSetTile
+UNIVERSAL=gdImageSetAntiAliased
+UNIVERSAL=gdImageSetAntiAliasedDontBlend
+UNIVERSAL=gdImageSetStyle
+UNIVERSAL=gdImageSetThickness
+UNIVERSAL=gdImageInterlace
+UNIVERSAL=gdImageAlphaBlending
+UNIVERSAL=gdImageSaveAlpha
+UNIVERSAL=gdNewFileCtx
+UNIVERSAL=gdNewDynamicCtx
+UNIVERSAL=gdNewDynamicCtxEx
+UNIVERSAL=gdNewSSCtx
+UNIVERSAL=gdDPExtractData
+UNIVERSAL=gdFontGetGiant
+UNIVERSAL=gdFontGetLarge
+UNIVERSAL=gdFontGetMediumBold
+UNIVERSAL=gdFontGetSmall
+UNIVERSAL=gdFontGetTiny
+UNIVERSAL=gdImageCompare
+UNIVERSAL=gdFontGiant
+UNIVERSAL=GDFONTLARGE
+UNIVERSAL=GDFONTMEDIUMBOLD
+UNIVERSAL=GDFONTSMALL
+UNIVERSAL=GDFONTTINY
+
+$ENDIF
+$!
+$!
+$DEF SYS$OUTPUT _NL0:
+$!
+$!Making OPT file for GD$SHR.EXE, i.e without reference to himself
+$COPY SYS$INPUT OPT.OPT
+[]GD/LIB
+$IF ((HAVE_LIBPNG.EQ.1) .AND. (LIBPNG_STATIC.EQ.1))
+$  THEN
+$       APP SYS$INPUT OPT.OPT
+PNG:LIBPNG/LIB
+$ENDIF
+$IF ((HAVE_LIBPNG.EQ.1) .AND. (LIBPNG_STATIC.EQ.0))
+$  THEN
+$       APP PNG:LIBPNG$SHR.OPT OPT.OPT
+$ENDIF
+$!
+$IF ((HAVE_JPEG.EQ.1) .AND. (JPEG_STATIC.EQ.1))
+$  THEN
+$       APP SYS$INPUT OPT.OPT
+JPEG:LIBJPEG/LIB
+$ENDIF
+$IF ((HAVE_JPEG.EQ.1) .AND. (JPEG_STATIC.EQ.0))
+$  THEN
+$       APP JPEG:LIBJPEG$SHR.OPT OPT.OPT
+$ENDIF
+$!
+$IF (HAVE_LIBTIFF.EQ.1)
+$  THEN
+$       APP TIFF:LIBTIFF.OPT OPT.OPT
+$ENDIF
+$!
+$IF (HAVE_FREETYPE.EQ.1) .AND. (FREETYPE_STATIC.EQ.1)
+$ THEN
+$       APP SYS$INPUT OPT.OPT
+        FREETYPE2:FREETYPE/LIB
+        ZLIB:LIBZ/LIB
+$ENDIF
+$IF (HAVE_FREETYPE.EQ.1) .AND. (FREETYPE_STATIC.EQ.0)
+$ THEN
+$       APP FREETYPE2:FREETYPE.OPT OPT.OPT
+$ENDIF
+$!
+$IF (HAVE_ZLIB.EQ.1) .AND. ((FREETYPE_STATIC.NE.1).AND.(JPEG_STATIC.NE.1))
+$  THEN
+$       IF (ZLIB_STATIC.EQ.0)
+$         THEN
+$               APP SYS$INPUT OPT.OPT
+                SYS$SHARE:LIBZSHR/SHARE
+$         ELSE
+$               APP SYS$INPUT OPT.OPT
+                ZLIB:LIBZ/LIB
+$       ENDIF
+$ENDIF
+$!
+$!
+$PURGE OPT.OPT
+$!
+$!
+$!Making working LIBGD.OPT file
+$!
+$IF (SHARED.GT.0)
+$ THEN
+	$COPY SYS$INPUT LIBGD.OPT
+	SYS$SHARE:GD$SHR/SHARE
+$ ELSE
+	$COPY SYS$INPUT LIBGD.OPT
+	LIBGD:GD/LIB
+$ENDIF
+$!
+$!Append OPT files to LIBGD.OPT
+$IF ((HAVE_LIBPNG.EQ.1) .AND. (LIBPNG_STATIC.EQ.1))
+$  THEN
+$	APP SYS$INPUT LIBGD.OPT
+PNG:LIBPNG/LIB
+$ENDIF
+$IF ((HAVE_LIBPNG.EQ.1) .AND. (LIBPNG_STATIC.EQ.0))
+$  THEN
+$	APP PNG:LIBPNG$SHR.OPT LIBGD.OPT
+PNG:LIBPNG/LIB
+$ENDIF
+$!
+$IF ((HAVE_JPEG.EQ.1) .AND. (HAVE_LIBTIFF.NE.1) .AND. (JPEG_STATIC.EQ.1))
+$  THEN
+$       APP JPEG:LIBJPEG.OPT LIBGD.OPT
+$ENDIF
+$IF ((HAVE_JPEG.EQ.1) .AND. (JPEG_STATIC.EQ.0) .AND. (HAVE_LIBTIFF.NE.1))
+$  THEN
+$       APP JPEG:LIBJPEG$SHR.OPT LIBGD.OPT
+$ENDIF
+$!
+$IF (HAVE_LIBTIFF.EQ.1)
+$  THEN
+$	APP TIFF:LIBTIFF.OPT LIBGD.OPT
+$ENDIF
+$!
+$IF (HAVE_FREETYPE.EQ.1) .AND. (FREETYPE_STATIC.EQ.1)
+$ THEN
+$	APP SYS$INPUT LIBGD.OPT
+	FREETYPE2:FREETYPE/LIB
+	ZLIB:LIBZ/LIB
+$ENDIF
+$IF (HAVE_FREETYPE.EQ.1) .AND. (FREETYPE_STATIC.EQ.0)
+$ THEN
+$	APP FREETYPE2:FREETYPE.OPT LIBGD.OPT
+$ENDIF
+$!
+$IF (HAVE_ZLIB.EQ.1) .AND. ((FREETYPE_STATIC.NE.1).AND.(JPEG_STATIC.NE.1))
+$  THEN
+$	IF (ZLIB_STATIC.EQ.0)
+$	  THEN
+$		APP SYS$INPUT LIBGD.OPT
+		SYS$SHARE:LIBZSHR/SHARE	
+$	  ELSE
+$		APP SYS$INPUT LIBGD.OPT
+		ZLIB:LIBZ/LIB
+$	ENDIF
+$ENDIF
+$!
+$PURGE LIBGD.OPT
+$!
+$DEAS SYS$OUTPUT
+$!
+$OPEN/WRITE OUT BUILD.COM
+$ WRITE OUT "$",MAKE
+$ WRITE OUT "$ CURRENT = F$ENVIRONMENT (""DEFAULT"") "
+$ WRITE OUT "$TMP=CURRENT"
+$ WRITE OUT "$OPEN/WRITE OUTT LIBGD$STARTUP.COM"
+$ WRITE OUT "$WRITE OUTT ""DEFINE LIBGD ","'","'","TMP'""
+$ WRITE OUT "$WRITE OUTT ""GD2COPYPAL==""""$","'","'","TMP'"",""GD2COPYPAL""""
+$ WRITE OUT "$WRITE OUTT ""GD2TIME==""""$","'","'","TMP'"",""GD2TIME""""
+$ WRITE OUT "$WRITE OUTT ""GD2TOGIF==""""$","'","'","TMP'"",""GD2TOGIF""""
+$ WRITE OUT "$WRITE OUTT ""GD2TOPNG==""""$","'","'","TMP'"",""GD2TOPNG""""
+$ WRITE OUT "$WRITE OUTT ""GDCMPGIF==""""$","'","'","TMP'"",""GDCMPGIF""""
+$ WRITE OUT "$WRITE OUTT ""GDTOPNG==""""$","'","'","TMP'"",""GDTOPNG""""
+$ WRITE OUT "$WRITE OUTT ""GIFTOGD2==""""$","'","'","TMP'"",""GIFTOGD2""""
+$ WRITE OUT "$WRITE OUTT ""PNGTOGD==""""$","'","'","TMP'"",""PNGTOGD""""
+$ WRITE OUT "$WRITE OUTT ""PNGTOGD2==""""$","'","'","TMP'"",""PNGTOGD2""""
+$ WRITE OUT "$WRITE OUTT ""WEBPNG==""""$","'","'","TMP'"",""WEBPNG""""
+$!
+$ WRITE OUT "$WRITE SYS$OUTPUT "" ""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** ""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""LIBGD$STARTUP.COM has been created. ""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""This file setups all logicals needed. It should be execute before using ""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""Nice place to call it - LOGIN.COM ""
+$ WRITE OUT "$WRITE SYS$OUTPUT """"
+$ WRITE OUT "$WRITE SYS$OUTPUT ""Using:""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""CC/INCL=LIBGD PROG""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""LINK PROG, LIBGD:LIBGD/OPT""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** ""
+$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** ""
+$CLOSE OUT
+$!
+$!
+$!Writing config.h
+$COPY SYS$INPUT CONFIG.H
+/* Generated by configure.com  for OpenVMS */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+
+#define PACKAGE_NAME "GD"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "GD 2.0.34"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "gd"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.0.34"
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+ *    your system. */
+/* #undef PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "2.0.34"
+
+/* Define to 1 if you have the `m' library (-lm). */
+#define HAVE_LIBM 1
+
+
+/* Define to 1 if you have the <libpng/png.h> header file. */
+/* #undef HAVE_LIBPNG_PNG_H */
+
+
+
+/* Define to 1 if you have the <limits.h> header file. */
+//#define HAVE_LIMITS_H 1
+
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+
+/* Define if you have POSIX threads libraries and header files. */
+#define HAVE_PTHREAD 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+//#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define as const if the declaration of iconv() needs const. */
+//#define ICONV_CONST
+
+/* Name of package */
+#define PACKAGE "gd"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "http://bugs.libgd.org"
+
+/* Define to the full name of this package. */
+
+
+
+$IF HAVE_ICONV.EQ.1
+$ THEN
+$	APP SYS$INPUT CONFIG.H
+	/* Define if you have the iconv() function. */
+	#define HAVE_ICONV 1
+	/* Define to 1 if you have the <iconv.h> header file. */
+	#define HAVE_ICONV_H 1
+	/* Define if <iconv.h> defines iconv_t. */
+	#define HAVE_ICONV_T_DEF 1
+$ENDIF
+$IF HAVE_LIBTIFF.EQ.1 
+$  THEN 
+$	APP SYS$INPUT CONFIG.H
+	#define HAVE_LIBTIFF 1
+$ENDIF
+$IF HAVE_LIBPNG.EQ.1   
+$   THEN 
+$	APP SYS$INPUT CONFIG.H
+	#define HAVE_LIBPNG 1
+	#define HAVE_PNG_H 1
+$ENDIF
+$IF HAVE_FREETYPE.EQ.1
+$   THEN 
+$	APP SYS$INPUT CONFIG.H
+	#define HAVE_LIBFREETYPE 1
+	#define HAVE_FT2BUILD_H 1
+$ENDIF
+$IF HAVE_JPEG.EQ.1 
+$   THEN 
+$	APP SYS$INPUT CONFIG.H
+	#define HAVE_LIBJPEG 1
+$ENDIF
+$IF HAVE_ZLIB.EQ.1 
+$   THEN 
+$	APP SYS$INPUT CONFIG.H
+	#define HAVE_LIBZ 1
+$ENDIF
+$!
+$DEAS SYS$OUTPUT
+$!
+$!
+$!
+$COP SYS$INPUT DESCRIP.MMS
+# Generated by CONFIGURE.COM
+# Alexey Chupahin elvis_75@mail.ru
+#
+
+.FIRST
+	DEF LIBGD []
+
+CC=cc
+CFLAGS=/OPT=(INLINE=SPEED) /INCL=([],JPEG,PNG,FREETYPE2,ZLIB,TIFF) /DEF=(HAVE_CONFIG_H)/WARN=(DIS=MACROREDEF)
+LIBS=[]LIBGD/OPT
+
+
+ALL : \
+GD.OLB,\
+$IF (SHARED.GT.0)
+$ THEN
+$	APP SYS$INPUT DESCRIP.MMS
+GD$SHR.EXE,\
+$ENDIF
+$!
+$APP SYS$INPUT DESCRIP.MMS
+ANNOTATE.EXE,\
+CIRCLETEXTTEST.EXE,\
+FONTCONFIGTEST.EXE,\
+CIRCLETEXTTEST.EXE,\
+FONTCONFIGTEST.EXE,\
+FONTSIZETEST.EXE,\
+FONTWHEELTEST.EXE,\
+GD2COPYPAL.EXE,\
+GD2TIME.EXE,\
+GD2TOGIF.EXE,\
+GD2TOPNG.EXE,\
+GDCMPGIF.EXE,\
+GDDEMO.EXE,\
+GDTEST.EXE,\
+GDTESTFT.EXE,\
+GDTOPNG.EXE,\
+GIFANIMTEST.EXE,\
+GIFTOGD2.EXE,\
+PNGTOGD.EXE,\
+PNGTOGD2.EXE,\
+TESTAC.EXE,\
+TESTTR.EXE,\
+WEBPNG.EXE,\
+GDPARTTOPNG.EXE
+	$!
+
+ANNOTATE.EXE : ANNOTATE.OBJ
+       LINK $<, $(LIBS)
+
+CIRCLETEXTTEST.EXE : CIRCLETEXTTEST.OBJ
+       LINK $<, $(LIBS)
+
+FONTCONFIGTEST.EXE : FONTCONFIGTEST.OBJ
+       LINK $<, $(LIBS)
+
+FONTSIZETEST.EXE : FONTSIZETEST.OBJ
+       LINK $<, $(LIBS)
+
+FONTWHEELTEST.EXE : FONTWHEELTEST.OBJ
+       LINK $<, $(LIBS)
+
+GD2COPYPAL.EXE : GD2COPYPAL.OBJ
+       LINK $<, $(LIBS)
+
+GD2TIME.EXE : GD2TIME.OBJ
+       LINK $<, $(LIBS)
+
+GD2TOGIF.EXE : GD2TOGIF.OBJ
+       LINK $<, $(LIBS)
+
+GD2TOPNG.EXE : GD2TOPNG.OBJ
+       LINK $<, $(LIBS)
+
+
+GDCMPGIF.EXE : GDCMPGIF.OBJ
+       LINK $<, $(LIBS)
+
+
+GDDEMO.EXE : GDDEMO.OBJ
+       LINK $<, $(LIBS)
+
+
+GDTEST.EXE : GDTEST.OBJ
+       LINK $<, $(LIBS)
+
+
+GDTESTFT.EXE : GDTESTFT.OBJ
+       LINK $<, $(LIBS)
+
+
+GDTOPNG.EXE : GDTOPNG.OBJ
+       LINK $<, $(LIBS)
+
+
+GIFANIMTEST.EXE : GIFANIMTEST.OBJ
+       LINK $<, $(LIBS)
+
+GIFTOGD2.EXE : GIFTOGD2.OBJ
+       LINK $<, $(LIBS)
+
+GIFTOGD2.OBJ : GIFTOGD2.C
+	CC $(CFLAGS) GIFTOGD2.C
+
+
+
+PNGTOGD.EXE : PNGTOGD.OBJ
+       LINK $<, $(LIBS)
+
+
+PNGTOGD2.EXE : PNGTOGD2.OBJ
+       LINK $<, $(LIBS)
+
+
+TESTAC.EXE : TESTAC.OBJ
+       LINK $<, $(LIBS)
+
+
+TESTTR.EXE : TESTTR.OBJ
+       LINK $<, $(LIBS)
+
+
+WEBPNG.EXE : WEBPNG.OBJ
+       LINK $<, $(LIBS)
+
+
+GDPARTTOPNG.EXE : GDPARTTOPNG.OBJ
+       LINK $<, $(LIBS)
+
+
+OBJ=\
+GD.OBJ,\
+GDCACHE.OBJ,\
+GDFONTG.OBJ,\
+GDFONTL.OBJ,\
+GDFONTMB.OBJ,\
+GDFONTS.OBJ,\
+GDFONTT.OBJ,\
+GDFT.OBJ,\
+GDFX.OBJ,\
+GDHELPERS.OBJ,\
+GDKANJI.OBJ,\
+GDTABLES.OBJ,\
+GDXPM.OBJ,\
+GD_GD.OBJ,\
+GD_GD2.OBJ,\
+GD_GIF_IN.OBJ,\
+GD_GIF_OUT.OBJ,\
+GD_IO.OBJ,\
+GD_IO_DP.OBJ,\
+GD_IO_FILE.OBJ,\
+GD_IO_SS.OBJ,\
+GD_JPEG.OBJ,\
+GD_PNG.OBJ,\
+GD_SECURITY.OBJ,\
+GD_SS.OBJ,\
+GD_TOPAL.OBJ,\
+GD_WBMP.OBJ,\
+WBMP.OBJ
+
+
+GD.OLB : $(OBJ)
+        LIB/CREA GD.OLB $(OBJ)
+
+GD$SHR.EXE : $(OBJ)
+	LINK/SHARE=GD$SHR GD.OBJ,LIBGD$DEF/OPT,OPT/OPT
+	COPY GD$SHR.EXE SYS$SHARE
+
+CLEAN :
+	DEL [...]*.OBJ;*
+	DEL [...]*.OLB;*
+	DEL [...]*.EXE;*
+$!DEL TMP.MMS;*
+$!
+$IF (F$SEARCH("GD.H;2").EQS."")
+$ THEN
+$       WRITE SYS$OUTPUT "Patching GD.H"
+$	DEF SYS$OUTPUT "_NLA0:"
+$       COPY SYS$INPUT VMS.VMS
+        #define gdImageCreatePaletteFromTrueColor gdImageCreatePaletteFromTrueCol
+$       APP GD.H;1 VMS.VMS
+$       REN VMS.VMS GD.H;2       
+$	DEL VMS.VMS;*
+$	DEAS SYS$INPUT
+$ENDIF
+$!
+$!
+$!
+$!
+$WRITE SYS$OUTPUT " "
+$WRITE SYS$OUTPUT " "
+$WRITE SYS$OUTPUT "Now you can type @BUILD "
+$!
+$EXIT:
+$DEFINE SYS$OUTPUT _NLA0:
+$DEL TEST.OBJ;*
+$DEL TEST.C;*
+$DEL TEST.EXE;*
+$DEAS SYS$OUTPUT

src/VMS/README.VMS

+Dear OpenVMS user,
+
+Installation process is identical to one in *nix* world and consist to 
+four simple steps:
+1. Installing required libraries
+2. Configuration
+3. Compiling
+4. Installation.
+
+
+1. Please install required libraries first:
+
+1. ZLIB 1.2 or newer
+2. PNG 1.2.12 or newer
+3. FreeType 2
+4. JPEG 6B
+
+All may be found at OpenVMS libSDL porting project site
+http://fafner.dyndns.org/~alexey/libsdl/required.html
+
+Also, system should have MMS make utility from DEC or 
+free analogue MMK. And C compiler with runtime, of course. ;)
+
+
+2. Configuration is doing automatically by a configuration script:
+
+$@[.VMS]CONFIGURE
+
+The script detects hardware,system and required libraries have been installed.
+Compilation stage will be prepeared to create shared and static libraries. 
+Alpha,IA64 or VAX platform are supported. Optional argument "static" 
+tells to configurator to make static libraries only:
+
+$@[.VMS]CONFIGURE STATIC
+
+CONFIGURE script checks your ZLIB, FREETYPE, JPEG, PNG libraries. 
+If it detects any troubles, you may get and install good and tested ones 
+from OpenVMS libSDL porting project site:
+http://fafner.dyndns.org/~alexey/libsdl/required.html
+
+When success, it creates a building script named BUILD.COM
+
+3. Compilation:
+
+$@BUILD
+
+It should be error-free.
+
+When success, it creates a setup script named LIBGD$STARTUP.COM
+
+4. Setup OpenVMS environment before using libGD:
+
+$@LIBGD$STARTUP
+
+LIBGD and its utilites are ready to using.
+
+Optionally you may insert this startup file into your LOGIN.COM 
+to set libGD environment every time you login automatically.
+
+To learn libGD please refer libGD official documentation.
+Compiling with library should be:
+
+$CC/INCL=LIBGD PROG
+$LINK PROG, LIBGD:LIBGD/OPT
+
+
+
+yours,
+Alexey Chupahin
+Rostov-on-Don, Russia
+elvis_75@mail.ru  alex@rostov.rs-ultra.ru
 AC_PREREQ(2.54)
 
 #HEY! Change BOTH the version number and the GDLIB_REVISION setting!
-AC_INIT([GD], [2.0.34], [http://bugs.libgd.org])
+AC_INIT([GD], [2.1.0], [http://bugs.libgd.org])
 AC_CONFIG_SRCDIR([gd.c])
 AC_CONFIG_AUX_DIR(config)
 AC_CANONICAL_TARGET([])
 
 GDLIB_MAJOR=2
-GDLIB_MINOR=0
-GDLIB_REVISION=34
+GDLIB_MINOR=1
+GDLIB_REVISION=0
 GDLIBNAME=gd
 #Expanded by tests later in this file. TBB 2.0.26
 #2.0.28: GIF is standard now. Doesn't depend on anything else,
 extern "C" {
 #endif
 
-struct entities_s {
+static struct entities_s {
 	char	*name;
 	int	value;
 } entities[] = {
 	} else {
 		if (y2 < y1) {
 			int t = y1;
-			y2 = y1;
-			y1 = t;
+			y1 = y2;
+			y2 = t;
 		}
 
 		for (;y1 <= y2; y1++) {
 	nc =  gdImageTileGet(im,x,y);
 	pts = (int **) gdCalloc(sizeof(int *) * im->sy, sizeof(int));
 	if (!pts) {
-		return;	
+		return;
 	}
 
 	for (i=0; i<im->sy;i++) {
 		}
 		x = x1+1;
 		do {
-			for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
+			for (; x<wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
 				if (pts[y][x]){
 					/* we should never be here */
 					break;
 #define GD_H 1
 
 #define GD_MAJOR_VERSION 2
-#define GD_MINOR_VERSION 0
-#define GD_RELEASE_VERSION 34
+#define GD_MINOR_VERSION 1
+#define GD_RELEASE_VERSION 0
 #define GD_EXTRA_VERSION "alpha"
-#define GD_VERSION_STRING "2.0.34-alpha"
+#define GD_VERSION_STRING "2.1.0-alpha"
 
 
 /* Do the DLL dance: dllexport when building the DLL,
 #endif
 
 /* some might want to set DEFAULT_FONTPATH from configure in config.h */
+#ifdef NETWARE
+/* default fontpath for netware systems, could probably be handled in configure for 2.1 */
+#define DEFAULT_FONTPATH "sys:/java/nwgfx/lib/x11/fonts/ttf;."
+#define PATHSEPARATOR ";"
+#endif
 
 /* 2.0.23: more Type 1 fonts */
 #ifndef DEFAULT_FONTPATH
        unsigned char   c;
        unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
        unsigned char   localColorMap[3][MAXCOLORMAPSIZE];
-       int             imw, imh;
-       int             useGlobalColormap;
+       int             imw, imh, screen_width, screen_height;
+       int             gif87a, useGlobalColormap;
        int             bitPixel;
        int	       i;
        /*1.4//int             imageCount = 0; */
        /* 2.0.28: threadsafe storage */
        int ZeroDataBlock = FALSE;
+       int haveGlobalColormap;
 
        gdImagePtr im = 0;
        if (! ReadOK(fd,buf,6)) {
        if (strncmp((char *)buf,"GIF",3) != 0) {
 		return 0;
 	}
-
-       if ((strncmp((char *)buf+3, "87a", 3) != 0) && (strncmp((char *)buf+3, "89a", 3) != 0)) {
+		if (memcmp((char *)buf+3, "87a", 3) == 0) {
+			gif87a = 1;
+		} else if (memcmp((char *)buf+3, "89a", 3) == 0) {
+			gif87a = 0;
+		} else {
 		return 0;
 	}
+
        if (! ReadOK(fd,buf,7)) {
 		return 0;
 	}
+
        BitPixel        = 2<<(buf[4]&0x07);
 #if 0
        ColorResolution = (int) (((buf[4]&0x70)>>3)+1);
        Background      = buf[5];
        AspectRatio     = buf[6];
 #endif
-	   imw = LM_to_uint(buf[0],buf[1]);
-	   imh = LM_to_uint(buf[2],buf[3]);
+			screen_width = imw = LM_to_uint(buf[0],buf[1]);
+			screen_height = imh = LM_to_uint(buf[2],buf[3]);
 
-       if (BitSet(buf[4], LOCALCOLORMAP)) {    /* Global Colormap */
+			haveGlobalColormap = BitSet(buf[4], LOCALCOLORMAP);    /* Global Colormap */
+			if (haveGlobalColormap) {
                if (ReadColorMap(fd, BitPixel, ColorMap)) {
 			return 0;
 		}
        }
        for (;;) {
+							int top, left;
+							int width, height;
+
                if (! ReadOK(fd,&c,1)) {
                        return 0;
                }
                useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP);
 
                bitPixel = 1<<((buf[8]&0x07)+1);
-
-
-			   if (!useGlobalColormap) {
-				   if (ReadColorMap(fd, bitPixel, localColorMap)) {
-					   return 0;
-				   }
-			   }
-
-			   if (!(im = gdImageCreate(imw, imh))) {
+							left = LM_to_uint(buf[0], buf[1]);
+							top = LM_to_uint(buf[2], buf[3]);
+							width = LM_to_uint(buf[4], buf[5]);
+							height = LM_to_uint(buf[6], buf[7]);
+
+							if (left + width > screen_width || top + height > screen_height) {
+						 		if (VERBOSE) {
+									printf("Frame is not confined to screen dimension.\n");
+								}
+								return 0;
+							}
+
+			   if (!(im = gdImageCreate(width, height))) {
 				   return 0;
 			   }
 			   im->interlace = BitSet(buf[8], INTERLACE);
-               if (! useGlobalColormap) {
+			   if (!useGlobalColormap) {
                        if (ReadColorMap(fd, bitPixel, localColorMap)) { 
-                                 return 0;
-                       }
-                       ReadImage(im, fd, imw, imh, localColorMap, 
+													gdImageDestroy(im);
+					   return 0;
+				   }
+                       ReadImage(im, fd, width, height, localColorMap, 
                                  BitSet(buf[8], INTERLACE), &ZeroDataBlock); 
                } else {
-                       ReadImage(im, fd, imw, imh,
+							 				if (!haveGlobalColormap) {
+													gdImageDestroy(im);
+													return 0;
+                       }
+                       ReadImage(im, fd, width, height,
                                  ColorMap, 
                                  BitSet(buf[8], INTERLACE), &ZeroDataBlock);
                }
                if ((buf[0] & 0x1) != 0)
                        *Transparent = buf[3];
 
-               while (GetDataBlock(fd, (unsigned char*) buf, ZeroDataBlockP) > 0)
-                       ;
+               while (GetDataBlock(fd, (unsigned char*) buf, ZeroDataBlockP) > 0);
                return FALSE;
        default:
                break;
   /* */
   /* Send to PNG File then Ptr */
   /* */
+#ifdef VMS
+  sprintf (of, "%s-png", argv[1]);
+#else
   sprintf (of, "%s.png", argv[1]);
+#endif
   out = fopen (of, "wb");
   gdImagePng (im, out);
   fclose (out);
   /* */
   /* Send to GD2 File then Ptr */
   /* */
+#ifdef VMS
+  sprintf (of, "%s-gd2", argv[1]);
+#else
   sprintf (of, "%s.gd2", argv[1]);
+#endif
   out = fopen (of, "wb");
   gdImageGd2 (im, out, 128, 2);
   fclose (out);
   /* */
   /* Send to GD File then Ptr */
   /* */
+#ifdef VMS
+  sprintf (of, "%s-gd", argv[1]);
+#else
   sprintf (of, "%s.gd", argv[1]);
+#endif
   out = fopen (of, "wb");
   gdImageGd (im, out);
   fclose (out);
   gdImageDestroy (im2);
 
   /*
-     ** Test gdImageCreateFromPngSource'
-     * */
+   * Test gdImageCreateFromPngSource'
+   */
 
   in = fopen (argv[1], "rb");
 
 
 
   /*
-     ** Test gdImagePngToSink'
-     * */
-
+   * Test gdImagePngToSink'
+   */
+#ifdef VMS
+  sprintf (of, "%s-snk", argv[1]);
+#else
   sprintf (of, "%s.snk", argv[1]);
+#endif
   out = fopen (of, "wb");
   imgsnk.sink = fwriteWrapper;
   imgsnk.context = out;

src/tests/gd2/gd2_empty_file.c

 {
  	gdImagePtr im;
 	FILE *fp;
+	char path[1024];
 
-	fp = fopen("empty.gd2", "rb");
+	sprintf(path, "%s/gd2/empty.gd2", GDTEST_TOP_DIR);
+
+	fp = fopen(path, "rb");
 	if (!fp) {
-		printf("failed, cannot open file\n");
+		printf("failed, cannot open file (%s)\n", path);
 		return 1;
 	}
 

src/tests/gd2/gd2_read.c

 	int error;
  	gdImagePtr im;
 	FILE *fp;
+	char path[1024];
 
-	fp = fopen("conv_test.gd2", "rb");
+	sprintf(path, "%s/gd2/conv_test.gd2", GDTEST_TOP_DIR);
+
+	fp = fopen(path, "rb");
 	if (!fp) {
 		printf("failed, cannot open file\n");
 		return 1;
 	im = gdImageCreateFromGd2(fp);
 	fclose(fp);
 
-	if (!gdAssertImageEqualsToFile("conv_test_exp.png", im)) {
+	sprintf(path, "%s/gd2/conv_test_exp.png", GDTEST_TOP_DIR);
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 		gdImageDestroy(im);
 	} else {

src/tests/gdimagecopyrotated/bug00020.c

 #include "gd.h"
 #include "gdtest.h"
 
-#define exp_img "bug00020_exp.png"
 #define width 50
 
 int main()
 {
  	gdImagePtr im, im2;
  	int error = 0;
+	char path[1024];
+
+	sprintf(path, "%s/gdimagecopyrotated/bug00020_exp.png", GDTEST_TOP_DIR);
 
 	im = gdImageCreateTrueColor(width, width);
 	gdImageFilledRectangle(im, 0,0, width, width, 0xFF0000);
 
 	gdImageCopyRotated(im2, im, width / 2, width / 2, 0,0, width, width, 60);
 
-	if (!gdAssertImageEqualsToFile(exp_img, im2)) {
+	if (!gdAssertImageEqualsToFile(path, im2)) {
 		error = 1;
 	}
 

src/tests/gdimagefill/bug00002_1.c

 	gdImagePtr im;
 	int error = 0;
 	FILE *fp;
+	char path[1024];
 
 	fputs("flag 0\n", stdout);
 	im = gdImageCreateTrueColor(100, 100);
  	gdImagePng(im,fp);
 	fclose(fp);
 
-	if (!gdAssertImageEqualsToFile("bug00002_1_exp.png", im)) {
+	sprintf(path, "%s/gdimagefill/bug00002_1_exp.png", GDTEST_TOP_DIR);
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 

src/tests/gdimagefill/bug00002_2.c

 	int im_white, im_black, tile_white, tile_black;
 	int x,y, error = 0;
 	FILE *fp;
+	char path[1024];
 
 	fputs("flag 0\n", stdout);
 	im = gdImageCreate(150, 150);
 	gdImageFill(im, 0, 0, 0xffffff);
 	fputs("flag 2\n", stdout);
 
-	if (!gdAssertImageEqualsToFile("bug00002_2_exp.png", im)) {
+
+	sprintf(path, "%s/gdimagefill/bug00002_2_exp.png", GDTEST_TOP_DIR);
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 

src/tests/gdimagefill/bug00002_3.c

 	int im_white, im_black, tile_white, tile_black;
 	int x,y, error = 0;
 	FILE *fp;
+	char path[1024];
 
 	fputs("flag 0\n", stdout);
 	im = gdImageCreate(150, 150);
 	gdImageFill(im, 0, 0, 0xffffff);
 	fputs("flag 3\n", stdout);
 
-	if (!gdAssertImageEqualsToFile("bug00002_3_exp.png", im)) {
+	sprintf(path, "%s/gdimagefill/bug00002_3_exp.png", GDTEST_TOP_DIR);
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 

src/tests/gdimagefill/bug00002_4.c

  	gdImagePtr im;
 	FILE *fp;
 	int red, blue, white, black, error = 0;
+	char path[1024];
 
 	im = gdImageCreate(50,100);
 	red = gdImageColorAllocate(im, 255, 0, 0);
 	gdImageFill(im, 100,69, red);
 	gdImageFill(im, 100,21, white);
 
-	if (!gdAssertImageEqualsToFile("bug00002_4_exp.png", im)) {
+	sprintf(path, "%s/gdimagefill/bug00002_4_exp.png", GDTEST_TOP_DIR);
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 

src/tests/gdimagefilledellipse/bug00010.c

 #include "gd.h"
 #include "gdtest.h"
 
-#define exp_img "bug00010_exp.png"
-
 int main()
 {
  	gdImagePtr im;
  	int error = 0;
+	char path[1024];
 
 	im = gdImageCreateTrueColor(100,100);
 	gdImageFilledEllipse(im, 50,50, 70, 90, 0x50FFFFFF);
-	if (!gdAssertImageEqualsToFile(exp_img, im)) {
+
+	sprintf(path, "%s/gdimagefilledellipse/bug00010_exp.png", GDTEST_TOP_DIR);
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 

src/tests/gdimagefilledrectangle/CMakeLists.txt

+SET(TESTS_FILES
+	bug00004
+	bug00078
+)
 
-add_executable(bug00004 bug00004.c)
-target_link_libraries (bug00004 gdTest ${GD_LIB})
-ADD_TEST(bug00004 ${EXECUTABLE_OUTPUT_PATH}/bug00004)
+FOREACH(test_name ${TESTS_FILES})
+	add_executable(${test_name} "${test_name}.c")
+	target_link_libraries (${test_name} gdTest ${GD_LIB})
+	ADD_TEST(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
+ENDFOREACH(test_name)

src/tests/gdimagefilledrectangle/bug00078.c

 	 0x005e5e5e == c3 && 0x005e5e5e == c4)) {
 	 	return 1;
 	}
+
 	gdImageDestroy(im);
 	return 0;
 }

src/tests/gdimageline/CMakeLists.txt

 SET(TESTS_FILES
 	gdimageline_aa
 	gdimageline_aa_outofrange
+	bug00077
+	bug00072
 )
 
 FOREACH(test_name ${TESTS_FILES})

src/tests/gdimageline/bug00072.c

+#include "gdtest.h"
+#include "gd.h"
+
+int main()
+{
+ 	gdImagePtr im;
+	const char *exp = "bug00072_exp.png";
+	const int files_cnt = 4;
+	FILE *fp;
+	int i = 0;
+	int error = 0;
+
+	char path[1024];
+
+
+	im = gdImageCreateTrueColor(11, 11);
+	gdImageFilledRectangle(im, 0, 0, 10, 10, 0xFFFFFF);
+	gdImageSetThickness(im, 3);
+
+	gdImageLine(im, 5, 0, 5, 11, 0x000000);
+	gdImageLine(im, 0, 5, 11, 5, 0x000000);
+	gdImageLine(im, 0, 0, 11, 11, 0x000000);
+
+	gdImageSetThickness(im, 1);
+
+	gdImageLine(im, 5, 0, 5, 11, 0xFF0000);
+	gdImageLine(im, 0, 5, 11, 5, 0xFF0000);
+	gdImageLine(im, 0, 0, 11, 11, 0xFF0000);
+
+	sprintf(path, "%s/gdimageline/%s", GDTEST_TOP_DIR, exp);
+	if (!gdAssertImageEqualsToFile(path, im)) {
+		error = 1;
+	}
+
+	gdImageDestroy(im);
+
+	return error;
+}
Add a comment to this file

src/tests/gdimageline/bug00072_exp.png

Added
New image

src/tests/gdimageline/bug00077.c

 int main()
 {
  	gdImagePtr im;
-	const char *exp = "test.png";
+	const char *exp = "bug00077_exp.png";
 	const int files_cnt = 4;
 	FILE *fp;
 	int i = 0;

src/tests/gdimageline/gdimageline_aa.c