#!/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';

