+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=" -lodbc32 -lole32 -loleaut32 $LIBS"
+ 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* )
+ LDFLAGS="$LDFLAGS -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,
+ [
+ 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()
+
+ dnl we must link against lgthread unless the user
+ dnl used --disable-threads
+ GTK_MODULES=
+ if test "$wxUSE_THREADS" = "yes"; then
+ GTK_MODULES=gthread
+ fi
+
+ 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, , $GTK_MODULES)
+ fi
+
+ if test -z "$wx_cv_lib_gtk"; then
+ AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
+ fi
+
+ if test -z "$wx_cv_lib_gtk"; then
+ AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
+ 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
+ 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
+
+ dnl Find MGL library that we want
+ dnl FIXME_MGL - test for MGL variants for freebsd etc.
+ case "${host}" in
+ *-*-linux* )
+ mgl_os=linux/gcc/glibc
+ ;;
+ *-pc-msdosdjgpp )
+ mgl_os=dos32/dj2
+ ;;
+ *)
+ AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
+ esac
+
+ mgl_lib_type=""
+
+ if test "$wxUSE_DEBUG_FLAG" = yes ; then
+ if test -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.a -o \
+ -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.so; 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 -o \
+ -f $MGL_ROOT/lib/release/$mgl_os/libmgl.so; 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_MICROWIN" = 1; then
+ AC_MSG_CHECKING(for MicroWindows)
+ if test "x$MICROWINDOWS" = x ; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.])
+ else
+ AC_MSG_RESULT($MICROWINDOWS)
+ fi
+
+ if test -f $MICROWINDOWS/lib/libmwin.a; then
+ AC_MSG_RESULT(MicroWindows' libraries found.)
+ else
+ AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
+ fi
+
+ TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
+ GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
+
+ AFMINSTALL=afminstall
+ TOOLKIT=MICROWIN
+ GUIDIST=MICROWIN_DIST
+
+ TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__ -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
+ fi
+
+ if test "$wxUSE_WINE" = 1; then
+ AC_CHECK_HEADER(windows.h, [],
+ [
+ AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
+ ])
+
+ 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_LIBRARY="$GUI_TK_LIBRARY -lwine$mesa_link$xpm_link -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses"
+ TOOLKIT=MSW
+ GUIDIST=MSW_DIST
+ TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXWINE__"
+ fi
+
+ if test "$wxUSE_MOTIF" = 1; then
+ dnl use standard macros to check for X headers/libs, this brings support
+ dnl for the standard configure options --x-includes and --x-libraries
+ AC_PATH_XTRA
+
+ if test "$no_x" = "yes"; then
+ AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options)
+ fi
+
+ GUI_TK_LIBRARY="$X_LIBS"
+ TOOLKIT_INCLUDE="$X_CFLAGS"
+ AFMINSTALL=afminstall
+ COMPILED_X_PROGRAM=0
+
+ AC_MSG_CHECKING(for Motif/Lesstif headers)
+ WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)