+### check which frontend we want to use
+#LYX_USE_FRONTEND
+dnl The code below is not in a macro, because this would cause big
+dnl problems with the AC_REQUIRE contained in KDE_DO_IT_ALL.
+case "$lyx_use_frontend" in
+ xforms)
+ # for now don't set it for xforms as this is always entered
+ FRONTEND=""
+ FRONTEND_GUILIB="xforms/libxforms.la";;
+ gnome)
+ AM_PATH_GTKMM(1.2.1,,
+ AC_MSG_ERROR(Cannot find GTK--: Please install Version 1.2.1+))
+ AM_PATH_GNOMEMM
+
+dnl ******************************
+dnl LibGlade checking
+dnl ******************************
+dnl Ensure gnome-config is available...
+ AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
+ AC_MSG_CHECKING(for Glade libraries)
+ if $GNOME_CONFIG --libs libglade > /dev/null 2>&1; then
+ AC_MSG_RESULT(found)
+ else
+ AC_MSG_ERROR(Did not find libGlade installed)
+ fi
+
+ FRONTEND="gnome"
+ FRONTEND_GUILIB="gnome/libgnome.la"
+ FRONTEND_LDFLAGS="\$(GNOMEMM_LIBDIR)"
+ FRONTEND_INCLUDES="-I\${srcdir}/gnome \$(GNOMEMM_INCLUDEDIR) \$(GTKMM_CFLAGS)"
+ FRONTEND_LIBS="\$(GNOMEMM_LIBS) \$(GTKMM_LIBS) `gnome-config --libs libglade`";;
+ qt2)
+ QT2_DO_IT_ALL
+ FRONTEND="qt2"
+ FRONTEND_GUILIB="qt2/libqt2.la"
+ FRONTEND_LDFLAGS="\$(QT2_LDFLAGS)"
+ FRONTEND_INCLUDES="-I\${srcdir}/qt2 \$(QT2_INCLUDES)"
+ FRONTEND_LIBS="\$(QT2_LIBS)";;
+ *)
+ LYX_ERROR(Unknown frontend $lyx_use_frontend);;
+esac
+