implement --enable-monolithic-{client,frontend-qt4,controllers}. Careful with frontend-qt4, it takes ~490 MB to build (but 3 instead of 8 minutes...)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19641 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-08-19 09:44:34 +00:00
parent 3c504502bf
commit 6d5a52b8e3
13 changed files with 269 additions and 166 deletions

View File

@ -412,6 +412,48 @@ AC_ARG_ENABLE(monolithic-boost,
[enable_monolithic_boost=no])
AM_CONDITIONAL(MONOLITHIC_BOOST, test $enable_monolithic_boost = yes)
AC_ARG_ENABLE(monolithic-client,
AC_HELP_STRING([--enable-monolithic-client],
[Use monolithic client compilations]),,
[enable_monolithic_client=no])
AM_CONDITIONAL(MONOLITHIC_CLIENT, test $enable_monolithic_client = yes)
AC_ARG_ENABLE(monolithic-controllers,
AC_HELP_STRING([--enable-monolithic-controllers],
[Use monolithic controllers compilations]),,
[enable_monolithic_controllers=no])
AM_CONDITIONAL(MONOLITHIC_CONTROLLERS, test $enable_monolithic_controllers = yes)
AC_ARG_ENABLE(monolithic-insets,
AC_HELP_STRING([--enable-monolithic-insets],
[Use monolithic insets compilations]),,
[enable_monolithic_insets=no])
AM_CONDITIONAL(MONOLITHIC_INSETS, test $enable_monolithic_insets = yes)
AC_ARG_ENABLE(monolithic-mathed,
AC_HELP_STRING([--enable-monolithic-mathed],
[Use monolithic mathed compilations]),,
[enable_monolithic_mathed=no])
AM_CONDITIONAL(MONOLITHIC_MATHED, test $enable_monolithic_mathed = yes)
AC_ARG_ENABLE(monolithic-core,
AC_HELP_STRING([--enable-monolithic-core],
[Use monolithic core files compilations]),,
[enable_monolithic_core=no])
AM_CONDITIONAL(MONOLITHIC_CORE, test $enable_monolithic_core = yes)
AC_ARG_ENABLE(monolithic-tex2lyx,
AC_HELP_STRING([--enable-monolithic-tex2lyx],
[Use monolithic tex2lyx compilations]),,
[enable_monolithic_tex2lyx=no])
AM_CONDITIONAL(MONOLITHIC_TEX2LYX, test $enable_monolithic_tex2lyx = yes)
AC_ARG_ENABLE(monolithic-frontend-qt4,
AC_HELP_STRING([--enable-monolithic-frontend-qt4],
[Use monolithic compilation of the Qt 4 frontend. Only recommended with > 512 MB of RAM]),,
[enable_monolithic_frontend_qt4=no])
AM_CONDITIONAL(MONOLITHIC_FRONTEND_QT4, test $enable_monolithic_frontend_qt4 = yes)
AC_DEFINE_UNQUOTED([LYX_DATE],"$LYX_DATE",[Date of release])
AC_DEFINE_UNQUOTED([VERSION_INFO],"$VERSION_INFO",[Full version info])
AC_DEFINE_UNQUOTED([LYX_MAJOR_VERSION],$lyx_major,[Major version number])

View File

@ -2,43 +2,57 @@ include $(top_srcdir)/config/common.am
CLEANFILES += $(man_MANS)
EXTRA_DIST = pch.h lyxclient.man
BUILT_SOURCES = $(PCH_FILE)
man_MANS = lyxclient.1
bin_PROGRAMS = lyxclient
AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES)
EXTRA_DIST = lyxclient.man
AM_CPPFLAGS += -I$(srcdir)/.. $(BOOST_INCLUDES)
lyxclient.1:
cp -p $(srcdir)/lyxclient.man lyxclient.1
lyxclient_LDADD = \
$(top_builddir)/src/support/liblyxsupport.la \
$(BOOST_LIBS) $(INTLLIBS) @LIBS@ $(SOCKET_LIBS)
# everything below the line containing a single backslash and the
# spellchecker stuff is an ugly hack and needed because of the
# everything below the line containing the single backslashs
# an ugly hack and needed because of the
# linking problems described in ../Makefile.am
# These four objects are linked as object files as they are not
# referenced within the core and therefore are not picked up
# by the linker without looping over libs. We do not want that,
# and in fact libtools seems not able to do that.
lyxclient_SOURCES = \
SOURCEFILES = \
boost.cpp \
client.cpp \
debug.cpp \
debug.h \
gettext.cpp \
Messages.cpp \
Messages.h \
\
../Box.cpp \
../Box.h \
../Dimension.cpp \
../Dimension.h \
../PrinterParams.cpp \
../PrinterParams.h
Messages.cpp
lyxclient.1:
cp -p $(srcdir)/lyxclient.man lyxclient.1
HEADERFILES = \
debug.h \
Messages.h
if MONOLITHIC_CLIENT
lyxclient.cpp:
@echo -e '$(SOURCEFILES:%=\n#include "%")\n' > $@
AM_CPPFLAGS += -I$(srcdir)/.. $(BOOST_INCLUDES)
BUILT_SOURCES = lyxclient.cpp
lyxclient_SOURCES = lyxclient.cpp $(HEADERFILES)
else
EXTRA_DIST += pch.h
AM_CPPFLAGS += $(PCH_FLAGS)
BUILT_SOURCES = $(PCH_FILE)
lyxclient_SOURCES = $(SOURCEFILES) $(HEADERFILES)
endif

View File

@ -31,7 +31,7 @@ public:
docstring const get(std::string const & msg) const;
private:
class Pimpl;
boost::scoped_ptr<Pimpl> pimpl_;
::boost::scoped_ptr<Pimpl> pimpl_;
};

View File

@ -61,8 +61,8 @@ namespace lyx {
using support::FileName;
using support::prefixIs;
using boost::scoped_ptr;
namespace fs = boost::filesystem;
using ::boost::scoped_ptr;
namespace fs = ::boost::filesystem;
using std::string;
using std::vector;
@ -76,7 +76,7 @@ namespace support {
string itoa(unsigned int i)
{
return boost::lexical_cast<string>(i);
return ::boost::lexical_cast<string>(i);
}

View File

@ -22,6 +22,7 @@
#include <boost/signals/trackable.hpp>
#undef CursorShape
namespace lyx {

View File

@ -1,99 +1,116 @@
include $(top_srcdir)/config/common.am
EXTRA_DIST = pch.h BCView.tmpl
EXTRA_DIST = BCView.tmpl
BUILT_SOURCES = $(PCH_FILE)
AM_CPPFLAGS += -I$(top_srcdir)/src $(BOOST_INCLUDES)
pkglib_LTLIBRARIES = liblyxcontrollers.la
AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES)
liblyxcontrollers_la_SOURCES= \
SOURCEFILES = \
Dialog.cpp \
Dialog.h \
Kernel.cpp \
Kernel.h \
BCView.h \
BCView.cpp \
ButtonController.cpp \
ButtonController.h \
ButtonPolicy.cpp \
ButtonPolicy.h \
ControlAboutlyx.cpp \
ControlAboutlyx.h \
ControlBibtex.cpp \
ControlBibtex.h \
ControlBox.cpp \
ControlBox.h \
ControlBranch.cpp \
ControlBranch.h \
ControlCharacter.cpp \
ControlCharacter.h \
ControlChanges.cpp \
ControlChanges.h \
ControlCitation.cpp \
ControlCitation.h \
ControlCommand.cpp \
ControlCommand.h \
ControlCommandBuffer.cpp \
ControlCommandBuffer.h \
ControlDocument.cpp \
ControlDocument.h \
ControlErrorList.cpp \
ControlErrorList.h \
ControlERT.cpp \
ControlERT.h \
ControlExternal.cpp \
ControlExternal.h \
ControlFloat.cpp \
ControlFloat.h \
ControlGraphics.cpp \
ControlGraphics.h \
ControlInclude.cpp \
ControlListings.h \
ControlListings.cpp \
ControlInclude.h \
ControlLog.cpp \
ControlLog.h \
ControlViewSource.cpp \
ControlViewSource.h \
ControlMath.cpp \
ControlMath.h \
ControlNote.cpp \
ControlNote.h \
ControlParagraph.cpp \
ControlParagraph.h \
ControlPrefs.cpp \
ControlPrefs.h \
ControlPrint.cpp \
ControlPrint.h \
ControlRef.cpp \
ControlRef.h \
ControlSearch.cpp \
ControlSearch.h \
ControlSendto.cpp \
ControlSendto.h \
ControlShowFile.cpp \
ControlShowFile.h \
ControlSpellchecker.cpp \
ControlSpellchecker.h \
ControlTabular.cpp \
ControlTabular.h \
ControlTabularCreate.cpp \
ControlTabularCreate.h \
ControlTexinfo.cpp \
ControlTexinfo.h \
ControlThesaurus.cpp \
ControlThesaurus.h \
ControlToc.cpp \
ControlToc.h \
ControlVSpace.cpp \
ControlVSpace.h \
ControlWrap.cpp \
frontend_helpers.cpp
HEADERFILES = \
Kernel.h \
ButtonController.h \
ButtonPolicy.h \
ControlAboutlyx.h \
ControlBibtex.h \
ControlBox.h \
ControlBranch.h \
ControlCharacter.h \
ControlChanges.h \
ControlCitation.h \
ControlCommand.h \
ControlCommandBuffer.h \
ControlDocument.h \
ControlErrorList.h \
ControlERT.h \
ControlExternal.h \
ControlFloat.h \
ControlGraphics.h \
ControlListings.h \
ControlInclude.h \
ControlLog.h \
ControlViewSource.h \
ControlMath.h \
ControlNote.h \
ControlParagraph.h \
ControlPrefs.h \
ControlPrint.h \
ControlRef.h \
ControlSearch.h \
ControlSendto.h \
ControlShowFile.h \
ControlSpellchecker.h \
ControlTabular.h \
ControlTabularCreate.h \
ControlTexinfo.h \
ControlThesaurus.h \
ControlToc.h \
ControlVSpace.h \
ControlWrap.h \
frontend_helpers.cpp \
frontend_helpers.h
if MONOLITHIC_CONTROLLERS
lyxcontrollers.cpp:
@echo -e '$(SOURCEFILES:%=\n#include "%")\n' > $@
BUILT_SOURCES = lyxcontrollers.cpp
liblyxcontrollers_la_SOURCES = lyxcontrollers.cpp $(HEADERFILES)
else
EXTRA_DIST += pch.h
BUILT_SOURCES = $(PCH_FILE)
AM_CPPFLAGS += $(PCH_FLAGS)
liblyxcontrollers_la_SOURCES = $(SOURCEFILES) $(HEADERFILES)
endif
################################# Tests ################################

View File

@ -55,6 +55,8 @@ int const CursorWidth = 2;
int const CursorWidth = 1;
#endif
#undef KeyPress
#undef NoModifier
using std::endl;
using std::string;

View File

@ -1,15 +1,11 @@
include $(top_srcdir)/config/common.am
CLEANFILES += *.h
CLEANFILES += *_moc.cpp
CLEANFILES += $(UIFILES:%.ui=ui_%.h)
CLEANFILES += $(MOCEDFILES)
BUILT_SOURCES = $(UIFILES:%.ui=ui_%.h)
BUILT_SOURCES += $(PCH_FILE)
BUILT_SOURCES += $(MOCEDFILES)
EXTRA_DIST = pch.h
######################### Translation #############################
# Use _() for localization instead of tr() or trUtf8()
UIC4FLAGS=-tr lyx::qt_
@ -17,12 +13,11 @@ UIC4FLAGS=-tr lyx::qt_
ui_%.h: ui/%.ui
$(UIC4) $(UIC4FLAGS) $< -o $@
MOCEDFILES = $(MOCFILES:%.cpp=%_moc.cpp)
MOCEDFILES = $(MOCHEADER:%.h=%_moc.cpp)
%_moc.cpp: %.h
$(MOC4) -o $@ $<
######################### LIBRARIES #############################
pkglib_LTLIBRARIES = liblyxqt4.la
@ -33,184 +28,183 @@ liblyxqt4_la_LIBADD = $(QT4_LIB)
AM_CPPFLAGS += \
$(QT4_CPPFLAGS) \
$(PCH_FLAGS) \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/frontends \
-I$(top_srcdir)/images \
$(QT4_INCLUDES) $(BOOST_INCLUDES) \
-I$(top_srcdir)/src/frontends/controllers
liblyxqt4_la_SOURCES = \
SOURCEFILES = \
alert_pimpl.cpp \
CheckedLineEdit.cpp \
CheckedLineEdit.h \
Dialogs.cpp \
FileDialog.cpp \
GuiClipboard.cpp \
GuiClipboard.h \
GuiFontLoader.cpp \
GuiFontLoader.h \
GuiFontMetrics.cpp \
GuiFontMetrics.h \
GuiSelection.cpp \
GuiSelection.h \
KeySymbol.cpp \
QCitation.cpp \
QFloat.cpp \
QFontExample.cpp \
QGraphics.h \
QLImage.cpp \
QLImage.h \
QLPainter.cpp \
QLPainter.h \
QPrint.cpp \
QPrint.h \
Qt2BC.cpp \
Qt2BC.h \
qt_helpers.cpp \
qt_helpers.h \
UrlView.cpp \
UrlView.h \
$(MOCFILES)
MOCFILES = \
Action.cpp \
Action.h \
BulletsModule.cpp \
BulletsModule.h \
ColorCache.cpp \
ColorCache.h \
DockView.h \
EmptyTable.cpp \
EmptyTable.h \
FloatPlacement.cpp \
FloatPlacement.h \
GuiApplication.cpp \
GuiApplication.h \
GuiImplementation.cpp \
GuiImplementation.h \
GuiView.cpp \
GuiView.h \
GuiWorkArea.cpp \
GuiWorkArea.h \
IconPalette.cpp \
IconPalette.h \
InsertTableWidget.cpp \
InsertTableWidget.h \
LengthCombo.cpp \
LengthCombo.h \
LyXFileDialog.cpp \
LyXFileDialog.h \
PanelStack.cpp \
PanelStack.h \
QAbout.cpp \
QAbout.h \
QBibitem.cpp \
QBibitem.h \
QBibtex.cpp \
QBibtex.h \
QBox.cpp \
QBox.h \
QBranch.cpp \
QBranches.cpp \
QChanges.cpp \
QCharacter.cpp \
QCitationDialog.cpp \
QCommandBuffer.cpp \
QCommandEdit.cpp \
QDelimiterDialog.cpp \
QDialogView.cpp \
QDocument.cpp \
QErrorList.cpp \
QERT.cpp \
QExternal.cpp \
QFloatDialog.cpp \
QGraphics.cpp \
QGraphicsDialog.cpp \
QInclude.cpp \
QIndex.cpp \
QKeySymbol.cpp \
QListings.cpp \
QLMenubar.cpp \
QLog.cpp \
QLPopupMenu.cpp \
QLPrintDialog.cpp \
QLToolbar.cpp \
QMathMatrixDialog.cpp \
QNomencl.cpp \
QNote.cpp \
QParagraph.cpp \
QPrefs.cpp \
QRef.cpp \
QSearch.cpp \
QSendto.cpp \
QSetBorder.cpp \
QShowFile.cpp \
QSpellchecker.cpp \
QTabular.cpp \
QTabularCreate.cpp \
QTexinfo.cpp \
QThesaurus.cpp \
QToc.cpp \
QURLDialog.cpp \
QViewSource.cpp \
QVSpace.cpp \
QWrap.cpp \
socket_callback.cpp \
TocModel.cpp \
TocWidget.cpp \
Validator.cpp
NOMOCHEADER = \
CheckedLineEdit.h \
GuiClipboard.h \
GuiFontLoader.h \
GuiFontMetrics.h \
GuiSelection.h \
QGraphics.h \
QLImage.h \
QLPainter.h \
QPrint.h \
Qt2BC.h \
qt_helpers.h
MOCHEADER = \
Action.h \
BulletsModule.h \
ColorCache.h \
DockView.h \
EmptyTable.h \
FloatPlacement.h \
GuiApplication.h \
GuiImplementation.h \
GuiView.h \
GuiWorkArea.h \
IconPalette.h \
InsertTableWidget.h \
LengthCombo.h \
LyXFileDialog.h \
PanelStack.h \
QAbout.h \
QBibitem.h \
QBibtex.h \
QBox.h \
QBranches.h \
QBranch.h \
QChanges.cpp \
QChanges.h \
QCharacter.cpp \
QCharacter.h \
QCitationDialog.cpp \
QCitationDialog.h \
QCitation.h \
QCommandBuffer.cpp \
QCommandBuffer.h \
QCommandEdit.cpp \
QCommandEdit.h \
QDelimiterDialog.cpp \
QDelimiterDialog.h \
QDialogView.cpp \
QDialogView.h \
QDocument.cpp \
QDocument.h \
QErrorList.cpp \
QErrorList.h \
QERT.cpp \
QERT.h \
QExternal.cpp \
QExternal.h \
QFloatDialog.cpp \
QFloatDialog.h \
QFloat.h \
QFontExample.h \
QGraphics.cpp \
QGraphicsDialog.cpp \
QGraphicsDialog.h \
QInclude.cpp \
QInclude.h \
QIndex.cpp \
QIndex.h \
QKeySymbol.cpp \
QKeySymbol.h \
QListings.cpp \
QListings.h \
qlkey.h \
QLMenubar.cpp \
QLMenubar.h \
QLog.cpp \
QLog.h \
QLPopupMenu.cpp \
QLPopupMenu.h \
QLPrintDialog.cpp \
QLPrintDialog.h \
QLToolbar.cpp \
QLToolbar.h \
QMathMatrixDialog.cpp \
QMathMatrixDialog.h \
QNomencl.cpp \
QNomencl.h \
QNote.cpp \
QNote.h \
QParagraph.cpp \
QParagraph.h \
QPrefs.cpp \
QPrefs.h \
QRef.cpp \
QRef.h \
QSearch.cpp \
QSearch.h \
QSendto.cpp \
QSendto.h \
QSetBorder.cpp \
QSetBorder.h \
QShowFile.cpp \
QShowFile.h \
QSpellchecker.cpp \
QSpellchecker.h \
QTabular.cpp \
QTabularCreate.cpp \
QTabularCreate.h \
QTabular.h \
QTexinfo.cpp \
QTexinfo.h \
QThesaurus.cpp \
QThesaurus.h \
QToc.cpp \
QToc.h \
QURLDialog.cpp \
QURLDialog.h \
QViewSource.cpp \
QViewSource.h \
QVSpace.cpp \
QVSpace.h \
QWrap.cpp \
QWrap.h \
socket_callback.cpp \
socket_callback.h \
TocModel.cpp \
TocModel.h \
TocWidget.cpp \
TocWidget.h \
Validator.cpp \
Validator.h
UIFILES = \
@ -285,3 +279,32 @@ UIFILES = \
ViewSourceUi.ui \
VSpaceUi.ui \
WrapUi.ui
if MONOLITHIC_FRONTEND_QT4
liblyxqt4.cpp:
@echo -e '$(SOURCEFILES:%=\n#include "%")\n' > $@
liblyxqt4_la_SOURCES = \
liblyxqt4.cpp \
$(MOCHEADER) \
$(NOMOCHEADER)
BUILT_SOURCES += liblyxqt4.cpp
else
liblyxqt4_la_SOURCES = \
$(SOURCEFILES) \
$(MOCHEADER) \
$(NOMOCHEADER)
EXTRA_DIST = pch.h
BUILT_SOURCES += $(PCH_FILE)
AM_CPPFLAGS += $(PCH_FLAGS)
endif

View File

@ -30,6 +30,8 @@
#include <QCloseEvent>
#include <QKeyEvent>
#undef KeyPress
using std::vector;
using std::string;

View File

@ -15,6 +15,8 @@
#include <QKeyEvent>
#include <QEvent>
#undef KeyPress
namespace lyx {
namespace frontend {

View File

@ -129,7 +129,7 @@ void TocWidget::setTreeDepth(int depth)
QModelIndexList indices = tocTV->model()->match(
tocTV->model()->index(0,0),
Qt::DisplayRole, "*", -1,
Qt::MatchWildcard|Qt::MatchRecursive);
Qt::MatchFlags(Qt::MatchWildcard|Qt::MatchRecursive));
int size = indices.size();
for (int i = 0; i < size; i++) {

View File

@ -65,8 +65,8 @@ public:
// For explanation see the next find() function.
typename Map::const_iterator it =
std::find_if(map.begin(), map.end(),
boost::bind(std::equal_to<T1>(),
boost::bind(&MapPair::first, _1),
::boost::bind(std::equal_to<T1>(),
::boost::bind(&MapPair::first, _1),
first)
);
@ -94,8 +94,8 @@ public:
// equal_to(select2nd(pair) , second)
typename Map::const_iterator it =
std::find_if(map.begin(), map.end(),
boost::bind(std::equal_to<T2>(),
boost::bind(&MapPair::second, _1),
::boost::bind(std::equal_to<T2>(),
::boost::bind(&MapPair::second, _1),
second)
);

View File

@ -53,7 +53,7 @@ private:
std::string fromcode_;
struct Private;
boost::scoped_ptr<Private> pimpl_;
::boost::scoped_ptr<Private> pimpl_;
};
// A single codepoint conversion for utf8_to_ucs4 does not make