Mercurial > hg > octave-lojdl
changeset 15257:7ee62f559a73
Fix compilation under Windows with GUI and LLVM enabled.
* configure.ac (OCTGUI_DLL_DEFS): New substituted variabled. Define it to
-DOCTGUI_DLL under MinGW and MSVC platforms.
(QT_INCDIR, QT_LIBDIR): Replace backslash with forward slash characters.
(OCTGUI_API): New config.h macro.
* src/Makefile.am (MOC_CPPFLAGS): New variable. Define it to -DWIN32 when
compiling Win32 terminal implementation.
(moc-%.cc rule): Use it.
(libqterminal_la_CPPFLAGS): New variable defined to -DWIN32 when compiling
the win32 terminal implementation.
(liboctgui_la_CPPFLAGS): Add @OCTGUI_DLL_DEFS@.
* libgui/src/m-editor/file-editor-tab.cc (QApplication, QFileDialog,
QTextStream): New includes.
* libgui/src/m-editor/find-dialog.cc (find_dialog::search_next): Temporary
fix for compilation with QScintilla < 2.6.
* libgui/src/main-window.cc (QApplication, QLabel): New includes.
* libgui/src/octave-gui.h (octave_start_gui): Decorate with OCTGUI_API.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Thu, 30 Aug 2012 15:52:44 +0100 |
parents | 79baa37fde7a |
children | cd8248cc6020 |
files | configure.ac libgui/src/Makefile.am libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/find-dialog.cc libgui/src/main-window.cc libgui/src/octave-gui.h |
diffstat | 6 files changed, 32 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac +++ b/configure.ac @@ -1361,6 +1361,7 @@ CRUFT_DLL_DEFS= OCTAVE_DLL_DEFS= OCTINTERP_DLL_DEFS= +OCTGUI_DLL_DEFS= OCTGRAPHICS_DLL_DEFS= library_path_var=LD_LIBRARY_PATH ldpreloadsep=" " @@ -1442,6 +1443,7 @@ CRUFT_DLL_DEFS="-DCRUFT_DLL" OCTAVE_DLL_DEFS="-DOCTAVE_DLL" OCTINTERP_DLL_DEFS="-DOCTINTERP_DLL" + OCTGUI_DLL_DEFS="-DOCTGUI_DLL" OCTGRAPHICS_DLL_DEFS="-DOCTGRAPHICS_DLL" else CPICFLAG= @@ -1481,7 +1483,7 @@ ## Extra compilation flags. CRUFT_DLL_DEFS="-DCRUFT_DLL" OCTAVE_DLL_DEFS="-DOCTAVE_DLL" - OCTINTERP_DLL_DEFS="-DOCTINTERP_DLL" + OCTGUI_DLL_DEFS="-DOCTGUI_DLL" OCTGRAPHICS_DLL_DEFS="-DOCTGRAPHICS_DLL" ;; *-*-linux* | *-*-gnu*) @@ -1587,6 +1589,7 @@ AC_MSG_NOTICE([defining CRUFT_DLL_DEFS to be $CRUFT_DLL_DEFS]) AC_MSG_NOTICE([defining OCTAVE_DLL_DEFS to be $OCTAVE_DLL_DEFS]) AC_MSG_NOTICE([defining OCTINTERP_DLL_DEFS to be $OCTINTERP_DLL_DEFS]) +AC_MSG_NOTICE([defining OCTGUI_DLL_DEFS to be $OCTGUI_DLL_DEFS]) AC_MSG_NOTICE([defining OCTGRAPHICS_DLL_DEFS to be $OCTGRAPHICS_DLL_DEFS]) AC_MSG_NOTICE([defining library_path_var to be $library_path_var]) AC_SUBST(FPICFLAG) @@ -1615,6 +1618,7 @@ AC_SUBST(CRUFT_DLL_DEFS) AC_SUBST(OCTAVE_DLL_DEFS) AC_SUBST(OCTINTERP_DLL_DEFS) +AC_SUBST(OCTGUI_DLL_DEFS) AC_SUBST(OCTGRAPHICS_DLL_DEFS) AC_SUBST(library_path_var) AC_SUBST(ldpreloadsep) @@ -2190,8 +2194,8 @@ if test $build_gui = yes; then AC_CHECK_PROGS(QMAKE, [qmake qmake-qt4 qmake-qt5]) if test -n "$QMAKE"; then - QT_INCDIR=`$QMAKE -query | sed -n -e 's/^QT_INSTALL_HEADERS://p'` - QT_LIBDIR=`$QMAKE -query | sed -n -e 's/^QT_INSTALL_LIBS://p'` + QT_INCDIR=`$QMAKE -query | sed -n -e 's/^QT_INSTALL_HEADERS://p' | sed -e 's,\\\\,/,g'` + QT_LIBDIR=`$QMAKE -query | sed -n -e 's/^QT_INSTALL_LIBS://p' | sed -e 's,\\\\,/,g'` AC_CHECK_PROGS(MOC, [moc moc-qt4 moc-qt5]) AC_CHECK_PROGS(UIC, [uic uic-qt4 uic-qt5]) AC_CHECK_PROGS(RCC, [rcc]) @@ -2369,6 +2373,13 @@ #define OCTGRAPHICS_API OCTAVE_IMPORT #endif +/* API macro for libgui */ +#ifdef OCTGUI_DLL +#define OCTGUI_API OCTAVE_EXPORT +#else +#define OCTGUI_API OCTAVE_IMPORT +#endif + /* oct-types.h */ typedef OCTAVE_IDX_TYPE octave_idx_type;
--- a/libgui/src/Makefile.am +++ b/libgui/src/Makefile.am @@ -26,6 +26,8 @@ QT_LDFLAGS = -L$(QT_LIBDIR) +MOC_CPPFLAGS = + SRCDIRS = \ m-editor \ qtinfo \ @@ -92,6 +94,7 @@ nodist_liboctgui_la_SOURCES = $(octave_gui_MOC) $(octave_gui_RC) liboctgui_la_CPPFLAGS = \ + @OCTGUI_DLL_DEFS@ \ -I$(QT_INCDIR) \ -I$(QT_INCDIR)/QtCore \ -I$(QT_INCDIR)/QtGui \ @@ -263,6 +266,10 @@ ../qterminal/libqterminal/win32/QWinTerminalImpl.cpp libqterminal_la_MOC += ../qterminal/libqterminal/win32/moc-QWinTerminalImpl.cc +libqterminal_la_CPPFLAGS += -DUNICODE + +# This flag is required to let MOC know about Q_OS_WIN32. +MOC_CPPFLAGS += -DWIN32 else @@ -297,7 +304,7 @@ moc-%.cc: %.h test -d $(@D) || mkdir -p $(@D) - @MOC@ -o$@ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liboctgui_la_CPPFLAGS) $< + @MOC@ -o$@ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(MOC_CPPFLAGS) $(liboctgui_la_CPPFLAGS) $< ui-%.h: %.ui @UIC@ -o $@ $<
--- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -36,7 +36,10 @@ #include <Qsci/qscilexerbatch.h> #include <Qsci/qscilexerdiff.h> #include "resource-manager.h" +#include <QApplication> +#include <QFileDialog> #include <QMessageBox> +#include <QTextStream> #include <QVBoxLayout> file_editor_tab::file_editor_tab(file_editor *fileEditor)
--- a/libgui/src/m-editor/find-dialog.cc +++ b/libgui/src/m-editor/find-dialog.cc @@ -145,8 +145,11 @@ _wrap_check_box->isChecked (), !_backward_check_box->isChecked (), line,col, - true, true +// FIXME: write a proper configure test (is it worth?) +#if QSCINTILLA_VERSION >= 0x020600 + , true +#endif ); } }