|
@@ -0,0 +1,186 @@
|
|
1
|
+diff -rupN libzdb-3.0.orig/configure.ac libzdb-3.0/configure.ac
|
|
2
|
+--- libzdb-3.0.orig/configure.ac 2014-01-06 22:17:57.000000000 +0100
|
|
3
|
++++ libzdb-3.0/configure.ac 2014-11-20 13:59:27.456957651 +0100
|
|
4
|
+@@ -196,15 +196,6 @@ AC_SEARCH_LIBS([pthread_create], [pthrea
|
|
5
|
+ # Database Libraries
|
|
6
|
+
|
|
7
|
+ mysql="yes"
|
|
8
|
+-check_mysql_config()
|
|
9
|
+-{
|
|
10
|
+- AC_PATH_PROG([MYSQLCONFIG], [mysql_config], [no], [$PATH:/usr/local/bin:/usr/local/mysql/bin])
|
|
11
|
+- if test "x$MYSQLCONFIG" = "xno"
|
|
12
|
+- then
|
|
13
|
+- AC_MSG_WARN([mysql_config is required to build libzdb with mysql])
|
|
14
|
+- mysql="no"
|
|
15
|
+- fi
|
|
16
|
+-}
|
|
17
|
+ AC_MSG_CHECKING(for mysql)
|
|
18
|
+ AC_ARG_WITH([mysql],
|
|
19
|
+ AS_HELP_STRING([--with-mysql(=<path>)],
|
|
20
|
+@@ -216,22 +207,20 @@ AC_ARG_WITH([mysql],
|
|
21
|
+ mysql="no"
|
|
22
|
+ else
|
|
23
|
+ AC_MSG_RESULT([yes])
|
|
24
|
+- AC_CHECK_FILE([$with_mysql], [MYSQLCONFIG=$with_mysql], [check_mysql_config])
|
|
25
|
+ fi
|
|
26
|
+ ],
|
|
27
|
+ [
|
|
28
|
+ AC_MSG_RESULT([yes])
|
|
29
|
+- check_mysql_config
|
|
30
|
+ ])
|
|
31
|
+ if test "xyes" = "x$mysql"; then
|
|
32
|
+ svd_CPPFLAGS=$CPPFLAGS
|
|
33
|
+ svd_LDFLAGS=$LDFLAGS
|
|
34
|
+- CPPFLAGS="`$MYSQLCONFIG --include` $CPPFLAGS"
|
|
35
|
+- LDFLAGS="`$MYSQLCONFIG --libs` $LDFLAGS"
|
|
36
|
++ CPPFLAGS="-I$STAGING_DIR/usr/include/mysql $CPPFLAGS"
|
|
37
|
++ LDFLAGS="-L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib $LDFLAGS"
|
|
38
|
+ AC_CHECK_HEADERS([mysql.h], [], [mysql="no"])
|
|
39
|
+ if test "xyes" = "x$mysql"; then
|
|
40
|
+- DBCPPFLAGS="$DBCPPFLAGS `$MYSQLCONFIG --include`"
|
|
41
|
+- DBLDFLAGS="$DBLDFLAGS `$MYSQLCONFIG --libs`"
|
|
42
|
++ DBCPPFLAGS="$DBCPPFLAGS -I$STAGING_DIR/usr/include/mysql"
|
|
43
|
++ DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib -lmysqlclient -lz -lcrypt -lnsl -lm"
|
|
44
|
+ AC_DEFINE([HAVE_LIBMYSQLCLIENT], 1, [Define to 1 to enable mysql])
|
|
45
|
+ else
|
|
46
|
+ CPPFLAGS=$svd_CPPFLAGS
|
|
47
|
+@@ -241,15 +230,6 @@ fi
|
|
48
|
+ AM_CONDITIONAL([WITH_MYSQL], test "xyes" = "x$mysql")
|
|
49
|
+
|
|
50
|
+ postgresql="yes"
|
|
51
|
+-check_postgres_config()
|
|
52
|
+-{
|
|
53
|
+- AC_PATH_PROG([PGCONFIG], [pg_config], [no], [$PATH:/usr/local/bin:/usr/local/pgsql/bin])
|
|
54
|
+- if test "x$PGCONFIG" = "xno"
|
|
55
|
+- then
|
|
56
|
+- AC_MSG_WARN([pg_config is required to build libzdb with postgresql])
|
|
57
|
+- postgresql="no"
|
|
58
|
+- fi
|
|
59
|
+-}
|
|
60
|
+ AC_MSG_CHECKING(for postgresql)
|
|
61
|
+ AC_ARG_WITH([postgresql],
|
|
62
|
+ AS_HELP_STRING([--with-postgresql(=<path>)],
|
|
63
|
+@@ -261,22 +241,20 @@ AC_ARG_WITH([postgresql],
|
|
64
|
+ postgresql="no"
|
|
65
|
+ else
|
|
66
|
+ AC_MSG_RESULT([yes])
|
|
67
|
+- AC_CHECK_FILE([$with_postgresql], [PGCONFIG=$with_postgresql],[check_postgres_config])
|
|
68
|
+ fi
|
|
69
|
+ ],
|
|
70
|
+ [
|
|
71
|
+ AC_MSG_RESULT([yes])
|
|
72
|
+- check_postgres_config
|
|
73
|
+ ])
|
|
74
|
+ if test "xyes" = "x$postgresql"; then
|
|
75
|
+ svd_CPPFLAGS=$CPPFLAGS
|
|
76
|
+ svd_LDFLAGS=$LDFLAGS
|
|
77
|
+- CPPFLAGS="-I`$PGCONFIG --includedir` $CPPFLAGS"
|
|
78
|
+- LDFLAGS="-L`$PGCONFIG --libdir` $LDFLAGS"
|
|
79
|
++ CPPFLAGS="-I$STAGING_DIR/usr/include/postgresql -I$STAGING_DIR/usr/include $CPPFLAGS"
|
|
80
|
++ LDFLAGS="-L$STAGING_DIR/usr/lib $LDFLAGS"
|
|
81
|
+ AC_CHECK_HEADERS([libpq-fe.h], [], [postgresql="no"])
|
|
82
|
+ if test "xyes" = "x$postgresql"; then
|
|
83
|
+- DBCPPFLAGS="$DBCPPFLAGS -I`$PGCONFIG --includedir`"
|
|
84
|
+- DBLDFLAGS="$DBLDFLAGS -L`$PGCONFIG --libdir` -lpq"
|
|
85
|
++ DBCPPFLAGS="$DBCPPFLAGS -I$STAGING_DIR/usr/include/postgresql -I$STAGING_DIR/usr/include"
|
|
86
|
++ DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib -lpq"
|
|
87
|
+ AC_DEFINE([HAVE_LIBPQ], 1, [Define to 1 to enable postgresql])
|
|
88
|
+ else
|
|
89
|
+ CPPFLAGS=$svd_CPPFLAGS
|
|
90
|
+@@ -298,22 +276,7 @@ AC_ARG_WITH([sqlite],
|
|
91
|
+ sqlite="no"
|
|
92
|
+ else
|
|
93
|
+ AC_MSG_RESULT([yes])
|
|
94
|
+- AC_CHECK_FILE([$with_sqlite],
|
|
95
|
+- [
|
|
96
|
+- svd_LDFLAGS=$LDFLAGS
|
|
97
|
+- svd_CPPFLAGS=$CPPFLAGS
|
|
98
|
+- LDFLAGS="-L$with_sqlite/lib $LDFLAGS -lsqlite3"
|
|
99
|
+- CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
|
|
100
|
+- AC_SEARCH_LIBS([sqlite3_open], [sqlite3],
|
|
101
|
+- [
|
|
102
|
+- DBCPPFLAGS="$DBCPPFLAGS -I$with_sqlite/include"
|
|
103
|
+- DBLDFLAGS="$DBLDFLAGS -L$with_sqlite/lib/ -lsqlite3"
|
|
104
|
+- ],[sqlite="no"])
|
|
105
|
+- LDFLAGS=$svd_LDFLAGS
|
|
106
|
+- CPPFLAGS=$svd_CPPFLAGS
|
|
107
|
+-
|
|
108
|
+- ],
|
|
109
|
+- AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"]))
|
|
110
|
++ AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"])
|
|
111
|
+ fi
|
|
112
|
+ ],
|
|
113
|
+ [
|
|
114
|
+@@ -328,20 +291,8 @@ if test "xyes" = "x$sqlite"; then
|
|
115
|
+ fi
|
|
116
|
+ AM_CONDITIONAL([WITH_SQLITE], test "xyes" = "x$sqlite")
|
|
117
|
+
|
|
118
|
+-oracle="yes"
|
|
119
|
+-AC_MSG_CHECKING(for oracle)
|
|
120
|
+-AX_LIB_ORACLE_OCI
|
|
121
|
+-if test -n "$ORACLE_OCI_CFLAGS" -a -n "$ORACLE_OCI_LDFLAGS"; then
|
|
122
|
+- DBCPPFLAGS="$DBCPPFLAGS $ORACLE_OCI_CFLAGS"
|
|
123
|
+- DBLDFLAGS="$DBLDFLAGS $ORACLE_OCI_LDFLAGS"
|
|
124
|
+- AC_DEFINE([HAVE_ORACLE], 1, [Define to 1 to enable oracle])
|
|
125
|
+-else
|
|
126
|
+- oracle="no"
|
|
127
|
+-fi
|
|
128
|
+-AM_CONDITIONAL([WITH_ORACLE], test "xyes" = "x$oracle")
|
|
129
|
+-
|
|
130
|
+ # Test if any database system was found
|
|
131
|
+-if test "xno" = "x$postgresql" -a "xno" = "x$mysql" -a "xno" = "x$sqlite" -a "xno" = "x$oracle"; then
|
|
132
|
++if test "xno" = "x$postgresql" -a "xno" = "x$mysql" -a "xno" = "x$sqlite"; then
|
|
133
|
+ AC_MSG_ERROR([No available database found or selected. Try configure --help])
|
|
134
|
+ fi
|
|
135
|
+
|
|
136
|
+@@ -358,23 +309,6 @@ AC_HEADER_STDC
|
|
137
|
+ # Functions
|
|
138
|
+ # ------------------------------------------------------------------------
|
|
139
|
+
|
|
140
|
+-# Require a working setjmp
|
|
141
|
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
|
142
|
+- #include <setjmp.h>
|
|
143
|
+- ]],
|
|
144
|
+- [[jmp_buf env; setjmp(env);]])],
|
|
145
|
+- [], [AC_MSG_FAILURE([setjmp is required])]
|
|
146
|
+-)
|
|
147
|
+-
|
|
148
|
+-# Require that we have vsnprintf that conforms to c99. I.e. does bounds check
|
|
149
|
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
|
150
|
+- #include <stdarg.h>
|
|
151
|
+- #include <stdio.h>
|
|
152
|
+- ]],
|
|
153
|
+- [[char t[1]; va_list ap; int n = vsnprintf(t, 1, "hello", ap); if(n == 5) return 0;return 1;]])],
|
|
154
|
+- [], [AC_MSG_FAILURE([vsnprintf does not conform to c99])]
|
|
155
|
+-)
|
|
156
|
+-
|
|
157
|
+ AC_CHECK_FUNCS([timegm])
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+@@ -487,11 +421,6 @@ echo "| PostgreSQL:
|
|
161
|
+ else
|
|
162
|
+ echo "| PostgreSQL: DISABLED |"
|
|
163
|
+ fi
|
|
164
|
+-if test "xyes" = "x$oracle"; then
|
|
165
|
+-echo "| Oracle: ENABLED |"
|
|
166
|
+-else
|
|
167
|
+-echo "| Oracle: DISABLED |"
|
|
168
|
+-fi
|
|
169
|
+ echo "+------------------------------------------------------------+"
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+diff -rupN libzdb-3.0.orig/Makefile.am libzdb-3.0/Makefile.am
|
|
173
|
+--- libzdb-3.0.orig/Makefile.am 2014-01-06 22:34:08.000000000 +0100
|
|
174
|
++++ libzdb-3.0/Makefile.am 2014-11-20 13:51:22.508204689 +0100
|
|
175
|
+@@ -45,11 +45,6 @@ libzdb_la_SOURCES += src/db/sqlite/SQLit
|
|
176
|
+ src/db/sqlite/SQLiteResultSet.c \
|
|
177
|
+ src/db/sqlite/SQLitePreparedStatement.c
|
|
178
|
+ endif
|
|
179
|
+-if WITH_ORACLE
|
|
180
|
+-libzdb_la_SOURCES += src/db/oracle/OracleConnection.c \
|
|
181
|
+- src/db/oracle/OracleResultSet.c \
|
|
182
|
+- src/db/oracle/OraclePreparedStatement.c
|
|
183
|
+-endif
|
|
184
|
+
|
|
185
|
+ API_INTERFACES = src/zdb.h src/db/ConnectionPool.h src/db/Connection.h \
|
|
186
|
+ src/db/ResultSet.h src/net/URL.h src/db/PreparedStatement.h \
|