* not everybody uses bash
@ 2005-04-08 17:05 Han Boetes
2005-04-08 20:42 ` Greg KH
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Han Boetes @ 2005-04-08 17:05 UTC (permalink / raw)
To: linux-hotplug
Though most people do have which installed somewhere.
--- klibc/Makefile.orig 2005-04-08 18:34:56.827117248 +0200
+++ klibc/Makefile 2005-04-08 18:36:08.000297280 +0200
@@ -18,12 +18,12 @@
echo 'ARCH=$(ARCH)' >> $@
echo 'CROSS=$(CROSS)' >> $@
echo 'KCROSS=$(KCROSS)' >> $@
- echo "CC=$(shell bash -c 'type -p $(CC)')" >> $@
- echo "LD=$(shell bash -c 'type -p $(LD)')" >> $@
+ echo "CC=$(shell which gcc)" >> $@
+ echo "LD=$(shell which ld)" >> $@
echo 'REQFLAGS=$(filter-out -I%,$(REQFLAGS))' >> $@
echo 'OPTFLAGS=$(OPTFLAGS)' >> $@
echo 'LDFLAGS=$(LDFLAGS)' >> $@
- echo "STRIP=$(shell bash -c 'type -p $(STRIP)')" >> $@
+ echo "STRIP=$(shell which strip)" >> $@
echo 'STRIPFLAGS=$(STRIPFLAGS)' >> $@
echo 'EMAIN=$(EMAIN)' >> $@
echo 'BITSIZE=$(BITSIZE)' >> $@
@@ -34,7 +34,7 @@
$(CROSS)klcc: klcc.in $(CROSS)klibc.config makeklcc.pl
$(PERL) makeklcc.pl klcc.in $(CROSS)klibc.config \
- $(shell bash -c 'type -p $(PERL)') > $@ || ( rm -f $@ ; exit 1 )
+ $(shell which perl) > $@ || ( rm -f $@ ; exit 1 )
chmod a+x $@
# Han
--
_ (.".) _ And if sometime, somewhere, someone
'-'/. .\'-' asketh thee, Who kilt thee?, tell them it
/_ _\ _...._ 'twas the Doones of Bagworthy!
(` o o `)---` '.
jgs /"---"` \
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: not everybody uses bash
2005-04-08 17:05 not everybody uses bash Han Boetes
@ 2005-04-08 20:42 ` Greg KH
2005-04-10 0:20 ` [klibc] " H. Peter Anvin
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-04-08 20:42 UTC (permalink / raw)
To: linux-hotplug
On Fri, Apr 08, 2005 at 07:05:03PM +0200, Han Boetes wrote:
> Though most people do have which installed somewhere.
Care to send these patches to the klibc mailing list? That way we don't
get out of sync with the next update to klibc.
thanks,
greg k-h
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [klibc] not everybody uses bash
2005-04-08 17:05 not everybody uses bash Han Boetes
2005-04-08 20:42 ` Greg KH
@ 2005-04-10 0:20 ` H. Peter Anvin
2005-04-10 10:27 ` Han Boetes
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2005-04-10 0:20 UTC (permalink / raw)
To: linux-hotplug
Han Boetes wrote:
> Though most people do have which installed somewhere.
Denied. which has really bad properties on a lot of shells, and unless
you can trust "make" to invoke /usr/bin/which (or whatever it happens to
be), then you're screwed.
The reason the script invokes bash explicitly is to deal with people who
*aren't* using bash as a shell.
-hpa
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [klibc] not everybody uses bash
2005-04-08 17:05 not everybody uses bash Han Boetes
2005-04-08 20:42 ` Greg KH
2005-04-10 0:20 ` [klibc] " H. Peter Anvin
@ 2005-04-10 10:27 ` Han Boetes
2005-04-10 17:37 ` H. Peter Anvin
2005-04-10 17:53 ` Han Boetes
4 siblings, 0 replies; 6+ messages in thread
From: Han Boetes @ 2005-04-10 10:27 UTC (permalink / raw)
To: linux-hotplug
H. Peter Anvin wrote:
> Han Boetes wrote:
> > Though most people do have which installed somewhere.
>
> Denied. which has really bad properties on a lot of shells, and
> unless you can trust "make" to invoke /usr/bin/which (or
> whatever it happens to be), then you're screwed.
>
> The reason the script invokes bash explicitly is to deal with
> people who *aren't* using bash as a shell.
If people don't _have_ bash as a shell it won't work at all.
Every shell I know has ``type foo'' and return something like
``foo is /usr/bin/foo''
--- Makefile.orig 2005-04-10 11:27:49.523924416 +0200
+++ Makefile 2005-04-10 11:53:34.390069064 +0200
@@ -18,12 +18,12 @@
echo 'ARCH=$(ARCH)' >> $@
echo 'CROSS=$(CROSS)' >> $@
echo 'KCROSS=$(KCROSS)' >> $@
- echo "CC=$(shell bash -c 'type -p $(CC)')" >> $@
- echo "LD=$(shell bash -c 'type -p $(LD)')" >> $@
+ echo "CC=$(shell /bin/sh -c 'type $(CC)|sed "s,.* ,,"')" >> $@
+ echo "LD=$(shell /bin/sh -c 'type $(LD)|sed "s,.* ,,"')" >> $@
echo 'REQFLAGS=$(filter-out -I%,$(REQFLAGS))' >> $@
echo 'OPTFLAGS=$(OPTFLAGS)' >> $@
echo 'LDFLAGS=$(LDFLAGS)' >> $@
- echo "STRIP=$(shell bash -c 'type -p $(STRIP)')" >> $@
+ echo "STRIP=$(shell /bin/sh -c 'type $(STRIP)|sed "s,.* ,,"')" >> $@
echo 'STRIPFLAGS=$(STRIPFLAGS)' >> $@
echo 'EMAIN=$(EMAIN)' >> $@
echo 'BITSIZE=$(BITSIZE)' >> $@
@@ -34,7 +34,7 @@
$(CROSS)klcc: klcc.in $(CROSS)klibc.config makeklcc.pl
$(PERL) makeklcc.pl klcc.in $(CROSS)klibc.config \
- $(shell bash -c 'type -p $(PERL)') > $@ || ( rm -f $@ ; exit 1 )
+ $(shell /bin/sh -c 'type $(PERL)|sed "s,.* ,,"') > $@ || ( rm -f $@ ; exit 1 )
chmod a+x $@
%: local-%
# Han
--
(_) Consequences, Schmonsequences, as long as I'm rich. -- Looney
"==' Tunes, Ali Baba Bunny (1957, Chuck Jones)
" "
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [klibc] not everybody uses bash
2005-04-08 17:05 not everybody uses bash Han Boetes
` (2 preceding siblings ...)
2005-04-10 10:27 ` Han Boetes
@ 2005-04-10 17:37 ` H. Peter Anvin
2005-04-10 17:53 ` Han Boetes
4 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2005-04-10 17:37 UTC (permalink / raw)
To: linux-hotplug
Han Boetes wrote:
> H. Peter Anvin wrote:
>
>>Han Boetes wrote:
>>
>>>Though most people do have which installed somewhere.
>>
>>Denied. which has really bad properties on a lot of shells, and
>>unless you can trust "make" to invoke /usr/bin/which (or
>>whatever it happens to be), then you're screwed.
>>
>>The reason the script invokes bash explicitly is to deal with
>>people who *aren't* using bash as a shell.
>
>
> If people don't _have_ bash as a shell it won't work at all.
>
> Every shell I know has ``type foo'' and return something like
> ``foo is /usr/bin/foo''
>
"something like" isn't very good. Anyway, I already reimplemented the
path search in Perl in 1.0.6, eliminating the need for the shell to do
that job.
-hpa
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [klibc] not everybody uses bash
2005-04-08 17:05 not everybody uses bash Han Boetes
` (3 preceding siblings ...)
2005-04-10 17:37 ` H. Peter Anvin
@ 2005-04-10 17:53 ` Han Boetes
4 siblings, 0 replies; 6+ messages in thread
From: Han Boetes @ 2005-04-10 17:53 UTC (permalink / raw)
To: linux-hotplug
H. Peter Anvin wrote:
> Han Boetes wrote:
> > If people don't _have_ bash as a shell it won't work at all.
> >
> > Every shell I know has ``type foo'' and return something like
> > ``foo is /usr/bin/foo''
> >
>
> "something like" isn't very good.
Variations all resulted in the last argument being the full path
to the executable. And I've seen variations, so something like is
appropriate.
> Anyway, I already reimplemented the path search in Perl in
> 1.0.6, eliminating the need for the shell to do that job.
``#!/usr/bin/env perl'' works in most cases.
For the gcc, ld and strip you can use CC ?= cc, etc. since in that
case the path does resolve the binary name.
Indeed, that is also a solution.
Thanks for helping us poor non-bash users :-)
# Han
--
Lbh unir whfg ivbyngrq gur Qvtvgny Zvyyraavhz Pbclevtug Npg ol oernxvat gur
cebgrpgvba bs pbclevtugrq zngrevny. Vs lbh ner abg n pvgvmra be erfvqrag bs
gur HFN, lbh evfx orvat vzcevfbarq naq uryq jvgubhg onvy sbe hc gb gjb jrrxf
hcba ragel gb gur HFN (c) Copyright 2001 by Hartmann Schaffer (signature only)
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-10 17:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-08 17:05 not everybody uses bash Han Boetes
2005-04-08 20:42 ` Greg KH
2005-04-10 0:20 ` [klibc] " H. Peter Anvin
2005-04-10 10:27 ` Han Boetes
2005-04-10 17:37 ` H. Peter Anvin
2005-04-10 17:53 ` Han Boetes
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).