On Mon 17 Mar 2003 21:03, Tim Bunce <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 17, 2003 at 07:39:50PM +0100, H.Merijn Brand wrote:
> > On Thu 13 Mar 2003 01:25, Tim Bunce <[EMAIL PROTECTED]> wrote:
> > > With many thanks due to Jeff Urlwin, I've been able to get back into
> > > DBD::Oracle development after 18 months of, er, stability!
> > > 
> > > I've made a snapshot of what'll be in 1.13 and put it here:
> > > 
> > >   http://homepage.eircom.net/~timbunce/DBD-Oracle-1.13-20030313.tar.gz
> > > 
> > > I'd very much appreciate it if people could give it a whirl...
> > 
> > #############################################################################
> > 
> > HP-UX 11.00, Oracle 8.1.7.4/32, DBI-1.35, perl-5.8.0 (+ defined/or)
> > Against 1.13 from CPAN, this
> > 
> > --8<--- Makefile.PL
> > if ( ($Config{'cc'} eq 'cc') && ($Config{'ccflags'} !~ m/\+z/ && 
> > $Config{'ccldflags'} !~ m/\+Z/i) ) {
> >             print "Warning: perl was not built with +z in ccflags\n"
> >                 . "         You may need to rebuild perl from sources\n"
> >                 . "         See instructions in README.hpux\n" ;
> >         }
> > -->8---
> > 
> > will warn on my perl, whereas
> > 
> > lep a5:/pro/3gl/CPAN/DBD-Oracle-1.13 171 > perl -V |& grep -P '\+[zZ]'
> >     cccdlflags='+Z', lddlflags='-b +vnocompatwarnings -L/pro/local/lib'
> > lep a5:/pro/3gl/CPAN/DBD-Oracle-1.13 172 >
> > 
> > *is* more than enough, so I think you should relax that test
> 
> Could you generate a patch for me, that also includes a comment
> describing the underlying issue?

This is done in hints/hpux.sh, and based upon the docs in Glossary:

cccdlflags (dlsrc.U):
        This variable contains any special flags that might need to be
        passed with 'cc -c' to compile modules to be used to create a shared
        library that will be used for dynamic loading.  For hpux, this
        should be +z.  It is up to the makefile to use it.

I think that the change in the warning is clear enough to not need additional
comment or explanation

--- Makefile.PL.org     2003-03-14 18:46:06.000000000 +0100
+++ Makefile.PL 2003-03-18 08:44:43.000000000 +0100
@@ -405,8 +405,8 @@
              $inspdver{RDBMS} =~ /^7.3/ and
              $linkwith =~ m/-lcl\b/ && $linkwith =~ m/-l:libcl.a/
        ) {  # from [EMAIL PROTECTED]
-            print "Warning: Stripping -lcl from the link flags, because it\n"
-                . "         seems to conflict with -l:libcl.a\n" ;
+            print "Warning: Stripping -lcl from the link flags, because it\n",
+                 "         seems to conflict with -l:libcl.a\n" ;
             $linkwith =~ s/\s*-lcl\b//g;
         }

@@ -441,8 +441,8 @@
             }
         }

-         if ( $os eq "hpux" && $osvers >= 11 and $linkwith =~ m/-l:libcl.a/) {
-                print "Warning: stripping -l:libcl.a from liblist (conflict wit
h ld looking for shared libs)";
+        if ( $os eq "hpux" && $osvers >= 11 and $linkwith =~ m/-l:libcl.a/) {
+                print "Warning: stripping -l:libcl.a from liblist (conflict wit
h ld looking for shared libs)\n";
                 $linkwith =~ s/\s*-l:libcl.a\b//g;
        }

@@ -452,14 +452,17 @@
                 . "         with the following libraries: -lcl -lpthread\n" ;
         }

-        if ( ($Config{'cc'} eq 'cc') && ($Config{'ccflags'} !~ m/\+z/ && $Confi
g{'ccldflags'} !~ m/\+Z/i) ) {
-            print "Warning: perl was not built with +z in ccflags\n"
+        if ($Config{'cc'}) {
+           my $ccf = $Config{ccflags};
+           exists $Config{ccldflags}  and $ccf .= $Config{ccldflags};
+           exists $Config{cccdlflags} and $ccf .= $Config{cccdlflags};
+            $ccf =~ m/\+[zZ]/ and
+            print "Warning: perl was not built with +z or +Z in compiler flags\
n"
                 . "         You may need to rebuild perl from sources\n"
                 . "         See instructions in README.hpux\n" ;
         }
     }

-
     if ($::opt_b) {    # The simple approach
        $opts{dynamic_lib} = { OTHERLDFLAGS => "$::opt_g $linkwith" };
        $linkwith_msg = "OTHERLDFLAGS = $linkwith [from 'build' rule]";
End of patch


On a side note, is line 539 still valid?

lep a5:/pro/3gl/CPAN/DBD-Oracle-1.13 145 > perl -V:osvers
osvers='11.00';
lep a5:/pro/3gl/CPAN/DBD-Oracle-1.13 146 > perl5.6.1 -V:osvers
osvers='11.00';
lep a5:/pro/3gl/CPAN/DBD-Oracle-1.13 147 > uname -r
B.11.00
lep a5:/pro/3gl/CPAN/DBD-Oracle-1.13 148 > 

@@ -536,7 +539,7 @@
 # files, we sadly have to build static on HP-UX 9 :(
 if ($os eq 'hpux') {
     print "***$BELL\n";
-    $osvers =~ s/^[a-z]\.//;   # Sigh... 'b.11.0' etc
+    $osvers =~ s/^[a-z]\.//i;  # Sigh... 'b.11.0' etc (5.6.1 and up have '11.00')
     if ($osvers < 10) {
        print "*** Warning: Forced to build static not dynamic on $os $osvers.$BELL\n";
        $opts{LINKTYPE} = 'static';


> > #############################################################################
> > 
> > AIX 4.3.3.0, Oracle 8.1.7.4/32, DBI-1.35
> > perl-5.6.1, perl-5.8.0 (+ defined/or), and perl-5.9.0/blead
> > 
> > Warning: You will probably need to rebuild perl using the xlc_r compiler.
> >          You may also need do: ORACCENV='cc=xlc_r'; export ORACCENV
> >          Also see the README about the -p option
> > 
> > No way. xlc_r/cc_r are for threaded builds. I'm not going to give up 25% perl
> > performance just to be able to use threaded Oracle.
> 
> There was a good reason for adding that comment at the time.
> Of course I can't remember what it was now, but I think DBD::Oracle
> would either not build or would core dump unless the advice was followed.
> Possibly other changes have made the advice redundant now.

I can imagine this, but I'm using DBD-Oracle-1.12 on AIX-4.3.3 with
Oracle 8.1.7.4 for some time now, and never ran into any trouble.

Another reason to keep it in, might be that AIX has a variety of compilers,
and I have only one (vac)

> But I imagine that just rebuilding perl using the xlc_r compiler
> would not, of itself, trigger perl to be multi-threaded.  Don't

Probably very true. To focussed on /knowing/ that cc_r (or one of it's zillion
ways of invocation which can differ accross systems by changing the defaults
:/ ) is automatically selected when building for threaded perl.

> forget that the Oracle OCI libs *are* thread-aware and it's not
> unreasonable to suggest that a thread-aware compiler/linker may be needed.
> 
> For now I'll just s/probably/may/ but feel free to persuade me otherwise.

Very good.

> > "oci8.c", line 271.29: 1506-068 (E) Operation between types "void*(*)(struct 
> > imp_dbh_st*,int,int)" and "void*" is not allowed.
> > "oci8.c", line 498.12: 1506-068 (E) Operation between types "unsigned char*" and 
> > "char*" is not allowed.
> > "oci8.c", line 522.45: 1506-280 (E) Function argument assignment between types 
> > "unsigned char*" and "char*" is not allowed.
> 
> I've fixed the last two. For the first, does just removing the
> "(void*)" cast fix it for you?

Sorry, no:

xlc -c  -I/pro/oracle/v817/rdbms/demo -I/pro/oracle/v817/rdbms/public 
-I/pro/oracle/v817/plsql/public -I/pro/oracle/v817/network/public 
-I/pro/oracle/v817/rdbms/demo -I/pro/oracle/v817/rdbms/public 
-I/pro/oracle/v817/rdbms/demo -I/pro/lib/perl5/site_perl/5.8.0/aix/auto/DBI 
-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 
-qnoansialias -DUSE_NATIVE_DLOPEN -I/pro/local/include -q32 -D_LARGE_FILES -qlonglong 
-O2   -DVERSION=\"1.13\" -DXS_VERSION=\"1.13\"  "-I/pro/lib/perl5/5.8.0/aix/CORE"  
-DUTF8_SUPPORT oci8.c
1506-507 (W) No licenses available. Contact your program supplier to add additional 
users.  Compilation will proceed shortly.
"oci8.c", line 271.29: 1506-068 (E) Operation between types "void*(*)(struct 
imp_dbh_st*,int,int)" and "void*" is not allowed.
"oci8.c", line 498.12: 1506-068 (E) Operation between types "unsigned char*" and 
"char*" is not allowed.
"oci8.c", line 522.45: 1506-280 (E) Function argument assignment between types 
"unsigned char*" and "char*" is not allowed.
Running Mkbootstrap for DBD::Oracle ()


but hang on, if I change it to

    {
    typedef void (*PFV)();
    auto PFV p = oci_st_handle;
    imp_sth->done_desc = 0;
    imp_sth->get_oci_handle = p;
    }

I get

"oci8.c", line 271.16: 1506-196 (E) Initialization between types "void(*)()" and 
"void*(*)(struct imp_sth_st*,int,int)" is not allowed.
"oci8.c", line 273.29: 1506-068 (E) Operation between types "void*(*)(struct 
imp_dbh_st*,int,int)" and "void(*)()" is not allowed.
"oci8.c", line 501.12: 1506-068 (E) Operation between types "unsigned char*" and 
"char*" is not allowed.
"oci8.c", line 525.45: 1506-280 (E) Function argument assignment between types 
"unsigned char*" and "char*" is not allowed.

Which explains the error: struct imp_sth_st * vs struct imp_dbh_st *
                                     ^^^                    ^^^

How picky can compilers be :)

dbdimp.c:    imp_dbh->get_oci_handle = oci_db_handle;
dbdimp.h:    void *(*get_oci_handle) _((imp_dbh_t *imp_dbh, int handle_type, int 
flags));
dbdimp.h:    void *(*get_oci_handle) _((imp_dbh_t *imp_dbh, int handle_type, int 
flags));

It *is* contradicting. I don't know what you want

> > > I'm aware that OCI7 support is broken - the tests just dump core.
> > > If someone could look into that I'd be grateful.
> > > 
> > > There is still a large backlog of issues I've not dealt with so
> > > please don't ask if any particular change is in or not.
> > > What's needed right now is testing of this release candidate.
> > 
> > Since Oracle databases are supported from Unify 4GL, I cannot install
> > DBD-Oracle in the main perl lib, and I choose to install under
> > 
> >     $UNIFY/perl
> > 
> > so I can mix several versions of perl with several versions of $UNIFY
> > 
> > Would you condider to allow 'make installu' using attached script to support
> > this special way of installation?
> > 
> > --8<--- Makefile.PL
> > 
> > package MY;
> > sub postamble
> > {
> >     join "\n" =>
> >     DBI::DBD::dbd_postamble (),
> >     '',
> >     'installu uinstall:     all',
> >     '       $(PERL) installu.pl',
> >     '';
> >     } # postamble
> 
> I can't see much point or value to be honest. Why not just:
> 
>     perl Makefile.PL && make && make test && perl installu.pl

1. I have to rebuild the tarball to include installu.pl, so I can automate
   installations. Only after having installu.pl available, that sequence will
   work. [ And in fact, that *is* the sequence I'm currently using from my
   install scripts ]
2. It might be the start of documenting that it may be very useful to install
   DBD-Oracle outside the base tree, in order to be able to run several
   versions alongside. I bet you have been thinking about that too, the first
   time you had to upgrade Oracle, and your DBD::Oracle suddenly stopped
   working, or you wanted to switch DBD version depending on your current DB.
   IMHO, the only workable solution is to use $PERL5LIB, which you can
   (automatically) set on switching DB. Using that, it's safer to place *all*
   DBD's outside the base tree, instead of risking calling the wrong (default)
   one on a mismatching DB.

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0 & 632 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
     WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.024 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/


Reply via email to