At this moment, --enable-debug adds debugging information to most of the
parts o f postgresql. The jdbc drivers are never compiled with debugging support. This p atch make sure that debugging information is added to the jdbc jar when the --en able-debug is added. This was usefull for me for debugging some java jdbc poolin g objects but this might perhaps be usefull for other people too? Dries Verachtert
This commit is contained in:
parent
af41101a40
commit
0416641baa
4 changed files with 247 additions and 239 deletions
|
@ -259,7 +259,7 @@ AC_SUBST(enable_rpath)
|
||||||
#
|
#
|
||||||
PGAC_ARG_BOOL(enable, debug, no,
|
PGAC_ARG_BOOL(enable, debug, no,
|
||||||
[ --enable-debug build with debugging symbols (-g)])
|
[ --enable-debug build with debugging symbols (-g)])
|
||||||
|
AC_SUBST(enable_debug)
|
||||||
|
|
||||||
#
|
#
|
||||||
# C compiler
|
# C compiler
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# -*-makefile-*-
|
# -*-makefile-*-
|
||||||
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.141 2001/12/20 21:23:05 momjian Exp $
|
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.142 2002/03/05 17:55:22 momjian Exp $
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# All PostgreSQL makefiles include this file and use the variables it sets,
|
# All PostgreSQL makefiles include this file and use the variables it sets,
|
||||||
|
@ -132,6 +132,7 @@ MULTIBYTE = @MULTIBYTE@
|
||||||
enable_shared = @enable_shared@
|
enable_shared = @enable_shared@
|
||||||
enable_rpath = @enable_rpath@
|
enable_rpath = @enable_rpath@
|
||||||
enable_nls = @enable_nls@
|
enable_nls = @enable_nls@
|
||||||
|
enable_debug = @enable_debug@
|
||||||
|
|
||||||
python_version = @python_version@
|
python_version = @python_version@
|
||||||
python_includespec = @python_includespec@
|
python_includespec = @python_includespec@
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2001, PostgreSQL Global Development Group
|
# Copyright (c) 2001, PostgreSQL Global Development Group
|
||||||
#
|
#
|
||||||
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.33 2001/07/06 23:07:20 petere Exp $
|
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.34 2002/03/05 17:55:23 momjian Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@ minorversion := $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*
|
||||||
|
|
||||||
properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \
|
properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \
|
||||||
-Dfullversion=$(VERSION) \
|
-Dfullversion=$(VERSION) \
|
||||||
-Ddef_pgport=$(DEF_PGPORT)
|
-Ddef_pgport=$(DEF_PGPORT) \
|
||||||
|
-Denable_debug=$(enable_debug)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(ANT) -buildfile $(srcdir)/build.xml all \
|
$(ANT) -buildfile $(srcdir)/build.xml all \
|
||||||
|
|
|
@ -1,235 +1,241 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
build file to allow ant (http://jakarta.apache.org/ant/) to be used
|
build file to allow ant (http://jakarta.apache.org/ant/) to be used
|
||||||
to build the PostgreSQL JDBC Driver
|
to build the PostgreSQL JDBC Driver
|
||||||
|
|
||||||
$Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.20 2002/02/24 16:12:51 davec Exp $
|
$Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.21 2002/03/05 17:55:23 momjian Exp $
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!DOCTYPE project [
|
<!DOCTYPE project [
|
||||||
<!ENTITY jarfiles "postgresql.jar,postgresql-examples.jar">
|
<!ENTITY jarfiles "postgresql.jar,postgresql-examples.jar">
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<project name="postgresqlJDBC" default="all" basedir=".">
|
<project name="postgresqlJDBC" default="all" basedir=".">
|
||||||
|
|
||||||
<!-- set global properties for this build -->
|
<!-- set global properties for this build -->
|
||||||
<property name="srcdir" value="." />
|
<property name="srcdir" value="." />
|
||||||
<property name="jardir" value="jars" />
|
<property name="jardir" value="jars" />
|
||||||
<property name="builddir" value="build" />
|
<property name="builddir" value="build" />
|
||||||
<property name="package" value="org/postgresql" />
|
<property name="package" value="org/postgresql" />
|
||||||
<property name="debug" value="yes" />
|
<property name="debug" value="off" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
This is a simpler method than utils.CheckVersion
|
This is a simpler method than utils.CheckVersion
|
||||||
It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
|
It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
|
||||||
in the CLASSPATH (ie JDK1.2 or later), and then enterprise if the
|
in the CLASSPATH (ie JDK1.2 or later), and then enterprise if the
|
||||||
javax.sql.DataSource class is present.
|
javax.sql.DataSource class is present.
|
||||||
|
|
||||||
Important: This must have the following order: jdbc1, jdbc2, enterprise
|
Important: This must have the following order: jdbc1, jdbc2, enterprise
|
||||||
-->
|
-->
|
||||||
<target name="check_versions">
|
<target name="check_versions">
|
||||||
<condition property="jdbc1">
|
<condition property="jdbc1">
|
||||||
<equals arg1="${ant.java.version}" arg2="1.1"/>
|
<equals arg1="${ant.java.version}" arg2="1.1"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="jdbc2">
|
<condition property="jdbc2">
|
||||||
<or>
|
<or>
|
||||||
<equals arg1="${ant.java.version}" arg2="1.2"/>
|
<equals arg1="${ant.java.version}" arg2="1.2"/>
|
||||||
<equals arg1="${ant.java.version}" arg2="1.3"/>
|
<equals arg1="${ant.java.version}" arg2="1.3"/>
|
||||||
<equals arg1="${ant.java.version}" arg2="1.4"/>
|
<equals arg1="${ant.java.version}" arg2="1.4"/>
|
||||||
</or>
|
</or>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="datasource">
|
<condition property="datasource">
|
||||||
<and>
|
<and>
|
||||||
<or>
|
<or>
|
||||||
<equals arg1="${ant.java.version}" arg2="1.2"/>
|
<equals arg1="${ant.java.version}" arg2="1.2"/>
|
||||||
<equals arg1="${ant.java.version}" arg2="1.3"/>
|
<equals arg1="${ant.java.version}" arg2="1.3"/>
|
||||||
</or>
|
</or>
|
||||||
<available classname="javax.sql.DataSource"/>
|
<available classname="javax.sql.DataSource"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<available property="junit" classname="junit.framework.Test" />
|
<available property="junit" classname="junit.framework.Test" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
<!-- default target -->
|
<!-- default target -->
|
||||||
<target name="all">
|
<target name="all">
|
||||||
<antcall target="jar" />
|
<antcall target="jar" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
<!-- create the jar file -->
|
<!-- create the jar file -->
|
||||||
<target name="jar" depends="compile,examples">
|
<target name="jar" depends="compile,examples">
|
||||||
<jar jarfile="${jardir}/postgresql.jar" whenempty="fail">
|
<jar jarfile="${jardir}/postgresql.jar" whenempty="fail">
|
||||||
<fileset dir="${builddir}">
|
<fileset dir="${builddir}">
|
||||||
<include name="${package}/**/*.class" />
|
<include name="${package}/**/*.class" />
|
||||||
<exclude name="${package}/test/**" />
|
<exclude name="${package}/test/**" />
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
<fileset dir="${srcdir}">
|
<fileset dir="${srcdir}">
|
||||||
<include name="${package}/*.properties" />
|
<include name="${package}/*.properties" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</jar>
|
</jar>
|
||||||
|
|
||||||
<jar jarfile="${jardir}/postgresql-examples.jar" whenempty="fail">
|
<jar jarfile="${jardir}/postgresql-examples.jar" whenempty="fail">
|
||||||
<fileset dir="${builddir}">
|
<fileset dir="${builddir}">
|
||||||
<include name="example/**/*.class" />
|
<include name="example/**/*.class" />
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
<fileset dir="${srcdir}">
|
<fileset dir="${srcdir}">
|
||||||
<include name="example/*.properties" />
|
<include name="example/*.properties" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</jar>
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
<!-- This is the core of the driver. It is common for all three versions. -->
|
<!-- This is the core of the driver. It is common for all three versions. -->
|
||||||
<target name="compile" depends="prepare,check_versions,driver">
|
<target name="compile" depends="prepare,check_versions,driver">
|
||||||
<javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
|
<javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
|
||||||
<include name="${package}/**" />
|
<include name="${package}/**" />
|
||||||
|
|
||||||
<exclude name="${package}/jdbc1/**" unless="jdbc1"/>
|
<exclude name="${package}/jdbc1/**" unless="jdbc1"/>
|
||||||
<exclude name="${package}/jdbc2/**" unless="jdbc2"/>
|
<exclude name="${package}/jdbc2/**" unless="jdbc2"/>
|
||||||
|
|
||||||
<exclude name="${package}/largeobject/PGblob.java" unless="jdbc2" />
|
<exclude name="${package}/largeobject/PGblob.java" unless="jdbc2" />
|
||||||
<exclude name="${package}/largeobject/PGclob.java" unless="jdbc2" />
|
<exclude name="${package}/largeobject/PGclob.java" unless="jdbc2" />
|
||||||
|
|
||||||
<exclude name="${package}/PostgresqlDataSource.java" unless="datasource" />
|
<exclude name="${package}/PostgresqlDataSource.java" unless="datasource" />
|
||||||
<exclude name="${package}/xa/**" unless="datasource" />
|
<exclude name="${package}/xa/**" unless="datasource" />
|
||||||
|
|
||||||
<exclude name="${package}/test/**" unless="junit" />
|
<exclude name="${package}/test/**" unless="junit" />
|
||||||
</javac>
|
</javac>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
This generates Driver.java from Driver.java.in
|
This generates Driver.java from Driver.java.in
|
||||||
It's required for importing the driver version properties
|
It's required for importing the driver version properties
|
||||||
-->
|
-->
|
||||||
<target name="driver" depends="prepare,check_versions">
|
<target name="driver" depends="prepare,check_versions">
|
||||||
<!-- determine the edition text -->
|
<!-- determine the edition text -->
|
||||||
<property name="edition" value="JDBC1" />
|
<property name="edition" value="JDBC1" />
|
||||||
<condition property="edition" value="JDBC2">
|
<condition property="edition" value="JDBC2">
|
||||||
<or>
|
<or>
|
||||||
<equals arg1="${jdbc2}" arg2="true"/>
|
<equals arg1="${jdbc2}" arg2="true"/>
|
||||||
<equals arg1="${jdbc3}" arg2="true"/> <!-- fake it for now -->
|
<equals arg1="${jdbc3}" arg2="true"/> <!-- fake it for now -->
|
||||||
|
|
||||||
</or>
|
</or>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<condition property="edition" value="JDBC2 Enterprise">
|
<condition property="edition" value="JDBC2 Enterprise">
|
||||||
<and>
|
<and>
|
||||||
<available classname="javax.sql.DataSource" />
|
<available classname="javax.sql.DataSource" />
|
||||||
<equals arg1="${jdbc2}" arg2="true"/>
|
<equals arg1="${jdbc2}" arg2="true"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<!-- determine the connection class -->
|
<!-- determine the connection class -->
|
||||||
<property name="connectclass" value="org.postgresql.jdbc1.Connection" />
|
<property name="connectclass" value="org.postgresql.jdbc1.Connection" />
|
||||||
<available property="connectclass" value="org.postgresql.jdbc2.Connection" classname="java.lang.ThreadLocal" />
|
<available property="connectclass" value="org.postgresql.jdbc2.Connection" classname="java.lang.ThreadLocal" />
|
||||||
|
|
||||||
<!-- Some defaults -->
|
<!-- Some defaults -->
|
||||||
<filter token="MAJORVERSION" value="${major}" />
|
<filter token="MAJORVERSION" value="${major}" />
|
||||||
<filter token="MINORVERSION" value="${minor}" />
|
<filter token="MINORVERSION" value="${minor}" />
|
||||||
<filter token="VERSION" value="PostgreSQL ${fullversion} ${edition}" />
|
<filter token="VERSION" value="PostgreSQL ${fullversion} ${edition}" />
|
||||||
<filter token="JDBCCONNECTCLASS" value="${connectclass}" />
|
<filter token="JDBCCONNECTCLASS" value="${connectclass}" />
|
||||||
<filter token="DEF_PGPORT" value="${def_pgport}" />
|
<filter token="DEF_PGPORT" value="${def_pgport}" />
|
||||||
|
|
||||||
<!-- Put a check for the current version here -->
|
<!-- Put a check for the current version here -->
|
||||||
|
|
||||||
<!-- now copy and filter the file -->
|
<!-- now copy and filter the file -->
|
||||||
<copy file="${package}/Driver.java.in"
|
<copy file="${package}/Driver.java.in"
|
||||||
tofile="${package}/Driver.java"
|
tofile="${package}/Driver.java"
|
||||||
filtering="yes" />
|
filtering="yes" />
|
||||||
|
|
||||||
<echo message="Configured build for the ${edition} edition driver" />
|
<echo message="Configured build for the ${edition} edition driver" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
<!-- Prepares the build directory -->
|
<!-- Prepares the build directory -->
|
||||||
<target name="prepare">
|
<target name="prepare">
|
||||||
<mkdir dir="${builddir}" />
|
<!-- use the enable_debug option from configure -->
|
||||||
<mkdir dir="${jardir}" />
|
<condition property="debug" value="on">
|
||||||
</target>
|
<and>
|
||||||
|
<equals arg1="${enable_debug}" arg2="yes" />
|
||||||
|
</and>
|
||||||
<!-- This builds the examples -->
|
</condition>
|
||||||
<target name="examples" depends="compile">
|
<mkdir dir="${builddir}" />
|
||||||
<javac srcdir="${srcdir}" destdir="${builddir}">
|
<mkdir dir="${jardir}" />
|
||||||
<include name="example/**" />
|
</target>
|
||||||
<exclude name="example/corba/**"/>
|
|
||||||
<exclude name="example/blobtest.java" unless="jdk1.2+"/>
|
|
||||||
</javac>
|
<!-- This builds the examples -->
|
||||||
</target>
|
<target name="examples" depends="compile">
|
||||||
|
<javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
|
||||||
|
<include name="example/**" />
|
||||||
<!-- Builds the corba example -->
|
<exclude name="example/corba/**"/>
|
||||||
<target name="corba" if="jdk1.2+">
|
<exclude name="example/blobtest.java" unless="jdk1.2+"/>
|
||||||
<exec dir="${srcdir}/example/corba" executable="idl2java">
|
</javac>
|
||||||
<arg value="stock.idl" />
|
</target>
|
||||||
</exec>
|
|
||||||
|
|
||||||
<javac srcdir="${srcdir}" destdir="${builddir}">
|
<!-- Builds the corba example -->
|
||||||
<include name="example/corba/**" />
|
<target name="corba" if="jdk1.2+">
|
||||||
</javac>
|
<exec dir="${srcdir}/example/corba" executable="idl2java">
|
||||||
</target>
|
<arg value="stock.idl" />
|
||||||
|
</exec>
|
||||||
|
|
||||||
|
<javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
|
||||||
<!-- Install the jar files -->
|
<include name="example/corba/**" />
|
||||||
<target name="install" depends="all" if="install.directory">
|
</javac>
|
||||||
<copy todir="${install.directory}" overwrite="true">
|
</target>
|
||||||
<fileset dir="${jardir}" includes="&jarfiles;" />
|
|
||||||
</copy>
|
|
||||||
</target>
|
|
||||||
|
<!-- Install the jar files -->
|
||||||
|
<target name="install" depends="all" if="install.directory">
|
||||||
<!-- Uninstall the jar file -->
|
<copy todir="${install.directory}" overwrite="true">
|
||||||
<target name="uninstall" if="install.directory">
|
<fileset dir="${jardir}" includes="&jarfiles;" />
|
||||||
<delete>
|
</copy>
|
||||||
<fileset dir="${install.directory}" includes="&jarfiles;" />
|
</target>
|
||||||
</delete>
|
|
||||||
</target>
|
|
||||||
|
<!-- Uninstall the jar file -->
|
||||||
|
<target name="uninstall" if="install.directory">
|
||||||
|
<delete>
|
||||||
<!-- This target removes any class files from the build directory -->
|
<fileset dir="${install.directory}" includes="&jarfiles;" />
|
||||||
<target name="clean">
|
</delete>
|
||||||
<delete quiet="true" dir="${builddir}" />
|
</target>
|
||||||
<delete quiet="true" dir="${jardir}" />
|
|
||||||
<delete quiet="true" file="${package}/Driver.java" />
|
|
||||||
</target>
|
|
||||||
|
<!-- This target removes any class files from the build directory -->
|
||||||
|
<target name="clean">
|
||||||
|
<delete quiet="true" dir="${builddir}" />
|
||||||
<!-- This compiles and executes the JUnit tests -->
|
<delete quiet="true" dir="${jardir}" />
|
||||||
|
<delete quiet="true" file="${package}/Driver.java" />
|
||||||
<!-- defaults for the tests - override these if required -->
|
</target>
|
||||||
<property name="database" value="jdbc:postgresql:test" />
|
|
||||||
<property name="username" value="test" />
|
|
||||||
<!-- Password must be something. Doesn't matter if trust is used! -->
|
|
||||||
<property name="password" value="password" />
|
<!-- This compiles and executes the JUnit tests -->
|
||||||
<!-- junit.ui is one of textui, awtui, or swingui -->
|
|
||||||
<property name="junit.ui" value="textui" />
|
<!-- defaults for the tests - override these if required -->
|
||||||
|
<property name="database" value="jdbc:postgresql:test" />
|
||||||
|
<property name="username" value="test" />
|
||||||
<target name="test" depends="jar" if="junit">
|
<!-- Password must be something. Doesn't matter if trust is used! -->
|
||||||
<javac srcdir="${srcdir}" destdir="${builddir}">
|
<property name="password" value="password" />
|
||||||
<include name="${package}/test/jdbc2/**" if="jdk1.2+" />
|
<!-- junit.ui is one of textui, awtui, or swingui -->
|
||||||
<include name="${package}/test/java2ee/**" if="jdk1.2e+" />
|
<property name="junit.ui" value="textui" />
|
||||||
</javac>
|
|
||||||
|
|
||||||
<java fork="yes" classname="junit.${junit.ui}.TestRunner" taskname="junit" failonerror="true">
|
<target name="test" depends="jar" if="junit">
|
||||||
<arg value="org.postgresql.test.JDBC2Tests" />
|
<javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
|
||||||
<sysproperty key="database" value="${database}" />
|
<include name="${package}/test/jdbc2/**" if="jdk1.2+" />
|
||||||
<sysproperty key="username" value="${username}" />
|
<include name="${package}/test/java2ee/**" if="jdk1.2e+" />
|
||||||
<sysproperty key="password" value="${password}" />
|
</javac>
|
||||||
<classpath>
|
|
||||||
<pathelement location="${builddir}" />
|
<java fork="yes" classname="junit.${junit.ui}.TestRunner" taskname="junit" failonerror="true">
|
||||||
<pathelement path="${java.class.path}" />
|
<arg value="org.postgresql.test.JDBC2Tests" />
|
||||||
</classpath>
|
<sysproperty key="database" value="${database}" />
|
||||||
</java>
|
<sysproperty key="username" value="${username}" />
|
||||||
</target>
|
<sysproperty key="password" value="${password}" />
|
||||||
|
<classpath>
|
||||||
</project>
|
<pathelement location="${builddir}" />
|
||||||
|
<pathelement path="${java.class.path}" />
|
||||||
|
</classpath>
|
||||||
|
</java>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
Loading…
Reference in a new issue