Skip to contentSkip to conversation

Stop using "which" in ./configure

Qemu-devel Laurent Vivier 4 participants 4 messages Jan 19, 2010

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines

Hi

Following the thread on the sdl-config patch, please find attached a patch to add a couple of portable shell functions which allow testing whehter a command/builtin is available and to find the full pathname of an executable in the PATH. This also replaces all uses of "which" in ./configure. (This should be applied on top of the sdl-config patch.)

Thanks,

Why don't you use "type -P" for "path_of" ?"

Regards,
Laurent

Signature · 3 lines
--------------------- [email protected]  ---------------------
"Tout ce qui est impossible reste à accomplir"    Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard
#1 lore raw
Quoted 1 line · Laurent Vivier

Why don't you use "type -P" for "path_of" ?"

I don't think that's portable enough:

    $ sh -c 'type -P ls'
    -P: not found
    ls is /bin/ls
Signature · 1 line
Loïc Minier
#2 lore raw
In reply to Laurent Vivier

Hello Laurent,

Good or bad "type -P" skips the aliases.

Thanks

Chris

Quoted 35 lines

-----Original Message-----
From:
[email protected] [mailto:[email protected] rg] On Behalf Of Laurent Vivier
Sent: Tuesday, January 19, 2010 4:36 AM
To: [email protected]
Cc: [email protected]
Subject: RE: [Qemu-devel] Stop using "which" in ./configure

Quoted 4 lines

Hi

Following the thread on the sdl-config patch, please find attached a patch to add a couple of portable shell functions which

allow testing

Quoted 1 line

whehter a command/builtin is available and to find the full

pathname of

Quoted 1 line

an executable in the PATH. This also replaces all uses of

"which" in

Quoted 1 line

./configure. (This should be applied on top of the

sdl-config patch.)

Quoted 2 lines

Thanks,

Why don't you use "type -P" for "path_of" ?"

Regards,
Laurent

Signature · 3 lines
--------------------- [email protected]  ---------------------
"Tout ce qui est impossible reste à accomplir"    Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard
#3 lore raw
In reply to Laurent Vivier
Quoted 11 lines · Laurent Vivier
Quoted 9 lines

Hi

Following the thread on the sdl-config patch, please find attached a patch to add a couple of portable shell functions which allow testing whehter a command/builtin is available and to find the full pathname of an executable in the PATH. This also replaces all uses of "which" in ./configure. (This should be applied on top of the sdl-config patch.)

Thanks,

Why don't you use "type -P" for "path_of" ?"

The standard "type" has no options.

Signature · 2 lines
Måns Rullgård
[email protected]