-lyx_LDADD = mathed/mathed.o insets/insets.o @INTLLIBS@ @LYX_LIBS@
-lyx_DEPENDENCIES = mathed insets
-EXTRA_DIST = config.h.in stamp-h.in
-ETAGS_ARGS = --c++
-INCLUDES = -I${top_srcdir}/images
+## libfrontends is given twice on the link line because it needs stuff
+## from FRONTEND_GUILIB and inversely. If you do not like it, feel
+## free to provide another solution... Maybe signals would solve that
+## magically, but I do not understand them much (JMarc)
+lyx_DEPENDENCIES = mathed/libmathed.la insets/libinsets.la \
+ graphics/libgraphics.la \
+ frontends/libfrontends.la @FRONTEND_GUILIB@ \
+ frontends/libfrontends.la \
+ frontends/support/libfrontendsupport.la support/libsupport.la \
+ @INCLUDED_SIGC@
+lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \
+ $(PSPELL_LIBS) @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@
+#lyx_LDFLAGS=-Wl,-O1
+EXTRA_DIST = config.h.in stamp-h.in cheaders
+ETAGS_ARGS = --lang=c++
+BOOST_INCLUDES = -I$(top_srcdir)/boost
+INCLUDES = $(SIGC_CFLAGS) $(BOOST_INCLUDES) $(PSPELL_INCLUDES) @FRONTEND_INCLUDES@
+localedir = $(datadir)/locale