+ 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
+ if test "$wxUSE_LIBJPEG" = "sys" ; then
+ AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version])
+ else
+ AC_MSG_WARN([system jpeg library not found, will use built-in instead])
+ wxUSE_LIBJPEG=builtin
+ fi
+ else
+ dnl we are using the system library
+ wxUSE_LIBJPEG=sys
+ fi
+ fi
+
+ if test "$wxUSE_LIBJPEG" = "builtin" ; then
+ JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg"
+ fi
+fi
+
+dnl ------------------------------------------------------------------------
+dnl Check for tiff library
+dnl ------------------------------------------------------------------------
+
+TIFF_INCLUDE=
+TIFF_LINK=
+if test "$wxUSE_LIBTIFF" != "no" ; then
+ AC_DEFINE(wxUSE_LIBTIFF)
+
+ if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then
+ AC_CHECK_HEADER(tiffio.h,
+ AC_CHECK_LIB(tiff, TIFFError,
+ TIFF_LINK="-ltiff",
+ ,
+ -lm)
+ )
+
+ if test "x$TIFF_LINK" = "x" ; then
+ if test "$wxUSE_LIBTIFF" = "sys" ; then
+ AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version])
+ else
+ AC_MSG_WARN([system tiff library not found, will use built-in instead])
+ wxUSE_LIBTIFF=builtin
+ fi
+ else
+ dnl we are using the system library
+ wxUSE_LIBTIFF=sys
+ fi
+ fi
+
+ if test "$wxUSE_LIBTIFF" = "builtin" ; then
+ TIFF_INCLUDE="-I\${top_srcdir}/src/tiff"
+ fi
+fi
+
+dnl ------------------------------------------------------------------------
+dnl Check for freetype library
+dnl ------------------------------------------------------------------------
+
+FREETYPE_INCLUDE=
+FREETYPE_LINK=
+if test "$wxUSE_FREETYPE" != "no" ; then
+ AC_DEFINE(wxUSE_FREETYPE)
+
+ if test "$wxUSE_FREETYPE" = "sys" -o "$wxUSE_FREETYPE" = "yes" ; then
+ AC_CHECK_HEADER(freetype.h,
+ AC_CHECK_LIB(freetype, FT_Render_Glyph,
+ FREETYPE_LINK="-lfreetype",
+ ,
+ [-lm])
+ )
+
+ if test "x$FREETYPE_LINK" = "x" ; then
+ if test "$wxUSE_FREETYPE" = "sys" ; then
+ AC_MSG_ERROR([system freetype library not found! Use --with-freetype=builtin to use built-in version])
+ else
+ AC_MSG_WARN([system freetype library not found, will use built-in instead])
+ wxUSE_FREETYPE=builtin
+ fi
+ else
+ dnl we are using the system library
+ wxUSE_FREETYPE=sys
+ fi
+ fi
+
+ if test "$wxUSE_FREETYPE" = "builtin" ; then
+ FREETYPE_INCLUDE="-I\${top_srcdir}/src/freetype"
+ fi
+fi
+
+dnl ----------------------------------------------------------------
+dnl search for toolkit (widget sets)
+dnl ----------------------------------------------------------------
+
+AFMINSTALL=
+
+TOOLKIT=
+TOOLKIT_INCLUDE=
+WIDGET_SET=
+
+dnl are we building for a win32 target environment?
+dnl If so, setup common stuff needed for both GUI and Base libs.
+if test "$USE_WIN32" = 1 ; then
+ AC_CHECK_HEADERS(w32api.h)
+ AC_CHECK_HEADER(windows.h, [],
+ [
+ AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
+ ])
+
+ dnl check if can use _WIN32_IE macro
+ AC_CACHE_CHECK([if w32api has good enough MSIE support], wx_cv_w32api_win32_ie,
+ [
+ AC_TRY_COMPILE([#include <w32api.h>],
+ [
+ #define wxCHECK_W32API_VERSION( major, minor ) \
+ ( defined( __W32API_MAJOR_VERSION ) && defined( __W32API_MINOR_VERSION ) \
+ && ( ( __W32API_MAJOR_VERSION > (major) ) \
+ || ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor))))
+
+ #if !wxCHECK_W32API_VERSION(1,1)
+ #error You need w32api 1.1 or newer
+ #endif
+ ], [
+ wx_cv_w32api_win32_ie=yes
+ ], [
+ wx_cv_w32api_win32_ie=no
+ ])
+ ])
+ if test "$wx_cv_w32api_win32_ie" = "yes" ; then
+ CPPFLAGS="$CPPFLAGS -D_WIN32_IE=0x400"
+ fi
+
+ dnl --- FIXME: This is still a somewhat random list of libs,
+ dnl --- some of them should probably be included conditionally.
+ LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32"
+
+ case "${host}" in
+ *-*-cygwin* )
+ dnl Cygwin doesn't include these by default
+ LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32"
+ TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WIN95__"
+ esac
+
+ dnl add extra odbc libs if we have compiled in odbc
+ if test "$wxUSE_ODBC" = "yes" ; then
+ LIBS="$LIBS -lodbc32 -lole32 -loleaut32"
+ fi
+
+ RESFLAGS="--include-dir \$(top_srcdir)/include --include-dir \$(top_srcdir)/\$(program_dir) --define __WIN32__ --define __WIN95__ --define __GNUWIN32__"
+ RESPROGRAMOBJ="\$(PROGRAM)_resources.o"
+fi
+
+if test "$wxUSE_GUI" = "yes"; then
+ USE_GUI=1
+
+ GUI_TK_LIBRARY=
+
+ WXGTK12=
+ WXGTK127=
+ WXGTK20=
+
+ if test "$wxUSE_MSW" = 1 ; then
+ TOOLKIT=MSW
+ GUIDIST=MSW_DIST
+
+ dnl -mwindows causes a heap of other default gui libs to be linked in.
+ dnl FIXME: If cygwin needs this, please push it above, if not, please
+ dnl remove this comment :-)
+ case "${host}" in
+ *-*-mingw32* )
+ EXTRA_LIBS="$EXTRA_LIBS -Wl,--subsystem,windows -mwindows"
+ esac
+ fi
+
+ if test "$wxUSE_GTK" = 1; then
+ AC_MSG_CHECKING([for GTK+ version])
+
+ gtk_version_cached=1
+ AC_CACHE_VAL(wx_cv_lib_gtk,