summaryrefslogtreecommitdiff
path: root/org.handhelds.familiar/packages/javasqlite/files/buildsystem-fixes.patch
blob: 40cd272054fc796cabb95e52bf92b9dae844b92e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
--- javasqlite-20050608.orig/configure.in	2005-05-16 12:03:26.000000000 +0200
+++ javasqlite-20050608/configure.in	2005-10-01 22:08:57.000000000 +0200
@@ -1,5 +1,5 @@
 AC_INIT(native/sqlite_jni.c)
-AM_PROG_LIBTOOL
+AC_PROG_LIBTOOL
 AC_PROG_INSTALL
 CC=${CC:-cc}
 AC_SUBST(CC)
@@ -27,59 +27,11 @@
 ##########
 # Find SQLite header file and library
 #
-AC_ARG_WITH(sqlite, [  --with-sqlite=DIR       use SQLite header/lib from DIR],
-  SQLITE_DIR=$withval)
-if test ! -n "$SQLITE_DIR" -a -d "$SQLITE_DIR" ; then
-  AC_MSG_WARN([SQLite2 directory $SQLITE_DIR does not exist])
-fi
-
-if test -z "$SQLITE_DIR" ; then
-  SQLITE_DIR="../sqlite /usr /usr/local /opt"
-fi
-
-AC_MSG_CHECKING([for SQLite header and library])
-SQLITE_INC=UNKNOWN
-SQLITE_LIB=UNKNOWN
-for i in $SQLITE_DIR ; do
-  if test -r $i/sqlite.h ; then
-    if test -r $i/libsqlite.la ; then
-      SQLITE_INC="$i"
-      SQLITE_LIB="$i/libsqlite.la"
-      SQLITE_LIBDIR="$i"
-      break
-    elif test -r $i/libsqlite.a ; then
-      SQLITE_INC="$i"
-      SQLITE_LIB="$i/libsqlite.a"
-      SQLITE_LIBDIR="$i"
-      break
-    fi
-  elif test -r $i/include/sqlite.h ; then
-    if test -r $i/lib/libsqlite.la ; then
-      SQLITE_INC="$i/include"
-      SQLITE_LIB="$i/lib/libsqlite.la"
-      SQLITE_LIBDIR="$i/lib"
-      break
-    elif test -r $i/lib/libsqlite.a ; then
-      SQLITE_INC="$i/include"
-      SQLITE_LIB="$i/lib/libsqlite.a"
-      SQLITE_LIBDIR="$i/lib"
-      break
-    fi
-  fi
-done
-if test "$SQLITE_INC" = "UNKNOWN" -o "$SQLITE_LIB" = "UNKNOWN" ; then
-  AC_MSG_RESULT(no)
-  AC_MSG_WARN(SQLite2 header files and/or library not found)
-  SQLITE_INC=""
-  SQLITE_LIB=""
-  HAVE_SQLITE2=0
-else
-  SQLITE_INC="-I${SQLITE_INC}"
-  HAVE_SQLITE2=1
-  AC_MSG_RESULT(yes)
-fi
-AC_SUBST(SQLITE_INC)
-AC_SUBST(SQLITE_LIB)
+SQLITE_MODULES="sqlite >= 2.8.15"
+PKG_CHECK_MODULES(SQLITE, $SQLITE_MODULES)
+AC_SUBST(SQLITE_CFLAGS)
+AC_SUBST(SQLITE_LIBS)
+HAVE_SQLITE2=1
 AC_SUBST(HAVE_SQLITE2)
 
 ##########
@@ -87,9 +39,9 @@
 #
 
 saved_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS $SQLITE_INC"
+CFLAGS="$CFLAGS $SQLITE_CFLAGS"
 saved_LIBS=$LIBS
-LIBS="$LIBS -L$SQLITE_LIBDIR"
+LIBS="$LIBS $SQLITE_LIBS"
 AC_CHECK_LIB(sqlite,sqlite_function_type,
 	     HAVE_SQLITE_FUNCTION_TYPE=1,HAVE_SQLITE_FUNCTION_TYPE=0)
 AC_CHECK_LIB(sqlite,sqlite_open_aux_file,
@@ -114,60 +66,11 @@
 ##########
 # Find SQLite3 header file and library
 #
-AC_ARG_WITH(sqlite3,
-  [  --with-sqlite3=DIR      use SQLite3 header/lib from DIR],
-  SQLITE3_DIR=$withval)
-if test ! -n "$SQLITE3_DIR" -a -d "$SQLITE3_DIR" ; then
-  AC_MSG_WARN([SQLite3 directory $SQLITE3_DIR does not exist])
-fi
-
-if test -z "$SQLITE3_DIR" ; then
-  SQLITE3_DIR="../sqlite /usr /usr/local /opt"
-fi
-
-AC_MSG_CHECKING([for SQLite3 header and library])
-SQLITE3_INC=UNKNOWN
-SQLITE3_LIB=UNKNOWN
-for i in $SQLITE3_DIR ; do
-  if test -r $i/sqlite3.h ; then
-    if test -r $i/libsqlite3.la ; then
-      SQLITE3_INC="$i"
-      SQLITE3_LIB="$i/libsqlite3.la"
-      SQLITE3_LIBDIR="$i"
-      break
-    elif test -r $i/libsqlite3.a ; then
-      SQLITE3_INC="$i"
-      SQLITE3_LIB="$i/libsqlite3.a"
-      SQLITE3_LIBDIR="$i"
-      break
-    fi
-  elif test -r $i/include/sqlite3.h ; then
-    if test -r $i/lib/libsqlite3.la ; then
-      SQLITE3_INC="$i/include"
-      SQLITE3_LIB="$i/lib/libsqlite3.la"
-      SQLITE3_LIBDIR="$i/lib"
-      break
-    elif test -r $i/lib/libsqlite3.a ; then
-      SQLITE3_INC="$i/include"
-      SQLITE3_LIB="$i/lib/libsqlite3.a"
-      SQLITE3_LIBDIR="$i/lib"
-      break
-    fi
-  fi
-done
-if test "$SQLITE3_INC" = "UNKNOWN" -o "$SQLITE3_LIB" = "UNKNOWN" ; then
-  AC_MSG_RESULT(no)
-  AC_MSG_WARN(SQLite3 header files and/or library not found)
-  SQLITE3_INC=""
-  SQLITE3_LIB=""
-  HAVE_SQLITE3=0
-else
-  SQLITE3_INC="-I${SQLITE3_INC}"
-  HAVE_SQLITE3=1
-  AC_MSG_RESULT(yes)
-fi
-AC_SUBST(SQLITE3_INC)
-AC_SUBST(SQLITE3_LIB)
+SQLITE3_CFLAGS=""
+SQLITE3_LIBS=""
+AC_SUBST(SQLITE3_CFLAGS)
+AC_SUBST(SQLITE3_LIBS)
+HAVE_SQLITE3=0
 AC_SUBST(HAVE_SQLITE3)
 
 ##########
@@ -176,7 +79,7 @@
 
 AC_MSG_CHECKING([for usable SQLite])
 if test "$HAVE_SQLITE2" != "1" -a "$HAVE_SQLITE3" != "1" ; then
-  AC_MSG_ERROR([No SQLite found, please try --with-sqlite/--with-sqlite3])
+  AC_MSG_ERROR([No SQLite found])
 fi
 AC_MSG_RESULT(yes)
 
@@ -184,58 +87,20 @@
 # Find JRE things
 #
 
-AC_ARG_WITH(jdk, [  --with-jdk=DIR          use Java top directory DIR],
-  JAVA_HOME=$withval)
-if test -z "$JAVA_HOME" ; then
-  JAVA_HOME=`which java`
-  JAVA_HOME=`dirname $JAVA_HOME`
-  JAVA_HOME=`dirname $JAVA_HOME`
-fi
-if test ! -d "$JAVA_HOME" ; then
-  AC_MSG_ERROR([JAVA_HOME directory not found, please use --with-jdk=DIR])
-fi
-
-if test -n "$JAVA_HOME" ; then
-  JAVA_RUN=$JAVA_HOME/bin/java
-  JAVAC=$JAVA_HOME/bin/javac
-  JAVAH="$JAVA_HOME/bin/javah -jni"
-  JAR=$JAVA_HOME/bin/jar
-  JAVADOC=$JAVA_HOME/bin/javadoc
-else
-  JAVA_RUN=`which java`
-  JAVAC=`which javac`
-  JAVAH="`which javah` -jni"
-  JAR=`which jar`
-  JAVADOC=`which javadoc`
-  JAVA_HOME=`dirname $JAVAC`
-  JAVA_HOME=`dirname $JAVA_HOME`
-fi
+AC_PATH_PROG(JAVA, java)
+AC_PATH_PROG(JAVAC, javac)
+AC_PATH_PROG(JAVAH, javah)
+AC_PATH_PROG(JAR, jar)
+AC_PATH_PROG(JAVADOC, javadoc)
 
-AC_SUBST(JAVAH)
-AC_SUBST(JAVAC)
-AC_SUBST(JAR)
-AC_SUBST(JAVADOC)
-
-# Set up the JNI include directory specification                                
-case $build_os in                                                               
-    solaris* )                                                                  
-        JNIINCLUDE="-I$JAVA_HOME/include -I$JAVA_HOME/include/solaris"      
-        ;;                                                                      
-    linux* )                                                                    
-        JNIINCLUDE="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
-        ;;
-    *)                                                                          
-        JNIINCLUDE="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/${build_os}"
-        AC_MSG_WARN([setting generic JNI include file directives!])
-        ;;
-esac
+JNIINCLUDE=""
 AC_MSG_RESULT([setting JNI include file directives: $JNIINCLUDE])
 
 # Figure out JDK version
-JDBCVER=JDBC2
-$JAVA_RUN -version 2>&1 | grep 'version "1.1' >/dev/null && JDBCVER=JDBC1
-$JAVA_RUN -version 2>&1 | grep 'version "1.4' >/dev/null && JDBCVER=JDBC2x
-$JAVA_RUN -version 2>&1 | grep 'version "1.5' >/dev/null && JDBCVER=JDBC2y
+JDBCVER=JDBC2x
+#$JAVA -version 2>&1 | grep -q 'version "1.1' && JDBCVER=JDBC1
+#$JAVA -version 2>&1 | grep -q 'version "1.4' && JDBCVER=JDBC2x
+#$JAVA -version 2>&1 | grep -q 'version "1.5' && JDBCVER=JDBC2y
 AC_MSG_RESULT([using JDBC driver from $JDBCVER directory])
 
 if test "$JDBCVER" = "JDBC2y" ; then

--- javasqlite-20050608.orig/Makefile.in	2005-05-15 19:35:57.000000000 +0200
+++ javasqlite-20050608/Makefile.in	2005-10-01 22:17:11.000000000 +0200
@@ -1,12 +1,13 @@
 # Makefile template for SQLite Java wrapper
 
+top_builddir =	.
 prefix =	@prefix@
 CC =		@CC@
-LIBTOOL =	./libtool
-SQLITE_INC =	@SQLITE_INC@
-SQLITE_LIB =	@SQLITE_LIB@
-SQLITE3_INC =	@SQLITE3_INC@
-SQLITE3_LIB =	@SQLITE3_LIB@
+LIBTOOL =	@LIBTOOL@
+SQLITE_INC =	@SQLITE_CFLAGS@
+SQLITE_LIB =	@SQLITE_LIBS@
+SQLITE3_INC =	@SQLITE3_CFLAGS@
+SQLITE3_LIB =	@SQLITE3_LIBS@
 JAVAH =		@JAVAH@
 JAVAC =		@JAVAC@
 JAVADOC =	@JAVADOC@
@@ -16,15 +17,15 @@
 JAR_DIR =	@JAR_DIR@
 NATIVE_LIB_DIR =	@NATIVE_LIB_DIR@
 
-CFLAGS=	-Wall -O -fPIC $(JNIINCLUDE) $(SQLITE_INC) $(SQLITE3_INC) \
-	-DHAVE_SQLITE2=@HAVE_SQLITE2@ -DHAVE_SQLITE3=@HAVE_SQLITE3@ \
-	-DHAVE_SQLITE_FUNCTION_TYPE=@HAVE_SQLITE_FUNCTION_TYPE@ \
-	-DHAVE_SQLITE_OPEN_AUX_FILE=@HAVE_SQLITE_OPEN_AUX_FILE@ \
-	-DHAVE_SQLITE_SET_AUTHORIZER=@HAVE_SQLITE_SET_AUTHORIZER@ \
-	-DHAVE_SQLITE_TRACE=@HAVE_SQLITE_TRACE@ \
-	-DHAVE_SQLITE_COMPILE=@HAVE_SQLITE_COMPILE@ \
-	-DHAVE_SQLITE_PROGRESS_HANDLER=@HAVE_SQLITE_PROGRESS_HANDLER@
-LIBS=	@SQLITE_LIB@ @SQLITE3_LIB@
+PKG_CFLAGS =	-Wall -O -fPIC $(JNIINCLUDE) $(SQLITE_INC) $(SQLITE3_INC) \
+		-DHAVE_SQLITE2=@HAVE_SQLITE2@ -DHAVE_SQLITE3=@HAVE_SQLITE3@ \
+		-DHAVE_SQLITE_FUNCTION_TYPE=@HAVE_SQLITE_FUNCTION_TYPE@ \
+		-DHAVE_SQLITE_OPEN_AUX_FILE=@HAVE_SQLITE_OPEN_AUX_FILE@ \
+		-DHAVE_SQLITE_SET_AUTHORIZER=@HAVE_SQLITE_SET_AUTHORIZER@ \
+		-DHAVE_SQLITE_TRACE=@HAVE_SQLITE_TRACE@ \
+		-DHAVE_SQLITE_COMPILE=@HAVE_SQLITE_COMPILE@ \
+		-DHAVE_SQLITE_PROGRESS_HANDLER=@HAVE_SQLITE_PROGRESS_HANDLER@
+LIBS=		$(SQLITE_LIB) $(SQLITE3_LIB)
 
 # Add new suffixes
 .SUFFIXES: .java .class .lo .la .jar
@@ -92,14 +93,14 @@
 	    SQLite.FunctionContext
 
 sqlite_jni.lo:	native/sqlite_jni.h native/sqlite_jni.c
-	$(LIBTOOL) $(CC) -c $(CFLAGS) native/sqlite_jni.c
+	$(LIBTOOL) --tag=CC --mode=compile $(CC) -c $(CFLAGS) $(PKG_CFLAGS) native/sqlite_jni.c
 
 libsqlite_jni.la:	sqlite_jni.lo
-	$(LIBTOOL) $(CC) -o libsqlite_jni.la sqlite_jni.lo \
+	$(LIBTOOL) --tag=CC --mode=link $(CC) -o libsqlite_jni.la sqlite_jni.lo \
 	    -rpath $(NATIVE_LIB_DIR) $(LIBS)
 
 native/mkconst:	native/mkconst.c
-	$(LIBTOOL) $(CC) $(SQLITE_INC) $(SQLITE3_INC) \
+	$(BUILD_CC) $(SQLITE_INC) $(SQLITE3_INC) \
 	    -DHAVE_SQLITE2=@HAVE_SQLITE2@ -DHAVE_SQLITE3=@HAVE_SQLITE3@ \
 	    -o native/mkconst native/mkconst.c $(LIBS)
 
@@ -126,7 +127,7 @@
 	$(INSTALL) -m 644 test.java doc/test.java
 
 install:
-	$(INSTALL) -d -m 755 $(JAR_DIR)
-	$(INSTALL) -m 644 sqlite.jar $(JAR_DIR)
-	$(INSTALL) -d -m 755 $(NATIVE_LIB_DIR)
-	$(LIBTOOL) $(INSTALL) libsqlite_jni.la $(NATIVE_LIB_DIR)
+	$(INSTALL) -d -m 755 $(DESTDIR)$(JAR_DIR)
+	$(INSTALL) -m 644 sqlite.jar $(DESTDIR)$(JAR_DIR)
+	$(INSTALL) -d -m 755 $(DESTDIR)$(NATIVE_LIB_DIR)
+	$(LIBTOOL) --mode=install $(INSTALL) libsqlite_jni.la $(DESTDIR)$(NATIVE_LIB_DIR)