diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-24 18:29:06 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-24 18:29:06 +0000 |
| commit | 7b99f66d03c60cfd8b46e3350420ef07d1fdcc9c (patch) | |
| tree | 6eca8e182be22dcb72e57754865c0a8be347a7b4 | |
| parent | f87f7a7b1491efaeb52128b393e73c3a2ca4f733 (diff) | |
Add check for libpng/png.h as well as png.h, and include the appropriate
one as needed...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2106 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | configh.in | 13 | ||||
| -rw-r--r-- | configure.in | 12 | ||||
| -rw-r--r-- | makefiles/config.mingw | 12 | ||||
| -rw-r--r-- | makefiles/config.os2x | 13 | ||||
| -rw-r--r-- | src/Fl_PNG_Image.cxx | 22 | ||||
| -rw-r--r-- | visualc/config.h | 12 |
7 files changed, 59 insertions, 27 deletions
@@ -1,5 +1,7 @@ CHANGES IN FLTK 1.1.0rc1 + - Updated the PNG library check to support both png.h + and libpng/png.h. - Fixed a recursion bug in tooltips that was causing random crashes. - fl_file_chooser() could cause a segfault when passed a diff --git a/configh.in b/configh.in index 1eb821399..59911f471 100644 --- a/configh.in +++ b/configh.in @@ -1,5 +1,5 @@ /* - * "$Id: configh.in,v 1.11.2.11.2.9 2002/03/25 21:56:41 easysw Exp $" + * "$Id: configh.in,v 1.11.2.11.2.10 2002/04/24 18:29:05 easysw Exp $" * * Configuration file for the Fast Light Tool Kit (FLTK). * @configure_input@ @@ -30,7 +30,6 @@ #define FLTK_DOCDIR "" - /* * BORDER_WIDTH: * @@ -197,6 +196,13 @@ #undef HAVE_LIBJPEG /* + * Which header file do we include for libpng? + */ + +#undef HAVE_PNG_H +#undef HAVE_LIBPNG_PNG_H + +/* * Do we have the png_xyz() functions? */ @@ -204,7 +210,6 @@ #undef HAVE_PNG_SET_TRNS_TO_ALPHA #undef HAVE_PNG_READ_DESTROY - /* * Do we have POSIX threading? */ @@ -214,5 +219,5 @@ /* - * End of "$Id: configh.in,v 1.11.2.11.2.9 2002/03/25 21:56:41 easysw Exp $". + * End of "$Id: configh.in,v 1.11.2.11.2.10 2002/04/24 18:29:05 easysw Exp $". */ diff --git a/configure.in b/configure.in index 0ac9262cb..492708a29 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl -*- sh -*- dnl the "configure" script is made from this by running GNU "autoconf" dnl -dnl "$Id: configure.in,v 1.33.2.31.2.61 2002/04/16 17:11:11 easysw Exp $" +dnl "$Id: configure.in,v 1.33.2.31.2.62 2002/04/24 18:29:05 easysw Exp $" dnl dnl Configuration script for the Fast Light Tool Kit (FLTK). dnl @@ -285,12 +285,16 @@ AC_CHECK_HEADER(zlib.h, IMAGELIBS="$IMAGELIBS -lz" LIBS="$LIBS -lz")) -AC_CHECK_HEADER(png.h, +AC_CHECK_HEADER(png.h, AC_DEFINE(HAVE_PNG_H)) +AC_CHECK_HEADER(libpng/png.h, AC_DEFINE(HAVE_LIBPNG_PNG_H)) + +if test x$ac_cv_header_png_h = xyes -o x$ac_cv_header_libpng_png_h = xyes; then AC_CHECK_LIB(png, png_read_rows, AC_DEFINE(HAVE_LIBPNG) IMAGELIBS="-lpng $IMAGELIBS" LIBS="-lpng $LIBS" - AC_CHECK_FUNCS(png_get_valid png_set_tRNS_to_alpha png_read_destroy))) + AC_CHECK_FUNCS(png_get_valid png_set_tRNS_to_alpha png_read_destroy)) +fi dnl Restore original LIBS settings... LIBS="$SAVELIBS" @@ -720,5 +724,5 @@ dnl Make sure the fltk-config script is executable... chmod +x fltk-config dnl -dnl End of "$Id: configure.in,v 1.33.2.31.2.61 2002/04/16 17:11:11 easysw Exp $". +dnl End of "$Id: configure.in,v 1.33.2.31.2.62 2002/04/24 18:29:05 easysw Exp $". dnl diff --git a/makefiles/config.mingw b/makefiles/config.mingw index ef1c3c421..100951d19 100644 --- a/makefiles/config.mingw +++ b/makefiles/config.mingw @@ -1,5 +1,5 @@ /* - * "$Id: config.mingw,v 1.1.2.3.2.2 2001/10/19 14:04:08 easysw Exp $" + * "$Id: config.mingw,v 1.1.2.3.2.3 2002/04/24 18:29:05 easysw Exp $" * * Configuration file for the Fast Light Tool Kit (FLTK). * @@ -29,7 +29,6 @@ #define FLTK_DOCDIR "C:/FLTK/DOC" - /* * BORDER_WIDTH: * @@ -174,6 +173,13 @@ #undef HAVE_LIBJPEG /* + * Which header file do we include for libpng? + */ + +#undef HAVE_PNG_H +#undef HAVE_LIBPNG_PNG_H + +/* * Do we have the png_xyz() functions? */ @@ -183,5 +189,5 @@ /* - * End of "$Id: config.mingw,v 1.1.2.3.2.2 2001/10/19 14:04:08 easysw Exp $". + * End of "$Id: config.mingw,v 1.1.2.3.2.3 2002/04/24 18:29:05 easysw Exp $". */ diff --git a/makefiles/config.os2x b/makefiles/config.os2x index 70178494e..aa3574d62 100644 --- a/makefiles/config.os2x +++ b/makefiles/config.os2x @@ -1,6 +1,6 @@ /* config.h. Generated automatically by configure. */ /* - * "$Id: config.os2x,v 1.1.2.4.2.4 2002/03/26 18:47:01 easysw Exp $" + * "$Id: config.os2x,v 1.1.2.4.2.5 2002/04/24 18:29:05 easysw Exp $" * * Configuration file for the Fast Light Tool Kit (FLTK). * @configure_input@ @@ -31,7 +31,6 @@ #define FLTK_DOCDIR "/usr/local/share/doc/fltk" - /* * BORDER_WIDTH: * @@ -198,6 +197,13 @@ #define HAVE_LIBJPEG 1 /* + * Which header file do we include for libpng? + */ + +#define HAVE_PNG_H +#undef HAVE_LIBPNG_PNG_H + +/* * Do we have the png_xyz() functions? */ @@ -205,7 +211,6 @@ /* #undef HAVE_PNG_SET_TRNS_TO_ALPHA */ #define HAVE_PNG_READ_DESTROY 1 - /* * Do we have POSIX threading? */ @@ -215,5 +220,5 @@ /* - * End of "$Id: config.os2x,v 1.1.2.4.2.4 2002/03/26 18:47:01 easysw Exp $". + * End of "$Id: config.os2x,v 1.1.2.4.2.5 2002/04/24 18:29:05 easysw Exp $". */ diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx index 8053755d6..99a0537ea 100644 --- a/src/Fl_PNG_Image.cxx +++ b/src/Fl_PNG_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_PNG_Image.cxx,v 1.1.2.4 2002/01/01 15:11:31 easysw Exp $" +// "$Id: Fl_PNG_Image.cxx,v 1.1.2.5 2002/04/24 18:29:05 easysw Exp $" // // Fl_PNG_Image routines. // @@ -39,10 +39,14 @@ extern "C" { -#ifdef HAVE_LIBPNG +#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ) # include <zlib.h> -# include <png.h> -#endif // HAVE_LIBPNG +# ifdef HAVE_PNG_H +# include <png.h> +# else +# include <libpng/png.h> +# endif // HAVE_PNG_H +#endif // HAVE_LIBPNG ** HAVE_LIBZ } @@ -52,7 +56,7 @@ extern "C" Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read : Fl_RGB_Image(0,0,0) { -#ifdef HAVE_LIBPNG +#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ) int i; // Looping var FILE *fp; // File pointer int channels; // Number of color channels @@ -97,11 +101,11 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read else if (info->bit_depth == 16) png_set_strip_16(pp); -#if defined(HAVE_PNG_GET_VALID) && defined(HAVE_SET_TRNS_TO_ALPHA) +# if defined(HAVE_PNG_GET_VALID) && defined(HAVE_SET_TRNS_TO_ALPHA) // Handle transparency... if (png_get_valid(pp, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(pp); -#endif // HAVE_PNG_GET_VALID && HAVE_SET_TRNS_TO_ALPHA +# endif // HAVE_PNG_GET_VALID && HAVE_SET_TRNS_TO_ALPHA array = new uchar[w() * h() * d()]; @@ -126,10 +130,10 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read # endif // HAVE_PNG_READ_DESTROY fclose(fp); -#endif // HAVE_LIBPNG +#endif // HAVE_LIBPNG && HAVE_LIBZ } // -// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.4 2002/01/01 15:11:31 easysw Exp $". +// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.5 2002/04/24 18:29:05 easysw Exp $". // diff --git a/visualc/config.h b/visualc/config.h index d803d2d5c..ba54bef4f 100644 --- a/visualc/config.h +++ b/visualc/config.h @@ -1,5 +1,5 @@ /* - * "$Id: config.h,v 1.5.2.5.2.5 2002/01/01 15:11:33 easysw Exp $" + * "$Id: config.h,v 1.5.2.5.2.6 2002/04/24 18:29:06 easysw Exp $" * * Configuration file for the Fast Light Tool Kit (FLTK) for Visual C++. * @@ -29,7 +29,6 @@ #define FLTK_DOCDIR "C:/FLTK/DOC" - /* * BORDER_WIDTH: * @@ -168,6 +167,13 @@ #undef HAVE_LIBJPEG /* + * Which header file do we include for libpng? + */ + +#undef HAVE_PNG_H +#undef HAVE_LIBPNG_PNG_H + +/* * Do we have the png_xyz() functions? */ @@ -176,5 +182,5 @@ /* - * End of "$Id: config.h,v 1.5.2.5.2.5 2002/01/01 15:11:33 easysw Exp $". + * End of "$Id: config.h,v 1.5.2.5.2.6 2002/04/24 18:29:06 easysw Exp $". */ |
