+ if test "$wxUSE_GTK" = 1; then
+ AC_MSG_CHECKING([for GTK+ version])
+
+ gtk_version_cached=1
+ AC_CACHE_VAL(wx_cv_lib_gtk,
+ [
+ dnl stupid GTK+ AM macros produce their own messages, so we
+ dnl have to pass to the next line
+ gtk_version_cached=0
+ AC_MSG_RESULT("")
+
+ wx_cv_lib_gtk=
+ if test "x$wxUSE_GTK2" = "xyes"; then
+ AM_PATH_GTK_2_0(1.3.1, wx_cv_lib_gtk=2.0, gthread)
+ fi
+
+ if test -z "$wx_cv_lib_gtk"; then
+ AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7)
+ fi
+
+ if test -z "$wx_cv_lib_gtk"; then
+ AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3)
+ fi
+
+ if test -z "$wx_cv_lib_gtk"; then
+ dnl looks better in AC_MSG_RESULT
+ wx_cv_lib_gtk=none
+ else
+ dnl we need to cache GTK_CFLAGS and GTK_LIBS for the
+ dnl subsequent runs
+ wx_cv_cflags_gtk=$GTK_CFLAGS
+ wx_cv_libs_gtk=$GTK_LIBS
+ fi
+ ]
+ )
+
+ dnl if it wasn't cached, the messages from AM_PATH_GTK() above are
+ dnl enough
+ if test "$gtk_version_cached" = 1; then
+ AC_MSG_RESULT($wx_cv_lib_gtk)
+ fi
+
+ case "$wx_cv_lib_gtk" in
+ 2.0) WXGTK20=1
+ ;;
+ 1.2.7) WXGTK127=1
+ WXGTK12=1
+ ;;
+ 1.2.3) WXGTK12=1
+ ;;
+ *) AC_MSG_ERROR([
+Please check that gtk-config is in path, the directory
+where GTK+ libraries are installed (returned by
+'gtk-config --libs' command) is in LD_LIBRARY_PATH or
+equivalent variable and GTK+ is version 1.2.3 or above.
+ ])
+ ;;
+ esac
+
+ TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
+ GUI_TK_LIBRARY="$wx_cv_libs_gtk"
+
+ AFMINSTALL=afminstall
+ TOOLKIT=GTK
+ GUIDIST=GTK_DIST
+
+ dnl test for XIM support in libgdk
+ AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
+ fi
+
+ if test "$wxUSE_MGL" = 1; then
+ dnl FIXME_MGL - test for MGL's variants for freebsd etc.
+
+ AC_MSG_CHECKING(for SciTech MGL library)
+ if test "x$MGL_ROOT" = x ; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.])
+ else
+ AC_MSG_RESULT($MGL_ROOT)
+ fi
+
+ MGL_OS=linux/gcc/glibc
+ MGL_LIB_TYPE=""
+
+ if test "$wxUSE_DEBUG_FLAG" = yes ; then
+ if test -f $MGL_ROOT/lib/debug/$MGL_OS/libmgl.a ; then
+ MGL_LIB_TYPE=debug
+ fi
+ fi
+ if test "x$MGL_LIB_TYPE" = x ; then
+ if test -f $MGL_ROOT/lib/release/$MGL_OS/libmgl.a ; then
+ MGL_LIB_TYPE=release
+ else
+ AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.])
+ fi
+ fi
+
+ TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
+ GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$MGL_LIB_TYPE/$MGL_OS -lmgl -lmglcpp -lpm"
+
+ AFMINSTALL=afminstall
+ TOOLKIT=MGL
+ GUIDIST=MGL_DIST
+ fi
+
+ if test "$wxUSE_WINE" = 1; then
+ AC_MSG_CHECKING(for WINE includes)
+ WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
+ if test "$ac_find_includes" != "" ; then
+ AC_MSG_RESULT(found $ac_find_includes)
+ TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes"
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
+ fi
+
+ XPM_LINK=""
+ AC_MSG_CHECKING(for Xpm library)
+ WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
+ if test "$ac_find_libraries" != "" ; then
+ GUI_TK_LIBRARY="-L$ac_find_libraries"
+ XPM_LINK="-lXpm"
+ AC_DEFINE(wxHAVE_LIB_XPM)
+ AC_MSG_RESULT(found at $ac_find_libraries)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN(library will be compiled without support for images in XPM format)
+ fi
+
+ MESA_LINK=""
+ AC_MSG_CHECKING(for Mesa library)
+ WX_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
+ if test "$ac_find_libraries" != "" ; then
+ GUI_TK_LIBRARY="$GUI_TK_LIBRARY -L$ac_find_libraries"
+ MESA_LINK="-lMesaGL"
+ AC_MSG_RESULT(found at $ac_find_libraries)
+ else
+ AC_MSG_ERROR(no)
+ fi
+
+ GUI_TK_LINK="-lwine $MESA_LINK $XPM_LINK -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses"
+ GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
+ WXWINE=1
+ TOOLKIT=MSW
+ GUIDIST=MSW_DIST
+ fi
+
+ dnl use standard macros to check for X headers/libs, this brings support
+ dnl for the standard configure options --x-includes and --x-libraries;
+ dnl the path to the X headers/libs is not only needed for motif, but also
+ dnl by the OpenGL and XKBlib.h checks further down