psqlodbc: Upgrade to 13.02.0000

Forward port patches
Merged .inc into .bb for easing out devtool use

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2022-08-30 20:35:59 -07:00
parent f7a8fbf8f0
commit 1a8d4b2423
5 changed files with 68 additions and 72 deletions

View File

@ -1,26 +1,27 @@
[PATCH] do not use the hardcode libdir From 8f3ed8df4721991958a5becf75a69493d67e7514 Mon Sep 17 00:00:00 2001
From: "Roy.Li" <rongqing.li@windriver.com>
Date: Tue, 5 Sep 2017 10:24:10 +0800
Subject: [PATCH] [PATCH] do not use the hardcode libdir
Upstream-status: Pending Upstream-status: Pending
Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
--- ---
configure.ac | 2 +- configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 9b88d4c..df5ad7a 100644 index 00b359e..ba50e6f 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -140,7 +140,7 @@ if test "$with_libpq" != yes; then @@ -114,7 +114,7 @@ if test "$with_libpq" != yes; then
if test -d "$with_libpq"; then if test -d "$with_libpq"; then
PATH="$PATH:$with_libpq/bin" PATH="$with_libpq/bin:$PATH"
CPPFLAGS="$CPPFLAGS -I$with_libpq/include" CPPFLAGS="$CPPFLAGS -I$with_libpq/include -I$with_libpq/include/postgresql/internal"
- LDFLAGS="$LDFLAGS -L$with_libpq/lib" - LDFLAGS="$LDFLAGS -L$with_libpq/lib"
+ LDFLAGS="$LDFLAGS -L$with_libpq/${base_libdir}" + LDFLAGS="$LDFLAGS -L$with_libpq/${base_libdir}"
else else
if test -x "$with_libpq"; then if test -x "$with_libpq"; then
PG_CONFIG=$with_libpq PG_CONFIG=$with_libpq
--
2.8.1

View File

@ -1,3 +1,6 @@
From 96896b88776d0080609ec830cf9538d2babe665a Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Tue, 5 Sep 2017 10:24:10 +0800
Subject: [PATCH] psqlodbc: fixes for ptest support Subject: [PATCH] psqlodbc: fixes for ptest support
* Fix the LIBODBC since we don't use ODBC_CONFIG. * Fix the LIBODBC since we don't use ODBC_CONFIG.
@ -9,27 +12,28 @@ Subject: [PATCH] psqlodbc: fixes for ptest support
Upstream-Status: Inappropriate [OE ptest specific] Upstream-Status: Inappropriate [OE ptest specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
--- ---
test/Makefile.in | 2 +- test/Makefile.in | 2 +-
test/odbcini-gen.sh | 8 ++++---- test/odbcini-gen.sh | 8 ++++----
test/runsuite.c | 26 +++++++++++++------------- test/runsuite.c | 20 ++++++++++----------
3 files changed, 18 insertions(+), 18 deletions(-) 3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in diff --git a/test/Makefile.in b/test/Makefile.in
index 8710616..fcb470e 100644 index 3f9a9af..09406ae 100644
--- a/test/Makefile.in --- a/test/Makefile.in
+++ b/test/Makefile.in +++ b/test/Makefile.in
@@ -18,7 +18,7 @@ CFLAGS = @CFLAGS@ @@ -19,7 +19,7 @@ CPPFLAGS = @CPPFLAGS@ -I.. # config.h
ODBC_CONFIG = @ODBC_CONFIG@ ODBC_CONFIG = @ODBC_CONFIG@
PROVE = @PROVE@ PROVE = @PROVE@
-LIBODBC := $(shell $(ODBC_CONFIG) --libs) -LIBODBC = @LIBODBC@
+LIBODBC = -lodbc +LIBODBC = -lodbc
all: $(TESTBINS) runsuite reset-db all: $(TESTBINS) runsuite reset-db
diff --git a/test/odbcini-gen.sh b/test/odbcini-gen.sh diff --git a/test/odbcini-gen.sh b/test/odbcini-gen.sh
index d2c2c87..6068d9d 100755 index 2eaba35..6555cdb 100755
--- a/test/odbcini-gen.sh --- a/test/odbcini-gen.sh
+++ b/test/odbcini-gen.sh +++ b/test/odbcini-gen.sh
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
@ -41,7 +45,7 @@ index d2c2c87..6068d9d 100755
driver=${drvr}.so driver=${drvr}.so
if test ! -e $driver ; then if test ! -e $driver ; then
driver=${drvr}.dll driver=${drvr}.dll
@@ -33,10 +33,10 @@ Driver = psqlodbc test driver @@ -52,10 +52,10 @@ Driver = PostgreSQL Unicode
Trace = No Trace = No
TraceFile = TraceFile =
Database = contrib_regression Database = contrib_regression
@ -56,10 +60,10 @@ index d2c2c87..6068d9d 100755
RowVersioning = No RowVersioning = No
ShowSystemTables = No ShowSystemTables = No
diff --git a/test/runsuite.c b/test/runsuite.c diff --git a/test/runsuite.c b/test/runsuite.c
index 583cf35..fd2a90e 100644 index 3be5732..cd842dc 100644
--- a/test/runsuite.c --- a/test/runsuite.c
+++ b/test/runsuite.c +++ b/test/runsuite.c
@@ -51,7 +51,7 @@ bailout(const char *fmt, ...) @@ -55,7 +55,7 @@ bailout(const char *fmt, ...)
/* Given a test program's name, get the test name */ /* Given a test program's name, get the test name */
void void
@ -68,7 +72,7 @@ index 583cf35..fd2a90e 100644
{ {
const char *basename; const char *basename;
#ifdef WIN32 #ifdef WIN32
@@ -65,7 +65,7 @@ parse_argument(const char *in, char *testname, char *binname) @@ -69,7 +69,7 @@ parse_argument(const char *in, char *testname, char *binname)
if (strchr(in, DIR_SEP) == NULL) if (strchr(in, DIR_SEP) == NULL)
{ {
strcpy(testname, in); strcpy(testname, in);
@ -77,7 +81,7 @@ index 583cf35..fd2a90e 100644
return; return;
} }
@@ -127,7 +127,7 @@ int main(int argc, char **argv) @@ -131,7 +131,7 @@ int main(int argc, char **argv)
failures = 0; failures = 0;
for (i = 1, j = 1; i <= numtests; i++, j++) for (i = 1, j = 1; i <= numtests; i++, j++)
{ {
@ -86,7 +90,7 @@ index 583cf35..fd2a90e 100644
if (runtest(binname, testname, i, inputdir) != 0) if (runtest(binname, testname, i, inputdir) != 0)
failures++; failures++;
} }
@@ -157,29 +157,29 @@ runtest(const char *binname, const char *testname, int testno, const char *input @@ -161,29 +161,29 @@ runtest(const char *binname, const char *testname, int testno, const char *input
#ifndef WIN32 #ifndef WIN32
snprintf(cmdline, sizeof(cmdline), snprintf(cmdline, sizeof(cmdline),
"ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini " "ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini "
@ -123,26 +127,3 @@ index 583cf35..fd2a90e 100644
ret = 0; ret = 0;
} }
fflush(stdout); fflush(stdout);
@@ -196,7 +196,7 @@ rundiff(const char *testname, const char *inputdir)
char *result;
size_t result_len;
- snprintf(filename, sizeof(filename), "results/%s.out", testname);
+ snprintf(filename, sizeof(filename), "%s/results/%s.out", inputdir, testname);
result = slurpfile(filename, &result_len);
outputno = 0;
@@ -244,8 +244,8 @@ rundiff(const char *testname, const char *inputdir)
* files and print the smallest diff?
*/
snprintf(cmdline, sizeof(cmdline),
- "diff -c %s/expected/%s.out results/%s.out >> regression.diffs",
- inputdir, testname, testname);
+ "diff -c %s/expected/%s.out %s/results/%s.out >> regression.diffs",
+ inputdir, testname, inputdir, testname);
if (system(cmdline) == -1)
printf("# diff failed\n");
--
2.8.2

View File

@ -1,3 +1,6 @@
From 8ca6b0c72b6b933642ec7c4ebb83734244fec46f Mon Sep 17 00:00:00 2001
From: "Song.Li" <Song.Li@windriver.com>
Date: Tue, 5 Sep 2017 10:24:10 +0800
Subject: [PATCH] remove some checks for cross-compiling Subject: [PATCH] remove some checks for cross-compiling
some lib check is not suitable for some lib check is not suitable for
@ -8,15 +11,16 @@ Upstream-Status: Inappropriate [not a real bug,just for cross-compiling]
Signed-off-by: Song.Li <Song.Li@windriver.com> Signed-off-by: Song.Li <Song.Li@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
--- ---
configure.ac | 66 +++++++----------------------------------------------------- configure.ac | 80 +++++-----------------------------------------------
1 file changed, 7 insertions(+), 59 deletions(-) 1 file changed, 7 insertions(+), 73 deletions(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index df5ad7a..b72bd4c 100644 index 7f79563..00b359e 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -46,57 +46,19 @@ AC_ARG_WITH(iodbc, [ --with-iodbc[[=DIR]] [[default=no]] DIR is the iODBC bas @@ -57,71 +57,20 @@ AC_ARG_WITH(iodbc, [ --with-iodbc[[=DIR]] [[default=no]] DIR is the iODBC bas
if test "$with_iodbc" != no; then if test "$with_iodbc" != no; then
with_unixodbc=no with_unixodbc=no
AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support]) AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support])
@ -34,6 +38,7 @@ index df5ad7a..b72bd4c 100644
- fi - fi
fi fi
wo_odbc_config=__without_odbc_config
if test "$with_unixodbc" != no; then if test "$with_unixodbc" != no; then
AC_DEFINE(WITH_UNIXODBC, 1, AC_DEFINE(WITH_UNIXODBC, 1,
[Define to 1 to build with unixODBC support]) [Define to 1 to build with unixODBC support])
@ -42,7 +47,9 @@ index df5ad7a..b72bd4c 100644
- else - else
- ODBC_CONFIG=$with_unixodbc - ODBC_CONFIG=$with_unixodbc
- fi - fi
- if test ! -x "${ODBC_CONFIG}/bin/odbc_config"; then - if test "${ODBC_CONFIG}" = "${wo_odbc_config}"; then
- :
- elif test ! -x "${ODBC_CONFIG}/bin/odbc_config"; then
- if test ! -x "${ODBC_CONFIG}"; then - if test ! -x "${ODBC_CONFIG}"; then
- AC_MSG_ERROR([odbc_config not found (required for unixODBC build)]) - AC_MSG_ERROR([odbc_config not found (required for unixODBC build)])
- fi - fi
@ -62,22 +69,33 @@ index df5ad7a..b72bd4c 100644
- # Linking libiodoc is rather problematic - # Linking libiodoc is rather problematic
- [ODBC_LIBDIR=`${ODBC_CONFIG} --libs | sed -e "s/^\(-L\|.*[ \t]-L\)\([^ \n\r\f\t]*\).*$/-L\2/"`] - [ODBC_LIBDIR=`${ODBC_CONFIG} --libs | sed -e "s/^\(-L\|.*[ \t]-L\)\([^ \n\r\f\t]*\).*$/-L\2/"`]
- LDFLAGS="$LDFLAGS ${ODBC_LIBDIR}" - LDFLAGS="$LDFLAGS ${ODBC_LIBDIR}"
- LIBODBC=`${ODBC_CONFIG} --libs` # for regression test
- elif test "${ODBC_CONFIG}" = "${wo_odbc_config}"; then
- ODBC_INCLUDE=/usr/include
- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}"
- ODBC_LIBDiR=""
- LIBODBC="-lodbc" # for regression test
- else - else
- ODBC_INCLUDE=`${ODBC_CONFIG} --include-prefix` - ODBC_INCLUDE=`${ODBC_CONFIG} --include-prefix`
- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}" - CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}"
- # Linking libodoc is rather problematic - # Linking libodbc is rather problematic
- ODBC_LIBDIR=`${ODBC_CONFIG} --lib-prefix` - ODBC_LIBDIR=`${ODBC_CONFIG} --lib-prefix`
- LDFLAGS="$LDFLAGS -L${ODBC_LIBDIR}" - if test "${ODBC_LIBDIR}" != ""; then
- LDFLAGS="$LDFLAGS -L${ODBC_LIBDIR}"
- fi
- LIBODBC=`${ODBC_CONFIG} --libs` # for regression test
- fi - fi
- AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBDIR]) - AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBDIR])
- AC_MSG_NOTICE([using $LIBODBC for regression test])
-fi -fi
-AC_SUBST(LIBODBC)
+ODBC_LIBS="-lodbcinst" +ODBC_LIBS="-lodbcinst"
+LIBS="$LIBS ${ODBC_LIBS}" +LIBS="$LIBS ${ODBC_LIBS}"
+AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBS]) +AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBS])
# #
# SQLCOLATTRIBUTE_SQLLEN check # SQLCOLATTRIBUTE_SQLLEN check
@@ -176,18 +138,10 @@ PGAC_ARG_BOOL(enable, pthreads, yes, @@ -190,19 +139,10 @@ PGAC_ARG_BOOL(enable, pthreads, yes,
# Find libpq headers and libraries # Find libpq headers and libraries
# #
@ -87,8 +105,9 @@ index df5ad7a..b72bd4c 100644
- -
-if test -n "$PG_CONFIG"; then -if test -n "$PG_CONFIG"; then
- pg_includedir=`"$PG_CONFIG" --includedir` - pg_includedir=`"$PG_CONFIG" --includedir`
- pg_pkg_includedir=`"$PG_CONFIG" --pkgincludedir`
- pg_libdir=`"$PG_CONFIG" --libdir` - pg_libdir=`"$PG_CONFIG" --libdir`
- CPPFLAGS="$CPPFLAGS -I$pg_includedir" - CPPFLAGS="$CPPFLAGS -I$pg_includedir -I$pg_pkg_includedir/internal"
- LDFLAGS="$LDFLAGS -L$pg_libdir" - LDFLAGS="$LDFLAGS -L$pg_libdir"
-fi -fi
- -
@ -100,7 +119,7 @@ index df5ad7a..b72bd4c 100644
# 1. Programs # 1. Programs
@@ -211,12 +165,6 @@ if test "$with_iodbc" != no; then @@ -226,12 +166,6 @@ if test "$with_iodbc" != no; then
[AC_MSG_ERROR([iODBC library "iodbcinst" not found])]) [AC_MSG_ERROR([iODBC library "iodbcinst" not found])])
fi fi
@ -113,6 +132,3 @@ index df5ad7a..b72bd4c 100644
AC_CHECK_LIB(pq, PQsetSingleRowMode, [], AC_CHECK_LIB(pq, PQsetSingleRowMode, [],
[AC_MSG_ERROR([libpq library version >= 9.2 is required])]) [AC_MSG_ERROR([libpq library version >= 9.2 is required])])
--
2.8.1

View File

@ -1,14 +0,0 @@
require ${PN}.inc
LICENSE = "LGPL-2.0-only"
LIC_FILES_CHKSUM = "file://license.txt;md5=6db3822fc7512e83087ba798da013692"
SRC_URI = "http://ftp.postgresql.org/pub/odbc/versions/src/${BPN}-${PV}.tar.gz \
file://psqlodbc-remove-some-checks-for-cross-compiling.patch \
file://psqlodbc-donot-use-the-hardcode-libdir.patch \
file://psqlodbc-fix-for-ptest-support.patch \
file://run-ptest \
"
SRC_URI[md5sum] = "4c6e0b22187d7bb1c998ffac89e50f6b"
SRC_URI[sha256sum] = "9521f328bf28aaaf5c8488dc89792b614f9d6271742c0baf9bb41c97537764a8"

View File

@ -16,6 +16,18 @@ DESCRIPTION = "\
SECTION = "libs" SECTION = "libs"
HOMEPAGE = "http://psqlodbc.projects.postgresql.org/" HOMEPAGE = "http://psqlodbc.projects.postgresql.org/"
LICENSE = "LGPL-2.0-only"
LIC_FILES_CHKSUM = "file://license.txt;md5=6db3822fc7512e83087ba798da013692"
SRC_URI = "http://ftp.postgresql.org/pub/odbc/versions/src/${BPN}-${PV}.tar.gz \
file://psqlodbc-remove-some-checks-for-cross-compiling.patch \
file://psqlodbc-donot-use-the-hardcode-libdir.patch \
file://psqlodbc-fix-for-ptest-support.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "b39b7e5c41fd6475c551112fa724bf57c4a446175ec4188a90e2844cc1612585"
DEPENDS += "postgresql unixodbc" DEPENDS += "postgresql unixodbc"
EXTRA_OECONF = "\ EXTRA_OECONF = "\
@ -24,8 +36,7 @@ EXTRA_OECONF = "\
--with-unixodbc=yes \ --with-unixodbc=yes \
--with-libpq=${STAGING_LIBDIR}/.. \ --with-libpq=${STAGING_LIBDIR}/.. \
--enable-pthreads \ --enable-pthreads \
--disable-unicode \ LIBS='-lpthread' \
LIBS="-lpthread" \
" "
inherit autotools pkgconfig ptest inherit autotools pkgconfig ptest
@ -48,3 +59,4 @@ FILES:${PN} += "${libdir}"
# The tests need a local PostgreSQL server running # The tests need a local PostgreSQL server running
RDEPENDS:${PN}-ptest = "postgresql" RDEPENDS:${PN}-ptest = "postgresql"