Debian Codegraph @

JPEG/Makefile.jpeg.maybe

raw
1 #!perl
2 # -*- cperl -*-
3 use Config;
4 use File::Copy;
5 if ($^O eq 'MSWin32')
6 {
7 my $file;
8 chmod(0666,'Makefile');
9 chmod(0666,'jconfig.h');
10 if ($Config{'cc'} =~ /gcc/)
11 {
12 copy("jconfig.v32","jconfig.h") ||
13 die "Cannot copy jconfig.v32 to jconfig.h:$!";
14 $file = 'makefile.mingw32';
15 }
16 elsif ($Config{'cc'} =~ /bcc/)
17 {
18 copy("jconfig.b32","jconfig.h") ||
19 die "Cannot copy jconfig.b32 to jconfig.h:$!";
20 $file = 'makefile.b32';
21 }
22 else
23 {
24 copy("jconfig.v32","jconfig.h") ||
25 die "Cannot copy jconfig.v32 to jconfig.h:$!";
26 $file = 'makefile.v32';
27 warn "Assuming ".$Config{'cc'}." is visual C of some kind\n";
28 }
29 copy($file,"Makefile")
30 || die "Cannot copy $file to Makefile:$!";
31 }
32 else
33 {
34 $ENV{CC} = $Config{cc};
35 local $ENV{CFLAGS} = "$Config{ccflags} $Config{cccdlflags}";
36 local $ENV{LDFLAGS} = "$Config{ccflags} $Config{ldflags}";
37 system(sh => "./configure");
38 }
39
40 my $seen_empty_rule;
41 open my $fh, '<', 'Makefile' or die "Error opening Makefile: $!";
42 while(<$fh>)
43 {
44 if (/# Empty rule needed/)
45 {
46 $seen_empty_rule = 1;
47 last;
48 }
49 }
50 if (!$seen_empty_rule)
51 {
52 open my $ofh, '>>', 'Makefile' or die "Error appending to Makefile: $!";
53 print $ofh <<'EOF';
54
55 # Empty rules needed since ExtUtils::MakeMaker 7.18 (see https://rt.cpan.org/Ticket/Display.html?id=117800)
56 test_dynamic:
57
58 subdirs-test_dynamic:
59
60 EOF
61 close $ofh or die "Error closing Makefile: $!";
62 }
63
64 1;