Don't accept nonsensical --without-<toolkit> options in configure

Only --with-<toolkit> options make sense, something like --without-x11
couldn't possibly be useful and was actually actively harmful as it set
wxUSE_UNIVERSAL to 1 as a side effect.

Closes #2306.
This commit is contained in:
Vadim Zeitlin
2017-05-27 14:11:07 +02:00
parent aa7e10bb09
commit a7ae3de703
3 changed files with 118 additions and 24 deletions

View File

@@ -394,6 +394,16 @@ AC_DEFUN([WX_ARG_WITH],
dnl same as WX_ARG_WITH but makes it clear that the option is enabled by default
AC_DEFUN([WX_ARG_WITHOUT], [WX_ARG_WITH($1, [$2], $3, without)])
dnl variant of AC_ARG_WITH which doesn't accept --without-xxx varient
AC_DEFUN([WX_ARG_ONLY_WITH], [
AC_ARG_WITH($1, [$2], [
if test "$withval" != yes; then
AC_MSG_ERROR([Option --with-$1 doesn't accept any arguments])
fi
$3
])
])
dnl like WX_ARG_WITH but uses AC_ARG_ENABLE instead of AC_ARG_WITH
dnl usage: WX_ARG_ENABLE(option, helpmessage, var, [enablestring], [default])
dnl

108
configure vendored
View File

@@ -4247,78 +4247,162 @@ if test "${with_gtk+set}" = set; then :
fi
# Check whether --with-motif was given.
if test "${with_motif+set}" = set; then :
withval=$with_motif; wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1
withval=$with_motif;
if test "$withval" != yes; then
as_fn_error $? "Option --with-motif doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-osx_cocoa was given.
if test "${with_osx_cocoa+set}" = set; then :
withval=$with_osx_cocoa; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
withval=$with_osx_cocoa;
if test "$withval" != yes; then
as_fn_error $? "Option --with-osx_cocoa doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-osx_iphone was given.
if test "${with_osx_iphone+set}" = set; then :
withval=$with_osx_iphone; wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1
withval=$with_osx_iphone;
if test "$withval" != yes; then
as_fn_error $? "Option --with-osx_iphone doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-osx was given.
if test "${with_osx+set}" = set; then :
withval=$with_osx; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
withval=$with_osx;
if test "$withval" != yes; then
as_fn_error $? "Option --with-osx doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-cocoa was given.
if test "${with_cocoa+set}" = set; then :
withval=$with_cocoa; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
withval=$with_cocoa;
if test "$withval" != yes; then
as_fn_error $? "Option --with-cocoa doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-iphone was given.
if test "${with_iphone+set}" = set; then :
withval=$with_iphone; wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1
withval=$with_iphone;
if test "$withval" != yes; then
as_fn_error $? "Option --with-iphone doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-mac was given.
if test "${with_mac+set}" = set; then :
withval=$with_mac; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
withval=$with_mac;
if test "$withval" != yes; then
as_fn_error $? "Option --with-mac doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-wine was given.
if test "${with_wine+set}" = set; then :
withval=$with_wine; wxUSE_WINE="$withval" CACHE_WINE=1
withval=$with_wine;
if test "$withval" != yes; then
as_fn_error $? "Option --with-wine doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_WINE="$withval" CACHE_WINE=1
fi
# Check whether --with-msw was given.
if test "${with_msw+set}" = set; then :
withval=$with_msw; wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1
withval=$with_msw;
if test "$withval" != yes; then
as_fn_error $? "Option --with-msw doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-directfb was given.
if test "${with_directfb+set}" = set; then :
withval=$with_directfb; wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1
withval=$with_directfb;
if test "$withval" != yes; then
as_fn_error $? "Option --with-directfb doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-x11 was given.
if test "${with_x11+set}" = set; then :
withval=$with_x11; wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1
withval=$with_x11;
if test "$withval" != yes; then
as_fn_error $? "Option --with-x11 doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-qt was given.
if test "${with_qt+set}" = set; then :
withval=$with_qt; wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1
withval=$with_qt;
if test "$withval" != yes; then
as_fn_error $? "Option --with-qt doesn't accept any arguments" "$LINENO" 5
fi
wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1
fi
enablestring=
defaultval=
if test -z "$defaultval"; then

View File

@@ -415,18 +415,18 @@ fi
dnl we use AC_ARG_WITH and not WX_ARG_WITH for the toolkit options as they
dnl shouldn't default to wxUSE_ALL_FEATURES
AC_ARG_WITH(gtk, [[ --with-gtk[=VERSION] use GTK+, VERSION can be 3, 2 (default), 1 or "any"]], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(osx_cocoa, [ --with-osx_cocoa use Mac OS X (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(osx_iphone, [ --with-osx_iphone use iPhone OS X port], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(osx, [ --with-osx use Mac OS X (default port, Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(cocoa, [ --with-cocoa same as --with-osx_cocoa], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(iphone, [ --with-iphone same as --with-osx_iphone], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(mac, [ --with-mac same as --with-osx], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1])
AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(osx_cocoa, [ --with-osx_cocoa use Mac OS X (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(osx_iphone, [ --with-osx_iphone use iPhone OS X port], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(osx, [ --with-osx use Mac OS X (default port, Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(cocoa, [ --with-cocoa same as --with-osx_cocoa], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(iphone, [ --with-iphone same as --with-osx_iphone], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(mac, [ --with-mac same as --with-osx], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1])
WX_ARG_ONLY_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
WX_ARG_ONLY_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1])
WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX)
WX_ARG_ENABLE(gpe, [ --enable-gpe use GNOME PDA Environment features if possible], wxUSE_GPE)