1 |
## ltdl.m4 - Configure ltdl for the target system. -*-Shell-script-*- |
2 |
## Copyright (C) 1999-2000 Free Software Foundation, Inc. |
3 |
## |
4 |
## This program is free software; you can redistribute it and/or modify |
5 |
## it under the terms of the GNU General Public License as published by |
6 |
## the Free Software Foundation; either version 2 of the License, or |
7 |
## (at your option) any later version. |
8 |
## |
9 |
## This program is distributed in the hope that it will be useful, but |
10 |
## WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
## General Public License for more details. |
13 |
## |
14 |
## You should have received a copy of the GNU General Public License |
15 |
## along with this program; if not, write to the Free Software |
16 |
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 |
## |
18 |
## As a special exception to the GNU General Public License, if you |
19 |
## distribute this file as part of a program that contains a |
20 |
## configuration script generated by Autoconf, you may include it under |
21 |
## the same distribution terms that you use for the rest of that program. |
22 |
|
23 |
# serial 2 AC_LIB_LTDL |
24 |
|
25 |
# AC_LIB_LTDL |
26 |
# ----------- |
27 |
AC_DEFUN(AC_LIB_LTDL, |
28 |
[AC_PREREQ(2.13)dnl |
29 |
AC_REQUIRE([AC_PROG_CC])dnl |
30 |
AC_REQUIRE([AC_C_CONST])dnl |
31 |
|
32 |
# Perform all the checks necessary for compilation of the ltdl objects |
33 |
# -- including compiler checks (above) and header checks (below). |
34 |
AC_REQUIRE([AC_HEADER_STDC])dnl |
35 |
AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl |
36 |
|
37 |
AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dl.h sys/dl.h dld.h) |
38 |
AC_CHECK_HEADERS(string.h strings.h, break) |
39 |
AC_CHECK_FUNCS(strchr index, break) |
40 |
AC_CHECK_FUNCS(strrchr rindex, break) |
41 |
AC_CHECK_FUNCS(memcpy bcopy, break) |
42 |
AC_CHECK_FUNCS(strcmp) |
43 |
|
44 |
AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl |
45 |
AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl |
46 |
AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl |
47 |
AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl |
48 |
AC_REQUIRE([AC_LTDL_OBJDIR])dnl |
49 |
AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl |
50 |
AC_REQUIRE([AC_LTDL_DLLIB])dnl |
51 |
AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl |
52 |
AC_REQUIRE([AC_LTDL_DLSYM_USCORE])dnl |
53 |
AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])dnl |
54 |
])# AC_LIB_LTDL |
55 |
|
56 |
# AC_LTDL_ENABLE_INSTALL |
57 |
# ---------------------- |
58 |
AC_DEFUN(AC_LTDL_ENABLE_INSTALL, |
59 |
[AC_ARG_ENABLE(ltdl-install, |
60 |
[ --enable-ltdl-install install libltdl]) |
61 |
|
62 |
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) |
63 |
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno) |
64 |
])])# AC_LTDL_ENABLE_INSTALL |
65 |
|
66 |
# AC_LTDL_SYS_DLOPEN_DEPLIBS |
67 |
# -------------------------- |
68 |
AC_DEFUN(AC_LTDL_SYS_DLOPEN_DEPLIBS, |
69 |
[AC_REQUIRE([AC_CANONICAL_HOST]) |
70 |
AC_CACHE_CHECK([whether deplibs are loaded by dlopen], |
71 |
libltdl_cv_sys_dlopen_deplibs, [dnl |
72 |
# PORTME does your system automatically load deplibs for dlopen()? |
73 |
libltdl_cv_sys_dlopen_deplibs=unknown |
74 |
case "$host_os" in |
75 |
linux*) |
76 |
libltdl_cv_sys_dlopen_deplibs=yes |
77 |
;; |
78 |
netbsd*) |
79 |
libltdl_cv_sys_dlopen_deplibs=yes |
80 |
;; |
81 |
solaris*) |
82 |
libltdl_cv_sys_dlopen_deplibs=yes |
83 |
;; |
84 |
esac |
85 |
]) |
86 |
if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then |
87 |
AC_DEFINE(LTDL_DLOPEN_DEPLIBS, 1, |
88 |
[Define if the OS needs help to load dependent libraries for dlopen(). ]) |
89 |
fi |
90 |
])# AC_LTDL_SYS_DLOPEN_DEPLIBS |
91 |
|
92 |
# AC_LTDL_SHLIBEXT |
93 |
# ---------------- |
94 |
AC_DEFUN(AC_LTDL_SHLIBEXT, |
95 |
[AC_REQUIRE([_LT_AC_LTCONFIG_HACK]) |
96 |
AC_CACHE_CHECK([which extension is used for shared libraries], |
97 |
libltdl_cv_shlibext, |
98 |
[ac_last= |
99 |
for ac_spec in $library_names_spec; do |
100 |
ac_last="$ac_spec" |
101 |
done |
102 |
echo "$ac_last" | [sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//'] > conftest |
103 |
libltdl_cv_shlibext=`cat conftest` |
104 |
rm -f conftest |
105 |
]) |
106 |
if test -n "$libltdl_cv_shlibext"; then |
107 |
AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext", |
108 |
[Define to the extension used for shared libraries, say, ".so". ]) |
109 |
fi |
110 |
])# AC_LTDL_SHLIBEXT |
111 |
|
112 |
# AC_LTDL_SHLIBPATH |
113 |
# ----------------- |
114 |
AC_DEFUN(AC_LTDL_SHLIBPATH, |
115 |
[AC_REQUIRE([_LT_AC_LTCONFIG_HACK]) |
116 |
AC_CACHE_CHECK([which variable specifies run-time library path], |
117 |
libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"]) |
118 |
if test -n "$libltdl_cv_shlibpath_var"; then |
119 |
AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var", |
120 |
[Define to the name of the environment variable that determines the dynamic library search path. ]) |
121 |
fi |
122 |
])# AC_LTDL_SHLIBPATH |
123 |
|
124 |
# AC_LTDL_SYSSEARCHPATH |
125 |
# --------------------- |
126 |
AC_DEFUN(AC_LTDL_SYSSEARCHPATH, |
127 |
[AC_REQUIRE([_LT_AC_LTCONFIG_HACK]) |
128 |
AC_CACHE_CHECK([for the default library search path], |
129 |
libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) |
130 |
if test -n "$libltdl_cv_sys_search_path"; then |
131 |
case "$host" in |
132 |
*-*-mingw*) pathsep=";" ;; |
133 |
*) pathsep=":" ;; |
134 |
esac |
135 |
sys_search_path= |
136 |
for dir in $libltdl_cv_sys_search_path; do |
137 |
if test -z "$sys_search_path"; then |
138 |
sys_search_path="$dir" |
139 |
else |
140 |
sys_search_path="$sys_search_path$pathsep$dir" |
141 |
fi |
142 |
done |
143 |
AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path", |
144 |
[Define to the system default library search path. ]) |
145 |
fi |
146 |
])# AC_LTDL_SYSSEARCHPATH |
147 |
|
148 |
# AC_LTDL_OBJDIR |
149 |
# -------------- |
150 |
AC_DEFUN(AC_LTDL_OBJDIR, |
151 |
[AC_CACHE_CHECK([for objdir], |
152 |
libltdl_cv_objdir, [libltdl_cv_objdir="$objdir" |
153 |
if test -n "$objdir"; then |
154 |
: |
155 |
else |
156 |
rm -f .libs 2>/dev/null |
157 |
mkdir .libs 2>/dev/null |
158 |
if test -d .libs; then |
159 |
libltdl_cv_objdir=.libs |
160 |
else |
161 |
# MS-DOS does not allow filenames that begin with a dot. |
162 |
libltdl_cv_objdir=_libs |
163 |
fi |
164 |
rmdir .libs 2>/dev/null |
165 |
fi]) |
166 |
AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/", |
167 |
[Define to the sub-directory in which libtool stores uninstalled libraries. ]) |
168 |
])# AC_LTDL_OBJDIR |
169 |
|
170 |
# AC_LTDL_DLPREOPEN |
171 |
# ----------------- |
172 |
AC_DEFUN(AC_LTDL_DLPREOPEN, |
173 |
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl |
174 |
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], |
175 |
libltdl_cv_preloaded_symbols, [dnl |
176 |
if test -n "$global_symbol_pipe"; then |
177 |
libltdl_cv_preloaded_symbols=yes |
178 |
else |
179 |
libltdl_cv_preloaded_symbols=no |
180 |
fi |
181 |
]) |
182 |
if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then |
183 |
AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1, |
184 |
[Define if libtool can extract symbol lists from object files. ]) |
185 |
fi |
186 |
])# AC_LTDL_DLPREOPEN |
187 |
|
188 |
# AC_LTDL_DLLIB |
189 |
# ------------- |
190 |
AC_DEFUN(AC_LTDL_DLLIB, |
191 |
[LIBADD_DL= |
192 |
AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1, |
193 |
[Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"], |
194 |
[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1, |
195 |
[Define if you have the libdl library or equivalent.])], |
196 |
[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1, |
197 |
[Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"] |
198 |
)])]) |
199 |
AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1, |
200 |
[Define if you have the shl_load function.])], |
201 |
[AC_CHECK_LIB(dld, shl_load, |
202 |
[AC_DEFINE(HAVE_SHL_LOAD, 1, |
203 |
[Define if you have the shl_load function.]) |
204 |
LIBADD_DL="$LIBADD_DL -ldld"]) |
205 |
]) |
206 |
AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1, |
207 |
[Define if you have the GNU dld library.])dnl |
208 |
test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"]) |
209 |
AC_SUBST(LIBADD_DL) |
210 |
|
211 |
if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then |
212 |
LIBS_SAVE="$LIBS" |
213 |
LIBS="$LIBS $LIBADD_DL" |
214 |
AC_CHECK_FUNCS(dlerror) |
215 |
LIBS="$LIBS_SAVE" |
216 |
fi |
217 |
])# AC_LTDL_DLLIB |
218 |
|
219 |
# AC_LTDL_SYMBOL_USCORE |
220 |
# --------------------- |
221 |
AC_DEFUN(AC_LTDL_SYMBOL_USCORE, |
222 |
[dnl does the compiler prefix global symbols with an underscore? |
223 |
AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl |
224 |
AC_MSG_CHECKING([for _ prefix in compiled symbols]) |
225 |
AC_CACHE_VAL(ac_cv_sys_symbol_underscore, |
226 |
[ac_cv_sys_symbol_underscore=no |
227 |
cat > conftest.$ac_ext <<EOF |
228 |
void nm_test_func(){} |
229 |
int main(){nm_test_func;return 0;} |
230 |
EOF |
231 |
if AC_TRY_EVAL(ac_compile); then |
232 |
# Now try to grab the symbols. |
233 |
ac_nlist=conftest.nm |
234 |
if AC_TRY_EVAL(NM conftest.$ac_objext \| $global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then |
235 |
# See whether the symbols have a leading underscore. |
236 |
if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then |
237 |
ac_cv_sys_symbol_underscore=yes |
238 |
else |
239 |
if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then |
240 |
: |
241 |
else |
242 |
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC |
243 |
fi |
244 |
fi |
245 |
else |
246 |
echo "configure: cannot run $global_symbol_pipe" >&AC_FD_CC |
247 |
fi |
248 |
else |
249 |
echo "configure: failed program was:" >&AC_FD_CC |
250 |
cat conftest.c >&AC_FD_CC |
251 |
fi |
252 |
rm -rf conftest* |
253 |
]) |
254 |
AC_MSG_RESULT($ac_cv_sys_symbol_underscore) |
255 |
])# AC_LTDL_SYMBOL_USCORE |
256 |
|
257 |
|
258 |
# AC_LTDL_DLSYM_USCORE |
259 |
# -------------------- |
260 |
AC_DEFUN(AC_LTDL_DLSYM_USCORE, |
261 |
[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl |
262 |
if test x"$ac_cv_sys_symbol_underscore" = xyes; then |
263 |
if test x"$ac_cv_func_dlopen" = xyes || |
264 |
test x"$ac_cv_lib_dl_dlopen" = xyes ; then |
265 |
AC_CACHE_CHECK([whether we have to add an underscore for dlsym], |
266 |
libltdl_cv_need_uscore, [dnl |
267 |
libltdl_cv_need_uscore=unknown |
268 |
save_LIBS="$LIBS" |
269 |
LIBS="$LIBS $LIBADD_DL" |
270 |
_LT_AC_TRY_DLOPEN_SELF( |
271 |
libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes, |
272 |
[], libltdl_cv_need_uscore=cross) |
273 |
LIBS="$save_LIBS" |
274 |
]) |
275 |
fi |
276 |
fi |
277 |
|
278 |
if test x"$libltdl_cv_need_uscore" = xyes; then |
279 |
AC_DEFINE(NEED_USCORE, 1, |
280 |
[Define if dlsym() requires a leading underscode in symbol names. ]) |
281 |
fi |
282 |
])# AC_LTDL_DLSYM_USCORE |
283 |
|
284 |
dnl Autoconf macros for libmcrypt |
285 |
dnl $id$ |
286 |
|
287 |
# This script detects libmcrypt version and defines |
288 |
# LIBMCRYPT_CFLAGS, LIBMCRYPT_LIBS |
289 |
# and LIBMCRYPT24 or LIBMCRYPT22 depending on libmcrypt version |
290 |
# found. |
291 |
|
292 |
# Modified for LIBMCRYPT -- nmav |
293 |
# Configure paths for LIBGCRYPT |
294 |
# Shamelessly stolen from the one of XDELTA by Owen Taylor |
295 |
# Werner Koch 99-12-09 |
296 |
|
297 |
dnl AM_PATH_LIBMCRYPT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) |
298 |
dnl Test for libmcrypt, and define LIBMCRYPT_CFLAGS and LIBMCRYPT_LIBS |
299 |
dnl |
300 |
AC_DEFUN(AM_PATH_LIBMCRYPT, |
301 |
[dnl |
302 |
dnl Get the cflags and libraries from the libmcrypt-config script |
303 |
dnl |
304 |
AC_LTDL_DLLIB |
305 |
AC_ARG_WITH(libmcrypt-prefix, |
306 |
[ --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional)], |
307 |
libmcrypt_config_prefix="$withval", libmcrypt_config_prefix="") |
308 |
|
309 |
if test x$libmcrypt_config_prefix != x ; then |
310 |
libmcrypt_config_args="$libmcrypt_config_args --prefix=$libmcrypt_config_prefix" |
311 |
if test x${LIBMCRYPT_CONFIG+set} != xset ; then |
312 |
LIBMCRYPT_CONFIG=$libmcrypt_config_prefix/bin/libmcrypt-config |
313 |
fi |
314 |
fi |
315 |
|
316 |
AC_PATH_PROG(LIBMCRYPT_CONFIG, libmcrypt-config, no) |
317 |
min_libmcrypt_version=ifelse([$1], ,2.4.0,$1) |
318 |
AC_MSG_CHECKING(for libmcrypt - version >= $min_libmcrypt_version) |
319 |
no_libmcrypt="" |
320 |
if test "$LIBMCRYPT_CONFIG" = "no" ; then |
321 |
dnl libmcrypt-config was not found (pre 2.4.11 versions) |
322 |
dnl Try to detect libmcrypt version |
323 |
AC_TRY_RUN([ |
324 |
#include <stdio.h> |
325 |
#include <stdlib.h> |
326 |
#include <string.h> |
327 |
#include <mcrypt.h> |
328 |
|
329 |
int |
330 |
main () |
331 |
{ |
332 |
#if MCRYPT_API_VERSION <= 19991015 |
333 |
/* version 2.2 */ |
334 |
return 0; |
335 |
#else |
336 |
/* version 2.4 */ |
337 |
return 1; |
338 |
#endif /* 19991015 */ |
339 |
} |
340 |
], libmcrypt_config_version="2.2.0" |
341 |
if test x$libmcrypt_config_prefix != x ; then |
342 |
TTLIBS="-L${libmcrypt_config_prefix}/libs" |
343 |
TTINCLUDE="-I${libmcrypt_config_prefix}/include" |
344 |
fi |
345 |
LIBMCRYPT_CFLAGS="${TTINCLUDE}" |
346 |
LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt" |
347 |
AC_DEFINE(LIBMCRYPT22) |
348 |
|
349 |
, libmcrypt_config_version="2.4.0" |
350 |
if test x$libmcrypt_config_prefix != x ; then |
351 |
TTLIBS="-L${libmcrypt_config_prefix}/libs" |
352 |
TTINCLUDE="-I${libmcrypt_config_prefix}/include" |
353 |
fi |
354 |
LIBMCRYPT_CFLAGS="${TTINCLUDE}" |
355 |
LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl ${LIBADD_DL}" |
356 |
AC_DEFINE(LIBMCRYPT24)) |
357 |
else |
358 |
dnl libmcrypt-config was found |
359 |
LIBMCRYPT_CFLAGS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --cflags` |
360 |
LIBMCRYPT_LIBS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --libs` |
361 |
libmcrypt_config_version=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --version` |
362 |
AC_DEFINE(LIBMCRYPT24) |
363 |
fi |
364 |
|
365 |
ac_save_CFLAGS="$CFLAGS" |
366 |
ac_save_LIBS="$LIBS" |
367 |
CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" |
368 |
LIBS="$LIBS $LIBMCRYPT_LIBS" |
369 |
|
370 |
dnl |
371 |
dnl Now check if the installed libmcrypt is sufficiently new. Also sanity |
372 |
dnl checks the results of libmcrypt-config to some extent |
373 |
dnl |
374 |
rm -f conf.libmcrypttest |
375 |
AC_TRY_RUN([ |
376 |
#include <stdio.h> |
377 |
#include <stdlib.h> |
378 |
#include <string.h> |
379 |
#include <mcrypt.h> |
380 |
|
381 |
#define TWO "2.2" |
382 |
|
383 |
int |
384 |
main () |
385 |
{ |
386 |
#if MCRYPT_API_VERSION <= 20010201 |
387 |
|
388 |
#if MCRYPT_API_VERSION <= 19991015 |
389 |
/* version 2.2 */ |
390 |
int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); |
391 |
system ("touch conf.libmcrypttest"); |
392 |
|
393 |
if( strncmp( TWO, "$min_libmcrypt_version", strlen(TWO))) { |
394 |
printf("\n*** Requested libmcrypt %s, but LIBMCRYPT (%s)\n", |
395 |
"$min_libmcrypt_version", TWO ); |
396 |
printf("*** was found!\n"); |
397 |
return 1; |
398 |
} |
399 |
return 0; |
400 |
#else |
401 |
/* version 2.4 before 11 */ |
402 |
MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); |
403 |
system ("touch conf.libmcrypttest"); |
404 |
mcrypt_module_close(td); |
405 |
|
406 |
return 0; |
407 |
#endif /* 19991015 */ |
408 |
|
409 |
#else |
410 |
|
411 |
system ("touch conf.libmcrypttest"); |
412 |
|
413 |
if( strcmp( mcrypt_check_version(NULL), "$libmcrypt_config_version" ) ) |
414 |
{ |
415 |
printf("\n*** 'libmcrypt-config --version' returned %s, but LIBMCRYPT (%s)\n", |
416 |
"$libmcrypt_config_version", mcrypt_check_version(NULL) ); |
417 |
printf("*** was found! If libmcrypt-config was correct, then it is best\n"); |
418 |
printf("*** to remove the old version of LIBMCRYPT. You may also be able to fix the error\n"); |
419 |
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
420 |
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
421 |
printf("*** required on your system.\n"); |
422 |
printf("*** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG\n"); |
423 |
printf("*** to point to the correct copy of libmcrypt-config, and remove the file config.cache\n"); |
424 |
printf("*** before re-running configure\n"); |
425 |
} |
426 |
else if ( strcmp(mcrypt_check_version(NULL), LIBMCRYPT_VERSION ) ) |
427 |
{ |
428 |
printf("\n*** LIBMCRYPT header file (version %s) does not match\n", LIBMCRYPT_VERSION); |
429 |
printf("*** library (version %s)\n", mcrypt_check_version(NULL) ); |
430 |
} |
431 |
else |
432 |
{ |
433 |
if ( mcrypt_check_version( "$min_libmcrypt_version" ) ) |
434 |
{ |
435 |
return 0; |
436 |
} |
437 |
else |
438 |
{ |
439 |
printf("no\n*** An old version of LIBMCRYPT (%s) was found.\n", |
440 |
mcrypt_check_version(NULL) ); |
441 |
printf("*** You need a version of LIBMCRYPT newer than %s. The latest version of\n", |
442 |
"$min_libmcrypt_version" ); |
443 |
printf("*** LIBMCRYPT is always available from ftp://mcrypt.hellug.gr/pub/mcrypt.\n"); |
444 |
printf("*** \n"); |
445 |
printf("*** If you have already installed a sufficiently new version, this error\n"); |
446 |
printf("*** probably means that the wrong copy of the libmcrypt-config shell script is\n"); |
447 |
printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
448 |
printf("*** of LIBMCRYPT, but you can also set the LIBMCRYPT_CONFIG environment to point to the\n"); |
449 |
printf("*** correct copy of libmcrypt-config. (In this case, you will have to\n"); |
450 |
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
451 |
printf("*** so that the correct libraries are found at run-time))\n"); |
452 |
} |
453 |
} |
454 |
return 1; |
455 |
|
456 |
#endif /* 20010201 */ |
457 |
|
458 |
} |
459 |
],, no_libmcrypt=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
460 |
CFLAGS="$ac_save_CFLAGS" |
461 |
LIBS="$ac_save_LIBS" |
462 |
|
463 |
|
464 |
if test "x$no_libmcrypt" = x ; then |
465 |
AC_MSG_RESULT(yes) |
466 |
ifelse([$2], , :, [$2]) |
467 |
else |
468 |
if test -f conf.libmcrypttest ; then |
469 |
: |
470 |
else |
471 |
AC_MSG_RESULT(no) |
472 |
fi |
473 |
|
474 |
if test -f conf.libmcrypttest ; then |
475 |
: |
476 |
else |
477 |
echo "*** Could not run libmcrypt test program, checking why..." |
478 |
CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" |
479 |
LIBS="$LIBS $LIBMCRYPT_LIBS" |
480 |
AC_TRY_LINK([ |
481 |
#include <stdio.h> |
482 |
#include <stdlib.h> |
483 |
#include <string.h> |
484 |
#include <mcrypt.h> |
485 |
], [ |
486 |
#if MCRYPT_API_VERSION <= 20010201 |
487 |
|
488 |
#if MCRYPT_API_VERSION <= 19991015 |
489 |
/* version 2.2 */ |
490 |
int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); |
491 |
return 0; |
492 |
#else |
493 |
/* version 2.4 before 11 */ |
494 |
MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); |
495 |
mcrypt_module_close(td); |
496 |
return 0; |
497 |
#endif /* 19991015 */ |
498 |
#else |
499 |
|
500 |
return !!mcrypt_check_version(NULL); |
501 |
|
502 |
#endif /* 20010201 */ |
503 |
|
504 |
], |
505 |
[ echo "*** The test program compiled, but did not run. This usually means" |
506 |
echo "*** that the run-time linker is not finding LIBMCRYPT or finding the wrong" |
507 |
echo "*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your" |
508 |
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
509 |
echo "*** to the installed location Also, make sure you have run ldconfig if that" |
510 |
echo "*** is required on your system" |
511 |
echo "***" |
512 |
echo "*** If you have an old version installed, it is best to remove it, although" |
513 |
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
514 |
echo "***" ], |
515 |
[ echo "*** The test program failed to compile or link. See the file config.log for the" |
516 |
echo "*** exact error that occured. This usually means LIBMCRYPT was incorrectly installed" |
517 |
echo "*** or that you have moved LIBMCRYPT since it was installed. In the latter case, you" |
518 |
echo "*** may want to edit the libmcrypt-config script: $LIBMCRYPT_CONFIG" ]) |
519 |
CFLAGS="$ac_save_CFLAGS" |
520 |
LIBS="$ac_save_LIBS" |
521 |
fi |
522 |
|
523 |
LIBMCRYPT_CFLAGS="" |
524 |
LIBMCRYPT_LIBS="" |
525 |
ifelse([$3], , :, [$3]) |
526 |
fi |
527 |
AC_SUBST(LIBMCRYPT_CFLAGS) |
528 |
AC_SUBST(LIBMCRYPT_LIBS) |
529 |
]) |
530 |
|
531 |
dnl *-*wedit:notab*-* Please keep this as the last line. |