Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steal from MakeMaker #24

Open
DrHyde opened this issue Jan 21, 2021 · 0 comments
Open

Steal from MakeMaker #24

DrHyde opened this issue Jan 21, 2021 · 0 comments

Comments

@DrHyde
Copy link
Owner

DrHyde commented Jan 21, 2021

Thsi ticket migrated from rt.cpan by @DrHyde. Originally reported by @schwern on 2007-12-31.

MakeMaker has learned, over the years, how to identify various operating
systems across various versions of Perl. Most of this code lies in
ExtUtils::MM via building up a big %Is hash.

Some of the trickier ones are here:

Win9x, which works differently than XP and NT.
$^O eq 'MSWin32' and Win32::IsWin95();

U/WIN:
$^O =~ /^uwin(-nt)?$/;

Netware, which sometimes leaves $^O as MSWin32
$Config{osname} eq 'NetWare';
MakeMaker goes ahead and sets $^O to 'NetWare'.

BeOS whose $^O fluctuated:
$^O =~ /beos/i;

VOS which MakeMaker treats mostly like Unix but I don't think it really
is. I've never actually seen one.
$^O eq 'vos';
You've got VOS. I think perlport is wrong, looking at Configure, but I
think perhaps at one point it was right. You might want to do a case
insensitive check.

QNX, a real time Unix.
$^O eq 'qnx';

Operationally, MakeMaker treats both Cygwin and U/WIN as Unix with very
little alteration. I would say they should identify as both Unix and
Windows.

MakeMaker also found it handy to identify the BSD flavors, though it's
not used much anymore. *bsd, bsdos, interix and dragonfly:
$^O =~ /^(?:free|net|open)bsd$/
or grep( $^O eq $_, qw(bsdos interix dragonfly) )

Darwin is mostly a BSD, it ships with BSD tools, but is such an
amalgamation that I don't think anyone would blame you for leaving it
out of a "BSD" category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant