Re: RE: Compiling

From: Marko Kreen <marko(at)l-t(dot)ee>
To: Peter Mount <peter(at)retep(dot)org(dot)uk>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: RE: Compiling
Date: 2001-03-29 12:29:34
Message-ID: 20010329142934.A31346@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, Mar 29, 2001 at 09:50:04AM +0100, Peter Mount wrote:
> At 13:04 27/03/01 +0200, Marko Kreen wrote:
> >On Tue, Mar 27, 2001 at 07:54:15AM +1000, Mike Cannon-Brookes wrote:
> > > 3) currently we seem to have a build process that is 99% Ant and 1% make
> > > (for 4 substitutions). It seems unnecessarily complex to add make when we
> > > can remove it completely and not lose any functionality.
> >
> >Peter E, Peter M: how about build.xml.in, where the needed
> >substitutions are done in configure end-phase? I can prepare
> >patch if this is acceptable.
>
> For me that would be a good idea (remember there are three build.xml files)
> - it's just that I don't know enough about autoconf to do it myself :-)

The .xml.in was not needed. I solved it using java.util.Properties
format file src/build.cfg.in where the parameters are specified.

Note: $DESTDIR works only with make. -Dinstall.directory overrides
build.cfg specified one.

Comments?

--
marko

diff -urNX /home/marko/misc/diff-exclude pgsql.orig/build.xml pgsql/build.xml
--- pgsql.orig/build.xml Mon Mar 12 19:43:52 2001
+++ pgsql/build.xml Thu Mar 29 13:32:48 2001
@@ -18,6 +18,9 @@

<project name="postgresql" default="jar" basedir=".">

+ <!-- Load autoconfed properties. -->
+ <property file="src/build.cfg" />
+
<!--
This is the normal entry point. It builds first the
jdbc driver, then the extra tools.
diff -urNX /home/marko/misc/diff-exclude pgsql.orig/configure.in pgsql/configure.in
--- pgsql.orig/configure.in Fri Mar 23 22:53:06 2001
+++ pgsql/configure.in Thu Mar 29 12:34:30 2001
@@ -32,6 +32,13 @@
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION")

+changequote({, })
+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/'`
+changequote([, ])
+AC_SUBST(VERSION_MAJOR)
+AC_SUBST(VERSION_MINOR)
+
unset CDPATH

AC_CANONICAL_HOST
@@ -414,6 +421,9 @@
[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
@@ -1179,6 +1189,7 @@
GNUmakefile
src/GNUmakefile
src/Makefile.global
+ src/build.cfg
src/backend/port/Makefile
],
[
diff -urNX /home/marko/misc/diff-exclude pgsql.orig/contrib/retep/build.xml pgsql/contrib/retep/build.xml
--- pgsql.orig/contrib/retep/build.xml Tue Mar 27 12:27:11 2001
+++ pgsql/contrib/retep/build.xml Thu Mar 29 13:32:29 2001
@@ -14,6 +14,9 @@
<property name="package" value="uk/org/retep" />
<property name="jars" value="jars" />

+ <!-- Load autoconfed properties. -->
+ <property file="../../src/build.cfg" />
+
<!-- Some checks used to build dependent on the environment -->
<target name="checks">
<available property="jdk1.2+" classname="java.lang.ThreadLocal" />
diff -urNX /home/marko/misc/diff-exclude pgsql.orig/src/GNUmakefile.in pgsql/src/GNUmakefile.in
--- pgsql.orig/src/GNUmakefile.in Mon Feb 12 19:29:27 2001
+++ pgsql/src/GNUmakefile.in Thu Mar 29 13:50:49 2001
@@ -40,4 +40,4 @@
-$(MAKE) -C bin $@
-$(MAKE) -C pl $@
-$(MAKE) -C test $@
- rm -f Makefile.port Makefile.global GNUmakefile
+ rm -f Makefile.port Makefile.global GNUmakefile build.cfg
diff -urNX /home/marko/misc/diff-exclude pgsql.orig/src/build.cfg.in pgsql/src/build.cfg.in
--- pgsql.orig/src/build.cfg.in Thu Jan 1 03:00:00 1970
+++ pgsql/src/build.cfg.in Thu Mar 29 13:48:09 2001
@@ -0,0 +1,8 @@
+# Properties file for Ant
+
+fullversion=(at)VERSION@
+major=(at)VERSION_MAJOR@
+minor=(at)VERSION_MINOR@
+def_pgport=(at)default_port@
+install(dot)directory=(at)JAVA_DEST@
+
diff -urNX /home/marko/misc/diff-exclude pgsql.orig/src/interfaces/jdbc/Makefile pgsql/src/interfaces/jdbc/Makefile
--- pgsql.orig/src/interfaces/jdbc/Makefile Tue Mar 27 12:27:11 2001
+++ pgsql/src/interfaces/jdbc/Makefile Thu Mar 29 12:12:10 2001
@@ -12,20 +12,13 @@
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 $(top_srcdir)/build.xml $(properties)
+ $(ANT) -buildfile $(top_srcdir)/build.xml

install: installdirs
$(ANT) -Dinstall.directory=$(DESTDIR)$(datadir)/java \
-buildfile $(top_srcdir)/build.xml \
- install $(properties)
+ install

installdirs:
$(mkinstalldirs) $(DESTDIR)$(datadir)/java
diff -urNX /home/marko/misc/diff-exclude pgsql.orig/src/interfaces/jdbc/build.xml pgsql/src/interfaces/jdbc/build.xml
--- pgsql.orig/src/interfaces/jdbc/build.xml Tue Mar 27 12:27:11 2001
+++ pgsql/src/interfaces/jdbc/build.xml Thu Mar 29 13:31:43 2001
@@ -27,6 +27,9 @@
<property name="tablename" value="jdbctest" />
<property name="junit.ui" value="textui" />

+ <!-- Load autoconfed properties. -->
+ <property file="../../build.cfg" />
+
<!--
This is a simpler method than utils.CheckVersion
It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mihai Gheorghiu 2001-03-29 14:15:19 Re: Combo box
Previous Message Eric Frazier 2001-03-29 10:14:32 Re: [JDBC] Logging Queries