From 62c168ac21d56685e574845d447ae78f7dc92958 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 29 Jun 2020 22:15:26 +0200 Subject: [PATCH] Add --enable-menubar corresponding to wxUSE_MENUBAR to configure This is required in order to define wxUSE_MENUBAR for configure builds. --- configure | 42 ++++++++++++++++++++++++++++++++++++++++-- configure.in | 10 ++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 977eee3b90..1f4d6cddba 100755 --- a/configure +++ b/configure @@ -1319,6 +1319,7 @@ enable_tipdlg enable_progressdlg enable_wizarddlg enable_menus +enable_menubar enable_miniframe enable_tooltips enable_splines @@ -2274,7 +2275,8 @@ Optional Features: --enable-tipdlg use startup tips --enable-progressdlg use wxProgressDialog --enable-wizarddlg use wxWizard - --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes + --enable-menus use wxMenu and wxMenuItem classes + --enable-menubar use wxMenuBar class --enable-miniframe use wxMiniFrame class --enable-tooltips use wxToolTip class --enable-splines use spline drawing code @@ -11728,6 +11730,35 @@ fi eval "$wx_cv_use_menus" + enablestring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-menubar was given. +if test "${enable_menubar+set}" = set; then : + enableval=$enable_menubar; + if test "$enableval" = yes; then + wx_cv_use_menubar='wxUSE_MENUBAR=yes' + else + wx_cv_use_menubar='wxUSE_MENUBAR=no' + fi + +else + + wx_cv_use_menubar='wxUSE_MENUBAR=${'DEFAULT_wxUSE_MENUBAR":-$defaultval}" + +fi + + + eval "$wx_cv_use_menubar" + + enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -36559,7 +36590,14 @@ fi if test "$wxUSE_MENUS" = "yes"; then $as_echo "#define wxUSE_MENUS 1" >>confdefs.h - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu" + if test "$wxUSE_MENUBAR" = "yes"; then + $as_echo "#define wxUSE_MENUBAR 1" >>confdefs.h + + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu" + fi +elif test "$wxUSE_MENUBAR" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: wxMenuBar can't be used without wxMenu and will be disabled" >&5 +$as_echo "$as_me: WARNING: wxMenuBar can't be used without wxMenu and will be disabled" >&2;} fi if test "$wxUSE_MIMETYPE" = "yes"; then diff --git a/configure.in b/configure.in index 5be318d8dd..6ddd8eccd9 100644 --- a/configure.in +++ b/configure.in @@ -1007,7 +1007,8 @@ if test "$wxUSE_MSW" = 1 ; then DEFAULT_wxUSE_ACCESSIBILITY=yes fi -WX_ARG_FEATURE(menus, [ --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS) +WX_ARG_FEATURE(menus, [ --enable-menus use wxMenu and wxMenuItem classes], wxUSE_MENUS) +WX_ARG_FEATURE(menubar, [ --enable-menubar use wxMenuBar class], wxUSE_MENUBAR) WX_ARG_FEATURE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME) WX_ARG_FEATURE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS) WX_ARG_FEATURE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES) @@ -7314,7 +7315,12 @@ fi if test "$wxUSE_MENUS" = "yes"; then AC_DEFINE(wxUSE_MENUS) - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu" + if test "$wxUSE_MENUBAR" = "yes"; then + AC_DEFINE(wxUSE_MENUBAR) + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu" + fi +elif test "$wxUSE_MENUBAR" = "yes"; then + AC_MSG_WARN([wxMenuBar can't be used without wxMenu and will be disabled]) fi if test "$wxUSE_MIMETYPE" = "yes"; then