Yeah. Many thanks Jonathan!

Tim.

On Thu, Apr 12, 2001 at 01:47:03PM -0400, Jonathan Segal wrote:
> Hi,
> 
>   I had major linking problems building DBD::Oracle on our DEC platforms, which
> after a while I diagnosed to a missing -L entry in the link path.  I then
> diagnosed the reason why this was missing -- there was a problem when
> Makefile.PL called oracle build scripts. It creates an empty .o file
> (DBD_ORA_OBJ.o), which, on the DEC platform (OSF4, ld version 3.11) caused ld to
> choke, therefore the Makefile.PL couldn't follow the oracle link rules, and had
> to guess (an in my case, guessed wrong).
> 
> I made a simple fix to the Makefile.PL so it can get past this step and use the
> oracle build properly -- instead of creating an empty DBD_ORA_OBJ.o, I have it
> compile a trivial program so this file is in the proper format.  Thus, ld works,
> Makefile.PL can properly parse the oracle build commands, and the package
> builds, links, tests, installs fine.
> 
> I have attached a context diff of the original (1.06) Makefile.PL and the fixed
> one -- perhaps this fix can make it into future releases and save others the
> headaches I had...
> 
> -Jonathan
> 
> --
> Jonathan Segal
> Principal Software Engineer, Bioinformatics
> Genome Therapeutics Corp.
> [EMAIL PROTECTED]
> (781) 398-2579
> *** Makefile.PL       Thu Apr 12 13:36:31 2001
> --- Makefile.PL.orig  Thu Apr 12 11:44:25 2001
> ***************
> *** 266,275 ****
>       print "\n";
>       my $rules = join "\n", '', @{ $mk_target_rules{build} };
>       my $DBD_ORA_OBJ = "DBD_ORA_OBJ.o";
> !     open DBD_ORA_C, ">DBD_ORA_OBJ.c" or die;
> !     print DBD_ORA_C "main () {}\n";
> !     close DBD_ORA_C;
> !     system ("$MK{CC} -c DBD_ORA_OBJ.c -o $DBD_ORA_OBJ");
>       my $make = "$Config{make} -f $mkfile build "
>               ."ECHODO=true ECHO=echo GENCLNTSH='echo genclntsh' "
>               ."EXE=DBD_ORA_EXE OBJS=$DBD_ORA_OBJ";
> --- 266,273 ----
>       print "\n";
>       my $rules = join "\n", '', @{ $mk_target_rules{build} };
>       my $DBD_ORA_OBJ = "DBD_ORA_OBJ.o";
> !     open DBD_ORA_OBJ, ">$DBD_ORA_OBJ" or die;
> !     close DBD_ORA_OBJ;
>       my $make = "$Config{make} -f $mkfile build "
>               ."ECHODO=true ECHO=echo GENCLNTSH='echo genclntsh' "
>               ."EXE=DBD_ORA_EXE OBJS=$DBD_ORA_OBJ";
> ***************
> *** 277,284 ****
>       print "by executing:\n$make\n" if $::opt_v;
>       my @cmds = map { chop; $_ } grep { !m/^\s*$/ } `$make 2>&1`;
>       warn "Warning: Oracle build rule discovery failed ($?)\n" if $?;
> !     unlink $DBD_ORA_OBJ || warn "couldn't unlink DBD_ORA_OBJ.o\n";
> !     unlink "DBD_ORA_OBJ.c";
>       my $prev = '';
>       @cmds = grep { my $skip = $prev eq "echo $_"; $prev=$_; !$skip } @cmds;
>       my @prolog; push @prolog, shift @cmds while @cmds && $cmds[0] !~ /DBD_ORA_EXE/;
> --- 275,281 ----
>       print "by executing:\n$make\n" if $::opt_v;
>       my @cmds = map { chop; $_ } grep { !m/^\s*$/ } `$make 2>&1`;
>       warn "Warning: Oracle build rule discovery failed ($?)\n" if $?;
> !     unlink $DBD_ORA_OBJ;
>       my $prev = '';
>       @cmds = grep { my $skip = $prev eq "echo $_"; $prev=$_; !$skip } @cmds;
>       my @prolog; push @prolog, shift @cmds while @cmds && $cmds[0] !~ /DBD_ORA_EXE/;
> 

Reply via email to