File: myld

package info (click to toggle)
libdbd-mysql-perl 2.9006-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 524 kB
  • ctags: 326
  • sloc: perl: 3,571; ansic: 1,986; makefile: 55
file content (59 lines) | stat: -rwxr-xr-x 1,603 bytes parent folder | download | duplicates (2)
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
# -*- cperl -*-
#
# Small frontend for ld that ought to catch common problems
# in the linking stage
#

use strict;
use Data::Dumper;

# fix to get link on Mac OSX to work!
if ($ARGV[0] =~ /MACOSX/)
{
  my ($macenv, $macenvval) = split('=',$ARGV[0]);;
  $ENV{$macenv} = $macenvval;
  shift @ARGV;
}
open(OLDSTDERR, ">&STDERR") || die "Failed to backup STDERR: $!";
open(FILE, ">myld.stderr") || die "Failed to create myld.stderr: $!";
open(STDERR, ">&FILE") || die "Failed to redirect STDERR: $!";
my $retval = system(@ARGV);

open(STDERR, ">&OLDSTDERR");
close(FILE) || die "Failed to close myld.stderr: $!";
my $contents = "";
if (-f "myld.stderr"  &&  !-z _) {
  open(FILE, "<myld.stderr") || die "Failed to reopen myld.stderr: $!";
  local $/ = undef;
  $contents = <FILE>;
  die "Failed to read myld.stderr: $!" unless defined($contents);
  close(FILE) || die "Failed to close myld.stderr: $!";

  if ($contents =~ /cannot find -l(g?z)/i) {
    my $missing = $1;
    print <<"MSG";
$contents

An error occurred while linking the DBD::mysql driver. The error
message seems to indicate that you don't have a lib$missing.a,
or a lib$missing.so. This is typically resolved by:

1.) You may try to remove the -lz or -lgz flag from the libs list
    by using the --libs switch for "perl Makefile.PL".
2.) On Red Hat Linux install libz-devel
3.) On other systems, please contact the mailing list

     Msql-Mysql-modules\@lists.mysql.com

For further hints, see INSTALL.html, section Linker flags.
MSG
    exit 1;
  }
}

if ($retval) {
  print STDERR $contents;
  exit 1;
}

END { unlink "myld.stderr"; }