what is the best way to determine system OS?

Mike Meyer mwm at mired.org
Mon Apr 25 17:19:23 EDT 2005


claird at lairds.us (Cameron Laird) writes:

> In article <868y37osc7.fsf at guru.mired.org>, Mike Meyer  <mwm at mired.org> wrote:
>>What you should do instead is check on how to use the features you
>>want. If you watch a typical autoconf script, you'll see it groveling
>>through libraries, include files, and various directories looking for
>>subroutines, defines and commands. That's the idea, but without
>>knowing which features you're looking for, I can't say how you would
>>check for them.
[...]
> Not for me.
> Briefly, use of autoconf is FAR from a guarantee that everything works
> right when starting with a new flavor.

You're right - it's not a guarantee that everything works
right. Nothing is perfect. You may run into something that you haven't
dealt with before. Or you may run into a file that you're using as an
indicator that contains information in a totally different format than
you expect. Both of those will break both technics. Checking for
features just gives you the possibility of success on a new
platform. You don't have that if you check for platform name.

Autoconf does things the way it does for a reason. Back before
autoconf (when dinosaurs walked the earth, etc.) people made systems
portable in a variety of ad hoc ways. Those that checked for
particular features tended to be more portable/robust than those that
checked for system name and tweaked everything depending on that. They
were also easier to port to new platforms, as the first step in the
porting process - figuring out what features the platform didn't
provide - was already done.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list