Show
Ignore:
Timestamp:
04/15/08 00:05:57 (5 years ago)
Author:
daisuke
Message:

lang/perl/Crypt-DH-GMP; Detect libgmp

Location:
lang/perl/Crypt-DH-GMP/trunk
Files:
3 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Crypt-DH-GMP/trunk/Makefile.PL

    r9443 r9444  
    11use strict; 
     2use inc::Devel::CheckLib; 
    23use ExtUtils::MakeMaker; 
     4 
     5# Check for hellish-ness 
     6my $RUNNING_IN_HELL = $^O eq 'MSWin32'; 
     7 
     8my $CCFLAGS = $ENV{CCFLAGS}; 
     9my $LDFLAGS = $ENV{LDFLAGS}; 
     10if (! $RUNNING_IN_HELL) { 
     11    $CCFLAGS ||= '-I/usr/local/include'; 
     12    $LDFLAGS ||= '-L/usr/local/lib'; 
     13} 
     14 
     15{ 
     16    eval { 
     17        Devel::CheckLib::assert_lib(lib => "gmp", LIBS => $LDFLAGS); 
     18    }; 
     19    if ($@) { 
     20        print <<EOM; 
     21 
     22*** Whoa! libgmp was not detected! *** 
     23 
     24Can't proceed without libgmp. 
     25You will have to install libgmp by yourself. 
     26 
     27EOM 
     28        exit 0; 
     29    } 
     30} 
     31 
    332 
    433# Stolen from Math::BigInt::GMP 
     
    1746    'NAME'          => 'Crypt::DH::GMP', 
    1847    'VERSION_FROM'  => 'lib/Crypt/DH/GMP.pm', 
    19     'LIBS'          => ['-lgmp'], 
     48    'LIBS'          => [ split(/\s+/, $LDFLAGS), '-lgmp'], 
    2049    'OBJECT'        => '$(O_FILES)', 
     50    'CCFLAGS'       => $CCFLAGS, 
    2151#    'OPTIMIZE'      => '-g', 
    2252);