DBD-Informix
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
# ESQL/C 2.90 was released in ClientSDK 2.90 (IDS 10.00) (Nov 2004)
# The ESQL/C versions above are long obsolete and no longer supported.
dbd_ix_die nlws(qq%
$infversion is no longer supported by $opts{NAME}
%);
}
elsif ($effvernum >= 970 && $effvernum < 1000)
{
# ESQL/C 3.00 was released in ClientSDK 3.00 (IDS 11.10)
# ESQL/C 3.50 was released in ClientSDK 3.50 (IDS 11.50)
# ESQL/C 3.70 was released in ClientSDK 3.70 (IDS 11.70)
# ESQL/C 4.10 was released in ClientSDK 4.10 (IDS 12.10) (Mar 2013)
# It's a bit of a misnomer to say 'new IUS types' since they are 20 years old!
print nlws(qq%
Beware: $opts{NAME} is not yet fully aware of all the Informix data types.
%);
$esqlc_flags .= set_esqlc_linkage("-shared");
# Shadows outer $esql
my $esql = (defined $ENV{ESQL}) ? $ENV{ESQL} : "esql";
if ($esql =~ m%(.*/)?c4gl$%)
{
dbd_ix_die nlws(qq%
$opts{NAME} no longer supports linking with Informix 4GL.
%);
}
}
else
{
dbd_ix_die nlws(qq{
$opts{NAME} does not know anything about $infversion.
Please report this to the $opts{NAME} maintenance team.
However, there is a fair chance that $opts{NAME} will work if
you modify the code in Makefile.PL which contains this message
to recognize your version.
Please report your experiences to the $opts{NAME} maintenance team.
});
}
# -- Configure the make process
# Define the version of ESQL/C for the object code.
# Do not use $effvernum here (tempting though it is)!
$opts{DEFINE} = " -DESQLC_VERSION=$vernum";
# Disable assertions by default; override by setting DBD_INFORMIX_ENABLE_ASSERT.
if (defined($ENV{DBD_INFORMIX_ENABLE_ASSERT}))
{
$opts{DEFINE} .= " -DDBD_INFORMIX_ENABLE_ASSERT";
print "** Warning ** assert macro is enabled!\n\n";
}
else
{
print "Assert macro will be disabled!\n\n";
$opts{DEFINE} .= " -DNDEBUG";
}
print "** Warning ** you will build $opts{NAME} for a relocatable INFORMIXDIR!\n\n"
if (defined($ENV{DBD_INFORMIX_RELOCATABLE_INFORMIXDIR}));
$opts{INC} = " ";
Write_DBD_Informix_Defaults($ID);
# Grumble: ifx_loc_t was added to CSDK (ESQL/C) 3.00/xC3 and was not in
# 3.00.xC2. Hence this test is more complex than I'd like.
sub check_for_ifx_loc_t
{
my($ifx_loc_t);
if ($effvernum >= 975)
{
$ifx_loc_t = "define";
}
elsif ($effvernum < 970)
{
$ifx_loc_t = "undef";
}
else
{
my $hdr = "$ID/incl/esql/locator.h";
die "Unable to open $hdr for reading\n"
unless open my $fh, "<$hdr";
local $/;
my $text = <$fh>;
close $fh;
$ifx_loc_t = ($text =~ m/ifx_loc_t/m) ? "define" : "undef";
}
return($ifx_loc_t);
}
# The ESQL/C preprocessors do not handle conditional compilation
# of #ifdef blocks, so such code has to be handled with $include
# and $ifdef and so on. Ugh!!! Necessary for IUS support.
{
my $infofile = "esqlinfo.h";
unlink $infofile;
die "Unable to open $infofile for writing\n"
unless open my $ESQLINFO, ">$infofile";
print $ESQLINFO "/*\n** File $infofile\n** Generated by $opts{NAME} $dbd_ix\n** For $infversion\n*/\n";
printf $ESQLINFO "%sdefine ESQLC_VERSION_STRING \"%s\";\n", '$', $infversion;
printf $ESQLINFO "%s%s ESQLC_BIGINT;\n", '$',
($effvernum >= 975 ? "define" : "undef");
my($ifx_loc_t) = check_for_ifx_loc_t();
printf $ESQLINFO "%s%s ESQLC_IFX_LOC_T;\n", '$', $ifx_loc_t;
$opts{DEFINE} .= " -DESQLC_IFX_LOC_T" if ($ifx_loc_t eq "define");
close $ESQLINFO or die "Failed to write $infofile\n";
print "$infofile written OK\n\n";
}
# Add extra definitions to compile the code under GCC if DBD_INFORMIX_DEBUG_GCC set.
# Perl configuration headers contain lots of /* inside comments (-Wno-comment)
#$opts{DEFINE} .= ' -Wall -pedantic -Wno-comment -Wpointer-arith -Wcast-align'
# . ' -Wconversion -Wtraditional -Wcast-qual'
# . ' -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decl'
# Neither Perl (DBI) nor DBD-Informix is really ready for -Wextra.
$opts{DEFINE} .= ' -Wall -pedantic -Wextra -Wno-comment'
if $Config{cc} eq 'gcc' and $ENV{DBD_INFORMIX_DEBUG_GCC};
Makefile.PL view on Meta::CPAN
if (defined $env_link);
return (defined $env_link) ? $env_link : $def_link;
}
sub Write_DBD_Informix_Defaults
{
my($ixd) = @_;
my $defaults = "$dbd_ix_pm_dir/Defaults.pm";
open DEFAULTS, ">$defaults"
or die "Cannot create $defaults ($!)";
print DEFAULTS <<'EOF';
# Default Environment Variables for Informix Database Driver for Perl DBI Version 2018.1031 (2018-10-31)
#
# Copyright 2002-03 IBM
# Copyright 2004-10 Jonathan Leffler
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the Perl README file.
{
package DBD::Informix::Defaults;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(default_INFORMIXDIR default_INFORMIXSERVER);
$VERSION = "2018.1031";
$VERSION = "0.97002" if ($VERSION =~ m%[:]VERSION[:]%);
EOF
print DEFAULTS "\tsub default_INFORMIXDIR\n\t{\n\t\treturn '$ixd';\n\t}\n";
print DEFAULTS "\tsub default_INFORMIXSERVER\n\t{\n\t\treturn '$ENV{INFORMIXSERVER}';\n\t}\n";
print DEFAULTS <<'EOF';
1;
}
__END__
=head1 NAME
DBD::Informix::Defaults - Default values for INFORMIXDIR and INFORMIXSERVER
=head1 SYNOPSIS
use DBD::Informix::Defaults;
=head1 DESCRIPTION
This module was generated automatically by DBD::Informix
(Informix Database Driver for Perl DBI Version 2018.1031 (2018-10-31)).
It records the default values of INFORMIXDIR and INFORMIXSERVER
that were in use when DBD::Informix was built.
You can edit the returned values if you need to,
but worry about where the Informix libraries are loaded from.
EOF
if (defined($ENV{DBD_INFORMIX_RELOCATABLE_INFORMIXDIR}))
{
print DEFAULTS "Because $opts{NAME} was built with a relocatable INFORMIXDIR,\n";
print DEFAULTS "if you edit INFORMIXDIR here, you will need to worry about\n";
print DEFAULTS "how the shared libraries are located, which is hard, in general,\n";
print DEFAULTS "because the mechanisms vary from platform to platform.\n\n";
}
else
{
print DEFAULTS "Because $opts{NAME} was built without a relocatable INFORMIXDIR,\n";
print DEFAULTS "if you edit INFORMIXDIR here, you will need to keep the libraries\n";
print DEFAULTS "in the original location because those path names are hard-linked.\n\n";
}
print DEFAULTS qq'The recorded default values are:\n\n';
print DEFAULTS qq' INFORMIXDIR = "$ENV{INFORMIXDIR}"\n';
print DEFAULTS qq' INFORMIXSERVER = "$ENV{INFORMIXSERVER}"\n\n';
if ($effvernum < 600)
{
print DEFAULTS "NB: although you are using $infversion,\n";
print DEFAULTS "DBD::Informix needs this module to set a default value for INFORMIXSERVER,\n";
print DEFAULTS "but you will not normally set it in your environment,\n";
print DEFAULTS "despite the comments below.\n\n";
}
print DEFAULTS <<'EOF';
You will seldom if ever have cause to use this module directly.
You should seldom have cause to use it indirectly either because
you will always set INFORMIXDIR and INFORMIXSERVER in the
environment before using DBD::Informix.
This module increases the chances of DBD::Informix working
with Apache and mod_perl without attention modifying the Apache configuration.
=head1 AUTHOR
Jonathan Leffler
=cut
EOF
close DEFAULTS or die;
print "$defaults written OK\n";
}
__END__
( run in 1.148 second using v1.01-cache-2.11-cpan-71847e10f99 )