unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: Andy Wingo <wingo@oblong.com>
Cc: notmuch@notmuchmail.org
Subject: Re: ./configure with CC="ccache gcc" doesn't work
Date: Thu, 20 Jan 2011 15:38:39 +0100	[thread overview]
Message-ID: <87mxmv4p3k.fsf@steelpick.2x.cz> (raw)
In-Reply-To: <m339on7nq6.fsf@oblong.com>

On Thu, 20 Jan 2011, Andy Wingo wrote:
> On Thu 20 Jan 2011 10:50, Michal Sojka <sojkam1@fel.cvut.cz> writes:
> 
> > Hmm, the IFS thing in configure seems annoying in this case. But you can
> > create a little script containing
> >
> >   exec ccache gcc "$@"
> >
> > and set CC to the name of the script, cannot you?
> 
> Sure.  But the ccache thing is fairly common, AFAIK, and IMO notmuch's
> configure should either handle spaces in a non-absolute-path $CC or exit
> with an error in that case.
> 
> And, oddly enough, the $CC does succeed in compiling, modulo this build
> error -- so it seems that the $IFS isn't actually providing any benefit
> in this case.  (If the IFS did its job, I would expect to see an error
> like "ccache gcc: command not found" or something.)

Hmm, after experimenting a bit, it seems that there is no way to
distinguish between the command with space in its name and your case
with ccache.

I tend to think that having IFS without space is not much useful here
because plenty of software use GNU Make and it cannot handle file names
with spaces at all. So many things would be really difficult, if someone
use spaces in the name of his/her binaries such as gcc or xapian-config.

I went through configure in notmuch and it seems that there is only one
place where the value of IFS matters (the call to ldconfig), so we may
want to apply the patch bellow. On the other hand, a brief look at
Makefile reveals that there are many things that wont work if there are
spaces in filanames[1], so I'm not sure whether to care about that
single case at all.

diff --git a/configure b/configure
index c58dd0f..a196962 100755
--- a/configure
+++ b/configure
@@ -1,13 +1,5 @@
 #! /bin/sh
 
-# Removing space from IFS makes it much easier to support filenames
-# with spaces. See http://www.dwheeler.com/essays/filenames-in-shell.html
-# for gory details.
-IFS="$(printf '\n\t')"
-
-# Since we don't have space in IFS we use tab to separate things in lists
-tab="$(printf '\t')"
-
 # Set several defaults (optionally specified by the user in
 # environemnt variables)
 CC=${CC:-gcc}
@@ -303,11 +295,14 @@ elif [ $uname = "Linux" ] ; then
     platform=LINUX
     linker_resolves_library_dependencies=1
     ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
+    OLD_IFS=$IFS
+    IFS="$(printf '\n')" 
     for path in $ldconfig_paths; do
        if [ "$path" = "$libdir_expanded" ]; then
            libdir_in_ldconfig=1
        fi
     done
+    IFS=$OLD_IFS
 else
     printf "Unknown.\n"
     cat <<EOF


Footnotes: 
[1]  For example most commands in install targets contain unquoted
     parameters so if DESTDIR contains a space, it wont work.

  reply	other threads:[~2011-01-20 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 16:24 ./configure with CC="ccache gcc" doesn't work Andy Wingo
2011-01-20  9:50 ` Michal Sojka
2011-01-20 12:40   ` Andy Wingo
2011-01-20 14:38     ` Michal Sojka [this message]
2011-01-26 13:38       ` Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxmv4p3k.fsf@steelpick.2x.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=notmuch@notmuchmail.org \
    --cc=wingo@oblong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).