fcb4db055911064e9a0b998b5ae29eb9526d0070
[pspp-builds.git] / perl-module / Makefile.PL
1 use 5.008008;
2 use ExtUtils::MakeMaker;
3 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
4 # the contents of the Makefile that is written.
5
6
7 do 'pspp-module-config' || do {
8     my $build = prompt ("Enter the location of the build directory of the configured pspp source:", "" );
9     do 'lib/pspp-vers.pl' || die "No version info";
10     my $src = $top_srcdir;
11
12     %Locations = (SourceDir => "$src", BuildDir => "$build");
13 };
14
15 WriteMakefile(
16     FULLPERL          => "PSPP_TEST_CMD=\"$Locations{BuildDir}/src/ui/terminal/pspp -B $Locations{SourceDir}/config\" \$(PERL)",
17     NAME              => 'PSPP',
18     DISTNAME          => 'PSPP-Perl',
19     VERSION_FROM      => "$Locations{BuildDir}/src/libpspp/version.c", 
20     PREREQ_PM         => {POSIX=>0}, 
21     PM                => {"lib/PSPP.pm", "\$(INST_LIBDIR)/PSPP.pm"},
22     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
23       (ABSTRACT_FROM  => 'lib/PSPP.pm', # retrieve abstract from module
24        AUTHOR         => 'John Darrington <john@darrington.wattle.id.au>') : ()),
25     INC       => "-I $Locations{SourceDir}  -I $Locations{SourceDir}/src -I $Locations{SourceDir}/gl -I $Locations{BuildDir}/gl -I $Locations{BuildDir}", 
26     MYEXTLIB  => "$Locations{BuildDir}/src/.libs/libpspp-core.\$(DLEXT)",
27     MAN3PODS  => {"lib/PSPP.pm", "\$(INST_MAN3DIR)/PSPP.3pm",
28             "Examples.pod", "\$(INST_MAN3DIR)/PSPP::Examples.3pm"}
29 );
30
31 if  (eval {require ExtUtils::Constant; 1}) {
32   # If you edit these definitions to change the constants used by this module,
33   # you will need to use the generated const-c.inc and const-xs.inc
34   # files to replace their "fallback" counterparts before distributing your
35   # changes.
36   my @names = (qw());
37   ExtUtils::Constant::WriteConstants(
38                                      NAME         => 'PSPP',
39                                      NAMES        => \@names,
40                                      DEFAULT_TYPE => 'IV',
41                                      C_FILE       => 'const-c.inc',
42                                      XS_FILE      => 'const-xs.inc',
43                                   );
44
45 }
46 else {
47   use File::Copy;
48   use File::Spec;
49   foreach my $file ('const-c.inc', 'const-xs.inc') {
50     my $fallback = File::Spec->catfile('fallback', $file);
51     copy ($fallback, $file) or die "Can't copy $fallback to $file: $!";
52   }
53 }