Thread: Ant configuration

Ant configuration

From
Marko Kreen
Date:
I dusted a old patch that integrates Ant better with
autoconf.  It creates a file src/ant.cfg.in to pass
autoconf parameters to Ant.  Now Ant can be used directly,
without going through Makefile.

'install.directory' is still passed in Makefile to keep
DESTDIR working.

--
marko


Index: configure.in
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/configure.in,v
retrieving revision 1.146
diff -u -c -r1.146 configure.in
*** configure.in    16 Oct 2001 10:09:15 -0000    1.146
--- configure.in    16 Oct 2001 13:37:46 -0000
***************
*** 32,37 ****
--- 32,42 ----
  AC_SUBST(VERSION)
  AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION")

+ VERSION_MAJOR=`echo $VERSION | sed 's/^\([[0-9]][[0-9]]*\)\..*\$/\1/'`
+ VERSION_MINOR=`echo $VERSION | sed 's/^[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\).*\$/\1/'`
+ AC_SUBST(VERSION_MAJOR)
+ AC_SUBST(VERSION_MINOR)
+
  unset CDPATH

  AC_CANONICAL_HOST
***************
*** 411,416 ****
--- 416,424 ----
  [AC_MSG_RESULT(no)])
  AC_SUBST(with_java)

+ JAVA_DEST=$prefix/share/java
+ AC_SUBST(JAVA_DEST)
+
  dnl A note on the Kerberos and OpenSSL options:
  dnl
  dnl The user can give an argument to the option in order the specify
***************
*** 1218,1223 ****
--- 1226,1232 ----
    src/GNUmakefile
    src/Makefile.global
    src/backend/port/Makefile
+   src/ant.cfg
  ],
  [
  # Update timestamp for pg_config.h (see Makefile.global)
Index: contrib/retep/build.xml
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/contrib/retep/build.xml,v
retrieving revision 1.8
diff -u -c -r1.8 build.xml
*** contrib/retep/build.xml    6 Jul 2001 23:07:20 -0000    1.8
--- contrib/retep/build.xml    12 Oct 2001 10:33:39 -0000
***************
*** 19,24 ****
--- 19,27 ----
    <property name="package" value="uk/org/retep" />
    <property name="jardir"  value="jars" />

+   <!-- Load autoconfed properties.  -->
+   <property file="${srcdir}../../src/ant.cfg" />
+
    <!-- Some checks used to build dependent on the environment -->
    <target name="checks">
      <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
Index: src/GNUmakefile.in
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/src/GNUmakefile.in,v
retrieving revision 1.61
diff -u -c -r1.61 GNUmakefile.in
*** src/GNUmakefile.in    10 Feb 2001 02:31:26 -0000    1.61
--- src/GNUmakefile.in    12 Oct 2001 10:34:36 -0000
***************
*** 40,43 ****
      -$(MAKE) -C bin $@
      -$(MAKE) -C pl $@
      -$(MAKE) -C test $@
!     rm -f Makefile.port Makefile.global GNUmakefile
--- 40,43 ----
      -$(MAKE) -C bin $@
      -$(MAKE) -C pl $@
      -$(MAKE) -C test $@
!     rm -f Makefile.port Makefile.global GNUmakefile ant.cfg
Index: src/interfaces/jdbc/Makefile
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/Makefile,v
retrieving revision 1.33
diff -u -c -r1.33 Makefile
*** src/interfaces/jdbc/Makefile    6 Jul 2001 23:07:20 -0000    1.33
--- src/interfaces/jdbc/Makefile    16 Oct 2001 13:40:57 -0000
***************
*** 12,31 ****
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global

- majorversion := $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
- minorversion := $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
-
- properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \
-         -Dfullversion=$(VERSION) \
-         -Ddef_pgport=$(DEF_PGPORT)
-
  all:
!     $(ANT) -buildfile $(srcdir)/build.xml all \
!       $(properties)

  install: installdirs
      $(ANT) -buildfile $(srcdir)/build.xml install \
!       -Dinstall.directory=$(javadir) $(properties)

  installdirs:
      $(mkinstalldirs) $(javadir)
--- 12,23 ----
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global

  all:
!     $(ANT) -buildfile $(srcdir)/build.xml all

  install: installdirs
      $(ANT) -buildfile $(srcdir)/build.xml install \
!       -Dinstall.directory=$(javadir)

  installdirs:
      $(mkinstalldirs) $(javadir)
Index: src/interfaces/jdbc/build.xml
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/build.xml,v
retrieving revision 1.18
diff -u -c -r1.18 build.xml
*** src/interfaces/jdbc/build.xml    23 Sep 2001 04:11:14 -0000    1.18
--- src/interfaces/jdbc/build.xml    12 Oct 2001 10:32:25 -0000
***************
*** 21,26 ****
--- 21,29 ----
    <property name="package" value="org/postgresql" />


+   <!-- Load autoconfed properties.  -->
+   <property file="${srcdir}/../../ant.cfg" />
+
    <!--
      This is a simpler method than utils.CheckVersion
      It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
*** /dev/null    Thu Jan  1 03:00:00 1970
--- src/ant.cfg.in    Tue Oct 16 15:49:05 2001
***************
*** 0 ****
--- 1,8 ----
+ # Properties file for Ant
+
+ fullversion = @VERSION@
+ major = @VERSION_MAJOR@
+ minor = @VERSION_MINOR@
+ def_pgport = @default_port@
+ install.directory = @JAVA_DEST@
+

Re: Ant configuration

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


>
> I dusted a old patch that integrates Ant better with
> autoconf.  It creates a file src/ant.cfg.in to pass
> autoconf parameters to Ant.  Now Ant can be used directly,
> without going through Makefile.
>
> 'install.directory' is still passed in Makefile to keep
> DESTDIR working.
>
> --
> marko
>
>
> Index: configure.in
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/configure.in,v
> retrieving revision 1.146
> diff -u -c -r1.146 configure.in
> *** configure.in    16 Oct 2001 10:09:15 -0000    1.146
> --- configure.in    16 Oct 2001 13:37:46 -0000
> ***************
> *** 32,37 ****
> --- 32,42 ----
>   AC_SUBST(VERSION)
>   AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION")
>
> + VERSION_MAJOR=`echo $VERSION | sed 's/^\([[0-9]][[0-9]]*\)\..*\$/\1/'`
> + VERSION_MINOR=`echo $VERSION | sed 's/^[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\).*\$/\1/'`
> + AC_SUBST(VERSION_MAJOR)
> + AC_SUBST(VERSION_MINOR)
> +
>   unset CDPATH
>
>   AC_CANONICAL_HOST
> ***************
> *** 411,416 ****
> --- 416,424 ----
>   [AC_MSG_RESULT(no)])
>   AC_SUBST(with_java)
>
> + JAVA_DEST=$prefix/share/java
> + AC_SUBST(JAVA_DEST)
> +
>   dnl A note on the Kerberos and OpenSSL options:
>   dnl
>   dnl The user can give an argument to the option in order the specify
> ***************
> *** 1218,1223 ****
> --- 1226,1232 ----
>     src/GNUmakefile
>     src/Makefile.global
>     src/backend/port/Makefile
> +   src/ant.cfg
>   ],
>   [
>   # Update timestamp for pg_config.h (see Makefile.global)
> Index: contrib/retep/build.xml
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/contrib/retep/build.xml,v
> retrieving revision 1.8
> diff -u -c -r1.8 build.xml
> *** contrib/retep/build.xml    6 Jul 2001 23:07:20 -0000    1.8
> --- contrib/retep/build.xml    12 Oct 2001 10:33:39 -0000
> ***************
> *** 19,24 ****
> --- 19,27 ----
>     <property name="package" value="uk/org/retep" />
>     <property name="jardir"  value="jars" />
>
> +   <!-- Load autoconfed properties.  -->
> +   <property file="${srcdir}../../src/ant.cfg" />
> +
>     <!-- Some checks used to build dependent on the environment -->
>     <target name="checks">
>       <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
> Index: src/GNUmakefile.in
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/src/GNUmakefile.in,v
> retrieving revision 1.61
> diff -u -c -r1.61 GNUmakefile.in
> *** src/GNUmakefile.in    10 Feb 2001 02:31:26 -0000    1.61
> --- src/GNUmakefile.in    12 Oct 2001 10:34:36 -0000
> ***************
> *** 40,43 ****
>       -$(MAKE) -C bin $@
>       -$(MAKE) -C pl $@
>       -$(MAKE) -C test $@
> !     rm -f Makefile.port Makefile.global GNUmakefile
> --- 40,43 ----
>       -$(MAKE) -C bin $@
>       -$(MAKE) -C pl $@
>       -$(MAKE) -C test $@
> !     rm -f Makefile.port Makefile.global GNUmakefile ant.cfg
> Index: src/interfaces/jdbc/Makefile
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/Makefile,v
> retrieving revision 1.33
> diff -u -c -r1.33 Makefile
> *** src/interfaces/jdbc/Makefile    6 Jul 2001 23:07:20 -0000    1.33
> --- src/interfaces/jdbc/Makefile    16 Oct 2001 13:40:57 -0000
> ***************
> *** 12,31 ****
>   top_builddir = ../../..
>   include $(top_builddir)/src/Makefile.global
>
> - majorversion := $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
> - minorversion := $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
> -
> - properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \
> -         -Dfullversion=$(VERSION) \
> -         -Ddef_pgport=$(DEF_PGPORT)
> -
>   all:
> !     $(ANT) -buildfile $(srcdir)/build.xml all \
> !       $(properties)
>
>   install: installdirs
>       $(ANT) -buildfile $(srcdir)/build.xml install \
> !       -Dinstall.directory=$(javadir) $(properties)
>
>   installdirs:
>       $(mkinstalldirs) $(javadir)
> --- 12,23 ----
>   top_builddir = ../../..
>   include $(top_builddir)/src/Makefile.global
>
>   all:
> !     $(ANT) -buildfile $(srcdir)/build.xml all
>
>   install: installdirs
>       $(ANT) -buildfile $(srcdir)/build.xml install \
> !       -Dinstall.directory=$(javadir)
>
>   installdirs:
>       $(mkinstalldirs) $(javadir)
> Index: src/interfaces/jdbc/build.xml
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/build.xml,v
> retrieving revision 1.18
> diff -u -c -r1.18 build.xml
> *** src/interfaces/jdbc/build.xml    23 Sep 2001 04:11:14 -0000    1.18
> --- src/interfaces/jdbc/build.xml    12 Oct 2001 10:32:25 -0000
> ***************
> *** 21,26 ****
> --- 21,29 ----
>     <property name="package" value="org/postgresql" />
>
>
> +   <!-- Load autoconfed properties.  -->
> +   <property file="${srcdir}/../../ant.cfg" />
> +
>     <!--
>       This is a simpler method than utils.CheckVersion
>       It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
> *** /dev/null    Thu Jan  1 03:00:00 1970
> --- src/ant.cfg.in    Tue Oct 16 15:49:05 2001
> ***************
> *** 0 ****
> --- 1,8 ----
> + # Properties file for Ant
> +
> + fullversion = @VERSION@
> + major = @VERSION_MAJOR@
> + minor = @VERSION_MINOR@
> + def_pgport = @default_port@
> + install.directory = @JAVA_DEST@
> +
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Ant configuration

From
Peter Eisentraut
Date:
Marko Kreen writes:

> ***************
> *** 411,416 ****
> --- 416,424 ----
>   [AC_MSG_RESULT(no)])
>   AC_SUBST(with_java)
>
> + JAVA_DEST=$prefix/share/java
> + AC_SUBST(JAVA_DEST)
> +
>   dnl A note on the Kerberos and OpenSSL options:
>   dnl
>   dnl The user can give an argument to the option in order the specify

References to $prefix don't work (always) in configure.  Plus, (even if
they did), this would break 'make install prefix=somewhere'.

> Index: contrib/retep/build.xml
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/contrib/retep/build.xml,v
> retrieving revision 1.8
> diff -u -c -r1.8 build.xml
> *** contrib/retep/build.xml    6 Jul 2001 23:07:20 -0000    1.8
> --- contrib/retep/build.xml    12 Oct 2001 10:33:39 -0000
> ***************
> *** 19,24 ****
> --- 19,27 ----
>     <property name="package" value="uk/org/retep" />
>     <property name="jardir"  value="jars" />
>
> +   <!-- Load autoconfed properties.  -->
> +   <property file="${srcdir}../../src/ant.cfg" />
> +
>     <!-- Some checks used to build dependent on the environment -->
>     <target name="checks">
>       <available property="jdk1.2+" classname="java.lang.ThreadLocal" />

This is obviously a typo.

Plus, I'm not sure whether this would work when building outside the
source tree, since ant.cfg is not going to be in the source tree.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: Ant configuration

From
Marko Kreen
Date:
On Wed, Oct 17, 2001 at 10:35:07PM +0200, Peter Eisentraut wrote:
> Marko Kreen writes:
> > Index: configure.in
> > + JAVA_DEST=$prefix/share/java
> > + AC_SUBST(JAVA_DEST)
>
> References to $prefix don't work (always) in configure.  Plus, (even if
> they did), this would break 'make install prefix=somewhere'.

The JAVA_DEST goes into ant.cfg.  It is replaced in configure
end-phase.  It tells Ant-only compiling/installing the final
directory and I cant use make variables there.

But when going through 'make', the install.directory
is replaced _in any case_ with what make uses.  So the patch
does not change anything how 'make install' currently works.

(Parameters from command line override parameters from properties
files in Ant)


> > Index: contrib/retep/build.xml
> > +   <!-- Load autoconfed properties.  -->
> > +   <property file="${srcdir}../../src/ant.cfg" />
>
> This is obviously a typo.

Heh.  Sorry.  Attached is fixed patch.

> Plus, I'm not sure whether this would work when building outside the
> source tree, since ant.cfg is not going to be in the source tree.

Well, does it work currently?  The parameters I put into ant.cfg
are currently fetched from Makefile.global...  Only thing I
changed is that now Ant does not need to be called from Makefile
to get those parameters.

Any other problems?

--
marko



Index: configure.in
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/configure.in,v
retrieving revision 1.146
diff -u -c -r1.146 configure.in
*** configure.in    16 Oct 2001 10:09:15 -0000    1.146
--- configure.in    16 Oct 2001 13:37:46 -0000
***************
*** 32,37 ****
--- 32,42 ----
  AC_SUBST(VERSION)
  AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION")

+ VERSION_MAJOR=`echo $VERSION | sed 's/^\([[0-9]][[0-9]]*\)\..*\$/\1/'`
+ VERSION_MINOR=`echo $VERSION | sed 's/^[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\).*\$/\1/'`
+ AC_SUBST(VERSION_MAJOR)
+ AC_SUBST(VERSION_MINOR)
+
  unset CDPATH

  AC_CANONICAL_HOST
***************
*** 411,416 ****
--- 416,424 ----
  [AC_MSG_RESULT(no)])
  AC_SUBST(with_java)

+ JAVA_DEST=$prefix/share/java
+ AC_SUBST(JAVA_DEST)
+
  dnl A note on the Kerberos and OpenSSL options:
  dnl
  dnl The user can give an argument to the option in order the specify
***************
*** 1218,1223 ****
--- 1226,1232 ----
    src/GNUmakefile
    src/Makefile.global
    src/backend/port/Makefile
+   src/ant.cfg
  ],
  [
  # Update timestamp for pg_config.h (see Makefile.global)
Index: contrib/retep/build.xml
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/contrib/retep/build.xml,v
retrieving revision 1.8
diff -u -c -r1.8 build.xml
*** contrib/retep/build.xml    6 Jul 2001 23:07:20 -0000    1.8
--- contrib/retep/build.xml    12 Oct 2001 10:33:39 -0000
***************
*** 19,24 ****
--- 19,27 ----
    <property name="package" value="uk/org/retep" />
    <property name="jardir"  value="jars" />

+   <!-- Load autoconfed properties.  -->
+   <property file="${srcdir}/../../src/ant.cfg" />
+
    <!-- Some checks used to build dependent on the environment -->
    <target name="checks">
      <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
Index: src/GNUmakefile.in
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/src/GNUmakefile.in,v
retrieving revision 1.61
diff -u -c -r1.61 GNUmakefile.in
*** src/GNUmakefile.in    10 Feb 2001 02:31:26 -0000    1.61
--- src/GNUmakefile.in    12 Oct 2001 10:34:36 -0000
***************
*** 40,43 ****
      -$(MAKE) -C bin $@
      -$(MAKE) -C pl $@
      -$(MAKE) -C test $@
!     rm -f Makefile.port Makefile.global GNUmakefile
--- 40,43 ----
      -$(MAKE) -C bin $@
      -$(MAKE) -C pl $@
      -$(MAKE) -C test $@
!     rm -f Makefile.port Makefile.global GNUmakefile ant.cfg
Index: src/interfaces/jdbc/Makefile
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/Makefile,v
retrieving revision 1.33
diff -u -c -r1.33 Makefile
*** src/interfaces/jdbc/Makefile    6 Jul 2001 23:07:20 -0000    1.33
--- src/interfaces/jdbc/Makefile    16 Oct 2001 13:40:57 -0000
***************
*** 12,31 ****
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global

- majorversion := $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
- minorversion := $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
-
- properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \
-         -Dfullversion=$(VERSION) \
-         -Ddef_pgport=$(DEF_PGPORT)
-
  all:
!     $(ANT) -buildfile $(srcdir)/build.xml all \
!       $(properties)

  install: installdirs
      $(ANT) -buildfile $(srcdir)/build.xml install \
!       -Dinstall.directory=$(javadir) $(properties)

  installdirs:
      $(mkinstalldirs) $(javadir)
--- 12,23 ----
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global

  all:
!     $(ANT) -buildfile $(srcdir)/build.xml all

  install: installdirs
      $(ANT) -buildfile $(srcdir)/build.xml install \
!       -Dinstall.directory=$(javadir)

  installdirs:
      $(mkinstalldirs) $(javadir)
Index: src/interfaces/jdbc/build.xml
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/build.xml,v
retrieving revision 1.18
diff -u -c -r1.18 build.xml
*** src/interfaces/jdbc/build.xml    23 Sep 2001 04:11:14 -0000    1.18
--- src/interfaces/jdbc/build.xml    12 Oct 2001 10:32:25 -0000
***************
*** 21,26 ****
--- 21,29 ----
    <property name="package" value="org/postgresql" />


+   <!-- Load autoconfed properties.  -->
+   <property file="${srcdir}/../../ant.cfg" />
+
    <!--
      This is a simpler method than utils.CheckVersion
      It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
*** /dev/null    Thu Jan  1 03:00:00 1970
--- src/ant.cfg.in    Tue Oct 16 15:49:05 2001
***************
*** 0 ****
--- 1,8 ----
+ # Properties file for Ant
+
+ fullversion = @VERSION@
+ major = @VERSION_MAJOR@
+ minor = @VERSION_MINOR@
+ def_pgport = @default_port@
+ install.directory = @JAVA_DEST@
+

Re: Ant configuration

From
Barry Lind
Date:
I don't like this patch.  If anything I think we should remove the
dependency on ANT, not remove the dependency on make.

By requiring ANT, we provide yet another hurdle for someone wanting to
use JDBC with postgres.  I would prefer that the build environment be
the same for the database as for the jdbc code.

Anything that makes it more difficult to download the source and get
going with it is a negative in my opinion.  And from my perspective
requiring the download of an additional tool (ANT in this case) makes it
more difficult.

I already know that some binary distributions of postgres do not include
JDBC simply because it is too complex to get ANT installed in their
build environment. (complex perhaps isn't the right word, but it is more
work than they are willing to put in for a small feature of postgres).

thanks,
--Barry




Marko Kreen wrote:

> I dusted a old patch that integrates Ant better with
> autoconf.  It creates a file src/ant.cfg.in to pass
> autoconf parameters to Ant.  Now Ant can be used directly,
> without going through Makefile.
>
> 'install.directory' is still passed in Makefile to keep
> DESTDIR working.
>
>



Re: Ant configuration

From
Marko Kreen
Date:
On Wed, Oct 17, 2001 at 01:23:13PM -0700, Barry Lind wrote:
> I don't like this patch.  If anything I think we should remove the
> dependency on ANT, not remove the dependency on make.
>
> By requiring ANT, we provide yet another hurdle for someone wanting to
> use JDBC with postgres.  I would prefer that the build environment be
> the same for the database as for the jdbc code.
>
> Anything that makes it more difficult to download the source and get
> going with it is a negative in my opinion.  And from my perspective
> requiring the download of an additional tool (ANT in this case) makes it
> more difficult.

I have no strong feelings about current situation, I simply made
it more flexible.  About changing it, you should consult JDBC
maintainers first, maybe they have some good reason why its
so...

> I already know that some binary distributions of postgres do not include
> JDBC simply because it is too complex to get ANT installed in their
> build environment. (complex perhaps isn't the right word, but it is more
> work than they are willing to put in for a small feature of postgres).

JDBC driver is simply a .jar file, I think it should be more
easily downloadable from main website.  (JDBC1/JDBC2 edition...)

--
marko


Re: Ant configuration

From
Bruce Momjian
Date:
I agree with Barry Lind that there is no reason for us to use Ant at
all.  Can you work on a patch that uses our standard Make machanism?

Patch rejected.

---------------------------------------------------------------------------

>
> I dusted a old patch that integrates Ant better with
> autoconf.  It creates a file src/ant.cfg.in to pass
> autoconf parameters to Ant.  Now Ant can be used directly,
> without going through Makefile.
>
> 'install.directory' is still passed in Makefile to keep
> DESTDIR working.
>
> --
> marko
>
>
> Index: configure.in
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/configure.in,v
> retrieving revision 1.146
> diff -u -c -r1.146 configure.in
> *** configure.in    16 Oct 2001 10:09:15 -0000    1.146
> --- configure.in    16 Oct 2001 13:37:46 -0000
> ***************
> *** 32,37 ****
> --- 32,42 ----
>   AC_SUBST(VERSION)
>   AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION")
>
> + VERSION_MAJOR=`echo $VERSION | sed 's/^\([[0-9]][[0-9]]*\)\..*\$/\1/'`
> + VERSION_MINOR=`echo $VERSION | sed 's/^[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\).*\$/\1/'`
> + AC_SUBST(VERSION_MAJOR)
> + AC_SUBST(VERSION_MINOR)
> +
>   unset CDPATH
>
>   AC_CANONICAL_HOST
> ***************
> *** 411,416 ****
> --- 416,424 ----
>   [AC_MSG_RESULT(no)])
>   AC_SUBST(with_java)
>
> + JAVA_DEST=$prefix/share/java
> + AC_SUBST(JAVA_DEST)
> +
>   dnl A note on the Kerberos and OpenSSL options:
>   dnl
>   dnl The user can give an argument to the option in order the specify
> ***************
> *** 1218,1223 ****
> --- 1226,1232 ----
>     src/GNUmakefile
>     src/Makefile.global
>     src/backend/port/Makefile
> +   src/ant.cfg
>   ],
>   [
>   # Update timestamp for pg_config.h (see Makefile.global)
> Index: contrib/retep/build.xml
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/contrib/retep/build.xml,v
> retrieving revision 1.8
> diff -u -c -r1.8 build.xml
> *** contrib/retep/build.xml    6 Jul 2001 23:07:20 -0000    1.8
> --- contrib/retep/build.xml    12 Oct 2001 10:33:39 -0000
> ***************
> *** 19,24 ****
> --- 19,27 ----
>     <property name="package" value="uk/org/retep" />
>     <property name="jardir"  value="jars" />
>
> +   <!-- Load autoconfed properties.  -->
> +   <property file="${srcdir}../../src/ant.cfg" />
> +
>     <!-- Some checks used to build dependent on the environment -->
>     <target name="checks">
>       <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
> Index: src/GNUmakefile.in
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/src/GNUmakefile.in,v
> retrieving revision 1.61
> diff -u -c -r1.61 GNUmakefile.in
> *** src/GNUmakefile.in    10 Feb 2001 02:31:26 -0000    1.61
> --- src/GNUmakefile.in    12 Oct 2001 10:34:36 -0000
> ***************
> *** 40,43 ****
>       -$(MAKE) -C bin $@
>       -$(MAKE) -C pl $@
>       -$(MAKE) -C test $@
> !     rm -f Makefile.port Makefile.global GNUmakefile
> --- 40,43 ----
>       -$(MAKE) -C bin $@
>       -$(MAKE) -C pl $@
>       -$(MAKE) -C test $@
> !     rm -f Makefile.port Makefile.global GNUmakefile ant.cfg
> Index: src/interfaces/jdbc/Makefile
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/Makefile,v
> retrieving revision 1.33
> diff -u -c -r1.33 Makefile
> *** src/interfaces/jdbc/Makefile    6 Jul 2001 23:07:20 -0000    1.33
> --- src/interfaces/jdbc/Makefile    16 Oct 2001 13:40:57 -0000
> ***************
> *** 12,31 ****
>   top_builddir = ../../..
>   include $(top_builddir)/src/Makefile.global
>
> - majorversion := $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
> - minorversion := $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
> -
> - properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \
> -         -Dfullversion=$(VERSION) \
> -         -Ddef_pgport=$(DEF_PGPORT)
> -
>   all:
> !     $(ANT) -buildfile $(srcdir)/build.xml all \
> !       $(properties)
>
>   install: installdirs
>       $(ANT) -buildfile $(srcdir)/build.xml install \
> !       -Dinstall.directory=$(javadir) $(properties)
>
>   installdirs:
>       $(mkinstalldirs) $(javadir)
> --- 12,23 ----
>   top_builddir = ../../..
>   include $(top_builddir)/src/Makefile.global
>
>   all:
> !     $(ANT) -buildfile $(srcdir)/build.xml all
>
>   install: installdirs
>       $(ANT) -buildfile $(srcdir)/build.xml install \
> !       -Dinstall.directory=$(javadir)
>
>   installdirs:
>       $(mkinstalldirs) $(javadir)
> Index: src/interfaces/jdbc/build.xml
> ===================================================================
> RCS file: /opt/cvs/pgsql/pgsql/src/interfaces/jdbc/build.xml,v
> retrieving revision 1.18
> diff -u -c -r1.18 build.xml
> *** src/interfaces/jdbc/build.xml    23 Sep 2001 04:11:14 -0000    1.18
> --- src/interfaces/jdbc/build.xml    12 Oct 2001 10:32:25 -0000
> ***************
> *** 21,26 ****
> --- 21,29 ----
>     <property name="package" value="org/postgresql" />
>
>
> +   <!-- Load autoconfed properties.  -->
> +   <property file="${srcdir}/../../ant.cfg" />
> +
>     <!--
>       This is a simpler method than utils.CheckVersion
>       It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
> *** /dev/null    Thu Jan  1 03:00:00 1970
> --- src/ant.cfg.in    Tue Oct 16 15:49:05 2001
> ***************
> *** 0 ****
> --- 1,8 ----
> + # Properties file for Ant
> +
> + fullversion = @VERSION@
> + major = @VERSION_MAJOR@
> + minor = @VERSION_MINOR@
> + def_pgport = @default_port@
> + install.directory = @JAVA_DEST@
> +
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Ant configuration

From
Bruce Momjian
Date:
> On Wed, Oct 17, 2001 at 01:23:13PM -0700, Barry Lind wrote:
> > I don't like this patch.  If anything I think we should remove the
> > dependency on ANT, not remove the dependency on make.
> >
> > By requiring ANT, we provide yet another hurdle for someone wanting to
> > use JDBC with postgres.  I would prefer that the build environment be
> > the same for the database as for the jdbc code.
> >
> > Anything that makes it more difficult to download the source and get
> > going with it is a negative in my opinion.  And from my perspective
> > requiring the download of an additional tool (ANT in this case) makes it
> > more difficult.
>
> I have no strong feelings about current situation, I simply made
> it more flexible.  About changing it, you should consult JDBC
> maintainers first, maybe they have some good reason why its
> so...

Barry and Dave are the jdbc maintainers now and I think there is general
consensus that we want to get away from Ant if possible.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Ant configuration

From
Peter Eisentraut
Date:
Barry Lind writes:

> I don't like this patch.  If anything I think we should remove the
> dependency on ANT, not remove the dependency on make.

The use of Ant originally seemed attractive because it would solve the
detection of the jdk version, the portable invocation of the compiler, and
the dependency generation.  However, I must currently consider this
experiment a failure, because for each problem Ant solves it introduces a
load of worse problems into the system.  Thus, if we can agree to work out
a configure/make-based system for the next release I would be very much
for it.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: [JDBC] Ant configuration

From
Gunnar Rønning
Date:
* Peter Eisentraut <peter_e@gmx.net> wrote:
|
| The use of Ant originally seemed attractive because it would solve the
| detection of the jdk version, the portable invocation of the compiler, and
| the dependency generation.  However, I must currently consider this
| experiment a failure, because for each problem Ant solves it introduces a
| load of worse problems into the system.  Thus, if we can agree to work out
| a configure/make-based system for the next release I would be very much
| for it.

What are the pro and cons for each approach ?

Would it be unfeasible to include the ant binary in the distribution or is
there other problems as well ?

If we use make I guess we could use jikes to generate dependency files for
make, but that does give use much as we then will require jikes for
developers. Another alternative is make clean or manual approaches.

I would say that we have two primary concerns here :

1. A build process that JDBC developers find convenient and productive
   to work with.

2. A build process that the users find convenient. Downloading things
   like Ant is not helping them.


--
Gunnar Rønning - gunnar@polygnosis.com
Senior Consultant, Polygnosis AS, http://www.polygnosis.com/

Re: Ant configuration

From
Bruce Momjian
Date:
> Barry Lind writes:
>
> > I don't like this patch.  If anything I think we should remove the
> > dependency on ANT, not remove the dependency on make.
>
> The use of Ant originally seemed attractive because it would solve the
> detection of the jdk version, the portable invocation of the compiler, and
> the dependency generation.  However, I must currently consider this
> experiment a failure, because for each problem Ant solves it introduces a
> load of worse problems into the system.  Thus, if we can agree to work out
> a configure/make-based system for the next release I would be very much
> for it.

I think I can safely at to TODO:

    JDBC
        o Move from Ant to Make builds

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Ant configuration

From
Gunnar Rønning
Date:
* Bruce Momjian <pgman@candle.pha.pa.us> wrote:
|
| I think I can safely at to TODO:
|
|     JDBC
|         o Move from Ant to Make builds

I don't think there is consesus over at the JDBC list yet. We need to get
all the pros/cons for both solutions on the table first. Make is not
neccesarily better than Ant, I would think a combination would work best.
Because then Mac and Windows users could use Ant to compile their JDBC
driver, while the compilation of the server on Unices would work
seamlessly.

--
Gunnar Rønning - gunnar@polygnosis.com
Senior Consultant, Polygnosis AS, http://www.polygnosis.com/

Re: Ant configuration

From
Bruce Momjian
Date:
OK, TODO item removed.


> * Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> |
> | I think I can safely at to TODO:
> |
> |     JDBC
> |         o Move from Ant to Make builds
>
> I don't think there is consesus over at the JDBC list yet. We need to get
> all the pros/cons for both solutions on the table first. Make is not
> neccesarily better than Ant, I would think a combination would work best.
> Because then Mac and Windows users could use Ant to compile their JDBC
> driver, while the compilation of the server on Unices would work
> seamlessly.
>
> --
> Gunnar R?nning - gunnar@polygnosis.com
> Senior Consultant, Polygnosis AS, http://www.polygnosis.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026