Gnus development mailing list
 help / color / mirror / Atom feed
* BUG: 'configure' doesn't preserve spaces in directory path; fixes
@ 2006-04-03 15:12 Chris Shenton
  2006-04-03 23:37 ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Shenton @ 2006-04-03 15:12 UTC (permalink / raw)


I'm building Gnus from CVS on OS X with Aquamacs Emacs.  It's
installed in /Applications/Aquamacs Emacs.app; note the space.  I can
do the config like:

 ./configure --prefix=/Applications/Aquamacs\ Emacs.app/Contents/Resources

It breaks here:

  checking where .elc files should go... ./configure: line 1547: test:
  /Applications/Aquamacs: binary operator expected
  ./configure: line 1547: test: /Applications/Aquamacs: binary operator
  expected
  $(datadir)/emacs/site-lisp/gnus

If I remove OS X stock /usr/bin/emacs and instead symlink it to
/Applications/Aquamacs\ Emacs.app and then do an configure (unadorned,
or with --prefix=/usr/local) it seems to work, but note the URL
version it finds:

  ./configure --prefix=/usr/local
  ...
  checking for acceptable URL version... "/Applications/Aquamacs Emacs.app/Contents/Resources/lisp/url/"
  ...

A "make" fails immediately:

  URLDIR=/Applications/Aquamacs Emacs.app/Contents/Resources/lisp/url/ W3DIR=no lispdir=/usr/share/emacs/site-lisp/gnus srcdir=. emacs -batch   -q -no-site-file -l ./dgnushack.el -f dgnushack-make-cus-load .
  /bin/sh: line 1: Emacs.app/Contents/Resources/lisp/url/: No such file or directory

If I quote the dirs in ./lisp/Makefile like the following, it works:

EMACS_COMP = URLDIR="$(URLDIR)" W3DIR="$(W3DIR)" lispdir="$(lispdir)" srcdir="$(srcdir)" $(EMACS) $(FLAGS)


I'm not really familiar with "configure", but the following patch got
it to work for me using

  --prefix="/Applications/Aquamacs Emacs.app/Contents/Resources

  
*** configure.~7.3.~            Tue Oct  4 05:38:54 2005
--- configure                   Mon Apr  3 11:02:49 2006
***************
*** 1125,1131 ****
      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
    fi
  fi
! for ac_site_file in $CONFIG_SITE; do
    if test -r "$ac_site_file"; then
      { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
  echo "$as_me: loading site script $ac_site_file" >&6;}
--- 1125,1131 ----
      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
    fi
  fi
! for ac_site_file in "$CONFIG_SITE"; do
    if test -r "$ac_site_file"; then
      { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
  echo "$as_me: loading site script $ac_site_file" >&6;}
***************
*** 1544,1550 ****
      fi
      for thedir in share lib; do
      potential=
!     if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
             if test "$EMACS_FLAVOR" = "xemacs"; then
                    lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/lisp/gnus"
             else
--- 1544,1550 ----
      fi
      for thedir in share lib; do
      potential=
!     if test -d "${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp"; then
             if test "$EMACS_FLAVOR" = "xemacs"; then
                    lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/lisp/gnus"
             else



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

* Re: BUG: 'configure' doesn't preserve spaces in directory path; fixes
  2006-04-03 15:12 BUG: 'configure' doesn't preserve spaces in directory path; fixes Chris Shenton
@ 2006-04-03 23:37 ` Katsumi Yamaoka
  2006-04-05 15:24   ` Reiner Steib
  0 siblings, 1 reply; 3+ messages in thread
From: Katsumi Yamaoka @ 2006-04-03 23:37 UTC (permalink / raw)
  Cc: Chris Shenton

Hi,

First of all, should it be fixed even if there seem to be only a
few days up to release?  Though I have a solution.

>>>>> In <86slouae1h.fsf@PECTOPAH.shenton.org> Chris Shenton wrote:

> I'm building Gnus from CVS on OS X with Aquamacs Emacs.  It's
> installed in /Applications/Aquamacs Emacs.app; note the space.  I can
> do the config like:

>  ./configure --prefix=/Applications/Aquamacs\ Emacs.app/Contents/Resources

> It breaks here:

>   checking where .elc files should go... ./configure: line 1547: test:
>   /Applications/Aquamacs: binary operator expected
>   ./configure: line 1547: test: /Applications/Aquamacs: binary operator
>   expected
>   $(datadir)/emacs/site-lisp/gnus

> If I remove OS X stock /usr/bin/emacs and instead symlink it to
> /Applications/Aquamacs\ Emacs.app and then do an configure (unadorned,
> or with --prefix=/usr/local) it seems to work, but note the URL
> version it finds:

>   ./configure --prefix=/usr/local
>   ...
>   checking for acceptable URL version... "/Applications/Aquamacs Emacs.app/Contents/Resources/lisp/url/"
>   ...

> A "make" fails immediately:

>   URLDIR=/Applications/Aquamacs Emacs.app/Contents/Resources/lisp/url/ W3DIR=no lispdir=/usr/share/emacs/site-lisp/gnus srcdir=. emacs -batch   -q -no-site-file -l ./dgnushack.el -f dgnushack-make-cus-load .
>   /bin/sh: line 1: Emacs.app/Contents/Resources/lisp/url/: No such file or directory

> If I quote the dirs in ./lisp/Makefile like the following, it works:

> EMACS_COMP = URLDIR="$(URLDIR)" W3DIR="$(W3DIR)" lispdir="$(lispdir)" srcdir="$(srcdir)" $(EMACS) $(FLAGS)

> I'm not really familiar with "configure", but the following patch got
> it to work for me using

>   --prefix="/Applications/Aquamacs Emacs.app/Contents/Resources

> *** configure.~7.3.~            Tue Oct  4 05:38:54 2005
> --- configure                   Mon Apr  3 11:02:49 2006
> ***************
> *** 1125,1131 ****
>       CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
>     fi
>   fi
> ! for ac_site_file in $CONFIG_SITE; do
>     if test -r "$ac_site_file"; then
>       { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
>   echo "$as_me: loading site script $ac_site_file" >&6;}
> --- 1125,1131 ----
>       CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
>     fi
>   fi
> ! for ac_site_file in "$CONFIG_SITE"; do
>     if test -r "$ac_site_file"; then
>       { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
>   echo "$as_me: loading site script $ac_site_file" >&6;}
> ***************
> *** 1544,1550 ****
>       fi
>       for thedir in share lib; do
>       potential=
> !     if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
>              if test "$EMACS_FLAVOR" = "xemacs"; then
>                     lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/lisp/gnus"
>              else
> --- 1544,1550 ----
>       fi
>       for thedir in share lib; do
>       potential=
> !     if test -d "${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp"; then
>              if test "$EMACS_FLAVOR" = "xemacs"; then
>                     lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/lisp/gnus"
>              else

Your patch solves two problems.  One is due to the AC_SITE_LOAD
macro defined in autoconf, the other is caused by the
AC_PATH_LISPDIR macro defined in aclocal.m4 which Gnus provides.
I don't think modifying the configure script is a good idea
because it should be generated automatically by autoconf.
Instead, my solution which modifies Gnus' aclocal.m4 is below.
However, I'm not sure whether redefining the AC_SITE_LOAD macro
is a right way.  Anyone?

--- aclocal.m4~	2005-10-04 08:37:27 +0000
+++ aclocal.m4	2006-04-03 23:35:24 +0000
@@ -91,7 +91,8 @@
     fi
     for thedir in share lib; do
 	potential=
-	if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
+	dnl The directory name should be quoted because it might contain spaces.
+	if test -d "${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp"; then
            if test "$EMACS_FLAVOR" = "xemacs"; then
 	       lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/lisp/gnus"
            else
@@ -322,6 +323,28 @@
 AC_SUBST(USE_FONTS)
 ])
 
+# Redefine AC_SITE_LOAD which is originally defined in general.m4.
+# ----------------------------------------------------------------
+# Look for site or system specific initialization scripts.
+m4_define([AC_SITE_LOAD],
+[# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+dnl $CONFIG_SITE should be quoted because the value might contain spaces.
+for ac_site_file in "$CONFIG_SITE"; do
+  if test -r "$ac_site_file"; then
+    AC_MSG_NOTICE([loading site script $ac_site_file])
+    sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD
+    . "$ac_site_file"
+  fi
+done
+])
+
 ifelse(dnl	Do not change this comment
    arch-tag: 5c987641-c3ef-4f12-b067-028302282c66
 )dnl



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

* Re: BUG: 'configure' doesn't preserve spaces in directory path; fixes
  2006-04-03 23:37 ` Katsumi Yamaoka
@ 2006-04-05 15:24   ` Reiner Steib
  0 siblings, 0 replies; 3+ messages in thread
From: Reiner Steib @ 2006-04-05 15:24 UTC (permalink / raw)


On Tue, Apr 04 2006, Katsumi Yamaoka wrote:

> First of all, should it be fixed even if there seem to be only a
> few days up to release?  Though I have a solution.

I'd suggest to wait.  Experience with AUCTeX shows that it's quite
hard to deal with spaces in filenames correctly without breaking in
other situations.

> Instead, my solution which modifies Gnus' aclocal.m4 is below.
> However, I'm not sure whether redefining the AC_SITE_LOAD macro
> is a right way.  Anyone?

(I didn't look at it carefully.)  We may want to look how AUCTeX' does
it.  AFAIK it deal with spaces quite good now.  Oh, I see that AUCTeX
(or preview-latex) has used code from you:

,----[ auctex/aclocal.m4 ]
| dnl this was once done by Katsumi Yamaoka <yamaoka@jpl.org>, but
| dnl pretty much no original code remains.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2006-04-05 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-03 15:12 BUG: 'configure' doesn't preserve spaces in directory path; fixes Chris Shenton
2006-04-03 23:37 ` Katsumi Yamaoka
2006-04-05 15:24   ` Reiner Steib

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).