PerlAlien / Alien-MSYS

Tools required for autogen scripts in Windows
1 stars 3 forks source link

Alien::MSYS linux windows-share

Tools required for GNU style configure scripts on Windows

SYNOPSIS

from Perl:

use Alien::MSYS;
# runs uname from MSYS
my $uname = msys { `uname` };

From Prompt/Makefile

C:\> perl -MAlien::MSYS -e Alien::MSYS::msys_run uname

DESCRIPTION

MSYS provides minimal shell and POSIX tools on Windows to enable GNU style configure scripts to run (the type usually generated by autoconf). This module aims to provide an interface for using MSYS on Windows and act as a no-op on Unix like operating systems which already have that capability. If you use this module, I recommend that you list this as a prerequisite only during MSWin32 installs.

When installing, this distribution will look for an existing MSYS using the following methods in this order:

If MSYS cannot be found using any of these methods, then it will download and install MSYS in this distribution's share directory.

FUNCTIONS

msys

# get the uname from MSYS
my $uname = msys { `uname` };

# run with GNU make from MSYS instead of
# dmake from Strawberry Perl
msys { system 'make' };

This function takes a single argument, a code reference, and runs it with the correctly set environment so that calls to the system function or the qx quote like operator will use MSYS instead of the default environment.

msys_run

# pass command through @ARGV
C:\> perl -MAlien::MSYS -e Alien::MSYS::msys_run uname

# pass command through @_
C:\> perl -MAlien::MSYS -e "Alien::MSYS::msys_run 'make'; Alien::MSYS::msys_run 'make install'"

This function runs a command with the MSYS environment. It gets the command and arguments either as passed to it, or if none are passed the the command is expected to be in @ARGV.

If the command fails then it will exit with a non-zero error code. This is useful, in the second example above if either make or make install fails, then the whole command will fail, also make install will not be attempted unless make succeeds.

msys_path

This function returns the full path to the MSYS bin directory.

CAVEATS

This Alien is big and slow to install. I am aware this is an annoying problem. It is also the only reliable way (that I know of) to install packages from source that use autotools on Strawberry or Visual C++ Perl. Here are some things that you can do to avoid this painful cost:

AUTHOR

Author: Graham Ollis plicease@cpan.org

Contributors:

Shawn Laffan (SLAFFAN, shawnlaffan)

bekuno

Zaki Mughal (zmughal)

COPYRIGHT AND LICENSE

This software is copyright (c) 2013-2022 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.