strawberry perl dbd-informix build

"Boylan, Crispin" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
Hi all,

I've managed to build dbd-informix 2011.0612 on Win32 with Strawberry Perl 5.12.3 and Informix CSDK 3.50.TC8

I'm attaching the changes I had to make here, in case anyone finds it useful.

Any pointers or improvements welcome!  it seems to work fine for what I use it for...

To use copy the attached to the same directory as the dbd-informix distribution:

set INFORMIXDIR to the correct place (ie c:\progra~1\ibm\informix\client-sdk)
perl strawberrybuild.pl (applies the attached patch and mods the makefiles)
gmake
gmake install

thanks
cris.



Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
strawberrybuild.patch (application/octet-stream, 2.8 KB)
--- DBD-Informix-2011.0612/ixblob.ec	2011-06-12 23:23:58.000000000 +0100
+++ dbd_new/ixblob.ec	2012-02-06 15:37:57.820808867 +0000
@@ -177,7 +177,7 @@
     blob->loc_oflags = LOC_WONLY | LOC_RONLY;
     blob->loc_size = -1;
     blob->loc_indicator = 0;
-    blob->loc_fd = mkstemp(tmp);
+    blob->loc_fd = _mktemp(tmp);
     if (blob->loc_fd < 0)
     {
         return(-1);
--- DBD-Informix-2011.0612/Makefile.PL	2011-06-12 23:23:59.000000000 +0100
+++ dbd_new/Makefile.PL	2012-02-06 15:38:01.939808625 +0000
@@ -142,7 +142,7 @@
     # These are necessary for AIX - ifx_checkAPI must be exported,
     # and DL_FUNCS ensures boot_DBD__Informix is available.
     'DL_FUNCS'   => { 'DBD::Informix' => [] },
-    'FUNCLIST'   => [qw(ifx_checkAPI)],
+    'FUNCLIST'   => [],
            );
 
 print qq%
@@ -271,7 +271,7 @@
     {
         # NT configuration
         # We have to assume that ESQL/C will use the correct C compiler
-        $opts{DEFINE} .= " -DWINNT -Dfar=";
+        $opts{DEFINE} .= ' -DWINNT -Dfar= -DPERL_OBJECT -D__int64="long long"';
         $INC1 = "-I$ID/incl";
     }
     else
@@ -405,7 +405,7 @@
 
 # Define the version of ESQL/C for the object code.
 # Do not use $effvernum here (tempting though it is)!
-$opts{DEFINE} = " -DESQLC_VERSION=$vernum";
+$opts{DEFINE} = " -DESQLC_VERSION=$vernum -DPERL_OBJECT -D__int64=\"long long\"";
 
 # Disable assertions by default; override by setting DBD_INFORMIX_ENABLE_ASSERT.
 if (defined($ENV{DBD_INFORMIX_ENABLE_ASSERT}))
@@ -696,14 +696,13 @@
 # the files list...
 
 # Default version of $opts{LD}
-$opts{LD} = "INFORMIXC='\$(FULLPERL) esqlld' " .
-            "ESQLLD='$Config{ld} \$(LDDLFLAGS)' \$(ESQL)";
+$opts{LD} = "$Config{ld} \$(LDDLFLAGS)";
 
 my $esql_nt = "";
 if ($NTConfiguration)
 {
     # NT configuration
-    $esql_nt = "-cc";   # Not sure what this does; ask Harold.
+    #$esql_nt = "-cc";   # Not sure what this does; ask Harold.
     if ($effvernum >= 500 && $effvernum < 600)
     {
         my $libs=" ISQLI501.LIB LMCSQLW.LIB ";
@@ -718,7 +717,7 @@
         $libs =~ s/esql: error -55923: No source or object file\.//gm;
         $libs =~ s/\n/ /gm;
         $opts{dynamic_lib} =
-            { OTHERLDFLAGS => "/LIBPATH:$ID/lib /LIBPATH:$ID/lib/esql $libs"};
+            { OTHERLDFLAGS => "$libs"};
     }
     else
     {
@@ -908,8 +907,7 @@
         .ec$objext:";
 
     $p2 = q%
-        \t$(ESQL_CC) -c $(ESQLCFLAGS) $(ESQLFLAGS) $*.ec
-        \t$(RM_F) $*.c
+        \t$(ESQL_CC) -c $(ESQLCFLAGS) $(ESQLFLAGS) $*.c
 
         # Cribbed from the definition of CCCMD (MakeMaker const_cccmd) and the
         # rules for compiling object files (MakeMakerc_o) in the Makefile.
@@ -927,7 +925,7 @@
     if ($NTConfiguration)
     {
         $p3 = q%
-        ESQL_CC     = $(ESQL)
+        ESQL_CC     = gcc
         %;
     }
     else
strawberrybuild.pl (application/octet-stream, 778 B)
#!/usr/bin/perl
# strawberrybuild.pl - manually build dbd-informix with strawberry perl

$ENV{DBD_INFORMIX_NO_ESQLTEST}=1;
$ENV{INFORMIXSERVER}=1;

system "type strawberrybuild.patch | patch -p1";

system "perl Makefile.pl";

# manually generate the c files as esql.exe cant hook into gcc
my @ecs = qw(esqlcver.ec esqlc_v6.ec esqlcver.ec dbdattr.ec dbdimp.ec ixblob.ec sqltype.ec);

foreach my $ec (@ecs)
{
   system "esql -p $ec";
}

# something odd here as the makefile generated is wrong.
system 'perl -p -i.bak -e "s/\{\{\@ARGV\}/\{\@ARGV\}/" Makefile';

# remove the wrong format libs from the command line retrieve from esql -lib (OTHERLDFLAGS)
system 'perl -p -i.bak -e "s/netapi32.lib wsock32.lib user32.lib winmm.lib advapi32.lib//" Makefile';
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.