Re: the build

From: Nic Ferrier <nferrier(at)tapsellferrier(dot)co(dot)uk>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: the build
Date: 2003-04-15 22:43:33
Message-ID: 87vfxfpeju.fsf@pooh-sticks-bridge.tapsellferrier.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

Oliver Jowett <oliver(at)opencloud(dot)com>
writes:

> On Tue, Apr 15, 2003 at 11:19:11AM +0100, Nic Ferrier wrote:
>
> > - the version of java is used to decide which version of the drivers
> > get built. This prevents cross compiling.
>
> I don't know if you're going to be able to get around this one.
>
> For example, the JDBC1 driver won't build under 1.4 as the concrete
> implementations of the JDBC interfaces only implement the JDBC1 parts while
> 1.4's java.sql interfaces are JDBC3 .. so the compiler will complain that
> the concrete class should be abstract.
>
> You *might* be able to cross-compile to an earlier JDBC version by providing
> an alternate java.sql.* but this sounds a bit hairy (I think that Sun has a
> "standard" mechanism for this in their 1.4 VMs, but I haven't looked at the
> details) -- but you won't have any guarantees that you're not using an API
> specific to your compile VM somewhere else.

The problem is the detection of which version to build. If this were
an autotools project (eg: autoconf/automake/etc...) I'd write a small
autoconf (m4) macro to test the target platform, eg:

cat > version_1_2_test.java << ENDJAVA12TEST
import java.sql.*;
public class version_1_2_test
{
public static void main (String argv)
{
Blob b = null;
}
}
ENDJAVA12TEST
$(JAVAC) -d . version_1_2_test.java
if [ $? -ne 0 ]
-- not version 1.2
fi

With java of course it's even easier because you can use reflection
to discover the feature, it might be possible to write either an ANT
task or an autoconf macro to acomplish a reflection based test.

But the important point is that the test MUST be done to the target
java platform and NOT the platform running ant as it is done at the
moment.

This is what I'm trying to find out if people have objections to.

Nic

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-04-16 04:43:08 Re: the build
Previous Message Oliver Jowett 2003-04-15 22:33:18 Re: the build

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-04-15 23:28:27 Re: Are we losing momentum?
Previous Message Oliver Jowett 2003-04-15 22:33:18 Re: the build