1 |
nmav |
1.1 |
# aclocal.m4 generated automatically by aclocal 1.6.2 -*- Autoconf -*- |
2 |
|
|
|
3 |
|
|
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 |
4 |
|
|
# Free Software Foundation, Inc. |
5 |
|
|
# This file is free software; the Free Software Foundation |
6 |
|
|
# gives unlimited permission to copy and/or distribute it, |
7 |
|
|
# with or without modifications, as long as this notice is preserved. |
8 |
|
|
|
9 |
|
|
# This program is distributed in the hope that it will be useful, |
10 |
|
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
11 |
|
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
12 |
|
|
# PARTICULAR PURPOSE. |
13 |
|
|
|
14 |
|
|
include(check_struct_for.m4) |
15 |
|
|
include(libgnutls.m4) |
16 |
|
|
|
17 |
|
|
AC_DEFUN([AC_CHECK_STRUCT_FOR],[ |
18 |
|
|
ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'` |
19 |
|
|
ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'` |
20 |
|
|
ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}" |
21 |
|
|
changequote(, )dnl |
22 |
|
|
ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` |
23 |
|
|
changequote([, ])dnl |
24 |
|
|
|
25 |
|
|
AC_MSG_CHECKING([for $2.$3]) |
26 |
|
|
AC_CACHE_VAL($ac_safe_all, |
27 |
|
|
[ |
28 |
|
|
if test "x$4" = "x"; then |
29 |
|
|
defineit="= 0" |
30 |
|
|
elif test "x$4" = "xno"; then |
31 |
|
|
defineit="" |
32 |
|
|
else |
33 |
|
|
defineit="$4" |
34 |
|
|
fi |
35 |
|
|
AC_TRY_COMPILE([ |
36 |
|
|
$1 |
37 |
|
|
],[ |
38 |
|
|
struct $2 testit; |
39 |
|
|
testit.$3 $defineit; |
40 |
|
|
], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" ) |
41 |
|
|
]) |
42 |
|
|
|
43 |
|
|
if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then |
44 |
|
|
AC_MSG_RESULT(yes) |
45 |
|
|
AC_DEFINE_UNQUOTED($ac_uc_define) |
46 |
|
|
else |
47 |
|
|
AC_MSG_RESULT(no) |
48 |
|
|
fi |
49 |
|
|
]) |
50 |
|
|
|
51 |
|
|
dnl AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no]) |
52 |
|
|
dnl 1.1 (2000/09/19) |
53 |
|
|
dnl Wes Hardaker <wjhardaker@ucdavis.edu> |
54 |
|
|
|
55 |
|
|
dnl ---------------------------------------------------------- |
56 |
|
|
|
57 |
|
|
|
58 |
|
|
dnl Autoconf macros for libgnutls |
59 |
|
|
dnl $id$ |
60 |
|
|
|
61 |
|
|
# Modified for LIBGNUTLS -- nmav |
62 |
|
|
# Configure paths for LIBGCRYPT |
63 |
|
|
# Shamelessly stolen from the one of XDELTA by Owen Taylor |
64 |
|
|
# Werner Koch 99-12-09 |
65 |
|
|
|
66 |
|
|
dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) |
67 |
|
|
dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS |
68 |
|
|
dnl |
69 |
|
|
AC_DEFUN(AM_PATH_LIBGNUTLS, |
70 |
|
|
[dnl |
71 |
|
|
dnl Get the cflags and libraries from the libgnutls-config script |
72 |
|
|
dnl |
73 |
|
|
AC_ARG_WITH(libgnutls-prefix, |
74 |
|
|
[ --with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional)], |
75 |
|
|
libgnutls_config_prefix="$withval", libgnutls_config_prefix="") |
76 |
|
|
|
77 |
|
|
if test x$libgnutls_config_prefix != x ; then |
78 |
|
|
libgnutls_config_args="$libgnutls_config_args --prefix=$libgnutls_config_prefix" |
79 |
|
|
if test x${LIBGNUTLS_CONFIG+set} != xset ; then |
80 |
|
|
LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config |
81 |
|
|
fi |
82 |
|
|
fi |
83 |
|
|
|
84 |
|
|
AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no) |
85 |
|
|
min_libgnutls_version=ifelse([$1], ,0.1.0,$1) |
86 |
|
|
AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version) |
87 |
|
|
no_libgnutls="" |
88 |
|
|
if test "$LIBGNUTLS_CONFIG" = "no" ; then |
89 |
|
|
no_libgnutls=yes |
90 |
|
|
else |
91 |
|
|
LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags` |
92 |
|
|
LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs` |
93 |
|
|
libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version` |
94 |
|
|
|
95 |
|
|
|
96 |
|
|
ac_save_CFLAGS="$CFLAGS" |
97 |
|
|
ac_save_LIBS="$LIBS" |
98 |
|
|
CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" |
99 |
|
|
LIBS="$LIBS $LIBGNUTLS_LIBS" |
100 |
|
|
dnl |
101 |
|
|
dnl Now check if the installed libgnutls is sufficiently new. Also sanity |
102 |
|
|
dnl checks the results of libgnutls-config to some extent |
103 |
|
|
dnl |
104 |
|
|
rm -f conf.libgnutlstest |
105 |
|
|
AC_TRY_RUN([ |
106 |
|
|
#include <stdio.h> |
107 |
|
|
#include <stdlib.h> |
108 |
|
|
#include <string.h> |
109 |
|
|
#include <gnutls/gnutls.h> |
110 |
|
|
|
111 |
|
|
int |
112 |
|
|
main () |
113 |
|
|
{ |
114 |
|
|
system ("touch conf.libgnutlstest"); |
115 |
|
|
|
116 |
|
|
if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) ) |
117 |
|
|
{ |
118 |
|
|
printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n", |
119 |
|
|
"$libgnutls_config_version", gnutls_check_version(NULL) ); |
120 |
|
|
printf("*** was found! If libgnutls-config was correct, then it is best\n"); |
121 |
|
|
printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n"); |
122 |
|
|
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
123 |
|
|
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
124 |
|
|
printf("*** required on your system.\n"); |
125 |
|
|
printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n"); |
126 |
|
|
printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n"); |
127 |
|
|
printf("*** before re-running configure\n"); |
128 |
|
|
} |
129 |
|
|
else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) ) |
130 |
|
|
{ |
131 |
|
|
printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION); |
132 |
|
|
printf("*** library (version %s)\n", gnutls_check_version(NULL) ); |
133 |
|
|
} |
134 |
|
|
else |
135 |
|
|
{ |
136 |
|
|
if ( gnutls_check_version( "$min_libgnutls_version" ) ) |
137 |
|
|
{ |
138 |
|
|
return 0; |
139 |
|
|
} |
140 |
|
|
else |
141 |
|
|
{ |
142 |
|
|
printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n", |
143 |
|
|
gnutls_check_version(NULL) ); |
144 |
|
|
printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n", |
145 |
|
|
"$min_libgnutls_version" ); |
146 |
|
|
printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n"); |
147 |
|
|
printf("*** \n"); |
148 |
|
|
printf("*** If you have already installed a sufficiently new version, this error\n"); |
149 |
|
|
printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n"); |
150 |
|
|
printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
151 |
|
|
printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n"); |
152 |
|
|
printf("*** correct copy of libgnutls-config. (In this case, you will have to\n"); |
153 |
|
|
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
154 |
|
|
printf("*** so that the correct libraries are found at run-time))\n"); |
155 |
|
|
} |
156 |
|
|
} |
157 |
|
|
return 1; |
158 |
|
|
} |
159 |
|
|
],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
160 |
|
|
CFLAGS="$ac_save_CFLAGS" |
161 |
|
|
LIBS="$ac_save_LIBS" |
162 |
|
|
fi |
163 |
|
|
|
164 |
|
|
if test "x$no_libgnutls" = x ; then |
165 |
|
|
AC_MSG_RESULT(yes) |
166 |
|
|
ifelse([$2], , :, [$2]) |
167 |
|
|
else |
168 |
|
|
if test -f conf.libgnutlstest ; then |
169 |
|
|
: |
170 |
|
|
else |
171 |
|
|
AC_MSG_RESULT(no) |
172 |
|
|
fi |
173 |
|
|
if test "$LIBGNUTLS_CONFIG" = "no" ; then |
174 |
|
|
echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found" |
175 |
|
|
echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in" |
176 |
|
|
echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the" |
177 |
|
|
echo "*** full path to libgnutls-config." |
178 |
|
|
else |
179 |
|
|
if test -f conf.libgnutlstest ; then |
180 |
|
|
: |
181 |
|
|
else |
182 |
|
|
echo "*** Could not run libgnutls test program, checking why..." |
183 |
|
|
CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" |
184 |
|
|
LIBS="$LIBS $LIBGNUTLS_LIBS" |
185 |
|
|
AC_TRY_LINK([ |
186 |
|
|
#include <stdio.h> |
187 |
|
|
#include <stdlib.h> |
188 |
|
|
#include <string.h> |
189 |
|
|
#include <gnutls/gnutls.h> |
190 |
|
|
], [ return !!gnutls_check_version(NULL); ], |
191 |
|
|
[ echo "*** The test program compiled, but did not run. This usually means" |
192 |
|
|
echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong" |
193 |
|
|
echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your" |
194 |
|
|
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
195 |
|
|
echo "*** to the installed location Also, make sure you have run ldconfig if that" |
196 |
|
|
echo "*** is required on your system" |
197 |
|
|
echo "***" |
198 |
|
|
echo "*** If you have an old version installed, it is best to remove it, although" |
199 |
|
|
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
200 |
|
|
echo "***" ], |
201 |
|
|
[ echo "*** The test program failed to compile or link. See the file config.log for the" |
202 |
|
|
echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed" |
203 |
|
|
echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you" |
204 |
|
|
echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ]) |
205 |
|
|
CFLAGS="$ac_save_CFLAGS" |
206 |
|
|
LIBS="$ac_save_LIBS" |
207 |
|
|
fi |
208 |
|
|
fi |
209 |
|
|
LIBGNUTLS_CFLAGS="" |
210 |
|
|
LIBGNUTLS_LIBS="" |
211 |
|
|
ifelse([$3], , :, [$3]) |
212 |
|
|
fi |
213 |
|
|
rm -f conf.libgnutlstest |
214 |
|
|
AC_SUBST(LIBGNUTLS_CFLAGS) |
215 |
|
|
AC_SUBST(LIBGNUTLS_LIBS) |
216 |
|
|
]) |
217 |
|
|
|
218 |
|
|
dnl *-*wedit:notab*-* Please keep this as the last line. |
219 |
|
|
|