Diff of /Makefile.PL [b73ac3] .. [9bcce7]  Maximize  Restore

Switch to unified view

a/Makefile.PL b/Makefile.PL
1
# Makefile.PL for a package defined by PP code.
1
# Makefile.PL for a package defined by PP code.
2
2
3
use ExtUtils::MakeMaker;
3
use ExtUtils::MakeMaker;
4
use Config;
4
use Config;
5
5
6
# comment this block out for PDL internal version
6
#eval {
7
eval {
7
#  require PDL::Core::Dev;  # needed for stand-alone version of package.
8
  require PDL::Core::Dev;  # needed for stand-alone version of package.
8
#                           # Need to comment out
9
                           # Need to comment out
9
#                           # for package included in PDL distro.
10
                           # for package included in PDL distro.
10
#
11
11
#  PDL::Core::Dev->import;
12
  PDL::Core::Dev->import;
12
#};
13
};
13
#my $pdl_installed = ($@) ? 0 : 1; # make always == 1 for install from PDL distro.
14
my $pdl_installed = ($@) ? 0 : 1; # make always == 1 for install from PDL distro.
14
my $pdl_installed = 1;
15
#print "PDL ", ($pdl_installed ? '' : 'not'), " installed\n";
15
print "PDL ", ($pdl_installed ? 'is' : 'is not'), " installed\n";
16
# end comment this block out for PDL internal version
17
18
#my $pdl_installed = 1; # uncomment for PDL-internal version
16
19
17
if (!$pdl_installed) {
20
if (!$pdl_installed) {
18
  # write dummy makefile if PDL not installed
21
  # write dummy makefile if PDL not installed
19
  WriteMakefile(
22
  WriteMakefile(
20
        'NAME'         => 'PDL::Graphics::PLplot',
23
        'NAME'         => 'PDL::Graphics::PLplot',
...
...
23
  exit;
26
  exit;
24
}
27
}
25
28
26
use vars qw /$plplotvers/; # version of plplot used
29
use vars qw /$plplotvers/; # version of plplot used
27
30
28
# 
31
#
29
## Search for plplot library and include file
32
## Search for plplot library and include file
30
#
33
#
31
print "\nChecking PDL::Graphics::PLplot...\n";
34
print "\nChecking PDL::Graphics::PLplot...\n";
32
35
33
unlink ("OPTIONS!"); # remove file uses to communicate with plplot.pd
36
unlink ("OPTIONS!"); # remove file uses to communicate with plplot.pd
...
...
37
#
40
#
38
my $libname = "libplplotd." . $Config{"so"};
41
my $libname = "libplplotd." . $Config{"so"};
39
my $libname_static = "libplplotd.a";
42
my $libname_static = "libplplotd.a";
40
my $incname = "plplot.h";
43
my $incname = "plplot.h";
41
44
42
43
# require bad value support.  D. Hunt 10/20/2008
45
# require bad value support.  D. Hunt 10/20/2008
44
unless ($PDL::Config{WITH_BADVAL}) {
46
unless ($PDL::Config{WITH_BADVAL}) {
45
  buildDummy ("Bad value support required!  (Turn on WITH_BADVAL in perldl.conf)");
47
  buildDummy ("Bad value support required!  (Turn on WITH_BADVAL in perldl.conf)");
46
  return if (caller); exit;
48
  return if (caller); exit;
47
}
49
}
48
50
49
my $found_plplot =
50
    (defined($PDL::Config{WITH_PLPLOT}) && (!$PDL::Config{WITH_PLPLOT}))
51
    ? 0 : 1;
52
print "found_plplot is $found_plplot\n";
53
unless ($found_plplot) {
54
  buildDummy ("User requested no PLplot interface!");
55
  return if (caller); exit;
56
}
57
foreach my $libdir (
51
foreach my $libdir (
52
          $ENV{PLPLOT_LIBDIR},
53
          $PDL::Config{WHERE_PLPLOT_LIBS},
58
            '/usr/local/plplot/lib64',
54
            '/usr/local/plplot/lib64',
59
                    '/usr/local/plplot/lib',
55
                    '/usr/local/plplot/lib',
60
            '/usr/local/lib64',
56
            '/usr/local/lib64',
61
            '/usr/local/lib',
57
            '/usr/local/lib',
62
            '/opt/local/lib',
58
            '/opt/local/lib',
...
...
64
            '/usr/lib',
60
            '/usr/lib',
65
            '/opt/lib64',
61
            '/opt/lib64',
66
            '/opt/lib',
62
            '/opt/lib',
67
            '/ops/tools/lib',
63
            '/ops/tools/lib',
68
                    '/sw/lib/',    # default FINK installation
64
                    '/sw/lib/',    # default FINK installation
69
          $PDL::Config{WHERE_PLPLOT_LIBS},
70
                          # Add new library paths here!!
65
                          # Add new library paths here!!
71
            ) {
66
            ) {
72
67
73
  if (-e "$libdir/$libname") {
68
  if (-e "$libdir/$libname") {
74
    $plplot_lib_path = $libdir;
69
    $plplot_lib_path = $libdir;
...
...
87
  buildDummy ("Cannot find plplot library ($libname), skipping PDL::Graphics::PLplot\n");
82
  buildDummy ("Cannot find plplot library ($libname), skipping PDL::Graphics::PLplot\n");
88
  return if (caller); exit;
83
  return if (caller); exit;
89
}
84
}
90
85
91
foreach my $incdir (
86
foreach my $incdir (
87
          $ENV{PLPLOT_INCDIR},
88
          $PDL::Config{WHERE_PLPLOT_INCLUDE},
92
                    '/usr/local/plplot/include',
89
                    '/usr/local/plplot/include',
93
                    '/usr/local/plplot/include/plplot',
90
                    '/usr/local/plplot/include/plplot',
94
            '/usr/local/include/plplot',
91
            '/usr/local/include/plplot',
95
            '/usr/local/include',
92
            '/usr/local/include',
96
            '/opt/local/include',
93
            '/opt/local/include',
...
...
98
            '/usr/include/plplot',
95
            '/usr/include/plplot',
99
            '/opt/include',
96
            '/opt/include',
100
            '/ops/tools/include/plplot',
97
            '/ops/tools/include/plplot',
101
            '/ops/tools/include',
98
            '/ops/tools/include',
102
                    '/sw/include/plplot/',    # default FINK installation
99
                    '/sw/include/plplot/',    # default FINK installation
103
          $PDL::Config{WHERE_PLPLOT_INCLUDE},
104
                          # Add new header paths here!!
100
                          # Add new header paths here!!
105
            ) {
101
            ) {
106
102
107
  if (-e "$incdir/$incname") {
103
  if (-e "$incdir/$incname") {
108
    $plplot_include_path = "-I$incdir";
104
    $plplot_include_path = "-I$incdir";
...
...
126
main () {  printf  ("%d", sizeof (PLFLT)); }
122
main () {  printf  ("%d", sizeof (PLFLT)); }
127
EOC
123
EOC
128
124
129
unless ($size == 8) {
125
unless ($size == 8) {
130
  print "          Sizeof(PLFLT) must be 8. PLplot must be compiled --with-double (IE ./configure --with-double)\n";
126
  print "          Sizeof(PLFLT) must be 8. PLplot must be compiled --with-double (IE ./configure --with-double)\n";
131
  $found_plplot = 0;
127
  buildDummy ("Cannot find good set of libraries for linking PLplot, try fiddling perldl.conf\n");
128
  return if (caller); exit;
132
} 
129
}
133
130
134
# Try linking with library.  New if blocks should be added if necessary
131
# Try linking with library.  New if blocks should be added if necessary
135
my $libs;
132
my $libs;
136
foreach my $l (
133
foreach my $l (
137
           "-L$plplot_lib_path -lplplotd -lX11",
134
           "-L$plplot_lib_path -lplplotd -lX11",
...
...
211
  open (OPT, ">>OPTIONS!");
208
  open (OPT, ">>OPTIONS!");
212
  print OPT "PLPOLY3 = 5\n";
209
  print OPT "PLPOLY3 = 5\n";
213
  close OPT;
210
  close OPT;
214
}  
211
}  
215
212
213
# Test if PLplot has the routine plseed, found only in plplot 5.9 svn and later
214
eval { compileAndRun ("$plplot_include_path -L$plplot_lib_path -lplplotd",0,<<'EOC');
215
#include <plplot.h>
216
main () { c_plseed(0);}
217
EOC
218
};
219
if ($@){
220
    print "\tc_plseed function not found, plplot versionn 5.9 or earlier!\n";
221
    open (OPT,">>OPTIONS!");
222
    print OPT "NOPLSEED!\n";
223
    close OPT;
224
} else {
225
    print "\tc_plseed function found, version 5.9 SVN or later!\n";
226
}
227
216
$PDL::Config{WITH_PLPLOT} = 1;
228
$PDL::Config{WITH_PLPLOT} = 1;
217
229
218
#
230
#
219
## new way to get writemakefile args...
231
## new way to get writemakefile args...
220
#
232
#
221
@pack = (["plplot.pd",PLplot,PDL::Graphics::PLplot]);
233
@pack = (["plplot.pd",PLplot,PDL::Graphics::PLplot]);
222
234
223
%hash = pdlpp_stdargs_int(@::pack);  # use this for module inside PDL source
235
#%hash = pdlpp_stdargs_int(@::pack);  # use this for module inside PDL source
224
###%hash = pdlpp_stdargs(@::pack);          # use this for separate module          
236
%hash = pdlpp_stdargs(@::pack);          # use this for separate module          
225
237
226
$hash{'PREREQ_PM'} = { PDL => 0 };
238
$hash{'PREREQ_PM'} = { PDL => 0 };
227
$hash{'OPTIMIZE'}  = '-g'; # If you want to debug, uncomment this.
239
$hash{'OPTIMIZE'}  = '-g'; # If you want to debug, uncomment this.
228
$hash{'VERSION'}   = '0.38';
240
$hash{'VERSION_FROM'}   = 'plplot.pd';
229
$hash{'LIBS'}      = [$libs];
241
$hash{'LIBS'}      = [$libs];
230
# add this to allow one to use the /ops/tools/lib plplot libs even when
242
# add this to allow one to use the /ops/tools/lib plplot libs even when
231
# another plplot is installed in /usr/local/lib. D. Hunt 6/4/2004
243
# another plplot is installed in /usr/local/lib. D. Hunt 6/4/2004
232
$hash{'LDDLFLAGS'} = " -shared -L$plplot_lib_path -L/usr/local/lib "; 
244
$hash{'LDDLFLAGS'} = " -shared -L$plplot_lib_path -L/usr/local/lib "; 
233
$hash{'INC'}      .= " $plplot_include_path";
245
$hash{'INC'}      .= " $plplot_include_path";
234
$hash{'clean'}     = {'FILES'  =>
246
$hash{'clean'}     = {'FILES'  =>
235
              'PLplot.pm PLplot.xs PLplot.o PLplot.c PLplot.bs *.xfig temp* OPTIONS! Makefile.old'};
247
              'PLplot.pm PLplot.xs PLplot.o PLplot.c PLplot.bs *.xfig temp* OPTIONS! Makefile.old'};
236
248
237
#my $postamble = pdlpp_postamble(@::pack); # use for external module
249
my $postamble = pdlpp_postamble(@::pack); # use for external module
238
my $postamble = pdlpp_postamble_int(@::pack); # use for install inside PDL distro
250
#my $postamble = pdlpp_postamble_int(@::pack); # use for install inside PDL distro
239
251
240
WriteMakefile(%hash);
252
WriteMakefile(%hash);
241
253
242
# Add genpp rule
254
# Add genpp rule
243
sub MY::postamble { $postamble };
255
sub MY::postamble { $postamble };

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks