Re: ./configure with CC="ccache gcc" doesn't work
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 20 Jan 2011 14:38:39 +0000 (15:38 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:43 +0000 (09:37 -0800)
76/38241e756e5d4fa227bf047fea46a47fb03197 [new file with mode: 0644]

diff --git a/76/38241e756e5d4fa227bf047fea46a47fb03197 b/76/38241e756e5d4fa227bf047fea46a47fb03197
new file mode 100644 (file)
index 0000000..2dfbe94
--- /dev/null
@@ -0,0 +1,133 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 12BB0431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 20 Jan 2011 06:38:45 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id I0RLsjVu4UlH for <notmuch@notmuchmail.org>;\r
+       Thu, 20 Jan 2011 06:38:43 -0800 (PST)\r
+Received: from mail.loccal.net (gw.loccal.net [94.142.235.206])\r
+       by olra.theworths.org (Postfix) with ESMTP id C346E431FB5\r
+       for <notmuch@notmuchmail.org>; Thu, 20 Jan 2011 06:38:43 -0800 (PST)\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by mail.loccal.net (Postfix) with ESMTP id B9E6A10477;\r
+       Thu, 20 Jan 2011 15:51:03 +0100 (CET)\r
+X-Virus-Scanned: amavisd-new at loccal.net\r
+Received: from mail.loccal.net ([127.0.0.1])\r
+       by localhost (mail.loccal.net [127.0.0.1]) (amavisd-new, port 10024)\r
+       with LMTP id eiQcI+y38qDw; Thu, 20 Jan 2011 15:51:01 +0100 (CET)\r
+Received: from steelpick.2x.cz (unknown [10.21.129.4])\r
+       by mail.loccal.net (Postfix) with ESMTPS id 29BA8103AB;\r
+       Thu, 20 Jan 2011 15:51:01 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.72)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1Pfvep-00005U-Bh; Thu, 20 Jan 2011 15:38:39 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: Andy Wingo <wingo@oblong.com>\r
+Subject: Re: ./configure with CC="ccache gcc" doesn't work\r
+In-Reply-To: <m339on7nq6.fsf@oblong.com>\r
+References: <m3ei8897za.fsf@oblong.com> <87zkqvnbu7.fsf@steelpick.2x.cz>\r
+       <m339on7nq6.fsf@oblong.com>\r
+User-Agent: Notmuch/0.5-38-g923b170 (http://notmuchmail.org) Emacs/23.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Thu, 20 Jan 2011 15:38:39 +0100\r
+Message-ID: <87mxmv4p3k.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 20 Jan 2011 14:38:45 -0000\r
+\r
+On Thu, 20 Jan 2011, Andy Wingo wrote:\r
+> On Thu 20 Jan 2011 10:50, Michal Sojka <sojkam1@fel.cvut.cz> writes:\r
+> \r
+> > Hmm, the IFS thing in configure seems annoying in this case. But you can\r
+> > create a little script containing\r
+> >\r
+> >   exec ccache gcc "$@"\r
+> >\r
+> > and set CC to the name of the script, cannot you?\r
+> \r
+> Sure.  But the ccache thing is fairly common, AFAIK, and IMO notmuch's\r
+> configure should either handle spaces in a non-absolute-path $CC or exit\r
+> with an error in that case.\r
+> \r
+> And, oddly enough, the $CC does succeed in compiling, modulo this build\r
+> error -- so it seems that the $IFS isn't actually providing any benefit\r
+> in this case.  (If the IFS did its job, I would expect to see an error\r
+> like "ccache gcc: command not found" or something.)\r
+\r
+Hmm, after experimenting a bit, it seems that there is no way to\r
+distinguish between the command with space in its name and your case\r
+with ccache.\r
+\r
+I tend to think that having IFS without space is not much useful here\r
+because plenty of software use GNU Make and it cannot handle file names\r
+with spaces at all. So many things would be really difficult, if someone\r
+use spaces in the name of his/her binaries such as gcc or xapian-config.\r
+\r
+I went through configure in notmuch and it seems that there is only one\r
+place where the value of IFS matters (the call to ldconfig), so we may\r
+want to apply the patch bellow. On the other hand, a brief look at\r
+Makefile reveals that there are many things that wont work if there are\r
+spaces in filanames[1], so I'm not sure whether to care about that\r
+single case at all.\r
+\r
+diff --git a/configure b/configure\r
+index c58dd0f..a196962 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -1,13 +1,5 @@\r
+ #! /bin/sh\r
\r
+-# Removing space from IFS makes it much easier to support filenames\r
+-# with spaces. See http://www.dwheeler.com/essays/filenames-in-shell.html\r
+-# for gory details.\r
+-IFS="$(printf '\n\t')"\r
+-\r
+-# Since we don't have space in IFS we use tab to separate things in lists\r
+-tab="$(printf '\t')"\r
+-\r
+ # Set several defaults (optionally specified by the user in\r
+ # environemnt variables)\r
+ CC=${CC:-gcc}\r
+@@ -303,11 +295,14 @@ elif [ $uname = "Linux" ] ; then\r
+     platform=LINUX\r
+     linker_resolves_library_dependencies=1\r
+     ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')\r
++    OLD_IFS=$IFS\r
++    IFS="$(printf '\n')" \r
+     for path in $ldconfig_paths; do\r
+        if [ "$path" = "$libdir_expanded" ]; then\r
+            libdir_in_ldconfig=1\r
+        fi\r
+     done\r
++    IFS=$OLD_IFS\r
+ else\r
+     printf "Unknown.\n"\r
+     cat <<EOF\r
+\r
+\r
+Footnotes: \r
+[1]  For example most commands in install targets contain unquoted\r
+     parameters so if DESTDIR contains a space, it wont work.\r
+\r