summaryrefslogtreecommitdiff
path: root/package/bogofilter/patches/patch-configure
blob: 165de8409bdb84c4f2f26b7664d6db7570f16aae (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
$Id$
--- bogofilter-1.1.3.orig/configure	2006-12-03 05:17:15.000000000 +0100
+++ bogofilter-1.1.3/configure	2007-03-29 19:27:35.000000000 +0200
@@ -13464,238 +13464,55 @@ echo "${ECHO_T}$LIBDB" >&6; }
 
 		saveLIBS="$LIBS"
 	LIBS="$LIBS $LIBDB"
-	{ echo "$as_me:$LINENO: checking if a program can be linked against Berkeley DB and run" >&5
-echo $ECHO_N "checking if a program can be linked against Berkeley DB and run... $ECHO_C" >&6; }
-	if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
+#	AC_MSG_CHECKING(if a program can be linked against Berkeley DB and run)
+#	AC_RUN_IFELSE(
+#	AC_LANG_PROGRAM([[
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
 #include <db.h>
+#		   ]], [[
+#return 0;
+#		   ]]),,
+#		   [AC_MSG_RESULT(no)
+#	AC_MSG_ERROR([Cannot run a program linked against libdb.
+#Did you adjust your library search path to include your libdb?])],)
+#	AC_MSG_RESULT(yes)
 
-int
-main ()
-{
-
-return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-	{ { echo "$as_me:$LINENO: error: Cannot run a program linked against libdb.
-Did you adjust your library search path to include your libdb?" >&5
-echo "$as_me: error: Cannot run a program linked against libdb.
-Did you adjust your library search path to include your libdb?" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-	{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-			{ echo "$as_me:$LINENO: checking if Berkeley DB header and library versions match" >&5
-echo $ECHO_N "checking if Berkeley DB header and library versions match... $ECHO_C" >&6; }
-	rm -r -f bfadtestdir
-	mkdir bfadtestdir
-	if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-		   #include <stdlib.h>
-		   #include <stdio.h>
+#	dnl check if header and library of DB library match
+#	dnl ignore if cross compiling
+#	AC_MSG_CHECKING(if Berkeley DB header and library versions match)
+#	rm -r -f bfadtestdir
+#	mkdir bfadtestdir
+#	AC_RUN_IFELSE(
+#	AC_LANG_PROGRAM([[
+#		   #include <stdlib.h>
+#		   #include <stdio.h>
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
-		   #include <db.h>
-
-int
-main ()
-{
-
-			int maj, min;
-			(void)db_version(&maj, &min, 0);
-			(void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n",
-				DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min);
-			if (maj != DB_VERSION_MAJOR) exit(1);
-			if (min != DB_VERSION_MINOR) exit(1);
-			exit(0);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-		   { { echo "$as_me:$LINENO: error: db.h header file and db library version do not match." >&5
-echo "$as_me: error: db.h header file and db library version do not match." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-	{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-	{ echo "$as_me:$LINENO: checking whether db_create is declared" >&5
-echo $ECHO_N "checking whether db_create is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_db_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef HAVE_INTTYPES_H
+#		   #include <db.h>
+#		   ]], [[
+#			int maj, min;
+#			(void)db_version(&maj, &min, 0);
+#			(void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n",
+#				DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min);
+#			if (maj != DB_VERSION_MAJOR) exit(1);
+#			if (min != DB_VERSION_MINOR) exit(1);
+#			exit(0);
+#		   ]]),,
+#		   [AC_MSG_RESULT(no)
+#		   AC_MSG_ERROR(db.h header file and db library version do not match.)],)
+#	AC_MSG_RESULT(yes)
+#	AC_CHECK_DECLS(db_create,,
+#	       AC_MSG_ERROR([[Can not locate a suitable Berkeley DB db.h header file.
+#Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory.
+#You can download Berkeley DB 4.3.x from http://www.sleepycat.com/]]),
+#	[[#ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
-#include <db.h>
-
-
-int
-main ()
-{
-#ifndef db_create
-  (void) db_create;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_db_create=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_db_create=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_db_create" >&5
-echo "${ECHO_T}$ac_cv_have_decl_db_create" >&6; }
-if test $ac_cv_have_decl_db_create = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_DB_CREATE 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_DB_CREATE 0
-_ACEOF
-
-{ { echo "$as_me:$LINENO: error: Can not locate a suitable Berkeley DB db.h header file.
-Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory.
-You can download Berkeley DB 4.3.x from http://www.sleepycat.com/" >&5
-echo "$as_me: error: Can not locate a suitable Berkeley DB db.h header file.
-Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory.
-You can download Berkeley DB 4.3.x from http://www.sleepycat.com/" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
+#include <db.h>]]
+#	)
 	{ echo "$as_me:$LINENO: checking if Berkeley DB supports shared environments" >&5
 echo $ECHO_N "checking if Berkeley DB supports shared environments... $ECHO_C" >&6; }
 	if test "x$enable_dbshared_test" != xno && test "x$USE_TRANSACTIONS" != xNO ; then