Subject: bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces

From: Glenn Morris <[email-masked]>
Date: Tue, 04 Dec 2012 20:59:34 -0500

Josh wrote:

> but the build failed because ./configure was finding a version of
> pkg-config whose path contained whitespace.  This exposed some quoting
> problems in configure.ac, fixed in the patch below.

Thanks, see comments below. (I wouldn't be surprised to learn that there
are similar problems for other variables.)

> --- a/configure.ac
> +++ b/configure.ac
[...]
> -     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
> +     if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
>          AC_MSG_CHECKING(for $2)
>
> -        if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD &&
> +        if "$PKG_CONFIG" --exists "$2" 2>&AS_MESSAGE_LOG_FD &&
>            $1_CFLAGS=`$PKG_CONFIG --cflags "$2" 2>&AS_MESSAGE_LOG_FD` &&
                        ^^^^^^^^^^^

>            $1_LIBS=`$PKG_CONFIG --libs "$2" 2>&AS_MESSAGE_LOG_FD`; then
                      ^^^^^^^^^^^

Surely these (and the --print-errors call) need quoting too?

>             edit_cflags="
> @@ -2027,7 +2027,7 @@ if test x"$pkg_check_gtk" = xyes; then
>      AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
>      GTK_OBJ="gtkutil.o $GTK_OBJ"
>      USE_X_TOOLKIT=none
> -    if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
> +    if "$PKG_CONFIG" --atleast-version=2.10 gtk+-2.0; then