adding DBD::Pg and DBIx::DBSchema for 5.005. argh freebsd and solaris!
[freeside.git] / install / 5.005 / DBD-Pg-1.22-fixvercmp / Makefile.PL
1
2 # $Id: Makefile.PL,v 1.1 2004-04-29 09:21:28 ivan Exp $
3
4 use ExtUtils::MakeMaker;
5 use Config;
6 use strict;
7
8 use DBI 1.00;
9 use DBI::DBD;
10
11 my $lib;
12 BEGIN {
13     my %sep = (MacOS   => ':',
14                MSWin32 => '\\',
15                os2     => '\\',
16                VMS     => '\\',
17                NetWare => '\\',
18                dos     => '\\');
19     my $s = $sep{$^O} || '/';
20     $lib = join $s, 't', 'lib';
21 }
22
23 use lib $lib;
24 print "Configuring Pg\n";
25 print "Remember to actually read the README file !\n";
26
27 my $POSTGRES_INCLUDE;
28 my $POSTGRES_LIB;
29
30 if ((!$ENV{POSTGRES_INCLUDE} or !$ENV{POSTGRES_LIB}) and !$ENV{POSTGRES_HOME}) {
31     # Use App::Info to get the data we need.
32     require App::Info::RDBMS::PostgreSQL;
33     require App::Info::Handler::Prompt;
34     my $p = App::Info::Handler::Prompt->new;
35     my $pg = App::Info::RDBMS::PostgreSQL->new(on_unknown => $p);
36     $POSTGRES_INCLUDE = $pg->inc_dir;
37     $POSTGRES_LIB     = $pg->lib_dir;
38 } elsif ((!$ENV{POSTGRES_INCLUDE} or !$ENV{POSTGRES_LIB}) and $ENV{POSTGRES_HOME}) {
39     $POSTGRES_INCLUDE = "$ENV{POSTGRES_HOME}/include";
40     $POSTGRES_LIB     = "$ENV{POSTGRES_HOME}/lib";
41 } else {
42     $POSTGRES_INCLUDE = "$ENV{POSTGRES_INCLUDE}";
43     $POSTGRES_LIB     = "$ENV{POSTGRES_LIB}";
44 }
45
46 my $os = $^O;
47 print "OS: $os\n";
48
49 my $dbi_arch_dir;
50 if ($os eq 'MSWin32') {
51     $dbi_arch_dir = "\$(INSTALLSITEARCH)/auto/DBI";
52 } else {
53     $dbi_arch_dir = dbd_dbi_arch_dir();
54 }
55
56 my %opts = (
57     NAME         => 'DBD::Pg',
58     VERSION_FROM => 'Pg.pm',
59     INC          => "-I$POSTGRES_INCLUDE -I$dbi_arch_dir",
60     OBJECT       => "Pg\$(OBJ_EXT) dbdimp\$(OBJ_EXT)",
61     LIBS         => ["-L$POSTGRES_LIB -lpq"],
62     AUTHOR       => 'http://gborg.postgresql.org/project/dbdpg/projdisplay.php',
63     ABSTRACT     => 'PostgreSQL database driver for the DBI module',
64     PREREQ_PM    => { 'Test::Simple' => 0.17 }, # Need Test::More
65 );
66
67 if ($os eq 'hpux') {
68     my $osvers = $Config{osvers};
69     if ($osvers < 10) {
70         print "Warning: Forced to build static not dynamic on $os $osvers.\a\n";
71         $opts{LINKTYPE} = 'static';
72     }
73 }
74
75 if ($Config{dlsrc} =~ /dl_none/) {
76     $opts{LINKTYPE} = 'static';
77 }
78
79 WriteMakefile(%opts);
80
81 exit(0);
82
83 # end of Makefile.PL