Merge branch 'autoconf-fixes'

Correction to m4 macros used in programs and libraries using wxWidgets.
This commit is contained in:
Vadim Zeitlin
2015-09-03 00:06:53 +02:00

View File

@@ -519,7 +519,7 @@ AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO],
$2=0
elif test "$enableval" = "auto" ; then
AC_MSG_RESULT([will be automatically detected])
$2="auto"
$2=""
else
AC_MSG_ERROR([
Unrecognized option value (allowed values: yes, no, auto)
@@ -545,7 +545,7 @@ AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
$2=0
elif test "$withval" = "auto" ; then
AC_MSG_RESULT([will be automatically detected])
$2="auto"
$2=""
else
AC_MSG_ERROR([
Unrecognized option value (allowed values: yes, auto)
@@ -597,17 +597,17 @@ AC_DEFUN([WX_STANDARD_OPTIONS],
AC_MSG_CHECKING([for the --with-toolkit option])
if test "$withval" = "auto" ; then
AC_MSG_RESULT([will be automatically detected])
TOOLKIT="auto"
TOOLKIT=""
else
TOOLKIT="$withval"
dnl PORT must be one of the allowed values
if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \
if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a "$TOOLKIT" != "gtk3" -a \
"$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \
"$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \
"$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then
AC_MSG_ERROR([
Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11)
Unrecognized option value (allowed values: auto, gtk1, gtk2, gtk3, msw, motif, osx_carbon, osx_cocoa, dfb, x11)
])
fi
@@ -671,7 +671,7 @@ AC_DEFUN([WX_STANDARD_OPTIONS],
AC_MSG_CHECKING([for the --with-wxversion option])
if test "$withval" = "auto" ; then
AC_MSG_RESULT([will be automatically detected])
WX_RELEASE="auto"
WX_RELEASE=""
else
wx_requested_major_version=`echo $withval | \
@@ -706,7 +706,7 @@ dnl ---------------------------------------------------------------------------
dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
dnl
dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values
dnl which are different from "auto".
dnl which were specified.
dnl Thus this macro needs to be called only once all options have been set.
dnl ---------------------------------------------------------------------------
AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
@@ -730,11 +730,11 @@ AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no "
fi
if test "$TOOLKIT" != "auto" ; then
if test -n "$TOOLKIT" ; then
WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
fi
if test "$WX_RELEASE" != "auto" ; then
if test -n "$WX_RELEASE" ; then
WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE "
fi
@@ -748,16 +748,16 @@ AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
dnl ---------------------------------------------------------------------------
dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG])
dnl
dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets
dnl additional CPP flags and put the result of the search in WX_$RESULTVAR
dnl also adding the "yes" or "no" message result to MSG.
dnl Sets WX_$RESULTVAR to the value of $RESULTVAR if it's defined. Otherwise,
dnl auto-detect the value by checking for the presence of STRING in
dnl $WX_SELECTEDCONFIG (which is supposed to be set by caller) and set
dnl WX_$RESULTVAR to either 0 or 1, also outputting "yes" or "no" after MSG.
dnl ---------------------------------------------------------------------------
AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR],
[
if test "$$1" = "auto" ; then
if test -z "$$1" ; then
dnl The user does not have particular preferences for this option;
dnl so we will detect the wxWidgets relative build setting and use it
@@ -772,11 +772,9 @@ AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR],
if test "$WX_$1" != "0"; then
WX_$1=1
AC_MSG_RESULT([yes])
ifelse([$4], , :, [$4])
else
WX_$1=0
AC_MSG_RESULT([no])
ifelse([$5], , :, [$5])
fi
else
@@ -823,19 +821,16 @@ AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG"
fi
dnl we could test directly for WX_SHARED with a line like:
dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared],
dnl [if wxWidgets was built in SHARED mode])
dnl but wx-config --selected-config DOES NOT outputs the 'shared'
dnl word when wx was built in shared mode; it rather outputs the
dnl 'static' word when built in static mode.
if test $WX_SHARED = "1"; then
if test "$WX_SHARED" = "1"; then
STATIC=0
elif test $WX_SHARED = "0"; then
elif test "$WX_SHARED" = "0"; then
STATIC=1
elif test $WX_SHARED = "auto"; then
STATIC="auto"
fi
dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables
@@ -858,7 +853,7 @@ AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
AC_SUBST(WX_SHARED)
dnl detect the WX_PORT to use
if test "$TOOLKIT" = "auto" ; then
if test -z "$TOOLKIT" ; then
dnl The user does not have particular preferences for this option;
dnl so we will detect the wxWidgets relative build setting and use it
@@ -866,6 +861,7 @@ AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*")
WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*")
WX_GTKPORT3=$(expr "$WX_SELECTEDCONFIG" : ".*gtk3.*")
WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*")
WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*")
WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*")
@@ -876,6 +872,7 @@ AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
WX_PORT="unknown"
if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi
if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi
if test "$WX_GTKPORT3" != "0"; then WX_PORT="gtk3"; fi
if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi
if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi
if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi
@@ -899,14 +896,8 @@ AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
AC_MSG_RESULT([$WX_PORT])
else
dnl Use the setting given by the user
if test -z "$TOOLKIT" ; then
WX_PORT=$TOOLKIT
else
dnl try with PORT
WX_PORT=$PORT
fi
WX_PORT=$TOOLKIT
fi
AC_SUBST(WX_PORT)
@@ -938,17 +929,17 @@ AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
fi
dnl now we can finally update the DEBUG,UNICODE,SHARED options
dnl to their final values if they were set to 'auto'
if test "$DEBUG" = "auto"; then
dnl to their final values if they were not already set
if test -z "$DEBUG" ; then
DEBUG=$WX_DEBUG
fi
if test "$UNICODE" = "auto"; then
if test -z "$UNICODE" ; then
UNICODE=$WX_UNICODE
fi
if test "$SHARED" = "auto"; then
if test -z "$SHARED" ; then
SHARED=$WX_SHARED
fi
if test "$TOOLKIT" = "auto"; then
if test -z "$TOOLKIT" ; then
TOOLKIT=$WX_PORT
fi