+#if wxUSE_URL
+# if !wxUSE_PROTOCOL
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_URL requires wxUSE_PROTOCOL"
+# else
+# undef wxUSE_PROTOCOL
+# define wxUSE_PROTOCOL 1
+# endif
+# endif
+#endif /* wxUSE_URL */
+
+#if wxUSE_PROTOCOL
+# if !wxUSE_SOCKETS
+# if wxUSE_PROTOCOL_HTTP || wxUSE_PROTOCOL_FTP
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_PROTOCOL_FTP/HTTP requires wxUSE_SOCKETS"
+# else
+# undef wxUSE_SOCKETS
+# define wxUSE_SOCKETS 1
+# endif
+# endif
+# endif
+
+# if !wxUSE_STREAMS
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_PROTOCOL requires wxUSE_STREAMS"
+# else
+# undef wxUSE_STREAMS
+# define wxUSE_STREAMS 1
+# endif
+# endif
+#endif /* wxUSE_PROTOCOL */
+
+/* have to test for wxUSE_HTML before wxUSE_FILESYSTEM */
+#if wxUSE_HTML
+# if !wxUSE_FILESYSTEM
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxHTML requires wxFileSystem"
+# else
+# undef wxUSE_FILESYSTEM
+# define wxUSE_FILESYSTEM 1
+# endif
+# endif
+#endif /* wxUSE_HTML */
+
+#if wxUSE_FILESYSTEM
+# if !wxUSE_STREAMS
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_FILESYSTEM requires wxUSE_STREAMS"
+# else
+# undef wxUSE_STREAMS
+# define wxUSE_STREAMS 1
+# endif
+# endif
+#endif /* wxUSE_FILESYSTEM */
+
+#if wxUSE_FS_INET
+# if !wxUSE_PROTOCOL
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_FS_INET requires wxUSE_PROTOCOL"
+# else
+# undef wxUSE_PROTOCOL
+# define wxUSE_PROTOCOL 1
+# endif
+# endif
+#endif /* wxUSE_FS_INET */
+
+#if wxUSE_STOPWATCH || wxUSE_DATETIME
+# if !wxUSE_LONGLONG
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_STOPWATCH and wxUSE_DATETIME require wxUSE_LONGLONG"
+# else
+# undef wxUSE_LONGLONG
+# define wxUSE_LONGLONG 1
+# endif
+# endif
+#endif /* wxUSE_STOPWATCH */
+
+#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE"
+# else
+# undef wxUSE_TEXTFILE
+# define wxUSE_TEXTFILE 1
+# endif
+#endif /* wxUSE_MIMETYPE */
+
+#if wxUSE_TEXTFILE && !wxUSE_TEXTBUFFER
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_TEXTFILE requires wxUSE_TEXTBUFFER"
+# else
+# undef wxUSE_TEXTBUFFER
+# define wxUSE_TEXTBUFFER 1
+# endif
+#endif /* wxUSE_TEXTFILE */
+
+#if wxUSE_TEXTFILE && !wxUSE_FILE
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_TEXTFILE requires wxUSE_FILE"
+# else
+# undef wxUSE_FILE
+# define wxUSE_FILE 1
+# endif
+#endif /* wxUSE_TEXTFILE */
+
+#if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_UNICODE_MSLU requires wxUSE_UNICODE"
+# else
+# undef wxUSE_UNICODE
+# define wxUSE_UNICODE 1
+# endif
+#endif /* wxUSE_UNICODE_MSLU */
+
+/* ODBC and Unicode are now compatible */
+
+#if 0 /* wxUSE_ODBC && wxUSE_UNICODE */
+# ifdef wxABORT_ON_CONFIG_ERROR
+ /* (ODBC classes aren't Unicode-compatible yet) */
+# error "wxUSE_ODBC can't be used with wxUSE_UNICODE"
+# else
+# undef wxUSE_ODBC
+# define wxUSE_ODBC 0
+# endif
+#endif /* wxUSE_ODBC */
+
+#if wxUSE_XML && !wxUSE_WCHAR_T
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_XML requires wxUSE_WCHAR_T"
+# else
+# undef wxUSE_XML
+# define wxUSE_XML 0
+# endif
+#endif /* wxUSE_UNICODE_MSLU */
+
+#if !wxUSE_DYNLIB_CLASS
+# if wxUSE_DYNAMIC_LOADER
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_DYNAMIC_LOADER requires wxUSE_DYNLIB_CLASS."
+# else
+# define wxUSE_DYNLIB_CLASS 1
+# endif
+# endif
+#endif /* wxUSE_DYNLIB_CLASS */
+
+/* the rest of the tests is for the GUI settings only */
+#if wxUSE_GUI
+
+#if wxUSE_BUTTON || \
+ wxUSE_CALENDARCTRL || \
+ wxUSE_CARET || \
+ wxUSE_COMBOBOX || \
+ wxUSE_BMPBUTTON || \
+ wxUSE_CHECKBOX || \
+ wxUSE_CHECKLISTBOX || \
+ wxUSE_CHOICE || \
+ wxUSE_GAUGE || \
+ wxUSE_GRID || \
+ wxUSE_LISTBOX || \
+ wxUSE_LISTCTRL || \
+ wxUSE_NOTEBOOK || \
+ wxUSE_RADIOBOX || \
+ wxUSE_RADIOBTN || \
+ wxUSE_SCROLLBAR || \
+ wxUSE_SLIDER || \
+ wxUSE_SPINBTN || \
+ wxUSE_SPINCTRL || \
+ wxUSE_STATBMP || \
+ wxUSE_STATBOX || \
+ wxUSE_STATLINE || \
+ wxUSE_STATTEXT || \
+ wxUSE_STATUSBAR || \
+ wxUSE_TEXTCTRL || \
+ wxUSE_TOOLBAR || \
+ wxUSE_TREECTRL
+# if !wxUSE_CONTROLS
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_CONTROLS unset but some controls used"
+# else
+# undef wxUSE_CONTROLS
+# define wxUSE_CONTROLS 1
+# endif
+# endif
+#endif /* controls */
+
+#if wxUSE_BMPBUTTON
+# if !wxUSE_BUTTON
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_BMPBUTTON requires wxUSE_BUTTON"
+# else
+# undef wxUSE_BUTTON
+# define wxUSE_BUTTON 1
+# endif
+# endif
+#endif /* wxUSE_BMPBUTTON */
+
+#if wxUSE_NOTEBOOK || wxUSE_LISTBOOK
+# if defined(wxUSE_BOOKCTRL) && !wxUSE_BOOKCTRL
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_BOOKCTRL must be set."
+# else
+# undef wxUSE_BOOKCTRL
+# endif
+# endif
+
+# ifndef wxUSE_BOOKCTRL
+# define wxUSE_BOOKCTRL 1
+# endif
+#endif /* wxUSE_NOTEBOOK */
+
+#if wxUSE_LISTBOOK
+# if !wxUSE_LISTCTRL
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxListbook requires wxListCtrl"
+# else
+# undef wxUSE_LISTCTRL
+# define wxUSE_LISTCTRL 1
+# endif
+# endif
+#endif /* wxUSE_LISTBOOK */
+
+/* wxUniv-specific dependencies */
+#if defined(__WXUNIVERSAL__)
+# if (wxUSE_COMBOBOX || wxUSE_MENUS) && !wxUSE_POPUPWIN
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_POPUPWIN must be defined to use comboboxes/menus"
+# else
+# undef wxUSE_POPUPWIN
+# define wxUSE_POPUPWIN 1
+# endif
+# endif
+
+# if wxUSE_COMBOBOX
+# if !wxUSE_LISTBOX
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxComboBox requires wxListBox in wxUniversal"
+# else
+# undef wxUSE_LISTBOX
+# define wxUSE_LISTBOX 1
+# endif
+# endif
+# endif /* wxUSE_COMBOBOX */
+
+# if wxUSE_RADIOBTN
+# if !wxUSE_CHECKBOX
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_RADIOBTN requires wxUSE_CHECKBOX in wxUniversal"
+# else
+# undef wxUSE_CHECKBOX
+# define wxUSE_CHECKBOX 1
+# endif
+# endif
+# endif /* wxUSE_RADIOBTN */
+
+# if wxUSE_TEXTCTRL
+# if !wxUSE_CARET
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxTextCtrl requires wxCaret in wxUniversal"
+# else
+# undef wxUSE_CARET
+# define wxUSE_CARET 1
+# endif
+# endif /* wxUSE_CARET */
+
+# if !wxUSE_SCROLLBAR
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxTextCtrl requires wxScrollBar in wxUniversal"
+# else
+# undef wxUSE_SCROLLBAR
+# define wxUSE_SCROLLBAR 1
+# endif
+# endif /* wxUSE_SCROLLBAR */
+# endif /* wxUSE_TEXTCTRL */
+#endif /* __WXUNIVERSAL__ */
+
+/* wxGTK-specific dependencies */
+#ifdef __WXGTK__
+# ifndef __WXUNIVERSAL__
+# if wxUSE_MDI_ARCHITECTURE && !wxUSE_MENUS
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "MDI requires wxUSE_MENUS in wxGTK"
+# else
+# undef wxUSE_MENUS
+# define wxUSE_MENUS 1
+# endif
+# endif
+# endif /* !__WXUNIVERSAL__ */
+
+# if wxUSE_JOYSTICK
+# if !wxUSE_THREADS
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxJoystick requires threads in wxGTK"
+# else
+# undef wxUSE_JOYSTICK
+# define wxUSE_JOYSTICK 0
+# endif
+# endif
+# endif
+#endif /* wxGTK && !wxUniv */
+
+/* wxMSW-specific dependencies */
+#ifdef __WXMSW__
+# ifndef wxUSE_UNICODE_MSLU
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_UNICODE_MSLU must be defined."
+# else
+# define wxUSE_UNICODE_MSLU 0
+# endif
+# endif /* wxUSE_UNICODE_MSLU */
+# ifndef wxUSE_UXTHEME
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_UXTHEME must be defined."
+# else
+# define wxUSE_UXTHEME 0
+# endif
+# endif /* wxUSE_UXTHEME */
+# ifndef wxUSE_UXTHEME_AUTO
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_UXTHEME_AUTO must be defined."
+# else
+# define wxUSE_UXTHEME_AUTO 0
+# endif
+# endif /* wxUSE_UXTHEME_AUTO */
+# ifndef wxUSE_MS_HTML_HELP
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_MS_HTML_HELP must be defined."
+# else
+# define wxUSE_MS_HTML_HELP 0
+# endif
+# endif /* !defined(wxUSE_MS_HTML_HELP) */
+# ifndef wxUSE_DIALUP_MANAGER
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_DIALUP_MANAGER must be defined."
+# else
+# define wxUSE_DIALUP_MANAGER 0
+# endif
+# endif /* !defined(wxUSE_DIALUP_MANAGER) */
+
+# if !wxUSE_DYNAMIC_LOADER
+# if wxUSE_MS_HTML_HELP
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_MS_HTML_HELP requires wxUSE_DYNAMIC_LOADER."
+# else
+# define wxUSE_DYNAMIC_LOADER 1
+# endif
+# endif
+# if wxUSE_DIALUP_MANAGER
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_DIALUP_MANAGER requires wxUSE_DYNAMIC_LOADER."
+# else
+# define wxUSE_DYNAMIC_LOADER 1
+# endif
+# endif
+# endif /* wxUSE_DYNAMIC_LOADER */
+#endif /* wxMSW */
+
+/* wxMAC-specific dependencies */
+#ifdef __WXMAC__
+# if wxUSE_UNICODE
+# if !TARGET_CARBON
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_UNICODE is only supported for Carbon Targets."
+# else
+# define wxUSE_UNICODE 0
+# endif
+# endif
+# endif
+#endif /* wxMAC */
+/* wxMotif-specific dependencies */
+#if defined(__WXMOTIF__) && wxUSE_NOTEBOOK && !wxUSE_TAB_DIALOG
+# undef wxUSE_TAB_DIALOG
+# define wxUSE_TAB_DIALOG 1
+#endif
+
+/* wxMGL-specific dependencies */
+#ifdef __WXMGL__
+# if !wxUSE_PALETTE
+# error "wxMGL requires wxUSE_PALETTE=1"
+# endif
+#endif /* wxMGL */
+
+/* Hopefully we can emulate these dialogs in due course */
+#ifdef __SMARTPHONE__
+# ifdef wxUSE_COLOURDLG
+# undef wxUSE_COLOURDLG
+# define wxUSE_COLOURDLG 0
+# endif
+#endif /* __SMARTPHONE__ */
+
+
+/* generic controls dependencies */
+#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
+# if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG
+ /* all common controls are needed by these dialogs */
+# if !defined(wxUSE_CHOICE) || \
+ !defined(wxUSE_TEXTCTRL) || \
+ !defined(wxUSE_BUTTON) || \
+ !defined(wxUSE_CHECKBOX) || \
+ !defined(wxUSE_STATTEXT)
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "These common controls are needed by common dialogs"
+# else
+# undef wxUSE_CHOICE
+# define wxUSE_CHOICE 1
+# undef wxUSE_TEXTCTRL
+# define wxUSE_TEXTCTRL 1
+# undef wxUSE_BUTTON
+# define wxUSE_BUTTON 1
+# undef wxUSE_CHECKBOX
+# define wxUSE_CHECKBOX 1
+# undef wxUSE_STATTEXT
+# define wxUSE_STATTEXT 1
+# endif
+# endif
+# endif
+#endif /* !wxMSW || wxUniv */
+
+/* common dependencies */
+#if wxUSE_CALENDARCTRL
+# if !(wxUSE_SPINBTN && wxUSE_COMBOBOX)
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxCalendarCtrl requires wxSpinButton and wxComboBox"
+# else
+# undef wxUSE_SPINBTN