dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) dnl it's all white-space separated AC_DEFUN(AC_REMOVE_FORBIDDEN, [ __val=$$1 __forbid=" $2 " if test -n "$__val"; then __new="" ac_save_IFS=$IFS IFS=" " for i in $__val; do case "$__forbid" in *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; *) # Careful to not add spaces, where there were none, because otherwise # libtool gets confused, if we change e.g. CXX if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; esac done IFS=$ac_save_IFS $1=$__new fi ])