~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to PNG/Makefile.libpng.maybe

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!perl
 
2
use strict;
 
3
use Config;
 
4
use File::Copy;
 
5
chmod(0666,'Makefile');
 
6
my $file;
 
7
 
 
8
if ($^O eq 'MSWin32')
 
9
 {
 
10
  if ($Config{'cc'} =~ /gcc/ && $Config{'make'} =~ /dmake/)
 
11
   {
 
12
    # This is the StrawberryPerl configuration
 
13
    $file = 'scripts/makefile.gcc';
 
14
   }
 
15
  elsif ($Config{'cc'} =~ /gcc/)
 
16
   {
 
17
    $file = 'scripts/makefile.mingw';
 
18
   }
 
19
  elsif ($Config{'cc'} =~ /bcc/)
 
20
   {
 
21
    $file = 'scripts/makefile.bc32';
 
22
   }
 
23
  else
 
24
   {
 
25
    $file = 'scripts/makefile.vcwin32';
 
26
    warn "Assuming ".$Config{'cc'}." is visual C of some kind\n";
 
27
   }
 
28
 }
 
29
else
 
30
 {
 
31
  if ($Config{'gccversion'})
 
32
   {
 
33
    $file = 'scripts/makefile.gcc';
 
34
   }
 
35
  else
 
36
   {
 
37
    if (($Config{archname} =~ /^IA64\./) && ($^O eq "hpux"))
 
38
     {
 
39
      $file = 'scripts/makefile.hp64';
 
40
     }
 
41
    else
 
42
     {
 
43
      $file = 'scripts/makefile.std';
 
44
      my %makefiles = map { /makefile\.(.*)/ && ($1 => $_) } glob('scripts/makefile.*');
 
45
      foreach my $arch (sort keys %makefiles)
 
46
       {
 
47
        if ($^O =~ /$arch/i)
 
48
         {
 
49
          $file = $makefiles{$arch};
 
50
         }
 
51
       }
 
52
     }
 
53
   }
 
54
  warn "Using $file for $^O\nIf make fails read PNG/libpng/INSTALL\n";
 
55
 }
 
56
 
 
57
copy($file,"Makefile")
 
58
   || die "Cannot copy $file to Makefile:$!";
 
59
 
 
60
if ($^O eq 'darwin' || $Config{'archname'} =~ m{^amd64-freebsd($|-.*)})
 
61
 {
 
62
  system(sh => "./configure");
 
63
  open my $fh, ">> Makefile" or die "Can't write to Makefile: $!";
 
64
  print $fh <<'EOF';
 
65
 
 
66
libpng.a: all
 
67
        cp .libs/libpng.a libpng.a
 
68
 
 
69
clean:
 
70
        rm -f libpng.a
 
71
 
 
72
# Empty rule needed since ExtUtils::MakeMaker 6.36 (ca.)
 
73
test:
 
74
 
 
75
EOF
 
76
 }
 
77
 
 
78
1;
 
79