Don't dup stdout into stderr in the test suite. Don't rely on $port_type eq "UNIX" to mean case-preserving. Check against the real output of ar when creating archives.
Handle SHELL set on the command line properly for windows.