-dnl ---------------------------------------------------------------------------
-dnl Optional libraries
-dnl ---------------------------------------------------------------------------
-
-ZLIB_INCLUDE=
-if test "$wxUSE_ZLIB" = "yes" -o "$wxUSE_ZLIB" = "sys" ; then
- AC_DEFINE(wxUSE_ZLIB)
- if test "$wxUSE_ZLIB" = "yes" ; then
- ZLIB_INCLUDE="-I\${top_srcdir}/src/zlib"
- else
- ZLIB_LINK=
- AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, deflate, ZLIB_LINK="-lz"))
- if test "x$ZLIB_LINK" = "x" ; then
- AC_MSG_ERROR(system zlib compression library not found! Use --with-zlib=yes to use built-in zlib)
- fi
- fi
-fi
-
-PNG_INCLUDE=
-if test "$wxUSE_LIBPNG" = "yes" -o "$wxUSE_LIBPNG" = "sys" ; then
- AC_DEFINE(wxUSE_LIBPNG)
- dnl for the check below to have a chance to succeed, we must already have
- dnl libz somewhere
- if test "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then
- AC_MSG_WARN([--with-libpng=sys doesn't work without --with-zlib=sys, will compile the built-in libpng instead])
- wxUSE_LIBPNG=yes
- fi
-
- if test "$wxUSE_LIBPNG" = "yes" ; then
- PNG_INCLUDE="-I\${top_srcdir}/src/png"
- else
- PNG_LINK=
- AC_CHECK_HEADER(png.h,
- AC_CHECK_LIB(png, png_check_sig,
- PNG_LINK="-lpng",
- ,
- [-lz -lm])
- )
- if test "x$PNG_LINK" = "x" ; then
- AC_MSG_ERROR(system png library not found! Use --with-libpng=yes to use the built-in libpng)
- fi
- fi
-
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png"
-fi
-
-JPEG_INCLUDE=
-if test "$wxUSE_LIBJPEG" = "yes" -o "$wxUSE_LIBJPEG" = "sys" ; then
- AC_DEFINE(wxUSE_LIBJPEG)
- if test "$wxUSE_LIBJPEG" = "yes" ; then
- JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg"
- else
- JPEG_LINK=
- dnl can't use AC_CHECK_HEADER as jconfig.h defines things like
- dnl HAVE_STDLIB_H which are already defined and this provokes
- dnl a compiler warning which configure considers as an error...
- AC_MSG_CHECKING(for jpeglib.h)
- AC_CACHE_VAL(ac_cv_header_jpeglib_h,
- AC_TRY_COMPILE(
- [
- #undef HAVE_STDLIB_H
- #include <stdio.h>
- #include <jpeglib.h>
- ],
- [
- ],
- ac_cv_header_jpeglib_h=yes,
- ac_cv_header_jpeglib_h=no
- )
- )
- AC_MSG_RESULT($ac_cv_header_jpeglib_h)
-
- if test "$ac_cv_header_jpeglib_h" = "yes"; then
- AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK="-ljpeg")
- fi
-
- if test "x$JPEG_LINK" = "x" ; then
- AC_MSG_ERROR(system jpeg library not found! Use --with-libjpeg=yes to use the built-in one)
- fi
- fi
-fi
-
-TIFF_INCLUDE=
-if test "$wxUSE_LIBTIFF" = "yes" -o "$wxUSE_LIBTIFF" = "sys" ; then
- AC_DEFINE(wxUSE_LIBTIFF)
- if test "$wxUSE_LIBTIFF" = "yes" ; then
- TIFF_INCLUDE="-I\${top_srcdir}/src/tiff"
- else
- TIFF_LINK=
- AC_CHECK_HEADER(tiffio.h, AC_CHECK_LIB(tiff, TIFFError,
- TIFF_LINK="-ltiff",
- ,
- -lm))
- if test "x$TIFF_LINK" = "x" ; then
- AC_MSG_ERROR(system tiff library not found! Use --with-libtiff=yes to use the built-in one)
- fi
- fi
-fi
-
-FREETYPE_INCLUDE=
-if test "$wxUSE_FREETYPE" = "yes" -o "$wxUSE_FREETYPE" = "sys" ; then
- AC_DEFINE(wxUSE_FREETYPE)
- if test "$wxUSE_FREETYPE" = "yes" ; then
- FREETYPE_INCLUDE="-I\${top_srcdir}/src/freetype"
- else
- FREETYPE_LINK=
- AC_CHECK_HEADER(freetype.h,
- AC_CHECK_LIB(freetype, FT_Render_Glyph,
- FREETYPE_LINK="-lfreetype",
- ,
- [-lm])
- )
- if test "x$FREETYPE_LINK" = "x" ; then
- AC_MSG_ERROR(system freetype library not found! Use --with-freetype=yes to use the built-in freetype)
- fi
- fi
-fi
-
-if test "$wxUSE_OPENGL" = "yes"; then
- AC_CHECK_HEADER(GL/gl.h, [
- AC_DEFINE(wxUSE_OPENGL)
- AC_DEFINE(wxUSE_GLCANVAS)
- AC_CHECK_LIB(GL, glFlush, [
- OPENGL_LINK="-lGL -lGLU"
- ],[
- AC_CHECK_LIB(MesaGL, glFlush, [
- OPENGL_LINK="-lMesaGL -lMesaGLU"
- ],)
- ],)
- ],wxUSE_OPENGL=0)
-fi
-