1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | dnl AC_INIT([BBFTP Client],[3.0.0],[bbftp@in2p3.fr]) |
---|
3 | AC_INIT(bbftp.c) |
---|
4 | AC_CONFIG_HEADER(bbftp.h:../includes/bbftp.h.in) |
---|
5 | |
---|
6 | AC_PROG_CC(cc) |
---|
7 | AC_PROG_INSTALL |
---|
8 | AC_CANONICAL_HOST |
---|
9 | |
---|
10 | dnl LIBS="" |
---|
11 | |
---|
12 | |
---|
13 | AC_CHECK_HEADERS( dirent.h errno.h fcntl.h fnmatch.h netdb.h netinet/in.h \ |
---|
14 | netinet/tcp.h byteswap.h pwd.h signal.h stdarg.h stdio.h string.h \ |
---|
15 | sys/socket.h sys/stat.h sys/time.h sys/types.h sys/wait.h \ |
---|
16 | syslog.h time.h unistd.h utime.h) |
---|
17 | AC_HEADER_TIME |
---|
18 | |
---|
19 | dnl =========================================================================== |
---|
20 | dnl Check for the socket routine |
---|
21 | dnl =========================================================================== |
---|
22 | |
---|
23 | AC_CHECK_LIB(c,socket,result=yes,result=no) |
---|
24 | if test $result = no ; then |
---|
25 | AC_CHECK_LIB(xnet,socket,result=yes,result=no) |
---|
26 | if test $result = yes ; then |
---|
27 | LIBS="$LIBS -lxnet" |
---|
28 | else |
---|
29 | AC_CHECK_LIB(socket,socket,result=yes,result=no) |
---|
30 | if test $result = yes ; then |
---|
31 | LIBS="$LIBS -lsocket" |
---|
32 | else |
---|
33 | AC_MSG_ERROR(socket function not found) |
---|
34 | fi |
---|
35 | fi |
---|
36 | fi |
---|
37 | |
---|
38 | dnl =========================================================================== |
---|
39 | dnl Does the socklen_t type exists? |
---|
40 | dnl Added by S.Pascoe@rl.ac.uk on 14.08.2006 |
---|
41 | dnl This test existed in the server distribution but not in the client. |
---|
42 | dnl =========================================================================== |
---|
43 | AC_CHECK_TYPES([socklen_t]) |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | dnl =========================================================================== |
---|
48 | dnl Check if size_t exists |
---|
49 | dnl =========================================================================== |
---|
50 | AC_TYPE_SIZE_T |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | dnl =========================================================================== |
---|
55 | dnl Check all other routines |
---|
56 | dnl =========================================================================== |
---|
57 | |
---|
58 | AC_CHECK_FUNC(chdir,result=yes,result=no) |
---|
59 | if test $result = no ; then |
---|
60 | AC_MSG_ERROR(chdir funtion not found) |
---|
61 | fi |
---|
62 | AC_CHECK_FUNC(fcntl,result=yes,result=no) |
---|
63 | if test $result = no ; then |
---|
64 | AC_MSG_ERROR(fcntl funtion not found) |
---|
65 | fi |
---|
66 | AC_CHECK_FUNC(fnmatch,result=yes,result=no) |
---|
67 | if test $result = no ; then |
---|
68 | AC_MSG_ERROR(fnmatch funtion not found) |
---|
69 | fi |
---|
70 | AC_CHECK_FUNC(fork,result=yes,result=no) |
---|
71 | if test $result = no ; then |
---|
72 | AC_MSG_ERROR(fork funtion not found) |
---|
73 | fi |
---|
74 | AC_CHECK_FUNC(fprintf,result=yes,result=no) |
---|
75 | if test $result = no ; then |
---|
76 | AC_MSG_ERROR(fprintf funtion not found) |
---|
77 | fi |
---|
78 | AC_CHECK_FUNC(free,result=yes,result=no) |
---|
79 | if test $result = no ; then |
---|
80 | AC_MSG_ERROR(free funtion not found) |
---|
81 | fi |
---|
82 | AC_CHECK_FUNC(getopt,result=yes,result=no) |
---|
83 | if test $result = no ; then |
---|
84 | AC_MSG_ERROR(getopt funtion not found) |
---|
85 | fi |
---|
86 | AC_CHECK_FUNC(getpid,result=yes,result=no) |
---|
87 | if test $result = no ; then |
---|
88 | AC_MSG_ERROR(getpid funtion not found) |
---|
89 | fi |
---|
90 | AC_CHECK_FUNC(gettimeofday,result=yes,result=no) |
---|
91 | if test $result = no ; then |
---|
92 | AC_MSG_ERROR(gettimeofday funtion not found) |
---|
93 | fi |
---|
94 | AC_CHECK_FUNC(kill,result=yes,result=no) |
---|
95 | if test $result = no ; then |
---|
96 | AC_MSG_ERROR(kill funtion not found) |
---|
97 | fi |
---|
98 | AC_CHECK_FUNC(localtime,result=yes,result=no) |
---|
99 | if test $result = no ; then |
---|
100 | AC_MSG_ERROR(localtime funtion not found) |
---|
101 | fi |
---|
102 | AC_CHECK_FUNC(openlog,result=yes,result=no) |
---|
103 | if test $result = no ; then |
---|
104 | AC_MSG_ERROR(openlog funtion not found) |
---|
105 | fi |
---|
106 | AC_CHECK_FUNC(opendir,result=yes,result=no) |
---|
107 | if test $result = no ; then |
---|
108 | AC_MSG_ERROR(opendir funtion not found) |
---|
109 | fi |
---|
110 | AC_CHECK_FUNC(random,result=yes,result=no) |
---|
111 | if test $result = no ; then |
---|
112 | AC_CHECK_FUNC([rand],[AC_DEFINE(random, rand)],[AC_MSG_ERROR(random, rand funtions not found)]) |
---|
113 | fi |
---|
114 | AC_CHECK_FUNC(readdir,result=yes,result=no) |
---|
115 | if test $result = no ; then |
---|
116 | AC_MSG_ERROR(readdir funtion not found) |
---|
117 | fi |
---|
118 | AC_CHECK_FUNC(read,result=yes,result=no) |
---|
119 | if test $result = no ; then |
---|
120 | AC_MSG_ERROR(read funtion not found) |
---|
121 | fi |
---|
122 | AC_CHECK_FUNC(select,result=yes,result=no) |
---|
123 | if test $result = no ; then |
---|
124 | AC_MSG_ERROR(select funtion not found) |
---|
125 | fi |
---|
126 | AC_CHECK_FUNC(setsid,result=yes,result=no) |
---|
127 | if test $result = no ; then |
---|
128 | AC_MSG_ERROR(setsid funtion not found) |
---|
129 | fi |
---|
130 | AC_CHECK_FUNC(sigaction,result=yes,result=no) |
---|
131 | if test $result = no ; then |
---|
132 | AC_MSG_ERROR(sigaction funtion not found) |
---|
133 | fi |
---|
134 | AC_CHECK_FUNC(sigemptyset,result=yes,result=no) |
---|
135 | if test $result = no ; then |
---|
136 | AC_MSG_ERROR(sigemptyset funtion not found) |
---|
137 | fi |
---|
138 | AC_CHECK_FUNC(sleep,result=yes,result=no) |
---|
139 | if test $result = no ; then |
---|
140 | AC_MSG_ERROR(sleep funtion not found) |
---|
141 | fi |
---|
142 | AC_CHECK_FUNC(sprintf,result=yes,result=no) |
---|
143 | if test $result = no ; then |
---|
144 | AC_MSG_ERROR(sprintf funtion not found) |
---|
145 | fi |
---|
146 | AC_CHECK_FUNC(srandom,result=yes,result=no) |
---|
147 | if test $result = no ; then |
---|
148 | AC_CHECK_FUNC([srand],[AC_DEFINE(srandom, srand)],[AC_MSG_ERROR(srandom, srand funtions not found)]) |
---|
149 | fi |
---|
150 | AC_CHECK_FUNC(strcmp,result=yes,result=no) |
---|
151 | if test $result = no ; then |
---|
152 | AC_MSG_ERROR(strcmp funtion not found) |
---|
153 | fi |
---|
154 | AC_CHECK_FUNC(strcpy,result=yes,result=no) |
---|
155 | if test $result = no ; then |
---|
156 | AC_MSG_ERROR(strcpy funtion not found) |
---|
157 | fi |
---|
158 | AC_CHECK_FUNC(strerror,result=yes,result=no) |
---|
159 | if test $result = no ; then |
---|
160 | AC_MSG_ERROR(strerror funtion not found) |
---|
161 | fi |
---|
162 | AC_CHECK_FUNC(strftime,result=yes,result=no) |
---|
163 | if test $result = no ; then |
---|
164 | AC_MSG_ERROR(strftime funtion not found) |
---|
165 | fi |
---|
166 | AC_CHECK_FUNC(strlen,result=yes,result=no) |
---|
167 | if test $result = no ; then |
---|
168 | AC_MSG_ERROR(strlen funtion not found) |
---|
169 | fi |
---|
170 | AC_CHECK_FUNC(syslog,result=yes,result=no) |
---|
171 | if test $result = no ; then |
---|
172 | AC_MSG_ERROR(syslog funtion not found) |
---|
173 | fi |
---|
174 | AC_CHECK_FUNC(unlink,result=yes,result=no) |
---|
175 | if test $result = no ; then |
---|
176 | AC_MSG_ERROR(unlink funtion not found) |
---|
177 | fi |
---|
178 | AC_CHECK_FUNC(waitpid,result=yes,result=no) |
---|
179 | if test $result = no ; then |
---|
180 | AC_MSG_ERROR(waitpid funtion not found) |
---|
181 | fi |
---|
182 | AC_CHECK_FUNC(write,result=yes,result=no) |
---|
183 | if test $result = no ; then |
---|
184 | AC_MSG_ERROR(write funtion not found) |
---|
185 | fi |
---|
186 | |
---|
187 | dnl =========================================================================== |
---|
188 | dnl Now check for siginfo structure |
---|
189 | dnl =========================================================================== |
---|
190 | AC_MSG_CHECKING(for siginfo struct) |
---|
191 | AC_TRY_COMPILE([#include <signal.h>], |
---|
192 | [ struct sigaction sga ; |
---|
193 | siginfo_t *code ; |
---|
194 | sga.sa_handler = 0 ; |
---|
195 | sigemptyset(&(sga.sa_mask)); |
---|
196 | sga.sa_flags = SA_SIGINFO ; |
---|
197 | if ( sigaction(SIGHUP,&sga,0) < 0 ) { |
---|
198 | return(1) ; |
---|
199 | } |
---|
200 | return 0 ;],[result=yes],[result=no]) |
---|
201 | if test $result = yes ; then |
---|
202 | AC_MSG_RESULT(found) |
---|
203 | AC_MSG_CHECKING(for signal to use) |
---|
204 | dnl =========================================================================== |
---|
205 | dnl Now check for signal to use |
---|
206 | dnl =========================================================================== |
---|
207 | AC_TRY_RUN([#include <signal.h> |
---|
208 | void in_sighup(sig,code,scp) |
---|
209 | int sig ; |
---|
210 | siginfo_t *code ; |
---|
211 | struct sigcontext *scp ; |
---|
212 | { |
---|
213 | if ( code->si_pid == getpid() ) { |
---|
214 | exit(0) ; |
---|
215 | } else { |
---|
216 | exit(1) ; |
---|
217 | } |
---|
218 | } |
---|
219 | main() { |
---|
220 | struct sigaction sga ; |
---|
221 | |
---|
222 | sga.sa_handler = in_sighup ; |
---|
223 | sigemptyset(&(sga.sa_mask)); |
---|
224 | sga.sa_flags = SA_SIGINFO ; |
---|
225 | if ( sigaction(SIGHUP,&sga,0) < 0 ) { |
---|
226 | exit(1) ; |
---|
227 | } |
---|
228 | sleep(1) ; |
---|
229 | raise(SIGHUP) ; |
---|
230 | sleep(1) ; |
---|
231 | exit(1) ; |
---|
232 | }], [result=yes],[result=no],[result=no]) |
---|
233 | if test $result = yes ; then |
---|
234 | AC_DEFINE(HAVE_SIGINFO) |
---|
235 | AC_DEFINE(USE_STANDART_SIGNALS) |
---|
236 | AC_MSG_RESULT(using standard signals) |
---|
237 | else |
---|
238 | AC_TRY_RUN([#include <signal.h> |
---|
239 | void in_sighup(sig,code,scp) |
---|
240 | int sig ; |
---|
241 | siginfo_t *code ; |
---|
242 | struct sigcontext *scp ; |
---|
243 | { |
---|
244 | if ( code->si_pid == getpid() ) { |
---|
245 | exit(0) ; |
---|
246 | } else { |
---|
247 | exit(1) ; |
---|
248 | } |
---|
249 | } |
---|
250 | main() { |
---|
251 | struct sigaction sga ; |
---|
252 | sga.sa_handler = in_sighup ; |
---|
253 | sigemptyset(&(sga.sa_mask)); |
---|
254 | sga.sa_flags = SA_SIGINFO ; |
---|
255 | if ( sigaction(SIGRTMIN,&sga,0) < 0 ) { |
---|
256 | exit(1) ; |
---|
257 | } |
---|
258 | sleep(1) ; |
---|
259 | raise(SIGRTMIN) ; |
---|
260 | sleep(1) ; |
---|
261 | exit(1) ; |
---|
262 | }], [result=yes],[result=no],[result=no]) |
---|
263 | if test $result = yes ; then |
---|
264 | AC_DEFINE(HAVE_SIGINFO) |
---|
265 | AC_MSG_RESULT(using real time signals) |
---|
266 | else |
---|
267 | AC_MSG_RESULT(no signals) |
---|
268 | fi |
---|
269 | fi |
---|
270 | else |
---|
271 | AC_MSG_RESULT(not found) |
---|
272 | fi |
---|
273 | |
---|
274 | dnl =========================================================================== |
---|
275 | dnl Now check for the SA_NOCLDWAIT flag for signal |
---|
276 | dnl =========================================================================== |
---|
277 | AC_MSG_CHECKING(for SA_NOCLDWAIT flag) |
---|
278 | AC_TRY_COMPILE([#include <signal.h>], |
---|
279 | [ struct sigaction sga ; |
---|
280 | sga.sa_flags = SA_NOCLDWAIT ;],[result=yes],[result=no]) |
---|
281 | if test $result = yes ; then |
---|
282 | AC_MSG_RESULT(found) |
---|
283 | AC_DEFINE(HAVE_SA_NOCLDWAIT) |
---|
284 | else |
---|
285 | AC_MSG_RESULT(not found) |
---|
286 | fi |
---|
287 | |
---|
288 | dnl =========================================================================== |
---|
289 | dnl Now check for the various type |
---|
290 | dnl =========================================================================== |
---|
291 | |
---|
292 | AC_CHECK_SIZEOF(long long) |
---|
293 | if test $ac_cv_sizeof_long_long = 8; then |
---|
294 | AC_DEFINE(my64_t,long long) |
---|
295 | else |
---|
296 | AC_MSG_ERROR(long long type is not 64 bits long... Aborting) |
---|
297 | fi |
---|
298 | |
---|
299 | AC_CHECK_SIZEOF(off_t) |
---|
300 | if test $ac_cv_sizeof_off_t = 8; then |
---|
301 | AC_DEFINE(STANDART_FILE_CALL) |
---|
302 | else |
---|
303 | AC_CHECK_SIZEOF(off64_t) |
---|
304 | if test $ac_cv_sizeof_off64_t = 0; then |
---|
305 | OLDCFLAGS="$CFLAGS" |
---|
306 | CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" |
---|
307 | unset ac_cv_sizeof_off64_t |
---|
308 | unset ac_cv_type_off64_t |
---|
309 | AC_CHECK_SIZEOF(off64_t) |
---|
310 | if test $ac_cv_sizeof_off64_t = 0; then |
---|
311 | CFLAGS="$OLDCFLAGS" |
---|
312 | AC_DEFINE(STANDART_FILE_CALL) |
---|
313 | else |
---|
314 | AC_MSG_CHECKING(for structure stat64) |
---|
315 | AC_TRY_COMPILE([#include <sys/stat.h>], |
---|
316 | [ struct stat64 statbuf ;],[result=yes],[result=no]) |
---|
317 | if test $result = yes ; then |
---|
318 | AC_MSG_RESULT(found) |
---|
319 | AC_CHECK_FUNC(open64,result=yes,result=no) |
---|
320 | if test $result = no ; then |
---|
321 | AC_MSG_ERROR(open64 funtion not found) |
---|
322 | fi |
---|
323 | AC_CHECK_FUNC(stat64,result=yes,result=no) |
---|
324 | if test $result = no ; then |
---|
325 | AC_MSG_ERROR(stat64 funtion not found) |
---|
326 | fi |
---|
327 | AC_CHECK_FUNC(lseek64,result=yes,result=no) |
---|
328 | if test $result = no ; then |
---|
329 | AC_MSG_ERROR(lseek64 funtion not found) |
---|
330 | fi |
---|
331 | AC_CHECK_FUNC(readdir64,result=yes,result=no) |
---|
332 | if test $result = no ; then |
---|
333 | AC_DEFINE(STANDART_READDIR_CALL) |
---|
334 | fi |
---|
335 | else |
---|
336 | AC_MSG_RESULT(not found) |
---|
337 | CFLAGS="$OLDCFLAGS" |
---|
338 | AC_DEFINE(STANDART_FILE_CALL) |
---|
339 | fi |
---|
340 | fi |
---|
341 | else |
---|
342 | AC_MSG_CHECKING(for structure stat64) |
---|
343 | AC_TRY_COMPILE([#include <sys/stat.h>], |
---|
344 | [ struct stat64 statbuf ;],[result=yes],[result=no]) |
---|
345 | if test $result = yes ; then |
---|
346 | AC_MSG_RESULT(found) |
---|
347 | AC_CHECK_FUNC(open64,result=yes,result=no) |
---|
348 | if test $result = no ; then |
---|
349 | AC_MSG_ERROR(open64 funtion not found) |
---|
350 | fi |
---|
351 | AC_CHECK_FUNC(stat64,result=yes,result=no) |
---|
352 | if test $result = no ; then |
---|
353 | AC_MSG_ERROR(stat64 funtion not found) |
---|
354 | fi |
---|
355 | AC_CHECK_FUNC(lseek64,result=yes,result=no) |
---|
356 | if test $result = no ; then |
---|
357 | AC_MSG_ERROR(lseek64 funtion not found) |
---|
358 | fi |
---|
359 | AC_CHECK_FUNC(readdir64,result=yes,result=no) |
---|
360 | if test $result = no ; then |
---|
361 | AC_DEFINE(STANDART_READDIR_CALL) |
---|
362 | fi |
---|
363 | else |
---|
364 | AC_MSG_RESULT(not found) |
---|
365 | OLDCFLAGS="$CFLAGS" |
---|
366 | CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" |
---|
367 | AC_MSG_CHECKING(for structure stat64) |
---|
368 | AC_TRY_COMPILE([#include <sys/stat.h>], |
---|
369 | [ struct stat64 statbuf ;],[result=yes],[result=no]) |
---|
370 | if test $result = yes ; then |
---|
371 | AC_MSG_RESULT(found) |
---|
372 | AC_CHECK_FUNC(open64,result=yes,result=no) |
---|
373 | if test $result = no ; then |
---|
374 | AC_MSG_ERROR(open64 funtion not found) |
---|
375 | fi |
---|
376 | AC_CHECK_FUNC(stat64,result=yes,result=no) |
---|
377 | if test $result = no ; then |
---|
378 | AC_MSG_ERROR(stat64 funtion not found) |
---|
379 | fi |
---|
380 | AC_CHECK_FUNC(lseek64,result=yes,result=no) |
---|
381 | if test $result = no ; then |
---|
382 | AC_MSG_ERROR(lseek64 funtion not found) |
---|
383 | fi |
---|
384 | AC_CHECK_FUNC(readdir64,result=yes,result=no) |
---|
385 | if test $result = no ; then |
---|
386 | AC_DEFINE(STANDART_READDIR_CALL) |
---|
387 | fi |
---|
388 | else |
---|
389 | AC_MSG_RESULT(not found) |
---|
390 | CFLAGS="$OLDCFLAGS" |
---|
391 | AC_DEFINE(STANDART_FILE_CALL) |
---|
392 | fi |
---|
393 | fi |
---|
394 | fi |
---|
395 | fi |
---|
396 | |
---|
397 | dnl =========================================================================== |
---|
398 | dnl Now how to print a long long |
---|
399 | dnl =========================================================================== |
---|
400 | |
---|
401 | AC_MSG_CHECKING(how to printf a long long) |
---|
402 | AC_TRY_RUN([#include <stdio.h> |
---|
403 | int main(argc,argv) |
---|
404 | int argc; |
---|
405 | char **argv ; |
---|
406 | { |
---|
407 | char t[10] ; |
---|
408 | sprintf(t,"%lld",(long long) 1) ; |
---|
409 | if(!strcmp(t,"1")) return 0; |
---|
410 | return 1; |
---|
411 | }],[ result="lld" |
---|
412 | AC_DEFINE_UNQUOTED(LONG_LONG_FORMAT, "$result") |
---|
413 | AC_MSG_RESULT(using %lld)], |
---|
414 | [ result="no" ], [ result="no" ]) |
---|
415 | if test $result = "no" ; then |
---|
416 | AC_TRY_RUN([#include <stdio.h> |
---|
417 | int main(argc,argv) |
---|
418 | int argc; |
---|
419 | char **argv ; |
---|
420 | { |
---|
421 | char t[10] ; |
---|
422 | sprintf(t,"%ld",(long long) 1) ; |
---|
423 | if(!strcmp(t,"1")) return 0; |
---|
424 | return 1; |
---|
425 | }],[ result="ld"], [ result="d" ], [ result="d" ]) |
---|
426 | AC_DEFINE_UNQUOTED(LONG_LONG_FORMAT, "$result") |
---|
427 | AC_MSG_RESULT(using %$result) |
---|
428 | fi |
---|
429 | |
---|
430 | dnl =========================================================================== |
---|
431 | dnl Now check big endian or not |
---|
432 | dnl =========================================================================== |
---|
433 | |
---|
434 | AC_C_BIGENDIAN |
---|
435 | |
---|
436 | AC_CHECK_FUNCS([ntohll bswap_64]) |
---|
437 | |
---|
438 | case $host in |
---|
439 | *hpux10.20*) |
---|
440 | CFLAGS="$CFLAGS -Aa +e -D_HPUX_SOURCE" |
---|
441 | ;; |
---|
442 | *solaris2.*) |
---|
443 | CFLAGS="$CFLAGS -Aa -DSUNOS" |
---|
444 | ;; |
---|
445 | *irix*) |
---|
446 | CFLAGS="$CFLAGS -DIRIX" |
---|
447 | ;; |
---|
448 | *osf4*) |
---|
449 | CFLAGS="$CFLAGS -DOSF1" |
---|
450 | ;; |
---|
451 | *linux*) |
---|
452 | ;; |
---|
453 | *aix4.3.2* | *aix4.3.3*) |
---|
454 | ;; |
---|
455 | *darwin*) |
---|
456 | CFLAGS="$CFLAGS -DDARWIN" |
---|
457 | ;; |
---|
458 | |
---|
459 | esac |
---|
460 | |
---|
461 | CPPFLAGS="-I../includes -I./ $CPPFLAGS" |
---|
462 | |
---|
463 | dnl =========================================================================== |
---|
464 | dnl Now check for the authentication module used |
---|
465 | dnl =========================================================================== |
---|
466 | dnl |
---|
467 | AC_ARG_WITH([gsi],[ |
---|
468 | --with-gsi Enable GSI authentication module: automatic search in $GLOBUS_LOCATION or "/opt/globus" |
---|
469 | --with-gsi=DIR Enable GSI authentication module: search GSI libs in DIR/lib and GSI includes in DIR/include/FLAVOR if defined with with-globus-flavor, gcc32dbg else |
---|
470 | --without-gsi Disable GSI authentication module (DEFAULT)]) |
---|
471 | AC_ARG_WITH([globus-flavor],[ |
---|
472 | --with-globus-flavor=FLAVOR search GSI libs in include/FLAVOR, gcc32dbg if not defined]) |
---|
473 | |
---|
474 | if test "$enable_authentication" = "certificates" ; then |
---|
475 | |
---|
476 | with_gfw="../gfw" |
---|
477 | (cd $with_gfw; ./configure -q) |
---|
478 | CPPFLAGS="$CPPFLAGS -I$with_gfw" |
---|
479 | GFWLIB="$with_gfw/libgfw.a" |
---|
480 | dnl CERTOBJS="$CERTOBJS $with_gfw/gfw-misc.o $with_gfw/gfw_init.o $with_gfw/gfw_accept.o $with_gfw/gfw_acquire.o" |
---|
481 | |
---|
482 | if test "$with_gsi" = "" ; then |
---|
483 | if test "$GLOBUS_LOCATION" = "" ; then |
---|
484 | with_gsi="/opt/globus" |
---|
485 | else |
---|
486 | with_gsi="$GLOBUS_LOCATION" |
---|
487 | fi |
---|
488 | fi |
---|
489 | |
---|
490 | if test "$with_globus_flavor" != "" ; then |
---|
491 | GSI_FLAVOR="$with_globus_flavor" |
---|
492 | else |
---|
493 | GSI_FLAVOR="gcc32dbg" |
---|
494 | fi |
---|
495 | |
---|
496 | AC_MSG_CHECKING(Globus toolkit version) |
---|
497 | OLDLDFLAGS=$LDFLAGS |
---|
498 | LDFLAGS="$LDFLAGS -L$with_gsi/lib" |
---|
499 | ls $with_gsi/lib/libglobus_ssl_utils* > /dev/null 2>&1 |
---|
500 | if test $? -eq 0 ; then |
---|
501 | AC_MSG_RESULT(2.0) |
---|
502 | AC_CHECK_LIB([globus_gssapi_gsi_$GSI_FLAVOR],[gss_init_sec_context],[result=yes],[result=no],[-lglobus_ssl_utils_$GSI_FLAVOR -lssl_$GSI_FLAVOR -lcrypto_$GSI_FLAVOR]) |
---|
503 | if test $result = no ; then |
---|
504 | GSI_FLAVOR="vendorcc32dbg" |
---|
505 | AC_CHECK_LIB([globus_gssapi_gsi_$GSI_FLAVOR],[gss_init_sec_context],[result=yes],[AC_MSG_ERROR(Cannot find GSI)],[-lglobus_ssl_utils_$GSI_FLAVOR -lssl_$GSI_FLAVOR -lcrypto_$GSI_FLAVOR]) |
---|
506 | fi |
---|
507 | LDFLAGS=$OLDLDFLAGS |
---|
508 | LIBS="$LIBS $with_gsi/lib/libglobus_gssapi_gsi_$GSI_FLAVOR.a $with_gsi/lib/libglobus_ssl_utils_$GSI_FLAVOR.a $with_gsi/lib/libssl_$GSI_FLAVOR.a $with_gsi/lib/libcrypto_$GSI_FLAVOR.a" |
---|
509 | else |
---|
510 | AC_MSG_RESULT(>=2.2) |
---|
511 | AC_CHECK_LIB([globus_gssapi_gsi_$GSI_FLAVOR],[gss_init_sec_context],[result=yes],[result=no],[-lglobus_gsi_proxy_core_$GSI_FLAVOR -lglobus_gsi_credential_$GSI_FLAVOR -lglobus_gsi_callback_$GSI_FLAVOR -lglobus_oldgaa_$GSI_FLAVOR -lglobus_gsi_sysconfig_$GSI_FLAVOR -lglobus_gsi_cert_utils_$GSI_FLAVOR -lglobus_openssl_$GSI_FLAVOR -lglobus_openssl_error_$GSI_FLAVOR -lglobus_proxy_ssl_$GSI_FLAVOR -lglobus_common_$GSI_FLAVOR -lssl_$GSI_FLAVOR -lcrypto_$GSI_FLAVOR]) |
---|
512 | if test $result = no ; then |
---|
513 | GSI_FLAVOR="vendorcc32dbg" |
---|
514 | AC_CHECK_LIB([globus_gssapi_gsi_$GSI_FLAVOR],[gss_init_sec_context],[result=yes],[result=no],[-lglobus_gsi_proxy_core_$GSI_FLAVOR -lglobus_gsi_credential_$GSI_FLAVOR -lglobus_gsi_callback_$GSI_FLAVOR -lglobus_oldgaa_$GSI_FLAVOR -lglobus_gsi_sysconfig_$GSI_FLAVOR -lglobus_gsi_cert_utils_$GSI_FLAVOR -lglobus_openssl_$GSI_FLAVOR -lglobus_openssl_error_$GSI_FLAVOR -lglobus_proxy_ssl_$GSI_FLAVOR -lglobus_common_$GSI_FLAVOR -lssl_$GSI_FLAVOR -lcrypto_$GSI_FLAVOR]) |
---|
515 | fi |
---|
516 | LDFLAGS=$OLDLDFLAGS |
---|
517 | LIBS="$LIBS $with_gsi/lib/libglobus_gssapi_gsi_$GSI_FLAVOR.a $with_gsi/lib/libglobus_gsi_proxy_core_$GSI_FLAVOR.a $with_gsi/lib/libglobus_gsi_credential_$GSI_FLAVOR.a $with_gsi/lib/libglobus_gsi_callback_$GSI_FLAVOR.a $with_gsi/lib/libglobus_oldgaa_$GSI_FLAVOR.a $with_gsi/lib/libglobus_gsi_sysconfig_$GSI_FLAVOR.a $with_gsi/lib/libglobus_gsi_cert_utils_$GSI_FLAVOR.a $with_gsi/lib/libglobus_openssl_$GSI_FLAVOR.a $with_gsi/lib/libglobus_openssl_error_$GSI_FLAVOR.a $with_gsi/lib/libglobus_proxy_ssl_$GSI_FLAVOR.a $with_gsi/lib/libglobus_common_$GSI_FLAVOR.a $with_gsi/lib/libssl_$GSI_FLAVOR.a $with_gsi/lib/libcrypto_$GSI_FLAVOR.a" |
---|
518 | if test "$GSI_FLAVOR" = "gcc32dbg" ; then |
---|
519 | case $host in |
---|
520 | *solaris2.*) |
---|
521 | GCCLIB=`gcc --print-libgcc-file-name` |
---|
522 | LIBS="$LIBS $GCCLIB" |
---|
523 | ;; |
---|
524 | esac |
---|
525 | fi |
---|
526 | fi |
---|
527 | |
---|
528 | CPPFLAGS="$CPPFLAGS -I$with_gsi/include/$GSI_FLAVOR" |
---|
529 | |
---|
530 | dnl define WITH_SSL as this external library is provided with Globus |
---|
531 | AC_DEFINE(WITH_SSL) |
---|
532 | AC_DEFINE(CERTIFICATE_AUTH) |
---|
533 | CERTOBJS="bbftp_cert.o $CERTOBJS" |
---|
534 | else |
---|
535 | if test "$enable_authentication" = "private" ; then |
---|
536 | if test "$with_ssl" != "no" ; then |
---|
537 | PRIVOBJS="$PRIVOBJS bbftp_private.o bbftp_private_user.o" |
---|
538 | AC_DEFINE(PRIVATE_AUTH) |
---|
539 | else |
---|
540 | AC_MSG_ERROR(The private mode needs OpenSSL) |
---|
541 | fi |
---|
542 | fi |
---|
543 | fi |
---|
544 | |
---|
545 | |
---|
546 | dnl =========================================================================== |
---|
547 | dnl Now check how to enter the password |
---|
548 | dnl =========================================================================== |
---|
549 | |
---|
550 | AC_ARG_WITH([afs],[ |
---|
551 | --with-afs Enable AFS interface: automatic search |
---|
552 | --with-afs=DIR Enable AFS interface: search AFS libs in DIR/lib |
---|
553 | --without-afs Disable AFS (DEFAULT)], |
---|
554 | [result=yes],[result=no]) |
---|
555 | if test $result = yes && test "$with_afs" != "no" ; then |
---|
556 | if test "$with_afs" = "yes" ; then |
---|
557 | with_afs="/usr/afsws" |
---|
558 | fi |
---|
559 | dnl Check function ka_UserReadPassword |
---|
560 | LDFLAGS="$LDFLAGS -L$with_afs/lib -L$with_afs/lib/afs" |
---|
561 | LIBS="$LIBS -lkauth -lprot -lubik -lauth -lcom_err -lrxkad -lcmd -lsys -lrx -llwp -ldes -laudit" |
---|
562 | case $host in |
---|
563 | *hpux10.20*) |
---|
564 | LDFLAGS="$LDFLAGS -L$with_afs/export/lib" |
---|
565 | LIBS="$LIBS -lBSD $with_afs/lib/afs/util.a" |
---|
566 | ;; |
---|
567 | *solaris2.*) |
---|
568 | LIBS="-z muldefs $LIBS -lresolv -lnsl $with_afs/lib/afs/util.a" |
---|
569 | ;; |
---|
570 | *irix*) |
---|
571 | ;; |
---|
572 | *osf4*) |
---|
573 | LDFLAGS="$LDFLAGS -L$with_afs/export/lib" |
---|
574 | LIBS="$LIBS $with_afs/lib/afs/util.a" |
---|
575 | ;; |
---|
576 | *osf5*) |
---|
577 | LDFLAGS="$LDFLAGS -L$with_afs/export/lib" |
---|
578 | LIBS="$LIBS $with_afs/lib/afs/util.a" |
---|
579 | ;; |
---|
580 | *linux*) |
---|
581 | LIBS="-z muldefs $LIBS -lnsl -lresolv $with_afs/lib/afs/util.a" |
---|
582 | ;; |
---|
583 | *aix*) |
---|
584 | LIBS="$LIBS -lnsl -lpthreads -lafsauthent" |
---|
585 | ;; |
---|
586 | esac |
---|
587 | AC_CHECK_FUNC([ka_UserReadPassword],[AC_DEFINE(AFS)],[result=no]) |
---|
588 | if test $result = no ; then |
---|
589 | AC_MSG_ERROR(AFS libs not found) |
---|
590 | fi |
---|
591 | else |
---|
592 | AC_CHECK_FUNC([sysconf],[result=yes],[result=no]) |
---|
593 | if test $result = no ; then |
---|
594 | AC_MSG_ERROR(sysconf function not found) |
---|
595 | fi |
---|
596 | |
---|
597 | AC_CHECK_FUNC([getpassphrase],[result=yes],[result=no]) |
---|
598 | if test $result = no ; then |
---|
599 | AC_CHECK_FUNC([getpass],[result=yes],[result=no]) |
---|
600 | if test $result = no ; then |
---|
601 | AC_MSG_ERROR(getpass function not found) |
---|
602 | fi |
---|
603 | else |
---|
604 | AC_DEFINE(USE_GETPASSPHRASE) |
---|
605 | fi |
---|
606 | fi |
---|
607 | |
---|
608 | dnl =========================================================================== |
---|
609 | dnl Now check for the additional libraries |
---|
610 | dnl =========================================================================== |
---|
611 | |
---|
612 | dnl =========================================================================== |
---|
613 | dnl Now check for RFIO |
---|
614 | dnl =========================================================================== |
---|
615 | |
---|
616 | AC_ARG_WITH([rfio],[ |
---|
617 | --with-rfio Enable RFIO interface: automatic search (DEFAULT) in /usr/local |
---|
618 | --with-rfio=DIR Enable RFIO interface: search libshift in DIR/lib and .h in DIR/include |
---|
619 | --without-rfio Disable RFIO interface], |
---|
620 | [result=yes],[result=no]) |
---|
621 | if test $result = no ; then |
---|
622 | with_rfio="yes" |
---|
623 | fi |
---|
624 | if test "$with_rfio" != "no" ; then |
---|
625 | if test "$with_rfio" = "yes" ; then |
---|
626 | CCIN2P3_CHECK_RFIO([RFIOOBJS="bbftp_retr_rfio.o bbftp_store_rfio.o"],[AC_MSG_WARN(RFIO not installed)]) |
---|
627 | else |
---|
628 | CCIN2P3_CHECK_RFIO([RFIOOBJS="bbftp_retr_rfio.o bbftp_store_rfio.o"],[AC_MSG_WARN(RFIO not installed)],[$with_rfio]) |
---|
629 | fi |
---|
630 | fi |
---|
631 | |
---|
632 | dnl =========================================================================== |
---|
633 | dnl Include OpenSSL as encrypting library if needed |
---|
634 | dnl Openssl is not necessary as it is provided with Globus |
---|
635 | dnl =========================================================================== |
---|
636 | dnl |
---|
637 | AC_ARG_ENABLE([authentication],[ |
---|
638 | --enable-authentication=certificates Enable the certificates authentication module |
---|
639 | --enable-authentication=private Use a private authentication module ONLY |
---|
640 | --disable-authentication Use ssh and password modules ONLY (DEFAULT)]) |
---|
641 | if test "$enable_authentication" != "certificates" ; then |
---|
642 | AC_ARG_WITH([ssl],[ |
---|
643 | --with-ssl Enable encoding: automatic search (DEFAULT) |
---|
644 | --with-ssl=DIR Enable encoding: search OpenSSL lib in DIR/lib and .h in DIR/include/openssl |
---|
645 | --without-ssl Disable encoding], |
---|
646 | [result=yes],[result=no]) |
---|
647 | if test $result = no ; then |
---|
648 | with_ssl="yes" |
---|
649 | fi |
---|
650 | if test "$with_ssl" != "no" ; then |
---|
651 | if test "$with_ssl" = "yes" ; then |
---|
652 | AC_CHECK_LIB([crypto],[RSA_private_decrypt],[result=yes],[AC_MSG_WARN(libcrypto not found: encryption not enabled)]) |
---|
653 | if test $result = yes ; then |
---|
654 | LIBS="$LIBS -lcrypto" |
---|
655 | fi |
---|
656 | else |
---|
657 | AC_CHECK_FILE([$with_ssl/lib/libcrypto.a],[result=yes],[AC_MSG_ERROR(libcrypto.a not found in $with_ssl/lib)]) |
---|
658 | LIBS="$LIBS $with_ssl/lib/libcrypto.a" |
---|
659 | CPPFLAGS="$CPPFLAGS -I$with_ssl/include" |
---|
660 | fi |
---|
661 | if test $result = yes ; then |
---|
662 | AC_CHECK_HEADERS([openssl/rsa.h],[AC_DEFINE(WITH_SSL)],[AC_MSG_ERROR(openssl/rsa.h not found in $INCLUDE)]) |
---|
663 | fi |
---|
664 | # Some crypto require -ldl... |
---|
665 | AC_SEARCH_LIBS([dlopen], [dl]) |
---|
666 | fi |
---|
667 | fi |
---|
668 | dnl =========================================================================== |
---|
669 | dnl Include GZIP as compression library if needed |
---|
670 | dnl =========================================================================== |
---|
671 | dnl |
---|
672 | AC_ARG_WITH([gzip],[ |
---|
673 | --with-gzip Enable compression: automatic search (DEFAULT) |
---|
674 | --with-gzip=DIR Enable compression: search Zlib libs in DIR/lib and Zlib inc in DIR/include |
---|
675 | --without-gzip Disable compression], |
---|
676 | [result=yes],[result=no]) |
---|
677 | if test $result = no ; then |
---|
678 | with_gzip="yes" |
---|
679 | fi |
---|
680 | if test "$with_gzip" != "no" ; then |
---|
681 | if test "$with_gzip" = "yes" ; then |
---|
682 | AC_CHECK_LIB([z],[compress],[result=yes],[AC_MSG_WARN(zlib not found: compression not enabled)]) |
---|
683 | if test $result = yes ; then |
---|
684 | LIBS="$LIBS -lz" |
---|
685 | fi |
---|
686 | else |
---|
687 | AC_CHECK_FILE([$with_gzip/lib/libz.a],[result=yes],[AC_MSG_ERROR(libz.a not found)]) |
---|
688 | LIBS="$LIBS $with_gzip/lib/libz.a" |
---|
689 | CPPFLAGS="$CPPFLAGS -I$with_gzip/include" |
---|
690 | fi |
---|
691 | if test $result = yes ; then |
---|
692 | AC_CHECK_HEADERS([zlib.h zconf.h],[AC_DEFINE(WITH_GZIP)],[AC_MSG_ERROR(include files not found in $CPPFLAGS)]) |
---|
693 | fi |
---|
694 | fi |
---|
695 | |
---|
696 | AC_SUBST(CERTOBJS) |
---|
697 | AC_SUBST(PRIVOBJS) |
---|
698 | AC_SUBST(RFIOOBJS) |
---|
699 | AC_SUBST(GFWLIB) |
---|
700 | AC_OUTPUT(Makefile) |
---|