allow to compile several frontends at once (and produce several binaries)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7485 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2003-08-02 20:01:52 +00:00
parent 2ad6599081
commit 02aa32e2eb
15 changed files with 111 additions and 75 deletions

View File

@ -1,3 +1,9 @@
2003-08-02 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* configure.ac: only configure the frontends that have been
specified; build in FRONTENDS_PROGS the list of programs that
should be built
2003-07-31 John Levon <levon@movementarian.org>
* NEWS:

View File

@ -1,3 +1,14 @@
2003-08-02 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* xforms.m4 (XFORMS_DO_IT_ALL): new macro, which calls all the
xforms stuff and AC_SUBSTs XFORMS_LIBS with all libraries needed
by the xforms frontend
* lyxinclude.m4 (LYX_USE_FRONTENDS): renamed from
LYX_USE_FRONTEND. Can now accept a list of frontends; the
variables defines there are now FRONTENDS, FRONTENDS_SUBDIRS and
FRONTENDS_PROGS.
2003-07-29 Lars Gullik Bjønnes <larsbj@gullik.net>
* lyxinclude.m4: use AC_HELP_STRING

View File

@ -585,20 +585,18 @@ rm -f conftest*])
])
### end of LYX_PATH_HEADER
### Check which frontend we want to use. The default is XForms
### Check which frontends we want to use. The default is XForms only
###
AC_DEFUN(LYX_USE_FRONTEND,
[AC_MSG_CHECKING([what frontend should be used as main GUI])
AC_DEFUN(LYX_USE_FRONTENDS,
[AC_MSG_CHECKING([what frontend should be used for the GUI])
AC_ARG_WITH(frontend,
[ --with-frontend=THIS Use THIS frontend as main GUI:
Possible values: xforms, qt],
[lyx_use_frontend="$withval"], [lyx_use_frontend="xforms"])
AC_MSG_RESULT($lyx_use_frontend)
AC_SUBST(FRONTEND)
AC_SUBST(FRONTEND_GUILIB)
AC_SUBST(FRONTEND_LDFLAGS)
AC_SUBST(FRONTEND_INCLUDES)
AC_SUBST(FRONTEND_LIBS)
[FRONTENDS="$withval"], [FRONTENDS="xforms"])
AC_MSG_RESULT($FRONTENDS)
AC_SUBST(FRONTENDS)
AC_SUBST(FRONTENDS_SUBDIRS)
AC_SUBST(FRONTENDS_PROGS)
])

View File

@ -5,7 +5,6 @@ AC_DEFUN(LYX_PATH_XPM,[
### Check for Xpm library
AC_CHECK_LIB(Xpm, XpmCreateBufferFromImage, XPM_LIB="-lXpm",
[LYX_LIB_ERROR(libXpm,Xpm)])
AC_SUBST(XPM_LIB)
### Check for Xpm headers
lyx_cv_xpm_h_location="<xpm.h>"
AC_CHECK_HEADER(X11/xpm.h,[
@ -13,8 +12,6 @@ AC_CHECK_HEADER(X11/xpm.h,[
lyx_cv_xpm_h_location="<X11/xpm.h>"],[
AC_CHECK_HEADER(xpm.h,[],[
LYX_LIB_ERROR(xpm.h,Xpm)])])
#AC_DEFINE_UNQUOTED(XPM_H_LOCATION,$lyx_cv_xpm_h_location,
# [define this to the location of xpm.h to be used with #include, e.g. <xpm.h>])
AC_SUBST(XPM_H_LOCATION,$lyx_cv_xpm_h_location)
### Test for the header version
if test $ac_cv_header_xpm_h = yes; then
@ -61,7 +58,6 @@ AC_REQUIRE([LYX_PATH_XPM])
AC_CHECK_LIB(forms, fl_initialize, XFORMS_LIB="-lforms",
[AC_CHECK_LIB(xforms, fl_initialize, XFORMS_LIB="-lxforms",
[LYX_LIB_ERROR(libforms or libxforms,xforms)], $XPM_LIB)], $XPM_LIB)
AC_SUBST(XFORMS_LIB)
### Check for xforms headers
lyx_cv_forms_h_location="<forms.h>"
@ -108,7 +104,7 @@ fi
dnl Check the details of the xforms image loader
AC_DEFUN(LYX_CHECK_XFORMS_IMAGE_LOADER,
AC_DEFUN([LYX_CHECK_XFORMS_IMAGE_LOADER],
[AC_REQUIRE([LYX_PATH_XFORMS])
save_LIBS=$LIBS
LIBS="$XFORMS_LIB $XPM_LIB $LIBS"
@ -134,8 +130,6 @@ AC_SEARCH_LIBS(flimage_dup, flimage,
XFORMS_IMAGE_LIB="-lflimage $XFORMS_IMAGE_LIB"
fi])
AC_SUBST(XFORMS_IMAGE_LIB)
if test $lyx_use_jpeg_image_loader = yes ; then
lyx_flags="$lyx_flags xforms-image-loader"
AC_DEFINE(USE_JPEG_IMAGE_LOADER, 1,
@ -144,3 +138,10 @@ fi
AC_LANG_RESTORE
LIBS=$save_LIBS])
dnl Do all check required to use xforms
AC_DEFUN([XFORMS_DO_IT_ALL],
[LYX_PATH_XPM
LYX_PATH_XFORMS
LYX_CHECK_XFORMS_IMAGE_LOADER
AC_SUBST(XFORMS_LIBS, ["$XFORMS_IMAGE_LIB $XFORMS_LIB $XPM_LIB"])])

View File

@ -56,7 +56,7 @@ AC_ISC_POSIX
AC_AIX
### check which frontend we want to use
LYX_USE_FRONTEND
LYX_USE_FRONTENDS
### Check for a C++ compiler
LYX_PROG_CXX
@ -161,50 +161,47 @@ esac
### check which frontend we want to use
# XForms tests
LYX_PATH_XPM
LYX_PATH_XFORMS
LYX_CHECK_XFORMS_IMAGE_LOADER
# QT tests
QT_DO_IT_ALL
#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)
FRONTEND="xforms"
RPM_FRONTEND="xforms"
RPM_FRONTEND_DEPS='libforms >= 1.0'
FRONTEND_GUILIB="frontends/xforms/libxforms.la"
FRONTEND_INFO=" libXpm version: ${XPM_VERSION}\n\
libforms version: ${XFORMS_VERSION}\n"
;;
dnl gnome)
dnl LYX_PATH_XPM
dnl LYX_PATH_XFORMS
dnl LYX_CHECK_XFORMS_IMAGE_LOADER
dnl PKG_CHECK_MODULES(GNOME_FRONTEND, gtkmm-2.0 libglademm-2.0)
dnl AC_SUBST(GNOME_FRONTEND_CFLAGS)
dnl AC_SUBST(GNOME_FRONTEND_LIBS)
dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL.
for frontend in $FRONTENDS ; do
case "$frontend" in
xforms)
XFORMS_DO_IT_ALL
FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-xforms"
FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS xforms"
RPM_FRONTEND="xforms"
RPM_FRONTEND_DEPS='libforms >= 1.0'
FRONTEND_INFO="${FRONTEND_INFO}\
XForms Frontend:\n\
libXpm version: ${XPM_VERSION}\n\
libforms version: ${XFORMS_VERSION}\n"
;;
dnl gnome)
dnl XFORMS_DO_IT_ALL
dnl PKG_CHECK_MODULES(GNOME_FRONTEND, gtkmm-2.0 libglademm-2.0)
dnl AC_SUBST(GNOME_FRONTEND_CFLAGS)
dnl AC_SUBST(GNOME_FRONTEND_LIBS)
dnl FRONTEND="xforms gnome"
dnl FRONTEND_GUILIB="gnome/*.lo"
dnl FRONTEND_LDFLAGS="${GNOME_FRONTEND_LIBS}"
dnl FRONTEND_INCLUDES="${GNOME_FRONTEND_CFLAGS}"
dnl FRONTEND_LIBS="@XPM_LIB@ @XFORMS_LIB@ ${GNOME_FRONTEND_LIBS}"
dnl ;;
qt)
RPM_FRONTEND="qt"
RPM_FRONTEND_DEPS='qt >= 2.2.1'
FRONTEND="qt2"
FRONTEND_GUILIB="frontends/qt2/libqt2.la"
FRONTEND_INCLUDES="\$(QT_INCLUDES)"
FRONTEND_INFO=" Qt version: ${QT_VERSION}\n"
;;
*)
LYX_ERROR(Unknown frontend $lyx_use_frontend);;
esac
dnl FRONTEND="xforms gnome"
dnl FRONTEND_GUILIB="gnome/*.lo"
dnl FRONTEND_LDFLAGS="${GNOME_FRONTEND_LIBS}"
dnl FRONTEND_INCLUDES="${GNOME_FRONTEND_CFLAGS}"
dnl FRONTEND_LIBS="@XPM_LIB@ @XFORMS_LIB@ ${GNOME_FRONTEND_LIBS}"
dnl ;;
qt)
QT_DO_IT_ALL
FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-qt"
FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS qt2"
RPM_FRONTEND="qt"
RPM_FRONTEND_DEPS='qt >= 2.2.1'
FRONTEND_INFO="${FRONTEND_INFO}\
Qt Frontend:\n\
Qt version: ${QT_VERSION}\n"
;;
*)
LYX_ERROR(Unknown frontend $lyx_use_frontend);;
esac
done
### Setup GNU gettext
dnl GNU gettext is written in C
@ -287,7 +284,6 @@ VERSION_INFO="Configuration\n\
C++ Compiler: ${CXX} ${CXX_VERSION}\n\
C++ Compiler flags: ${CXXFLAGS}\n\
Linker flags: ${LDFLAGS}\n\
Frontend: ${lyx_use_frontend}\n\
${FRONTEND_INFO}\
LyX binary dir: ${real_bindir}\n\
LyX files dir: ${real_datadir}\n"

View File

@ -1,3 +1,9 @@
2003-08-02 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Makefile.am: move things around so that both lyx-qt and
lyx-xforms can be built (according to --with-frontend). Then lyx
is a symbolic link to lyx-[firstfrontend]
2003-08-02 Lars Gullik Bjønnes <larsbj@lyx.org>
* Always use std::endl with lyxerr

View File

@ -14,12 +14,10 @@ EXTRA_DIST = config.h.in stamp-h.in cheaders version.C.in \
tracer.C \
tracer.h
bin_PROGRAMS = lyx
LYX_PRE_LIBS = mathed/libmathed.la insets/libinsets.la \
frontends/libfrontends.la
LYX_CONV_LIBS = mathed/libmathed.la insets/libinsets.la \
frontends/libfrontends.la \
$(FRONTEND_GUILIB) \
frontends/controllers/libcontrollers.la \
LYX_POST_LIBS = frontends/controllers/libcontrollers.la \
graphics/libgraphics.la \
support/libsupport.la
@ -30,10 +28,23 @@ else
BOOST_LIBS = -lboost_regex -lboost_signals
endif
lyx_LDADD = $(LYX_CONV_LIBS) $(BOOST_LIBS) $(INTLLIBS) \
$(AIKSAURUS_LIBS) @LIBS@
OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(AIKSAURUS_LIBS) @LIBS@
lyx_DEPENDENCIES = $(LYX_CONV_LIBS) $(BOOST_LIBS) $(INTLLIBS)
bin_PROGRAMS = lyx
noinst_PROGRAMS = $(FRONTENDS_PROGS)
EXTRA_PROGRAMS = lyx-xforms lyx-qt
lyx_xforms_LDADD = $(lyx_OBJECTS) $(LYX_PRE_LIBS) \
frontends/xforms/libxforms.la $(LYX_POST_LIBS) $(OTHERLIBS)
lyx_xforms_SOURCES = main.C
lyx_qt_LDADD = $(lyx_OBJECTS) $(LYX_PRE_LIBS) \
frontends/qt2/libqt2.la $(LYX_POST_LIBS) $(OTHERLIBS)
lyx_qt_SOURCES = main.C
lyx$(EXEEXT): $(FRONTENDS_PROGS)
rm -f $@
$(LN_S) $< $@
#lyx_LDFLAGS=-Wl,-O1
@ -198,7 +209,6 @@ lyx_SOURCES = \
lyxtextclasslist.h \
lyxvc.C \
lyxvc.h \
main.C \
messages.C \
messages.h \
metricsinfo.C \

View File

@ -1,5 +1,7 @@
2003-08-02 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Makefile.am (SUBDIRS): use FRONTENDS_SUBDIRS
* Toolbar.C (clearLayoutList): new methods, which resets
last_textclass_. The derived methods should call that.

View File

@ -1,6 +1,6 @@
include $(top_srcdir)/config/common.am
SUBDIRS = controllers $(FRONTEND)
SUBDIRS = controllers $(FRONTENDS_SUBDIRS)
DIST_SUBDIRS = controllers xforms qt2 gnome

View File

@ -1,5 +1,9 @@
2003-08-02 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* ui/Makefile.am (INCLUDES):
* moc/Makefile.am (INCLUDES):
* Makefile.am (INCLUDES): use QT_INCLUDES
* QLToolbar.C (clearLayoutList): call Toolbar::clearLayoutList
2003-07-30 Juergen Spitzmueller <j.spitzmueller@gmx.de>

View File

@ -7,7 +7,7 @@ EXTRA_DIST = Makefile.dialogs
INCLUDES = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/frontends/ \
-I$(top_srcdir)/images \
$(FRONTEND_INCLUDES) $(BOOST_INCLUDES) \
$(QT_INCLUDES) $(BOOST_INCLUDES) \
-I$(top_srcdir)/src/frontends/controllers
noinst_LTLIBRARIES = libqt2.la

View File

@ -7,7 +7,7 @@ INCLUDES = -I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/frontends/ \
-I$(top_srcdir)/src/frontends/controllers \
-I$(top_builddir)/src/frontends/qt2 \
$(FRONTEND_INCLUDES) \
$(QT_INCLUDES) \
$(BOOST_INCLUDES)
AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_TRANSLATION

View File

@ -9,7 +9,7 @@ EXTRA_DIST = $(UIFILES)
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/frontends \
-I$(top_srcdir)/src/frontends/qt2 \
$(FRONTEND_INCLUDES) $(BOOST_INCLUDES) \
$(QT_INCLUDES) $(BOOST_INCLUDES) \
-I$(top_srcdir)/src/frontends/controllers
AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_TRANSLATION

View File

@ -1,5 +1,7 @@
2003-08-02 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Makefile.am (libxforms_la_LIBADD): use XFORMS_LIBS
* XFormsToolbar.C (clearLayoutList): call Toolbar::clearLayoutList
2003-08-02 Lars Gullik Bjønnes <larsbj@lyx.org>

View File

@ -11,7 +11,7 @@ INCLUDES = -I$(top_srcdir)/images -I$(top_srcdir)/src \
noinst_LTLIBRARIES = libxforms.la
libxforms_la_LIBADD = @XFORMS_IMAGE_LIB@ @XFORMS_LIB@ @XPM_LIB@ forms/*.lo
libxforms_la_LIBADD = @XFORMS_LIBS@ forms/*.lo
# Alphabetical order please. It makes it easier to figure out what's missing.
libxforms_la_SOURCES = \