Re: Handling multiple conditions in if statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 7, 2011 at 12:14, Eric Blake <eblake@xxxxxxxxxx> wrote:

> 'test -o' is completely non-portable.

Best to avoid that then

> case $build_os in
>  linux* | cygwin*) # case for linux, linux-gnu, and cygwin
>    ;;
>  *) # other platforms
>    ;;
> esac

case seems like the appropriate solution. Thanks.

> Finally, remember that while there are cases, like making sane guesses
> while cross-compiling, where probing $host_os is the only way, it goes
> against autoconf philosophy of testing features rather than platforms.
> And make sure that if you are making platform-specific variables that:
> 1) your code will still work even if your platform-specific guess was
> wrong (ie. guess pessimistically), and 2) you provide a cache variable
> to allow the user to override things if you guess wrong.

Thanks for the warning.

Cheers

Adam

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux