From a1873279648582e6af46f9103460da50bf5e03b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Jul 2007 19:06:18 +0000 Subject: [PATCH] Added wxUSE_CONSOLE_EVENTLOOP and wxUSE_SELECT/EPOLLDISPATCHER guards; put checks for them in the new Unix-specific wx/unix/chkconf.h file git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 8 ++++++ build/bakefiles/files.bkl | 2 ++ configure.in | 34 +++++++++++++++++++---- include/wx/apptrait.h | 4 +++ include/wx/chkconf.h | 12 ++++++++ include/wx/dfb/chkconf.h | 9 ++++++ include/wx/mac/setup0.h | 10 +++++++ include/wx/motif/setup0.h | 10 +++++++ include/wx/msw/setup0.h | 10 +++++++ include/wx/msw/wince/setup.h | 10 +++++++ include/wx/os2/setup0.h | 10 +++++++ include/wx/palmos/setup0.h | 10 +++++++ include/wx/private/selectdispatcher.h | 3 ++ include/wx/setup_inc.h | 10 +++++++ include/wx/unix/apptrait.h | 2 ++ include/wx/unix/chkconf.h | 22 +++++++++++++++ include/wx/unix/evtloop.h | 4 +++ include/wx/unix/private/epolldispatcher.h | 4 +-- include/wx/x11/chkconf.h | 10 ++++++- setup.h.in | 8 ++++++ src/common/gsocketiohandler.cpp | 2 +- src/common/selectdispatcher.cpp | 3 ++ src/unix/baseunix.cpp | 3 ++ src/unix/epolldispatcher.cpp | 4 +-- src/unix/evtloopunix.cpp | 17 +++++------- wxGTK.spec | 1 + wxMotif.spec | 1 + wxX11.spec | 1 + 28 files changed, 203 insertions(+), 21 deletions(-) create mode 100644 include/wx/unix/chkconf.h diff --git a/Makefile.in b/Makefile.in index 9e62270a56..69c5596644 100644 --- a/Makefile.in +++ b/Makefile.in @@ -582,6 +582,7 @@ ALL_PORTS_BASE_HEADERS = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/execute.h \ wx/unix/evtloop.h \ wx/unix/mimetype.h \ @@ -1844,6 +1845,7 @@ COND_TOOLKIT__BASE_MACOSX_HDR = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/execute.h \ wx/unix/evtloop.h \ wx/unix/mimetype.h \ @@ -1860,6 +1862,7 @@ COND_TOOLKIT_COCOA_BASE_MACOSX_HDR = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/execute.h \ wx/unix/evtloop.h \ wx/unix/mimetype.h \ @@ -1876,6 +1879,7 @@ COND_TOOLKIT_GTK_BASE_MACOSX_HDR = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/execute.h \ wx/unix/evtloop.h \ wx/unix/mimetype.h \ @@ -1896,6 +1900,7 @@ COND_TOOLKIT_MAC_BASE_MACOSX_HDR = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/evtloop.h \ wx/unix/stdpaths.h @COND_TOOLKIT_MAC@BASE_MACOSX_HDR = $(COND_TOOLKIT_MAC_BASE_MACOSX_HDR) @@ -1903,6 +1908,7 @@ COND_TOOLKIT_MOTIF_BASE_MACOSX_HDR = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/execute.h \ wx/unix/evtloop.h \ wx/unix/mimetype.h \ @@ -1919,6 +1925,7 @@ COND_TOOLKIT_X11_BASE_MACOSX_HDR = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/execute.h \ wx/unix/evtloop.h \ wx/unix/mimetype.h \ @@ -1946,6 +1953,7 @@ COND_PLATFORM_UNIX_1_BASE_PLATFORM_HDR = \ wx/unix/app.h \ wx/unix/apptbase.h \ wx/unix/apptrait.h \ + wx/unix/chkconf.h \ wx/unix/execute.h \ wx/unix/evtloop.h \ wx/unix/mimetype.h \ diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index f181fa2a01..0e5ecaa0a8 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -76,6 +76,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/unix/app.h wx/unix/apptbase.h wx/unix/apptrait.h + wx/unix/chkconf.h wx/unix/execute.h wx/unix/evtloop.h wx/unix/mimetype.h @@ -224,6 +225,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/unix/app.h wx/unix/apptbase.h wx/unix/apptrait.h + wx/unix/chkconf.h wx/unix/evtloop.h wx/unix/stdpaths.h diff --git a/configure.in b/configure.in index 0a5e8757b5..18d74811c4 100644 --- a/configure.in +++ b/configure.in @@ -433,7 +433,7 @@ dnl - WX_ARG_WITHOUT/WX_ARG_DISABLE mirror WX_ARG_WITH/WX_ARG_ENABLE but dnl should be used for the options which are enabled by default dnl - WX_ARG_FEATURE is a version of WX_ARG_ENABLE which should be used for dnl optional features, i.e. options which should be disabled if -dnl --disable-all_features is specified (WX_ARG_WITH/WX_ARG_SYS_WITH are +dnl --disable-all-features is specified (WX_ARG_WITH/WX_ARG_SYS_WITH are dnl also affected by this) dnl --------------------------------------------------------------------------- @@ -451,7 +451,7 @@ if test "x$VENDOR" = "x"; then VENDOR="custom" fi -WX_ARG_DISABLE(all_features,[ --disable-all_features disable all optional features to build minimal library], wxUSE_ALL_FEATURES) +WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES) dnl --------------------------------------------------------------------------- dnl port selection @@ -576,6 +576,10 @@ WX_ARG_FEATURE(dataobj, [ --enable-dataobj use data object classes WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) +WX_ARG_FEATURE(baseevtloop, [ --enable-base-evtloop use event loop in console programs too], wxUSE_CONSOLE_EVENTLOOP) +WX_ARG_FEATURE(epoolloop, [ --enable-epool-loop use wxEpollDispatcher class (Linux only)], wxUSE_EPOLL_DISPATCHER) +WX_ARG_FEATURE(selectloop, [ --enable-select-loop use wxSelectDispatcher class], wxUSE_SELECT_DISPATCHER) + dnl please keep the settings below in alphabetical order WX_ARG_FEATURE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE) WX_ARG_FEATURE(arcstream, [ --enable-arcstream use wxArchive streams], wxUSE_ARCHIVE_STREAMS) @@ -1440,9 +1444,6 @@ if test "$USE_UNIX" = 1 ; then AC_CHECK_HEADER([sys/select.h],,, [AC_INCLUDES_DEFAULT()]) fi -dnl defines HAVE_SYS_EPOLL_H - for epoll mainloop implementation in wxbase -AC_CHECK_HEADERS(sys/epoll.h) - dnl --------------------------------------------------------------------------- dnl Checks for compiler characteristics dnl --------------------------------------------------------------------------- @@ -5693,6 +5694,29 @@ if test "$wxUSE_OBJC_UNIQUIFYING" = "yes"; then AC_DEFINE(wxUSE_OBJC_UNIQUIFYING) fi +dnl --------------------------------------------------------------------------- +dnl console event loop stuff +dnl --------------------------------------------------------------------------- + +if test "$wxUSE_CONSOLE_EVENTLOOP" = "yes"; then + AC_DEFINE(wxUSE_CONSOLE_EVENTLOOP) + + if test "$wxUSE_UNIX" = "yes"; then + if test "$wxUSE_SELECT_DISPATCHER" = "yes"; then + AC_DEFINE(wxUSE_SELECT_DISPATCHER); + fi + + if test "$wxUSE_EPOLL_DISPATCHER" = "yes"; then + AC_CHECK_HEADERS(sys/epoll.h) + if test "$ac_cv_header_sys_epoll_h" = "yes"; then + AC_DEFINE(wxUSE_EPOLL_DISPATCHER) + else + AC_MSG_WARN([sys/epoll.h not available, wxEpollDispatcher disabled]) + fi + fi + fi +fi + dnl --------------------------------------------------------------------------- dnl time/date functions dnl --------------------------------------------------------------------------- diff --git a/include/wx/apptrait.h b/include/wx/apptrait.h index aca979f67a..322b047c8e 100644 --- a/include/wx/apptrait.h +++ b/include/wx/apptrait.h @@ -205,6 +205,10 @@ protected: class WXDLLIMPEXP_BASE wxConsoleAppTraitsBase : public wxAppTraits { public: +#if !wxUSE_CONSOLE_EVENTLOOP + virtual wxEventLoopBase *CreateEventLoop() { return NULL; } +#endif // !wxUSE_CONSOLE_EVENTLOOP + #if wxUSE_LOG virtual wxLog *CreateLogTarget(); #endif // wxUSE_LOG diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index f05ad703d2..ca9699d011 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -35,6 +35,10 @@ # include "wx/x11/chkconf.h" #endif +#ifdef __UNIX__ +# include "wx/unix/chkconf.h" +#endif + #ifdef __WXUNIVERSAL__ # include "wx/univ/chkconf.h" #endif @@ -83,6 +87,14 @@ please keep the options in alphabetical order! */ +#ifndef wxUSE_CONSOLE_EVENTLOOP +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_CONSOLE_EVENTLOOP must be defined." +# else +# define wxUSE_CONSOLE_EVENTLOOP 0 +# endif +#endif /* !defined(wxUSE_CONSOLE_EVENTLOOP) */ + #ifndef wxUSE_CRASHREPORT /* this one is special: as currently it is Windows-only, don't force it to be defined on other platforms */ diff --git a/include/wx/dfb/chkconf.h b/include/wx/dfb/chkconf.h index 290fb62220..cbc9e7f331 100644 --- a/include/wx/dfb/chkconf.h +++ b/include/wx/dfb/chkconf.h @@ -21,4 +21,13 @@ # error "wxFileConfig is required by wxDFB port" #endif +#if wxUSE_SOCKETS && !wxUSE_SELECT_DISPATCHER +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxSocket requires wxSelectDispatcher in wxDFB" +# else +# undef wxUSE_SELECT_DISPATCHER +# define wxUSE_SELECT_DISPATCHER 1 +# endif +#endif + #endif /* _WX_DFB_CHKCONF_H_ */ diff --git a/include/wx/mac/setup0.h b/include/wx/mac/setup0.h index 4fb97a6385..2b55bba682 100644 --- a/include/wx/mac/setup0.h +++ b/include/wx/mac/setup0.h @@ -331,6 +331,16 @@ // Recommended setting: 1 (but can be safely disabled if you don't use it) #define wxUSE_BASE64 1 +// Set this to 1 to be able to use wxEventLoop even in console applications +// (i.e. using base library only, without GUI). This is mostly useful for +// processing socket events but is also necessary to use timers in console +// applications +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_CONSOLE_EVENTLOOP 1 + // Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level // POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. // diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index c7aafa9c34..4f643f333e 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -330,6 +330,16 @@ // Recommended setting: 1 (but can be safely disabled if you don't use it) #define wxUSE_BASE64 1 +// Set this to 1 to be able to use wxEventLoop even in console applications +// (i.e. using base library only, without GUI). This is mostly useful for +// processing socket events but is also necessary to use timers in console +// applications +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_CONSOLE_EVENTLOOP 1 + // Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level // POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. // diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index aa0e083733..311559ffef 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -330,6 +330,16 @@ // Recommended setting: 1 (but can be safely disabled if you don't use it) #define wxUSE_BASE64 1 +// Set this to 1 to be able to use wxEventLoop even in console applications +// (i.e. using base library only, without GUI). This is mostly useful for +// processing socket events but is also necessary to use timers in console +// applications +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_CONSOLE_EVENTLOOP 1 + // Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level // POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. // diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index 121938f88d..953f07ca9f 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -330,6 +330,16 @@ // Recommended setting: 1 (but can be safely disabled if you don't use it) #define wxUSE_BASE64 1 +// Set this to 1 to be able to use wxEventLoop even in console applications +// (i.e. using base library only, without GUI). This is mostly useful for +// processing socket events but is also necessary to use timers in console +// applications +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_CONSOLE_EVENTLOOP 1 + // Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level // POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. // diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index e0235ba107..8e7f3214d6 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -330,6 +330,16 @@ // Recommended setting: 1 (but can be safely disabled if you don't use it) #define wxUSE_BASE64 1 +// Set this to 1 to be able to use wxEventLoop even in console applications +// (i.e. using base library only, without GUI). This is mostly useful for +// processing socket events but is also necessary to use timers in console +// applications +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_CONSOLE_EVENTLOOP 1 + // Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level // POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. // diff --git a/include/wx/palmos/setup0.h b/include/wx/palmos/setup0.h index a893ea9725..75686beaa3 100644 --- a/include/wx/palmos/setup0.h +++ b/include/wx/palmos/setup0.h @@ -330,6 +330,16 @@ // Recommended setting: 1 (but can be safely disabled if you don't use it) #define wxUSE_BASE64 1 +// Set this to 1 to be able to use wxEventLoop even in console applications +// (i.e. using base library only, without GUI). This is mostly useful for +// processing socket events but is also necessary to use timers in console +// applications +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_CONSOLE_EVENTLOOP 1 + // Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level // POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. // diff --git a/include/wx/private/selectdispatcher.h b/include/wx/private/selectdispatcher.h index b444c23d8c..130f85bd3f 100644 --- a/include/wx/private/selectdispatcher.h +++ b/include/wx/private/selectdispatcher.h @@ -13,6 +13,8 @@ #include "wx/defs.h" +#if wxUSE_SELECT_DISPATCHER + #include #include "wx/private/fdiodispatcher.h" @@ -111,5 +113,6 @@ private: int m_maxFD; }; +#endif // wxUSE_SELECT_DISPATCHER #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_ diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 0d54483d10..2bf77dd7a4 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -326,6 +326,16 @@ // Recommended setting: 1 (but can be safely disabled if you don't use it) #define wxUSE_BASE64 1 +// Set this to 1 to be able to use wxEventLoop even in console applications +// (i.e. using base library only, without GUI). This is mostly useful for +// processing socket events but is also necessary to use timers in console +// applications +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_CONSOLE_EVENTLOOP 1 + // Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level // POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. // diff --git a/include/wx/unix/apptrait.h b/include/wx/unix/apptrait.h index 229ae70b3c..8e1d0d73c9 100644 --- a/include/wx/unix/apptrait.h +++ b/include/wx/unix/apptrait.h @@ -19,7 +19,9 @@ class WXDLLEXPORT wxConsoleAppTraits : public wxConsoleAppTraitsBase { public: +#if wxUSE_CONSOLE_EVENTLOOP virtual wxEventLoopBase *CreateEventLoop(); +#endif // wxUSE_CONSOLE_EVENTLOOP virtual bool CreateEndProcessPipe(wxExecuteData& execData); virtual bool IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd); virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData); diff --git a/include/wx/unix/chkconf.h b/include/wx/unix/chkconf.h new file mode 100644 index 0000000000..a6a4e64cc5 --- /dev/null +++ b/include/wx/unix/chkconf.h @@ -0,0 +1,22 @@ +/* + * Name: wx/unix/chkconf.h + * Purpose: Unix-specific config settings consistency checks + * Author: Vadim Zeitlin + * Created: 2007-07-14 + * RCS-ID: $Id$ + * Copyright: (c) 2007 Vadim Zeitlin + * Licence: wxWindows licence + */ + +/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ + +#if wxUSE_CONSOLE_EVENTLOOP +# if !wxUSE_SELECT_DISPATCHER && !wxUSE_EPOLL_DISPATCHER +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxSelect/EpollDispatcher needed for console event loop" +# else +# undef wxUSE_SELECT_DISPATCHER +# define wxUSE_SELECT_DISPATCHER 1 +# endif +# endif +#endif /* wxUSE_CONSOLE_EVENTLOOP */ diff --git a/include/wx/unix/evtloop.h b/include/wx/unix/evtloop.h index a794bdd42d..3f5b54913c 100644 --- a/include/wx/unix/evtloop.h +++ b/include/wx/unix/evtloop.h @@ -11,6 +11,8 @@ #ifndef _WX_UNIX_EVTLOOP_H_ #define _WX_UNIX_EVTLOOP_H_ +#if wxUSE_CONSOLE_EVENTLOOP + #include "wx/private/fdiodispatcher.h" #include "wx/unix/pipe.h" @@ -67,4 +69,6 @@ private: DECLARE_NO_COPY_CLASS(wxConsoleEventLoop) }; +#endif // wxUSE_CONSOLE_EVENTLOOP + #endif // _WX_UNIX_EVTLOOP_H_ diff --git a/include/wx/unix/private/epolldispatcher.h b/include/wx/unix/private/epolldispatcher.h index ef67a1520b..c4b5074472 100644 --- a/include/wx/unix/private/epolldispatcher.h +++ b/include/wx/unix/private/epolldispatcher.h @@ -13,7 +13,7 @@ #include "wx/defs.h" -#ifdef HAVE_SYS_EPOLL_H +#ifdef wxUSE_EPOLL_DISPATCHER #include "wx/private/fdiodispatcher.h" @@ -42,6 +42,6 @@ private: int m_epollDescriptor; }; -#endif // HAVE_SYS_EPOLL_H +#endif // wxUSE_EPOLL_DISPATCHER #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_ diff --git a/include/wx/x11/chkconf.h b/include/wx/x11/chkconf.h index b587067185..e3c9bec6f5 100644 --- a/include/wx/x11/chkconf.h +++ b/include/wx/x11/chkconf.h @@ -14,10 +14,18 @@ #ifndef _WX_X11_CHKCONF_H_ #define _WX_X11_CHKCONF_H_ - /* wxPalette is always needed */ #if !wxUSE_PALETTE # error "wxX11 requires wxUSE_PALETTE=1" #endif +#if wxUSE_SOCKETS && !wxUSE_SELECT_DISPATCHER +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxSocket requires wxSelectDispatcher in wxX11" +# else +# undef wxUSE_SELECT_DISPATCHER +# define wxUSE_SELECT_DISPATCHER 1 +# endif +#endif + #endif /* _WX_X11_CHKCONF_H_ */ diff --git a/setup.h.in b/setup.h.in index 7cee7c7915..e77e00e343 100644 --- a/setup.h.in +++ b/setup.h.in @@ -217,6 +217,8 @@ #define wxUSE_BASE64 0 +#define wxUSE_CONSOLE_EVENTLOOP 0 + #define wxUSE_FILE 0 #define wxUSE_FFILE 0 @@ -544,6 +546,12 @@ /* --- end common options --- */ +/* + * Unix-specific options + */ +#define wxUSE_SELECT_DISPATCHER 0 +#define wxUSE_EPOLL_DISPATCHER 0 + /* for some features we don't have dedicated configure switches, so just choose * the common values automatically */ #if (defined(__WIN32__) && !defined(__WXUNIVERSAL__)) || defined(__WXPM__) diff --git a/src/common/gsocketiohandler.cpp b/src/common/gsocketiohandler.cpp index 7a8d2badba..e8e6dfcd62 100644 --- a/src/common/gsocketiohandler.cpp +++ b/src/common/gsocketiohandler.cpp @@ -19,7 +19,7 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if wxUSE_SOCKETS +#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER #include "wx/private/gsocketiohandler.h" #include "wx/unix/private.h" diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index 2a96b33453..ef8b95179c 100644 --- a/src/common/selectdispatcher.cpp +++ b/src/common/selectdispatcher.cpp @@ -19,6 +19,8 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_SELECT_DISPATCHER + #include "wx/private/selectdispatcher.h" #include "wx/module.h" #include "wx/timer.h" @@ -290,3 +292,4 @@ private: IMPLEMENT_DYNAMIC_CLASS(wxSelectDispatcherModule, wxModule) +#endif // wxUSE_SELECT_DISPATCHER diff --git a/src/unix/baseunix.cpp b/src/unix/baseunix.cpp index 9773a110a5..b2dacab6dd 100644 --- a/src/unix/baseunix.cpp +++ b/src/unix/baseunix.cpp @@ -95,8 +95,11 @@ wxTimerImpl *wxConsoleAppTraits::CreateTimerImpl(wxTimer *timer) #endif // wxUSE_TIMER +#if wxUSE_CONSOLE_EVENTLOOP + wxEventLoopBase *wxConsoleAppTraits::CreateEventLoop() { return new wxEventLoop(); } +#endif // wxUSE_CONSOLE_EVENTLOOP diff --git a/src/unix/epolldispatcher.cpp b/src/unix/epolldispatcher.cpp index 533d15b45a..382cd5473c 100644 --- a/src/unix/epolldispatcher.cpp +++ b/src/unix/epolldispatcher.cpp @@ -19,7 +19,7 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifdef HAVE_SYS_EPOLL_H +#ifdef wxUSE_EPOLL_DISPATCHER #include "wx/unix/private/epolldispatcher.h" #include "wx/unix/private.h" @@ -210,4 +210,4 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxEpollDispatcherModule, wxModule) -#endif // HAVE_SYS_EPOLL_H +#endif // wxUSE_EPOLL_DISPATCHER diff --git a/src/unix/evtloopunix.cpp b/src/unix/evtloopunix.cpp index 897f39a5bc..39afb42db0 100644 --- a/src/unix/evtloopunix.cpp +++ b/src/unix/evtloopunix.cpp @@ -19,7 +19,7 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/evtloop.h" +#if wxUSE_CONSOLE_EVENTLOOP #ifndef WX_PRECOMP #include "wx/app.h" @@ -27,6 +27,7 @@ #endif #include +#include "wx/evtloop.h" #include "wx/thread.h" #include "wx/module.h" #include "wx/unix/private/timer.h" @@ -35,10 +36,6 @@ #define TRACE_EVENTS _T("events") -//this code should not be compiled when GUI is defined -//(monolithic build issue) -#if !wxUSE_GUI - // =========================================================================== // wxEventLoop::PipeIOHandler implementation // =========================================================================== @@ -128,13 +125,13 @@ wxConsoleEventLoop::wxConsoleEventLoop() return; } -#ifdef HAVE_SYS_EPOLL_H +#ifdef wxUSE_EPOLL_DISPATCHER m_dispatcher = wxEpollDispatcher::Get(); if ( !m_dispatcher ) -#endif // HAVE_SYS_EPOLL_H - { +#endif // wxUSE_EPOLL_DISPATCHER +#if wxUSE_SELECT_DISPATCHER m_dispatcher = wxSelectDispatcher::Get(); - } +#endif // wxUSE_WCHAR_T wxCHECK_RET( m_dispatcher, _T("failed to create IO dispatcher") ); @@ -194,4 +191,4 @@ void wxConsoleEventLoop::OnNextIteration() wxTheApp->CheckSignal(); } -#endif // !wxUSE_GUI +#endif // wxUSE_CONSOLE_EVENTLOOP diff --git a/wxGTK.spec b/wxGTK.spec index dbd1509c8e..4a65ad12d5 100644 --- a/wxGTK.spec +++ b/wxGTK.spec @@ -334,6 +334,7 @@ wx/zstream.h wx/unix/app.h wx/unix/apptbase.h wx/unix/apptrait.h +wx/unix/chkconf.h wx/unix/execute.h wx/unix/evtloop.h wx/unix/mimetype.h diff --git a/wxMotif.spec b/wxMotif.spec index 525d05ce88..c738833e6f 100644 --- a/wxMotif.spec +++ b/wxMotif.spec @@ -237,6 +237,7 @@ wx/zstream.h wx/unix/app.h wx/unix/apptbase.h wx/unix/apptrait.h +wx/unix/chkconf.h wx/unix/execute.h wx/unix/evtloop.h wx/unix/mimetype.h diff --git a/wxX11.spec b/wxX11.spec index 28a5e33373..41cb07597f 100644 --- a/wxX11.spec +++ b/wxX11.spec @@ -262,6 +262,7 @@ wx/zstream.h wx/unix/app.h wx/unix/apptbase.h wx/unix/apptrait.h +wx/unix/chkconf.h wx/unix/execute.h wx/unix/evtloop.h wx/unix/mimetype.h -- 2.45.2