+dnl this macro checks for a three-valued command line --with argument:
+dnl possible arguments are 'yes', 'no', or 'sys'
+dnl usage: WX_ARG_SYS_WITH(option, helpmessage, variable-name)
+AC_DEFUN(WX_ARG_SYS_WITH,
+ [
+ AC_MSG_CHECKING("for --with-$1")
+ no_cache=0
+ AC_ARG_WITH($1, $2,
+ [
+ if test "$withval" = yes; then
+ ac_cv_use_$1='$3=yes'
+ elif test "$withval" = no; then
+ ac_cv_use_$1='$3=no'
+ elif test "$withval" = sys; then
+ ac_cv_use_$1='$3=sys'
+ else
+ AC_MSG_ERROR([Invalid value for --with-$1: should be yes, no or sys])
+ fi
+ ],
+ [
+ LINE=`grep "$3" ${wx_arg_cache_file}`
+ if test "x$LINE" != x ; then
+ eval "DEFAULT_$LINE"
+ else
+ no_cache=1
+ fi
+
+ ac_cv_use_$1='$3='$DEFAULT_$3
+ ])
+
+ eval "$ac_cv_use_$1"
+ if test "$no_cache" != 1; then
+ echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
+ fi
+
+ if test "$$3" = yes; then
+ AC_MSG_RESULT(yes)
+ elif test "$$3" = no; then
+ AC_MSG_RESULT(no)
+ elif test "$$3" = sys; then
+ AC_MSG_RESULT(system version)
+ else
+ AC_MSG_ERROR([Invalid value for --with-$1: should be yes, no or sys])
+ fi
+ ])
+