File: Makefile.PL

package info (click to toggle)
pspp 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 69,768 kB
  • sloc: ansic: 276,489; xml: 18,462; sh: 6,445; python: 2,881; makefile: 125; perl: 64
file content (69 lines) | stat: -rw-r--r-- 3,007 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# PSPP - a program for statistical analysis.
# Copyright (C) 2019 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

use 5.008008;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.


do './pspp-module-config' || do {
    my $build = prompt ("Enter the location of the build directory of the configured pspp source:", "" );
    my $src = $top_srcdir;

    %Locations = (SourceDir => "$src", BuildDir => "$build");
};

WriteMakefile(
    MAKEFILE          => 'MakefileX',
    FULLPERL          => "PSPP_TEST_CMD=\"$Locations{BuildDir}/src/ui/terminal/pspp\" \$(PERL)",
    NAME              => 'PSPP',
    DISTNAME          => 'PSPP-Perl',
    VERSION_FROM      => "$Locations{BuildDir}/src/libpspp/version.c",
    PREREQ_PM         => {POSIX=>0},
    PM                => {"lib/PSPP.pm", "\$(INST_LIBDIR)/PSPP.pm"},
    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
      (ABSTRACT       => 'Perl extension to PSPP',
       AUTHOR         => 'John Darrington <john@darrington.wattle.id.au>') : ()),
    INC       => "-I $Locations{SourceDir}  -I $Locations{SourceDir}/src -I $Locations{SourceDir}/gl -I $Locations{BuildDir}/gl -I $Locations{BuildDir}",
    MYEXTLIB  => "$Locations{BuildDir}/src/.libs/libpspp-core.\$(SO)",
    MAN3PODS  => {"lib/PSPP.pm", "\$(INST_MAN3DIR)/PSPP.3pm",
	    "Examples.pod", "\$(INST_MAN3DIR)/PSPP::Examples.3pm"}
);

if  (eval {require ExtUtils::Constant; 1}) {
  # If you edit these definitions to change the constants used by this module,
  # you will need to use the generated const-c.inc and const-xs.inc
  # files to replace their "fallback" counterparts before distributing your
  # changes.
  my @names = (qw());
  ExtUtils::Constant::WriteConstants(
                                     NAME         => 'PSPP',
                                     NAMES        => \@names,
                                     DEFAULT_TYPE => 'IV',
                                     C_FILE       => 'const-c.inc',
                                     XS_FILE      => 'const-xs.inc',
                                  );

}
else {
  use File::Copy;
  use File::Spec;
  foreach my $file ('const-c.inc', 'const-xs.inc') {
    my $fallback = File::Spec->catfile('fallback', $file);
    copy ($fallback, $file) or die "Can't copy $fallback to $file: $!";
  }
}