blob: 7ac08a4fd833d928bfae7212024fc013084f9f28 (
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
|
$NetBSD: patch-configure,v 1.1 2014/01/10 09:50:42 wiz Exp $
Fix libotr>=4 detection.
--- configure.orig 2012-12-02 13:30:10.000000000 +0000
+++ configure
@@ -15502,7 +15502,7 @@ else
fi
if test "x$enable_otr" = "xyes"; then
- # Look for libgcrypt and libotr
+ # Look for libgcrypt and libotr
# Check whether --with-libgcrypt-prefix was given.
if test "${with_libgcrypt_prefix+set}" = set; then :
@@ -15687,7 +15687,182 @@ $as_echo "does not match. want=$req_libg
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
- libotr_save_CFLAGS="$CFLAGS"
+ libotr_save_CFLAGS="$CFLAGS"
+libotr_save_LDFLAGS="$LDFLAGS"
+libotr_save_LIBS="$LIBS"
+libotr_found=yes
+
+
+# Check whether --with-libotr-prefix was given.
+if test "${with_libotr_prefix+set}" = set; then :
+ withval=$with_libotr_prefix; libotr_prefix="$withval"
+else
+ libotr_prefix=""
+fi
+
+
+
+# Check whether --with-libotr-inc-prefix was given.
+if test "${with_libotr_inc_prefix+set}" = set; then :
+ withval=$with_libotr_inc_prefix; libotr_inc_prefix="$withval"
+else
+ libotr_inc_prefix=""
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr CFLAGS" >&5
+$as_echo_n "checking for libotr CFLAGS... " >&6; }
+if test "$libotr_inc_prefix" != "" ; then
+ LIBOTR_CFLAGS="$LIBOTR_CFLAGS -I$libotr_inc_prefix"
+ CFLAGS="$CFLAGS $LIBOTR_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTR_CFLAGS" >&5
+$as_echo "$LIBOTR_CFLAGS" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr LIBS" >&5
+$as_echo_n "checking for libotr LIBS... " >&6; }
+if test "$libotr_prefix" != "" ; then
+ LIBOTR_LIBS="$LIBOTR_LIBS -L$libotr_prefix"
+ LDFLAGS="$LDFLAGS $LIBOTR_LIBS"
+fi
+
+LIBOTR_LIBS="$LIBOTR_LIBS -lotr"
+LIBS="$LIBOTR_LIBS $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTR_LIBS" >&5
+$as_echo "$LIBOTR_LIBS" >&6; }
+
+min_libotr_version=4.0.0
+no_libotr=""
+ libotr_min_major_version=`echo $min_libotr_version | \
+ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+ libotr_min_minor_version=`echo $min_libotr_version | \
+ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+ libotr_min_sub_version=`echo $min_libotr_version | \
+ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr headers version $libotr_min_major_version.x >= $min_libotr_version" >&5
+$as_echo_n "checking for libotr headers version $libotr_min_major_version.x >= $min_libotr_version... " >&6; }
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <libotr/version.h>
+
+int
+main ()
+{
+
+# if(OTRL_VERSION_MAJOR != $libotr_min_major_version)
+# error not present
+# else
+
+# if(OTRL_VERSION_MINOR > $libotr_min_minor_version)
+ exit(0);
+# else
+# if(OTRL_VERSION_MINOR < $libotr_min_minor_version)
+# error not present
+# endif
+
+# if(OTRL_VERSION_SUB < $libotr_min_sub_version)
+# error not present
+# endif
+# endif
+# endif
+exit(0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5
+$as_echo "found." >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5
+$as_echo "not present." >&6; }
+
+ libotr_found=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for otrl_message_receiving in -lotr" >&5
+$as_echo_n "checking for otrl_message_receiving in -lotr... " >&6; }
+if ${ac_cv_lib_otr_otrl_message_receiving+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lotr $LIBGCRYPT_LIBS
+ $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char otrl_message_receiving ();
+int
+main ()
+{
+return otrl_message_receiving ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_otr_otrl_message_receiving=yes
+else
+ ac_cv_lib_otr_otrl_message_receiving=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_otr_otrl_message_receiving" >&5
+$as_echo "$ac_cv_lib_otr_otrl_message_receiving" >&6; }
+if test "x$ac_cv_lib_otr_otrl_message_receiving" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBOTR 1
+_ACEOF
+
+ LIBS="-lotr $LIBS"
+
+else
+
+ libotr_found=no
+fi
+
+
+LDFLAGS="$libotr_save_LDFLAGS"
+LIBS="$libotr_save_LIBS"
+
+if test "x$libotr_found" = "xyes" ; then
+
+
+$as_echo "#define HAVE_LIBOTR 1" >>confdefs.h
+
+
+else
+ LIBOTR_CFLAGS=""
+ LIBOTR_LIBS=""
+
+ libotr_save_CFLAGS="$CFLAGS"
libotr_save_LDFLAGS="$LDFLAGS"
libotr_save_LIBS="$LIBS"
libotr_found=yes
@@ -15853,11 +16028,26 @@ LDFLAGS="$libotr_save_LDFLAGS"
LIBS="$libotr_save_LIBS"
if test "x$libotr_found" = "xyes" ; then
- :
+
+
+$as_echo "#define HAVE_LIBOTR 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_LIBOTR3 1" >>confdefs.h
+
+
else
LIBOTR_CFLAGS=""
LIBOTR_LIBS=""
- as_fn_error $? "libotr 3.1.0 or newer is required." "$LINENO" 5
+
+ as_fn_error $? "libotr 3.1.0 or newer is required." "$LINENO" 5
+
+fi
+
+
+
+
+
fi
@@ -15890,7 +16080,8 @@ $as_echo "$as_me: WARNING:
else
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS=""
- as_fn_error $? "libgcrypt 1.2.2 or newer is required." "$LINENO" 5
+
+ as_fn_error $? "libgcrypt 1.2.2 or newer is required." "$LINENO" 5
fi
|