Alien-OpenSSL-Static

 view release on metacpan or  search on metacpan

bin/openssl-env-bash  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

use Alien::OpenSSL::Static;
use Text::ParseWords qw( shellwords );

my $bindir  = Alien::OpenSSL::Static->bin_dir;
my $cflags  = Alien::OpenSSL::Static->cflags;
my $ldflags = Alien::OpenSSL::Static->libs;

my $cpath = join ':', map {s/^-I//; $_} shellwords( $cflags );
my $librarypath = join ':', map {s/^-L//; $_} grep {m/^-L/} shellwords( $ldflags );

exec(qq{$ENV{SHELL} -c 'export PATH="$bindir:\$PATH" CFLAGS="$cflags \$CFLAGS" LDFLAGS="$ldflags \$LDFLAGS" CPATH="$cpath:\$CPATH" LIBRARY_PATH="$librarypath:\$LIBRARY_PATH";\$SHELL'});

bin/openssl-env-perl  view on Meta::CPAN


use strict;
use warnings;

use Alien::OpenSSL::Static;
use Text::ParseWords qw( shellwords );

my %stash = ();

$stash{PATH} = Alien::OpenSSL::Static->bin_dir;
$stash{CFLAGS} = Alien::OpenSSL::Static->cflags;
$stash{LDFLAGS} = Alien::OpenSSL::Static->libs;

$stash{CPATH} = join ':', map {s/^-I//; $_} shellwords( $stash{CFLAGS} );
$stash{LIBRARY_PATH} = join ':', map {s/^-L//; $_}
                                 grep {m/^-L/} shellwords( $stash{LDFLAGS} );

exit 1 unless scalar @ARGV and $ARGV[0];
my $key = $ARGV[0];

if ($key eq 'KEYS') {

t/00-use.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More tests => 2;
use Text::ParseWords qw/shellwords/;

BEGIN { use_ok( 'Alien::OpenSSL::Static' ); }

diag("Libs: ".Alien::OpenSSL::Static->libs);
diag("Cflags: ".Alien::OpenSSL::Static->cflags);
diag("Install type: ".Alien::OpenSSL::Static->install_type);

my %libs = map { $_ => 1 } shellwords( Alien::OpenSSL::Static->libs );
if ($^O eq 'MSWin32') {
	ok(1, 'Library defined') if ( defined($libs{'-lssl32'}) || defined($libs{'-lcrypto'}) );
} else {
	ok(defined($libs{'-lcrypto'}), 'Libcrypto defined');
}



( run in 0.559 second using v1.01-cache-2.11-cpan-94b05bcf43c )