From mint-bounce@lists.fishpool.fi Thu Jan 7 15:05:07 2010 Message-ID: <4B463DE0.3030103@freesbee.fr> Date: Thu, 07 Jan 2010 21:02:40 +0100 From: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: mint@lists.fishpool.fi Subject: Re: [MiNT] trouble with mintlib + gcc 4.4.2 References: <4B45E231.6050006@freesbee.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Antivirus: avast! (VPS 100107-0, 07/01/2010), Outbound message X-Antivirus-Status: Clean X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: vincent.riviere@freesbee.fr Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id o07K56Bm001815 Miro Kropacek wrote: > echo `which cpp | sed -e 's/\/cpp//'` > > when I run this on easymint as "make all", I get: > > /bin/sh: alias: command not found > /usr/local/bin > > Does anybody know where that "command not found" comes from? It does not > happen in linux. which which will tell you the answer :-) Remember that by default the makefile commands are interpreted by /bin/sh, not your favourite shell. So you should run manually sh and test your command there. One solution could be to use: /usr/bin/which cpp because it will force using the external program and not the alias. But I don't like the absolute path. Another solution could be: env which cpp but it involves 2 external programs: env and which. An alternative could be the "type -p" sh builtin, but it may not be available on all shells. Personally I prefer the following: rpcgen-cmd := $(srcdir)/rpcgen -Y $(patsubst %/cpp,%,$(shell which cpp)) It is optimal because the only external command run is "which", executed directly from make without an intermediate sh. The the make function pathsubst remove the trailing filename. And note the := which initializes the rpcgen-cmd variable once and not on every invokation. MiKRO, check what is good for you, and please provide a patch. -- Vincent Rivière