Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 12BB0431FB6 for ; Thu, 20 Jan 2011 06:38:45 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I0RLsjVu4UlH for ; Thu, 20 Jan 2011 06:38:43 -0800 (PST) Received: from mail.loccal.net (gw.loccal.net [94.142.235.206]) by olra.theworths.org (Postfix) with ESMTP id C346E431FB5 for ; Thu, 20 Jan 2011 06:38:43 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.loccal.net (Postfix) with ESMTP id B9E6A10477; Thu, 20 Jan 2011 15:51:03 +0100 (CET) X-Virus-Scanned: amavisd-new at loccal.net Received: from mail.loccal.net ([127.0.0.1]) by localhost (mail.loccal.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eiQcI+y38qDw; Thu, 20 Jan 2011 15:51:01 +0100 (CET) Received: from steelpick.2x.cz (unknown [10.21.129.4]) by mail.loccal.net (Postfix) with ESMTPS id 29BA8103AB; Thu, 20 Jan 2011 15:51:01 +0100 (CET) Received: from wsh by steelpick.2x.cz with local (Exim 4.72) (envelope-from ) id 1Pfvep-00005U-Bh; Thu, 20 Jan 2011 15:38:39 +0100 From: Michal Sojka To: Andy Wingo Subject: Re: ./configure with CC="ccache gcc" doesn't work In-Reply-To: References: <87zkqvnbu7.fsf@steelpick.2x.cz> User-Agent: Notmuch/0.5-38-g923b170 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Thu, 20 Jan 2011 15:38:39 +0100 Message-ID: <87mxmv4p3k.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 14:38:45 -0000 On Thu, 20 Jan 2011, Andy Wingo wrote: > On Thu 20 Jan 2011 10:50, Michal Sojka 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 <