summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/psqlodbc/files/psqlodbc-donot-use-the-hardcode-libdir.patch26
-rw-r--r--meta-oe/recipes-support/psqlodbc/files/psqlodbc-fix-for-ptest-support.patch148
-rw-r--r--meta-oe/recipes-support/psqlodbc/files/psqlodbc-remove-some-checks-for-cross-compiling.patch118
-rw-r--r--meta-oe/recipes-support/psqlodbc/psqlodbc.inc50
-rw-r--r--meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb14
5 files changed, 356 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/psqlodbc/files/psqlodbc-donot-use-the-hardcode-libdir.patch b/meta-oe/recipes-support/psqlodbc/files/psqlodbc-donot-use-the-hardcode-libdir.patch
new file mode 100644
index 000000000..7eda03875
--- /dev/null
+++ b/meta-oe/recipes-support/psqlodbc/files/psqlodbc-donot-use-the-hardcode-libdir.patch
@@ -0,0 +1,26 @@
1[PATCH] do not use the hardcode libdir
2
3Upstream-status: Pending
4
5Signed-off-by: Roy.Li <rongqing.li@windriver.com>
6Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
7---
8 configure.ac | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/configure.ac b/configure.ac
12index 9b88d4c..df5ad7a 100644
13--- a/configure.ac
14+++ b/configure.ac
15@@ -140,7 +140,7 @@ if test "$with_libpq" != yes; then
16 if test -d "$with_libpq"; then
17 PATH="$PATH:$with_libpq/bin"
18 CPPFLAGS="$CPPFLAGS -I$with_libpq/include"
19- LDFLAGS="$LDFLAGS -L$with_libpq/lib"
20+ LDFLAGS="$LDFLAGS -L$with_libpq/${base_libdir}"
21 else
22 if test -x "$with_libpq"; then
23 PG_CONFIG=$with_libpq
24--
252.8.1
26
diff --git a/meta-oe/recipes-support/psqlodbc/files/psqlodbc-fix-for-ptest-support.patch b/meta-oe/recipes-support/psqlodbc/files/psqlodbc-fix-for-ptest-support.patch
new file mode 100644
index 000000000..a8f14e768
--- /dev/null
+++ b/meta-oe/recipes-support/psqlodbc/files/psqlodbc-fix-for-ptest-support.patch
@@ -0,0 +1,148 @@
1Subject: [PATCH] psqlodbc: fixes for ptest support
2
3* Fix the LIBODBC since we don't use ODBC_CONFIG.
4* Fix the path for driver.
5* Add the default info of postgresql server.
6* Fix the output format for ptest.
7* Fix the results and exe dir.
8
9Upstream-Status: Inappropriate [OE ptest specific]
10
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12---
13 test/Makefile.in | 2 +-
14 test/odbcini-gen.sh | 8 ++++----
15 test/runsuite.c | 26 +++++++++++++-------------
16 3 files changed, 18 insertions(+), 18 deletions(-)
17
18diff --git a/test/Makefile.in b/test/Makefile.in
19index 8710616..fcb470e 100644
20--- a/test/Makefile.in
21+++ b/test/Makefile.in
22@@ -18,7 +18,7 @@ CFLAGS = @CFLAGS@
23 ODBC_CONFIG = @ODBC_CONFIG@
24 PROVE = @PROVE@
25
26-LIBODBC := $(shell $(ODBC_CONFIG) --libs)
27+LIBODBC = -lodbc
28
29 all: $(TESTBINS) runsuite reset-db
30
31diff --git a/test/odbcini-gen.sh b/test/odbcini-gen.sh
32index d2c2c87..6068d9d 100755
33--- a/test/odbcini-gen.sh
34+++ b/test/odbcini-gen.sh
35@@ -6,7 +6,7 @@
36 outini=odbc.ini
37 outinstini=odbcinst.ini
38
39-drvr=../.libs/psqlodbcw
40+drvr=@LIBDIR@/psqlodbca
41 driver=${drvr}.so
42 if test ! -e $driver ; then
43 driver=${drvr}.dll
44@@ -33,10 +33,10 @@ Driver = psqlodbc test driver
45 Trace = No
46 TraceFile =
47 Database = contrib_regression
48-Servername =
49-Username =
50+Servername = localhost
51+Username = postgres
52 Password =
53-Port =
54+Port = 5432
55 ReadOnly = No
56 RowVersioning = No
57 ShowSystemTables = No
58diff --git a/test/runsuite.c b/test/runsuite.c
59index 583cf35..fd2a90e 100644
60--- a/test/runsuite.c
61+++ b/test/runsuite.c
62@@ -51,7 +51,7 @@ bailout(const char *fmt, ...)
63
64 /* Given a test program's name, get the test name */
65 void
66-parse_argument(const char *in, char *testname, char *binname)
67+parse_argument(const char *in, char *testname, char *binname, const char *inputdir)
68 {
69 const char *basename;
70 #ifdef WIN32
71@@ -65,7 +65,7 @@ parse_argument(const char *in, char *testname, char *binname)
72 if (strchr(in, DIR_SEP) == NULL)
73 {
74 strcpy(testname, in);
75- sprintf(binname, "exe%c%s-test", DIR_SEP, in);
76+ sprintf(binname, "%s%cexe%c%s-test", inputdir, DIR_SEP, DIR_SEP, in);
77 return;
78 }
79
80@@ -127,7 +127,7 @@ int main(int argc, char **argv)
81 failures = 0;
82 for (i = 1, j = 1; i <= numtests; i++, j++)
83 {
84- parse_argument(argv[j], testname, binname);
85+ parse_argument(argv[j], testname, binname, inputdir);
86 if (runtest(binname, testname, i, inputdir) != 0)
87 failures++;
88 }
89@@ -157,29 +157,29 @@ runtest(const char *binname, const char *testname, int testno, const char *input
90 #ifndef WIN32
91 snprintf(cmdline, sizeof(cmdline),
92 "ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini "
93- "%s > results/%s.out",
94- binname, testname);
95+ "%s > %s/results/%s.out",
96+ binname, inputdir, testname);
97 #else
98 snprintf(cmdline, sizeof(cmdline),
99- "%s > results\\%s.out",
100- binname, testname);
101+ "%s > %s/results\\%s.out",
102+ binname, inputdir, testname);
103 #endif
104 rc = system(cmdline);
105
106 diff = rundiff(testname, inputdir);
107 if (rc != 0)
108 {
109- printf("not ok %d - %s test returned %d\n", testno, testname, rc);
110+ printf("FAIL: %d - %s\n\ttest returned %d\n", testno, testname, rc);
111 ret = 1;
112 }
113 else if (diff != 0)
114 {
115- printf("not ok %d - %s test output differs\n", testno, testname);
116+ printf("FAIL: %d - %s\n\ttest output differs\n", testno, testname);
117 ret = 1;
118 }
119 else
120 {
121- printf("ok %d - %s\n", testno, testname);
122+ printf("PASS: %d - %s\n", testno, testname);
123 ret = 0;
124 }
125 fflush(stdout);
126@@ -196,7 +196,7 @@ rundiff(const char *testname, const char *inputdir)
127 char *result;
128 size_t result_len;
129
130- snprintf(filename, sizeof(filename), "results/%s.out", testname);
131+ snprintf(filename, sizeof(filename), "%s/results/%s.out", inputdir, testname);
132 result = slurpfile(filename, &result_len);
133
134 outputno = 0;
135@@ -244,8 +244,8 @@ rundiff(const char *testname, const char *inputdir)
136 * files and print the smallest diff?
137 */
138 snprintf(cmdline, sizeof(cmdline),
139- "diff -c %s/expected/%s.out results/%s.out >> regression.diffs",
140- inputdir, testname, testname);
141+ "diff -c %s/expected/%s.out %s/results/%s.out >> regression.diffs",
142+ inputdir, testname, inputdir, testname);
143 if (system(cmdline) == -1)
144 printf("# diff failed\n");
145
146--
1472.8.2
148
diff --git a/meta-oe/recipes-support/psqlodbc/files/psqlodbc-remove-some-checks-for-cross-compiling.patch b/meta-oe/recipes-support/psqlodbc/files/psqlodbc-remove-some-checks-for-cross-compiling.patch
new file mode 100644
index 000000000..1d988182e
--- /dev/null
+++ b/meta-oe/recipes-support/psqlodbc/files/psqlodbc-remove-some-checks-for-cross-compiling.patch
@@ -0,0 +1,118 @@
1Subject: [PATCH] remove some checks for cross-compiling
2
3some lib check is not suitable for
4cross-compiling, so remove them.
5
6Upstream-Status: Inappropriate [not a real bug,just for cross-compiling]
7
8Signed-off-by: Song.Li <Song.Li@windriver.com>
9Signed-off-by: Kai Kang <kai.kang@windriver.com>
10Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
11---
12 configure.ac | 66 +++++++-----------------------------------------------------
13 1 file changed, 7 insertions(+), 59 deletions(-)
14
15diff --git a/configure.ac b/configure.ac
16index df5ad7a..b72bd4c 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -46,57 +46,19 @@ AC_ARG_WITH(iodbc, [ --with-iodbc[[=DIR]] [[default=no]] DIR is the iODBC bas
20 if test "$with_iodbc" != no; then
21 with_unixodbc=no
22 AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support])
23- if test "$with_iodbc" = yes; then
24- AC_PATH_PROGS(ODBC_CONFIG, iodbc-config)
25- else
26- ODBC_CONFIG=$with_iodbc
27- fi
28- if test ! -x "${ODBC_CONFIG}/bin/iodbc-config"; then
29- if test ! -x "${ODBC_CONFIG}"; then
30- AC_MSG_ERROR([iodbc-config not found (required for iODBC build)])
31- fi
32- else
33- ODBC_CONFIG=${ODBC_CONFIG}/bin/iodbc-config
34- fi
35 fi
36
37 if test "$with_unixodbc" != no; then
38 AC_DEFINE(WITH_UNIXODBC, 1,
39 [Define to 1 to build with unixODBC support])
40- if test "$with_unixodbc" = yes; then
41- AC_PATH_PROGS(ODBC_CONFIG, odbc_config)
42- else
43- ODBC_CONFIG=$with_unixodbc
44- fi
45- if test ! -x "${ODBC_CONFIG}/bin/odbc_config"; then
46- if test ! -x "${ODBC_CONFIG}"; then
47- AC_MSG_ERROR([odbc_config not found (required for unixODBC build)])
48- fi
49- else
50- ODBC_CONFIG=${ODBC_CONFIG}/bin/odbc_config
51- fi
52 fi
53
54 #
55 # ODBC include and library
56 #
57-
58-if test "$ODBC_CONFIG" != ""; then
59- if test "$with_iodbc" != no; then
60- ODBC_INCLUDE=`${ODBC_CONFIG} --cflags`
61- CPPFLAGS="$CPPFLAGS ${ODBC_INCLUDE}"
62- # Linking libiodoc is rather problematic
63- [ODBC_LIBDIR=`${ODBC_CONFIG} --libs | sed -e "s/^\(-L\|.*[ \t]-L\)\([^ \n\r\f\t]*\).*$/-L\2/"`]
64- LDFLAGS="$LDFLAGS ${ODBC_LIBDIR}"
65- else
66- ODBC_INCLUDE=`${ODBC_CONFIG} --include-prefix`
67- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}"
68- # Linking libodoc is rather problematic
69- ODBC_LIBDIR=`${ODBC_CONFIG} --lib-prefix`
70- LDFLAGS="$LDFLAGS -L${ODBC_LIBDIR}"
71- fi
72- AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBDIR])
73-fi
74+ODBC_LIBS="-lodbcinst"
75+LIBS="$LIBS ${ODBC_LIBS}"
76+AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBS])
77
78 #
79 # SQLCOLATTRIBUTE_SQLLEN check
80@@ -176,18 +138,10 @@ PGAC_ARG_BOOL(enable, pthreads, yes,
81 # Find libpq headers and libraries
82 #
83
84-if test -z "$PG_CONFIG"; then
85- AC_PATH_PROGS(PG_CONFIG, pg_config)
86-fi
87-
88-if test -n "$PG_CONFIG"; then
89- pg_includedir=`"$PG_CONFIG" --includedir`
90- pg_libdir=`"$PG_CONFIG" --libdir`
91- CPPFLAGS="$CPPFLAGS -I$pg_includedir"
92- LDFLAGS="$LDFLAGS -L$pg_libdir"
93-fi
94-
95-
96+pg_includedir=""
97+pg_libdir=""
98+CPPFLAGS="$CPPFLAGS"
99+LDFLAGS="$LDFLAGS"
100
101 # 1. Programs
102
103@@ -211,12 +165,6 @@ if test "$with_iodbc" != no; then
104 [AC_MSG_ERROR([iODBC library "iodbcinst" not found])])
105 fi
106
107-if test "$enable_pthreads" = yes; then
108- AC_CHECK_LIB(pthreads, pthread_create,
109- [],
110- [AC_CHECK_LIB(pthread, pthread_create)])
111-fi
112-
113 AC_CHECK_LIB(pq, PQsetSingleRowMode, [],
114 [AC_MSG_ERROR([libpq library version >= 9.2 is required])])
115
116--
1172.8.1
118
diff --git a/meta-oe/recipes-support/psqlodbc/psqlodbc.inc b/meta-oe/recipes-support/psqlodbc/psqlodbc.inc
new file mode 100644
index 000000000..5337b4569
--- /dev/null
+++ b/meta-oe/recipes-support/psqlodbc/psqlodbc.inc
@@ -0,0 +1,50 @@
1SUMMARY = "ODBC driver for PostgreSQL"
2DESCRIPTION = "\
3 This package provides a driver that allows ODBC-enabled applications to \
4 access PostgreSQL databases. ODBC is an abstraction layer that allows \
5 applications written for that layer to access databases in a manner \
6 that is relatively independent of the particular database management \
7 system. \
8 . \
9 You need to install this package if you want to use an application that \
10 provides database access through ODBC and you want that application to \
11 access a PostgreSQL database. This package would need to be installed \
12 on the same machine as that client application; the PostgreSQL database \
13 server can be on a different machine and does not need any additional \
14 software to accept ODBC clients. \
15"
16SECTION = "libs"
17HOMEPAGE = "http://psqlodbc.projects.postgresql.org/"
18
19DEPENDS += "postgresql unixodbc"
20
21EXTRA_OECONF = "\
22 ac_cv_lib_ltdl_lt_dlopen=no \
23 ac_cv_lib_pq_PQconnectdb=yes \
24 --with-unixodbc=yes \
25 --with-libpq=${STAGING_LIBDIR}/.. \
26 --enable-pthreads \
27 --disable-unicode \
28 LIBS="-lpthread" \
29"
30
31inherit autotools pkgconfig ptest
32
33do_compile_ptest() {
34 oe_runmake -C ${B}/test
35}
36
37do_install_ptest() {
38 install -d ${D}${PTEST_PATH}
39 cp -a --no-preserve=ownership ${B}/test/exe ${S}/test/expected ${D}${PTEST_PATH}
40 install -m 0755 ${B}/test/reset-db ${D}${PTEST_PATH}
41 install -m 0755 ${B}/test/runsuite ${D}${PTEST_PATH}
42 install -m 0755 ${S}/test/odbcini-gen.sh ${D}${PTEST_PATH}
43 install -m 0755 ${S}/test/sampletables.sql ${D}${PTEST_PATH}
44 sed -i -e 's|@LIBDIR@|${libdir}|' ${D}${PTEST_PATH}/odbcini-gen.sh
45}
46
47FILES_${PN} += "${libdir}"
48
49# The tests need a local PostgreSQL server running
50RDEPENDS_${PN}-ptest = "postgresql"
diff --git a/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb b/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
new file mode 100644
index 000000000..6e1c8ab4a
--- /dev/null
+++ b/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
@@ -0,0 +1,14 @@
1require ${PN}.inc
2
3LICENSE = "LGPLv2"
4LIC_FILES_CHKSUM = "file://license.txt;md5=6db3822fc7512e83087ba798da013692"
5
6SRC_URI = "http://ftp.postgresql.org/pub/odbc/versions/src/${BPN}-${PV}.tar.gz \
7 file://psqlodbc-remove-some-checks-for-cross-compiling.patch \
8 file://psqlodbc-donot-use-the-hardcode-libdir.patch \
9 file://psqlodbc-fix-for-ptest-support.patch \
10 file://run-ptest \
11"
12
13SRC_URI[md5sum] = "4c6e0b22187d7bb1c998ffac89e50f6b"
14SRC_URI[sha256sum] = "9521f328bf28aaaf5c8488dc89792b614f9d6271742c0baf9bb41c97537764a8"