<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">use strict;
use warnings;
use lib 'inc';
use Config::AutoConf '0.19';
use File::Spec::Functions 'catdir';
use Capture::Tiny 'capture';
use MyBuilder;


my ($a,$b,$version) = capture {
    `$^X -MNAT -e 'print NAT-&gt;VERSION'`;
};
if ($version &amp;&amp; $version =~ /^\d+\.\d+$/) {
    print STDERR "\nOld NATools files found.\n";
    print STDERR "Please use 3rdParty/rm-old-nat.pl script to uninstall old NATools\n\n";
    exit 0;
}

my $DEBUG = 1;
my $builder = MyBuilder-&gt;new
  (
   module_name    =&gt; 'Lingua::NATools',
   license        =&gt; 'perl',
   dist_author    =&gt; ['Alberto SimÃµes &lt;ambs@cpan.org&gt;'],
   meta_merge =&gt; {
       resources =&gt; {
           repository =&gt; 'https://natura.di.uminho.pt/svn/main/Lingua/NATools/',
           bugtracker =&gt; 'https://rt.cpan.org/Public/Dist/Display.html?Name=Lingua-NATools',
       }
   },
   needs_compiler =&gt; 1,
   recursive_test_files =&gt; 1,
   requires =&gt; {
                'File::Copy'           =&gt; '0',
                'Lingua::PT::PLNbase'  =&gt; '0.17',
                'IO::Socket'           =&gt; '1.28',
                'XML::TMX'             =&gt; '0.21',
                'XML::DT'              =&gt; '0.44',
                'Test::Harness'        =&gt; '2.26',
                'Storable'             =&gt; '2.04',
                'MLDBM'                =&gt; '2.00',
                'Fcntl'                =&gt; '1.03',
                'POSIX'                =&gt; '0',
                'DB_File'              =&gt; '1.804',
                'DBI'                  =&gt; '0',
                'DBD::SQLite'          =&gt; '1.30',
                'File::Path'           =&gt; '1.06',
                'File::Spec'           =&gt; '0.86',
                'File::Copy'           =&gt; '2.06',
                'IPC::Open2'           =&gt; '1.01',
                'Time::HiRes'          =&gt; '1.2',
                'Term::ReadLine'       =&gt; '1.01',
                'Lingua::PTD'          =&gt; '1.00',
                'URI::Escape'          =&gt; '3.26',
                'Lingua::Identify'     =&gt; '0.17',
                'Test::Pod'            =&gt; '1.20',
                'Test::Pod::Coverage'  =&gt; '1.06',
                'ExtUtils::Manifest'   =&gt; '0',
                'ExtUtils::MakeMaker'  =&gt; '6.31',
                'Memoize'              =&gt; '0',
                'Text::NSP'            =&gt; '1.09',
                'List::MoreUtils'      =&gt; '0',
                'Parse::Yapp::Driver'  =&gt; '1.05',
                'Compress::Zlib'       =&gt; '1.16',
                'CGI'                  =&gt; '0',
               },
   configure_requires =&gt; {
                          'Config::AutoConf'   =&gt; '0.311',
                          'ExtUtils::PkgConfig' =&gt; '1.12',
                          'Capture::Tiny'        =&gt; '0.15',
                          'Parse::Yapp::Driver'  =&gt; '1.05',
                          'ExtUtils::CBuilder' =&gt; '0.27',
                          'ExtUtils::LibBuilder' =&gt; '0.01',
                          'Module::Build'      =&gt; '0.3603',
                         },
   build_requires =&gt; {
                      'Config::AutoConf'     =&gt; '0.311',
                      'ExtUtils::CBuilder'   =&gt; '0.27',
                      'Pod::Man'             =&gt; '0',
                      'ExtUtils::LibBuilder' =&gt; '0.01',
                      'Parse::Yapp::Driver'  =&gt; '1.05',
                      'Module::Build'        =&gt; '0.3603',
                      'Capture::Tiny'        =&gt; '0',
                      'Test::More'           =&gt; '0',
                     },
   script_files =&gt; [map { "scripts/nat-$_" } qw(StarDict dict mkMakefile rank
                                                addDict dumpDicts mkRealDict sentence-align
                                                codify	examplesExtractor ngramsIdx shell
                                                compareDicts lex2perl pair2tmx substDict
                                                create makeCWB tmx2pair)],
   add_to_cleanup =&gt; [
                      'src/*.o',
                      'src/*.so',
                      'src/*.dylib', 'src/*.dll',
                      'xs/*.c',
                      '*.log',
                      'lib/Lingua/NATools/PatternRules.pm',
                      'xs/*.o',
                      't/bin/*.o', 't/bin/*.exe',
                      't/bin/corpus', 't/bin/words',
                      'Lingua-NATools-*',
                      '_build',
                     ],
  );


our $CAC = Config::AutoConf-&gt;new();

# Check our version
$builder-&gt;set_version($CAC);

# Check stdc headers
$CAC-&gt;check_stdc_headers || $builder-&gt;FAIL;

# check libm
$builder-&gt;notes('cflags' =&gt; ""); # just make sure it gets initialized
my $lib = $CAC-&gt;check_lm(undef, sub { $builder-&gt;FAIL });
if ($lib) {
    $builder-&gt;notes('libs' =&gt; "-l$lib");
}

# check zlib
if ($CAC-&gt;check_lib("z", "gzopen")  &amp;&amp;
    $CAC-&gt;check_lib("z", "gzread")  &amp;&amp;
    $CAC-&gt;check_lib("z", "gzwrite") &amp;&amp;
    $CAC-&gt;check_lib("z", "gzclose")) {
    $builder-&gt;notes('libs' =&gt; ($builder-&gt;notes('libs') || "") . " -lz");
} else { $builder-&gt;FAIL }

# check glib-2.0
$builder-&gt;pkg_config_check($CAC, 'glib-2.0', '2.8');

# check sqlite3
$builder-&gt;pkg_config_check($CAC, 'sqlite3', '3.5.0');
# check we have the binary in the path
$builder-&gt;check_sqlite3($CAC);

# check berkeley DB
$builder-&gt;check_berkeley_db($CAC, "4.3");

if ($DEBUG) {
    $CAC-&gt;msg_notice("LIBS: "  ,$builder-&gt;notes('libs'));
    $CAC-&gt;msg_notice("CFLAGS: ",$builder-&gt;notes('cflags'));
}

# check snow leopard without wcsdup
$builder-&gt;notes('have_wcsdup' =&gt; 1);
if ($^O eq 'darwin') {
  require POSIX;
  my (undef, undef, $release) = POSIX::uname();
  if ($release =~ /^(\d+)/ and $1 &lt; 11) {
      $builder-&gt;notes('have_wcsdup' =&gt; 0);
  }
}

$builder-&gt;compute_lib_dir();
$builder-&gt;write_config_h();

$builder-&gt;add_build_element('usrlib');
$builder-&gt;install_path( 'usrlib' =&gt; $builder-&gt;notes('libdir') );

# $builder-&gt;add_build_element('pcfile');
# $builder-&gt;install_path( 'pcfile' =&gt; $builder-&gt;notes('pkgdir') );

# write build script
$builder-&gt;create_build_script;





</pre></body></html>