all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
@ 2012-12-04  4:35 Josh
  2012-12-05  1:59 ` Glenn Morris
  2012-12-09  2:28 ` Paul Eggert
  0 siblings, 2 replies; 11+ messages in thread
From: Josh @ 2012-12-04  4:35 UTC (permalink / raw)
  To: 13078

Hi,

I tried building trunk under Cygwin for the first time a few days ago
(with the `--with-w32' switch, though I don't think that's relevant)
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.  Here's a snippet
of the session with some representative errors:

checking for cma_open in -lpthreads... no
./configure: line 10967: /cygdrive/c/Program: No such file or directory
*** Your version of pkg-config is too old. You need version 0.9.0 or newer.
*** See http://www.freedesktop.org/software/pkgconfig
checking for lgetfilecon in -lselinux... no
./configure: line 11304: /cygdrive/c/Program: No such file or directory
*** Your version of pkg-config is too old. You need version 0.9.0 or newer.
*** See http://www.freedesktop.org/software/pkgconfig
checking for gnutls_certificate_set_verify_function... no
[...]
checking for gpm.h... no
./configure: line 13122: /cygdrive/c/Program: No such file or directory
*** Your version of pkg-config is too old. You need version 0.9.0 or newer.
*** See http://www.freedesktop.org/software/pkgconfig
checking whether netdb declares h_errno... yes

In addition to the quoting problem, it appears that failure to open a
file is interpreted as having a version which is too old, which is
perhaps not ideal.  Here's the patch I applied locally that allowed me
to build successfully:

diff --git a/configure.ac b/configure.ac
index 085ca83..85c21e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1189,10 +1189,10 @@ AC_DEFUN([PKG_CHECK_MODULES], [
       *** The pkg-config script could not be found. Make sure it is
in your path, or give the full path to pkg-config with the PKG_CONFIG
environment variable or --with-pkg-config-prog.  Or see
http://www.freedesktop.org/software/pkgconfig to get pkg-config.])],
[$4])
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
-     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
            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
       :
     else
       AC_MSG_WARN([[Your version of Gtk+ will have problems with





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-04  4:35 bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces Josh
@ 2012-12-05  1:59 ` Glenn Morris
  2012-12-05  4:16   ` Stefan Monnier
  2012-12-05  5:13   ` Josh
  2012-12-09  2:28 ` Paul Eggert
  1 sibling, 2 replies; 11+ messages in thread
From: Glenn Morris @ 2012-12-05  1:59 UTC (permalink / raw)
  To: Josh; +Cc: 13078

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-05  1:59 ` Glenn Morris
@ 2012-12-05  4:16   ` Stefan Monnier
  2012-12-05  4:40     ` Glenn Morris
  2012-12-05  5:13   ` Josh
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2012-12-05  4:16 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Josh, 13078

>> -     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
>> +     if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then

I'd expect $PKG_CONFIG_MIN_VERSION to need quoting as well.
In my experience, $FOO variable references in sh scripts need to be
wrapped inside "..." by default to avoid such problem.


        Stefan





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-05  4:16   ` Stefan Monnier
@ 2012-12-05  4:40     ` Glenn Morris
  2012-12-05  5:01       ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Glenn Morris @ 2012-12-05  4:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Josh, 13078

Stefan Monnier wrote:

>>> -     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
>>> +     if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
>
> I'd expect $PKG_CONFIG_MIN_VERSION to need quoting as well.

It's a variable that we define ourselves rather than something we get
from the environment, and we know it doesn't contain spaces.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-05  4:40     ` Glenn Morris
@ 2012-12-05  5:01       ` Stefan Monnier
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2012-12-05  5:01 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Josh, 13078

>>>> -     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
>>>> +     if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
>> I'd expect $PKG_CONFIG_MIN_VERSION to need quoting as well.
> It's a variable that we define ourselves rather than something we get
> from the environment, and we know it doesn't contain spaces.

I tend to just put "..." everywhere except in those rare cases where
I know I want the expansion to be split at spaces.

This way I don't need to worry about whether or not this is fully under
my control and whether I'm really sure it won't ever have a space in it.

Served me well so far,


        Stefan





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-05  1:59 ` Glenn Morris
  2012-12-05  4:16   ` Stefan Monnier
@ 2012-12-05  5:13   ` Josh
  1 sibling, 0 replies; 11+ messages in thread
From: Josh @ 2012-12-05  5:13 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 13078

On Tue, Dec 4, 2012 at 5:59 PM, Glenn Morris <rgm@gnu.org> wrote:
> 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.)

Nor would I.  My patch addresses only the failure I encountered; it
might be worthwhile for someone more conversant with the build process
than I to investigate.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-04  4:35 bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces Josh
  2012-12-05  1:59 ` Glenn Morris
@ 2012-12-09  2:28 ` Paul Eggert
  2012-12-09  4:14   ` Josh
  2012-12-09  7:57   ` Andreas Schwab
  1 sibling, 2 replies; 11+ messages in thread
From: Paul Eggert @ 2012-12-09  2:28 UTC (permalink / raw)
  To: 13078-done

I looked into problems in this area in configure.ac and
fixed all the ones mentioned so far in this bug report,
along with some others, in trunk bzr 111162.  No doubt
there are similar problems in other parts of Emacs,
but at least this bug report we can mark 'done' so I've done that.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-09  2:28 ` Paul Eggert
@ 2012-12-09  4:14   ` Josh
  2012-12-09  7:57   ` Andreas Schwab
  1 sibling, 0 replies; 11+ messages in thread
From: Josh @ 2012-12-09  4:14 UTC (permalink / raw)
  To: 13078, eggert, josh; +Cc: 13078-done

Great, thanks for looking into it Paul.

Josh

On Sat, Dec 8, 2012 at 6:28 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> I looked into problems in this area in configure.ac and
> fixed all the ones mentioned so far in this bug report,
> along with some others, in trunk bzr 111162.  No doubt
> there are similar problems in other parts of Emacs,
> but at least this bug report we can mark 'done' so I've done that.
>
>
>





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-09  2:28 ` Paul Eggert
  2012-12-09  4:14   ` Josh
@ 2012-12-09  7:57   ` Andreas Schwab
  2012-12-09  9:05     ` Paul Eggert
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2012-12-09  7:57 UTC (permalink / raw)
  To: 13078; +Cc: josh, eggert

Paul Eggert <eggert@cs.ucla.edu> writes:

> I looked into problems in this area in configure.ac and
> fixed all the ones mentioned so far in this bug report,
> along with some others, in trunk bzr 111162.

This is wrong.  It must be possible to pass options in MAKEINFO and
PKG_CONFIG.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-09  7:57   ` Andreas Schwab
@ 2012-12-09  9:05     ` Paul Eggert
  2012-12-09 11:53       ` Andreas Schwab
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Eggert @ 2012-12-09  9:05 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: josh, 13078

On 12/08/2012 11:57 PM, Andreas Schwab wrote:
> This is wrong.  It must be possible to pass options in MAKEINFO and
> PKG_CONFIG.

MAKEINFO perhaps (and I see that you already changed that back),
but PKG_CONFIG was already documented as being a file name, not
a command with arguments, so it seems more appropriate to quote it.
If we want to make it possible to pass options to PKG_CONFIG,
we could add another 'configure' option to do that.

Is it documented anywhere that Emacs cannot be built if
the working directory has spaces or other special characters
in its fully qualified file name?  If not, perhaps it should be.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces
  2012-12-09  9:05     ` Paul Eggert
@ 2012-12-09 11:53       ` Andreas Schwab
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Schwab @ 2012-12-09 11:53 UTC (permalink / raw)
  To: Paul Eggert; +Cc: josh, 13078

Paul Eggert <eggert@cs.ucla.edu> writes:

> Is it documented anywhere that Emacs cannot be built if
> the working directory has spaces or other special characters
> in its fully qualified file name?

configure rejects them.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-12-09 11:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04  4:35 bug#13078: [PATCH] configure.ac: Cygwin build breaks when path to pkg-tool contains spaces Josh
2012-12-05  1:59 ` Glenn Morris
2012-12-05  4:16   ` Stefan Monnier
2012-12-05  4:40     ` Glenn Morris
2012-12-05  5:01       ` Stefan Monnier
2012-12-05  5:13   ` Josh
2012-12-09  2:28 ` Paul Eggert
2012-12-09  4:14   ` Josh
2012-12-09  7:57   ` Andreas Schwab
2012-12-09  9:05     ` Paul Eggert
2012-12-09 11:53       ` Andreas Schwab

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.