autoconf
[Top][All Lists]
Advanced

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

Re: Handling multiple conditions in if statements


From: Adam Mercer
Subject: Re: Handling multiple conditions in if statements
Date: Thu, 7 Apr 2011 13:04:31 -0500

On Thu, Apr 7, 2011 at 12:14, Eric Blake <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]