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

« back to all changes in this revision

Viewing changes to myConfig

  • 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:
24
24
    $gccopt .= " -Wall -Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__";
25
25
    eval
26
26
     {
27
 
      if ((getpwuid($<))[6] =~ /Nick\s+Ing-Simmons/)
 
27
      if ((getpwuid($<))[6] =~ /(Nick\s+Ing-Simmons|XXXSlaven\s+Rezic)/)
28
28
       {
29
29
        # This is the author - catch as many bugs as possible
 
30
        # libpng causes some warnings, so this is not enabled for me - srt
30
31
        $gccopt .= "  -MMD -Werror -Wno-format";
31
 
#       @macro = ( macro => { INSTALLDIRS => 'perl' });
32
32
       }
33
33
     }
34
34
   }
42
42
       AUTHOR   => 'nick@ing-simmons.net (Nick Ing-Simmons)'
43
43
      );
44
44
  my $arch = ($^O eq 'MSWin32') ? $ENV{'PROCESSOR_ARCHITECTURE'} : $Config{'archname'};
45
 
  push(@ARGV,"BINARY_LOCATION=$arch/Tk$VERSION-PPM.tar.gz");
 
45
  my $binloc = "BINARY_LOCATION=$arch/Tk$VERSION-PPM.tar.gz";
 
46
  if (!grep { $binloc eq $_ } @ARGV)
 
47
   {
 
48
    push(@ARGV,$binloc);
 
49
   }
46
50
  warn "PPM for perl$]\n";
47
51
 }
48
52
else
92
96
$define{'NOVOID'}  = 1 if (($voidflags & $voidused) != $voidused);
93
97
$define{'NOCONST'} = 1 unless ($Config{'d_const'});
94
98
 
95
 
if (try_compile("config/signedchar.c"))
96
 
 {
97
 
  $define{'ANSI_SIGNED_CHAR'} = 1;
98
 
 }
99
 
else
100
 
 {
101
 
  if (try_run("config/unsigned.c"))
102
 
   {
103
 
    $define{'CHAR_UNSIGNED'} = 1;
104
 
   }
105
 
 }
106
 
 
107
 
if (!try_compile("config/Ksprintf.c") &&
108
 
     try_compile("-DSPRINTF_RETURN_CHAR config/Ksprintf.c"))
109
 
 {
110
 
  $define{'SPRINTF_RETURN_CHAR'} = 1;
111
 
 }
112
 
 
113
 
if (!$IsWin32)
114
 
 {
115
 
  if (!try_compile("config/tod.c"))
116
 
   {
117
 
    my $d;
118
 
    my $def;
119
 
    foreach $d (qw(TZ NO_TZ DOTS))
120
 
     {
121
 
      if (try_compile("-DTIMEOFDAY_$d config/tod.c"))
122
 
       {
123
 
        $def = "TIMEOFDAY_$d";
124
 
        print STDERR "$d gettimeofday()\n";
125
 
        last;
126
 
       }
127
 
     }
128
 
    if (defined $def)
129
 
     {
130
 
      $define{$def} = 1;
131
 
     }
132
 
    else
133
 
     {
134
 
      print STDERR "Problem gettimeofday()\n";
135
 
     }
136
 
   }
137
 
  else
138
 
   {
139
 
    print STDERR "Generic gettimeofday()\n";
140
 
   }
141
 
 }
142
 
 
143
99
#
144
100
# Hunt down X Library - first a function
145
101
#
202
158
  if ($arg =~ /^(X11\w*|XFT)=(.*)$/)
203
159
   {
204
160
    ${"$1"} = $2;
 
161
    # Pushing these args to @ARGV will generate MakeMaker warnings
 
162
    # ("... is not a known MakeMaker parameter name") but
 
163
    # will asure that the parameters are reused when automatically
 
164
    # re-building Makefiles.
 
165
   }
 
166
  elsif ($arg eq 'VERBOSE=1')
 
167
   {
 
168
    $Tk::MMtry::VERBOSE = 1;
205
169
   }
206
170
  else
207
171
   {
208
172
    $MakefileName = $1 if ($arg =~ /^MAKEFILE=(.*)$/);
209
 
    push(@args,$arg);
210
173
   }
 
174
  push(@args,$arg);
211
175
 }
212
176
@ARGV = @args;
213
177
 
 
178
# Now we have possibly $Tk::MMtry::VERBOSE set, we can
 
179
# use the try_compile stuff
 
180
if (try_compile("config/perlrx.c", ["-I$Config{'archlibexp'}/CORE"]))
 
181
 {
 
182
  $define{'USE_NEWSTYLE_REGEXP_STRUCT'} = 1;
 
183
 }
 
184
 
 
185
if (try_compile("config/pmop.c", ["-I$Config{'archlibexp'}/CORE"]))
 
186
 {
 
187
  $define{'HAS_PMOP_EXTRA_FLAGS'} = 1;
 
188
 }
 
189
 
 
190
if (try_compile("config/pregcomp2.c",  ["-I$Config{'archlibexp'}/CORE"], undef, ["-c"]))
 
191
 {
 
192
  $define{'USE_PREGCOMP_31027'} = 1; # pregcomp after perl change 31027
 
193
 }
 
194
 
 
195
if (try_compile("config/signedchar.c"))
 
196
 {
 
197
  $define{'ANSI_SIGNED_CHAR'} = 1;
 
198
 }
 
199
else
 
200
 {
 
201
  if (try_run("config/unsigned.c"))
 
202
   {
 
203
    $define{'CHAR_UNSIGNED'} = 1;
 
204
   }
 
205
 }
 
206
 
 
207
if (!try_compile("config/Ksprintf.c") &&
 
208
     try_compile("-DSPRINTF_RETURN_CHAR config/Ksprintf.c"))
 
209
 {
 
210
  $define{'SPRINTF_RETURN_CHAR'} = 1;
 
211
 }
 
212
 
 
213
if (!$IsWin32)
 
214
 {
 
215
  if (!try_compile("config/tod.c"))
 
216
   {
 
217
    my $d;
 
218
    my $def;
 
219
    foreach $d (qw(TZ NO_TZ DOTS))
 
220
     {
 
221
      if (try_compile("-DTIMEOFDAY_$d config/tod.c"))
 
222
       {
 
223
        $def = "TIMEOFDAY_$d";
 
224
        print STDERR "$d gettimeofday()\n";
 
225
        last;
 
226
       }
 
227
     }
 
228
    if (defined $def)
 
229
     {
 
230
      $define{$def} = 1;
 
231
     }
 
232
    else
 
233
     {
 
234
      print STDERR "Problem gettimeofday()\n";
 
235
     }
 
236
   }
 
237
  else
 
238
   {
 
239
    print STDERR "Generic gettimeofday()\n";
 
240
   }
 
241
 }
 
242
 
214
243
$win_arch or die '$win_arch not set in myConfig';
215
244
 
216
245
if ($win_arch eq 'x') {
290
319
    }
291
320
 
292
321
  #
 
322
  # Prefer 64bit libraries on certain architectures
 
323
  #
 
324
  unless (defined $xlib and $Config{'archname'} =~ m/x86_64/)
 
325
    {
 
326
      $xlib = &lX11(0, chooseX11(</usr/X11*/lib64>));
 
327
    }
 
328
 
 
329
  #
293
330
  # If no luck there try "common" places
294
331
  #
295
332
  unless (defined $xlib)
344
381
   {
345
382
    # Found basic X libraries now see if we can find -lXft
346
383
 
347
 
    my $ftinc = Ift("/usr/include","/usr/local/include");
 
384
    my $ftinc = Ift("/usr/include","/usr/local/include",$X11INC||());
348
385
    if ($ftinc)
349
386
     {
350
387
      print "xlib='$xlib' xinc='$xinc'\n";
351
 
      if (try_run("config/xft.c",[$xinc,$ftinc],[$xlib,'-lXft','-lfontconfig']))
 
388
      my $success = 0;
 
389
      # Including ft2build.h additionally seems to be necessary
 
390
      # on an old RedHat 8.0 system
 
391
      for my $def ([], ["-DNEED_FT2BUILD_H"])
352
392
       {
353
 
        $inc .= " $ftinc";
354
 
        warn "Seem to have -lXft\n";
355
 
        $define{USE_XFT_FONTS} = 1;
356
 
        $xlib .= " -lXft";
357
 
        $xtra = ' -lfontconfig';
 
393
        if (try_run("config/xft.c",[$xinc,$ftinc],[$xlib,'-lXft','-lfontconfig'],$def))
 
394
         {
 
395
          $inc .= " $ftinc";
 
396
          warn "Seem to have -lXft\n";
 
397
          $define{USE_XFT_FONTS} = 1;
 
398
          $xlib .= " -lXft";
 
399
          $xtra = ' -lfontconfig';
 
400
          if (@$def)
 
401
           {
 
402
            for my $d (@$def)
 
403
             {
 
404
              $d =~ s{-D}{};
 
405
              $define{$d} = 1;
 
406
             }
 
407
           }
 
408
          $success = 1;
 
409
          last;
 
410
         }
358
411
       }
359
 
      else
 
412
      if (!$success)
360
413
       {
361
 
        warn "Xft and/or fontconfig libraries and/or includes are missing\n";
 
414
        warn "Xft and/or fontconfig libraries and/or includes are missing" .
 
415
             (!$Tk::MMtry::VERBOSE ? ",\ntry perl Makefile.PL VERBOSE=1 for more information" : "") .
 
416
             ".\n";
362
417
       }
363
418
     }
364
419
    else
428
483
 
429
484
if (!defined($MakefileName) || $MakefileName eq 'Makefile')
430
485
 {
431
 
  my $config = "package Tk::Config;\nrequire Exporter;\nuse base qw(Exporter);\n";
 
486
  my $config = "# DO NOT EDIT. CREATED AUTOMATICALLY BY myConfig\npackage Tk::Config;\nrequire Exporter;\nuse base qw(Exporter);\n";
432
487
  my $sym;
433
488
  my @export = ();
434
489
  foreach $sym (qw(VERSION inc define xlib xinc gccopt win_arch))