Need some m4 wizardry to quote []s in configure.ac

Jeremy Huddleston jeremyhu at apple.com
Fri Mar 4 10:50:47 PST 2011


How do I quote []s in m4?  I've tried escaping with \, 's, "s, ... I'm out of tricks...  I'm trying to update the poll() checks in libxcb and libXt to allow poll on darwin11, but the []s are getting stripped.  darwin[789]* is becoming darwin789*, and the \([^ ]*\) in sed is becoming \(^ *\) ...

Here's what I want to do:

case $host_os in
        # darwin through Snow Leopard has poll() but can't be used to poll character devices.
        darwin[789]*|darwin10*) ;;
        darwin*)
                _ac_xorg_macosx_version_min=`echo $CPPFLAGS $CFLAGS | sed 's/^.*-mmacosx-version-min=\([^ ]*\).*$/\1/'`
                if test x$_ac_xorg_macosx_version_min = x ; then
                        _ac_xorg_macosx_version_min=$MACOSX_DEPLOYMENT_TARGET
                fi
                case $_ac_xorg_macosx_version_min in
                        10.[0123456]|10.[0123456].*) ;;
                        *)
                                AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
                        ;;
                esac
                unset _ac_xorg_macosx_version_min
                ;;
        *)
                AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
        ;;
esac



More information about the xorg-devel mailing list