1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
# -----------------------------------------------------------------------------
# $Id: openssl_config.PL 4705 2007-09-21 10:21:56Z pho $
# -----------------------------------------------------------------------------
use strict;
1;
sub openssl_config {
my $OPENSSL = shift;
$OPENSSL ||= {
LIBS => $ENV{LDFLAGS} || '',
CFLAGS => $ENV{CFLAGS} || '',
};
if ($^O eq 'MSWin32') {
_openssl_config_win32($OPENSSL);
}
else {
# FIXME: pkg-config を使うべき
$OPENSSL->{LIBS} .= " -lcrypto";
}
$OPENSSL->{LIBS} =~ s/^ +//;
$OPENSSL;
}
sub _openssl_config_win32
{
my $OPENSSL = shift;
my $openssl_path='c:/openssl';
if( -e $openssl_path && -x "$openssl_path/bin/openssl.exe" )
{
$OPENSSL->{CFLAGS} .= " -I$openssl_path/include";
use Config;
if( -e "$openssl_path/lib/vc" && $Config{cc} eq 'cl' && $Config{ccflags}=~/-(M[DLT])\b/ )
{
$OPENSSL->{LIBS} .= " -L$openssl_path/lib/vc -lssleay32$1 -llibeay32$1";
}else
{
$OPENSSL->{LIBS} .= " -L$openssl_path/lib -lssleay32 -llibeay32";
}
return;
}
}
# -----------------------------------------------------------------------------
# End of File.
# -----------------------------------------------------------------------------
|