source: TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/configure.in @ 773

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/configure.in@983
Revision 773, 27.6 KB checked in by spascoe, 14 years ago (diff)

Initial import of bbftp source

Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(bbftpd.c)
3dnl former bbftpd.h.in was merged with bbftp.h.in
4dnl result include file is bbftpd.h because a lot of source files are using it
5AC_CONFIG_HEADER(bbftpd.h:../includes/bbftp.h.in)
6
7AC_PROG_CC(cc)
8AC_PROG_INSTALL
9AC_CANONICAL_HOST
10
11dnl LIBS=""
12
13AC_CHECK_HEADERS(crypt.h dirent.h errno.h fcntl.h fnmatch.h glob.h\
14                 limits.h netdb.h netinet/in.h netinet/tcp.h pwd.h\
15                 shadow.h signal.h stdio.h\
16                 stdlib.h sys/socket.h sys/stat.h\
17                 sys/vfs.h sys/statvfs.h sys/time.h time.h\
18                 sys/types.h sys/wait.h syslog.h unistd.h\
19                 userpw.h utime.h byteswap.h)
20AC_HEADER_TIME
21
22dnl ===========================================================================
23dnl Check for the socket routine
24dnl ===========================================================================
25
26AC_CHECK_LIB(c,socket,result=yes,result=no)
27if test $result = no ; then
28        AC_CHECK_LIB(xnet,socket,result=yes,result=no)
29        if test $result = yes ; then
30                LIBS="$LIBS -lxnet"
31        else
32                AC_CHECK_LIB(socket,socket,result=yes,result=no)
33                if test $result = yes ; then
34                        LIBS="$LIBS -lsocket"
35                else
36                        AC_MSG_ERROR(socket funtion not found)
37                fi
38        fi
39fi
40
41dnl ===========================================================================
42dnl Check all other routines
43dnl ===========================================================================
44AC_CHECK_FUNC(chdir,result=yes,result=no)
45if test $result = no ; then
46        AC_MSG_ERROR(chdir funtion not found)
47fi
48AC_CHECK_FUNC(fcntl,result=yes,result=no)
49if test $result = no ; then
50        AC_MSG_ERROR(fcntl funtion not found)
51fi
52AC_CHECK_FUNC(fnmatch,result=yes,result=no)
53if test $result = no ; then
54        AC_MSG_ERROR(fnmatch funtion not found)
55fi
56AC_CHECK_FUNC(fork,result=yes,result=no)
57if test $result = no ; then
58        AC_MSG_ERROR(fork funtion not found)
59fi
60AC_CHECK_FUNC(free,result=yes,result=no)
61if test $result = no ; then
62        AC_MSG_ERROR(free funtion not found)
63fi
64AC_CHECK_FUNC(freopen,result=yes,result=no)
65if test $result = no ; then
66        AC_MSG_ERROR(freopen funtion not found)
67fi
68AC_CHECK_FUNC(getcwd,result=yes,result=no)
69if test $result = no ; then
70        AC_MSG_ERROR(getcwd funtion not found)
71fi
72AC_CHECK_FUNC(getopt,result=yes,result=no)
73if test $result = no ; then
74        AC_MSG_ERROR(getopt funtion not found)
75fi
76AC_CHECK_FUNC(getpwnam,result=yes,result=no)
77if test $result = no ; then
78        AC_MSG_ERROR(getpwnam funtion not found)
79fi
80AC_CHECK_FUNC(gettimeofday,result=yes,result=no)
81if test $result = no ; then
82        AC_MSG_ERROR(gettimeofday funtion not found)
83fi
84AC_CHECK_FUNC(glob,result=yes,result=no)
85if test $result = no ; then
86        AC_MSG_ERROR(glob funtion not found)
87fi
88AC_CHECK_FUNC(globfree,result=yes,result=no)
89if test $result = no ; then
90        AC_MSG_ERROR(globfree funtion not found)
91fi
92AC_CHECK_FUNC(kill,result=yes,result=no)
93if test $result = no ; then
94        AC_MSG_ERROR(kill funtion not found)
95fi
96AC_CHECK_FUNC(mkdir,result=yes,result=no)
97if test $result = no ; then
98        AC_MSG_ERROR(mkdir funtion not found)
99fi
100AC_CHECK_FUNC(openlog,result=yes,result=no)
101if test $result = no ; then
102        AC_MSG_ERROR(openlog funtion not found)
103fi
104AC_CHECK_FUNC(opendir,result=yes,result=no)
105if test $result = no ; then
106        AC_MSG_ERROR(opendir funtion not found)
107fi
108AC_CHECK_FUNC(random,result=yes,result=no)
109if test $result = no ; then
110        AC_CHECK_FUNC([rand],[AC_DEFINE(random, rand)],[AC_MSG_ERROR(random, rand funtions not found)])
111fi
112AC_CHECK_FUNC(readdir,result=yes,result=no)
113if test $result = no ; then
114        AC_MSG_ERROR(readdir funtion not found)
115fi
116AC_CHECK_FUNC(read,result=yes,result=no)
117if test $result = no ; then
118        AC_MSG_ERROR(read funtion not found)
119fi
120AC_CHECK_FUNC(select,result=yes,result=no)
121if test $result = no ; then
122        AC_MSG_ERROR(select funtion not found)
123fi
124AC_CHECK_FUNC(setgid,result=yes,result=no)
125if test $result = no ; then
126        AC_MSG_ERROR(setgid funtion not found)
127fi
128AC_CHECK_FUNC(setsid,result=yes,result=no)
129if test $result = no ; then
130        AC_MSG_ERROR(setsid funtion not found)
131fi
132AC_CHECK_FUNC(setuid,result=yes,result=no)
133if test $result = no ; then
134        AC_MSG_ERROR(setuid funtion not found)
135fi
136AC_CHECK_FUNC(sigaction,result=yes,result=no)
137if test $result = no ; then
138        AC_MSG_ERROR(sigaction funtion not found)
139fi
140AC_CHECK_FUNC(sigemptyset,result=yes,result=no)
141if test $result = no ; then
142        AC_MSG_ERROR(sigemptyset funtion not found)
143fi
144AC_CHECK_FUNC(sleep,result=yes,result=no)
145if test $result = no ; then
146        AC_MSG_ERROR(sleep funtion not found)
147fi
148AC_CHECK_FUNC(sprintf,result=yes,result=no)
149if test $result = no ; then
150        AC_MSG_ERROR(sprintf funtion not found)
151fi
152AC_CHECK_FUNC(srandom,result=yes,result=no)
153if test $result = no ; then
154        AC_CHECK_FUNC([srand],[AC_DEFINE(srandom, srand)],[AC_MSG_ERROR(srandom, srand funtions not found)])
155fi
156AC_CHECK_FUNC(strcmp,result=yes,result=no)
157if test $result = no ; then
158        AC_MSG_ERROR(strcmp funtion not found)
159fi
160AC_CHECK_FUNC(strcpy,result=yes,result=no)
161if test $result = no ; then
162        AC_MSG_ERROR(strcpy funtion not found)
163fi
164AC_CHECK_FUNC(strerror,result=yes,result=no)
165if test $result = no ; then
166        AC_MSG_ERROR(strerror funtion not found)
167fi
168AC_CHECK_FUNC(strlen,result=yes,result=no)
169if test $result = no ; then
170        AC_MSG_ERROR(strlen funtion not found)
171fi
172AC_CHECK_FUNC(sysconf,result=yes,result=no)
173if test $result = no ; then
174        AC_MSG_ERROR(sysconf funtion not found)
175fi
176AC_CHECK_FUNC(syslog,result=yes,result=no)
177if test $result = no ; then
178        AC_MSG_ERROR(syslog funtion not found)
179fi
180AC_CHECK_FUNC(unlink,result=yes,result=no)
181if test $result = no ; then
182        AC_MSG_ERROR(unlink funtion not found)
183fi
184AC_CHECK_FUNC(waitpid,result=yes,result=no)
185if test $result = no ; then
186        AC_MSG_ERROR(waitpid funtion not found)
187fi
188
189
190dnl ===========================================================================
191dnl See if we have shadow passwords...
192dnl ============================================================================
193if test $ac_cv_header_shadow_h = yes; then
194        AC_CHECK_LIB(c, getspnam, result=yes, result=no)
195        if test $result = no ; then
196                AC_CHECK_LIB(shadow, getspnam, result=yes, result=no)
197                if test $result = yes ; then
198                        LIBS="$LIBS -lshadow"
199                        if test -f /etc/shadow; then
200                                AC_DEFINE(SHADOW_PASSWORD)
201                        fi
202                fi
203        else
204                if test -f /etc/shadow; then
205                        AC_DEFINE(SHADOW_PASSWORD)
206                fi
207        fi
208fi
209
210dnl ===========================================================================
211dnl See if we have /etc/security/passwd (mainly AIX) ...
212dnl ============================================================================
213if test $ac_cv_header_userpw_h = yes; then
214        AC_CHECK_LIB(c, getuserpw, result=yes, result=no)
215        if test $result = no ; then
216                AC_CHECK_LIB(s, getuserpw, result=yes, result=no)
217                if test $result = yes ; then
218                        if test -d /etc/security; then
219                                LIBS="$LIBS -ls"
220                                AC_DEFINE(HAVE_SECURITY_PASS)
221                        fi
222                fi
223        else
224                if test -d /etc/security; then
225                        AC_DEFINE(HAVE_SECURITY_PASS)
226                fi
227
228        fi
229fi
230
231dnl ===========================================================================
232dnl Now check for the various type
233dnl ===========================================================================
234
235AC_CHECK_SIZEOF(long long)
236if test $ac_cv_sizeof_long_long = 8; then
237        AC_DEFINE(my64_t,long long)
238else
239        AC_MSG_ERROR(long long type is not 64 bits long... Aborting)
240fi
241
242AC_CHECK_FUNCS([ntohll])
243
244AC_CHECK_SIZEOF(off_t)
245if test $ac_cv_sizeof_off_t = 8; then
246    AC_DEFINE(STANDART_FILE_CALL)
247else
248    AC_CHECK_SIZEOF(off64_t)
249    if test $ac_cv_sizeof_off64_t = 0; then
250        OLDCFLAGS="$CFLAGS"
251        CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
252        unset ac_cv_sizeof_off64_t
253        unset ac_cv_type_off64_t
254        AC_CHECK_SIZEOF(off64_t)
255        if test $ac_cv_sizeof_off64_t = 0; then
256            CFLAGS="$OLDCFLAGS"
257            AC_DEFINE(STANDART_FILE_CALL)
258        else
259            AC_MSG_CHECKING(for structure stat64)
260            AC_TRY_COMPILE([#include <sys/stat.h>],
261            [   struct  stat64  statbuf ;],[result=yes],[result=no])
262            if test $result = yes ; then
263                    AC_MSG_RESULT(found)
264                AC_CHECK_FUNC(open64,result=yes,result=no)
265                if test $result = no ; then
266                        AC_MSG_ERROR(open64 funtion not found)
267                fi
268                AC_CHECK_FUNC(stat64,result=yes,result=no)
269                if test $result = no ; then
270                        AC_MSG_ERROR(stat64 funtion not found)
271                fi
272                AC_CHECK_FUNC(lseek64,result=yes,result=no)
273                if test $result = no ; then
274                        AC_MSG_ERROR(lseek64 funtion not found)
275                fi
276                AC_CHECK_FUNC(readdir64,result=yes,result=no)
277                if test $result = no ; then
278                        AC_DEFINE(STANDART_READDIR_CALL)
279                fi
280            else
281                AC_MSG_RESULT(not found)
282                CFLAGS="$OLDCFLAGS"               
283                AC_DEFINE(STANDART_FILE_CALL)
284            fi
285        fi
286    else
287        AC_MSG_CHECKING(for structure stat64)
288        AC_TRY_COMPILE([#include <sys/stat.h>],
289        [       struct  stat64  statbuf ;],[result=yes],[result=no])
290        if test $result = yes ; then
291            AC_MSG_RESULT(found)
292            AC_CHECK_FUNC(open64,result=yes,result=no)
293            if test $result = no ; then
294                    AC_MSG_ERROR(open64 funtion not found)
295            fi
296            AC_CHECK_FUNC(stat64,result=yes,result=no)
297            if test $result = no ; then
298                    AC_MSG_ERROR(stat64 funtion not found)
299            fi
300            AC_CHECK_FUNC(lseek64,result=yes,result=no)
301            if test $result = no ; then
302                    AC_MSG_ERROR(lseek64 funtion not found)
303            fi
304            AC_CHECK_FUNC(readdir64,result=yes,result=no)
305            if test $result = no ; then
306                    AC_DEFINE(STANDART_READDIR_CALL)
307            fi
308        else
309            AC_MSG_RESULT(not found)
310            OLDCFLAGS="$CFLAGS"
311            CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
312            AC_MSG_CHECKING(for structure stat64)
313            AC_TRY_COMPILE([#include <sys/stat.h>],
314            [   struct  stat64  statbuf ;],[result=yes],[result=no])
315            if test $result = yes ; then
316                    AC_MSG_RESULT(found)
317                AC_CHECK_FUNC(open64,result=yes,result=no)
318                if test $result = no ; then
319                        AC_MSG_ERROR(open64 funtion not found)
320                fi
321                AC_CHECK_FUNC(stat64,result=yes,result=no)
322                if test $result = no ; then
323                        AC_MSG_ERROR(stat64 funtion not found)
324                fi
325                AC_CHECK_FUNC(lseek64,result=yes,result=no)
326                if test $result = no ; then
327                        AC_MSG_ERROR(lseek64 funtion not found)
328                fi
329                AC_CHECK_FUNC(readdir64,result=yes,result=no)
330                if test $result = no ; then
331                        AC_DEFINE(STANDART_READDIR_CALL)
332                fi
333            else
334                AC_MSG_RESULT(not found)
335                CFLAGS="$OLDCFLAGS"               
336                AC_DEFINE(STANDART_FILE_CALL)
337            fi
338        fi   
339    fi
340fi
341
342dnl ===========================================================================
343dnl Now how to print a long long
344dnl ===========================================================================
345
346AC_MSG_CHECKING(how to printf a long long)
347AC_TRY_RUN([#include <stdio.h>
348int main() {
349        char t[10] ;
350        sprintf(t,"%lld",(long long) 1) ;
351        if(!strcmp(t,"1")) return 0;
352        return 1;
353        }],[ result="lld"
354AC_DEFINE_UNQUOTED(LONG_LONG_FORMAT, "$result")
355AC_MSG_RESULT(using %lld)],
356[ result="no" ], [ result="no" ])
357if test $result = "no" ; then
358        AC_TRY_RUN([#include <stdio.h>
359        int main() {
360        char t[10] ;
361        sprintf(t,"%ld",(long long) 1) ;
362        if(!strcmp(t,"1")) return 0;
363    return 1;
364        }],[ result="ld"], [ result="d" ], [ result="d" ])
365        AC_DEFINE_UNQUOTED(LONG_LONG_FORMAT, "$result")
366        AC_MSG_RESULT(using %$result)
367fi
368
369
370AC_CHECK_MEMBERS([struct stat.st_blksize])
371AC_STRUCT_ST_BLOCKS
372AC_CHECK_MEMBERS([struct stat.st_rdev])
373
374dnl ===========================================================================
375dnl Does the socklen_t type exists?
376dnl ===========================================================================
377AC_CHECK_TYPES([socklen_t])
378
379dnl ===========================================================================
380dnl Now check how to do the 'df' operation
381dnl ===========================================================================
382
383AC_CHECK_FUNCS([statvfs64 statvfs statfs],[break])
384if test "$ac_cv_func_statvfs64" = "yes" || test "$ac_cv_func_statvfs" = "yes" ; then
385    # AC_MSG_CHECKING(for structure statvfs64)
386    AC_TRY_COMPILE([#include <sys/statvfs.h>],
387                   [struct statvfs64 statvfsbuf ;],
388                   [AC_DEFINE([HAVE_STRUCT_STATVFS64])],
389                   [AC_DEFINE([HAVE_STRUCT_STATVFS])])
390else
391  if test "$ac_cv_func_statfs" = "yes" ; then
392    AC_TRY_COMPILE([#include <sys/vfs.h>],
393                   [struct statfs statfsbuf ;],
394                   [AC_DEFINE([HAVE_STRUCT_STATFS])])
395  fi
396fi
397
398dnl ===========================================================================
399dnl Now check big endian or not
400dnl ===========================================================================
401
402AC_C_BIGENDIAN
403
404case $host in
405    *hpux10.20*)
406        CFLAGS="-Aa +e -D_HPUX_SOURCE $CFLAGS"
407        ;;
408    *solaris2.*)
409        CFLAGS="-Aa -DSUNOS $CFLAGS"
410        ;;
411    *irix*)
412                CFLAGS="-DIRIX $CFLAGS"
413        ;;
414    *osf4*)
415            CFLAGS="-DOSF1 $CFLAGS"
416        ;;
417    *linux*)
418                ;;
419    *aix4.3.2* | *aix4.3.3*)
420                ;;
421    *darwin*)
422      CFLAGS="$CFLAGS -DDARWIN"
423      ;;
424esac
425
426CPPFLAGS="-I../includes -I./ $CPPFLAGS"
427
428dnl ===========================================================================
429dnl Now check for AFS and PAM
430dnl ===========================================================================
431
432AC_ARG_WITH([afs],[ 
433  --with-afs              Enable AFS interface: automatic search
434  --with-afs=DIR          Enable AFS interface: search AFS libs in DIR/lib
435  --without-afs           Disable AFS (DEFAULT)],
436[result=yes],[result=no])
437if test $result = yes && test "$with_afs" != "no" ; then
438    if test "$with_afs" = "yes" ; then
439        with_afs="/usr/afsws"
440    fi
441    dnl Check function ka_UserReadPassword
442    LDFLAGS="$LDFLAGS -L$with_afs/lib -L$with_afs/lib/afs"
443    LIBS="$LIBS -lkauth -lprot -lubik -lauth -lcom_err -lrxkad -lcmd -lsys -lrx -llwp -ldes -laudit"
444    case $host in
445        *hpux10.20*)
446            LDFLAGS="$LDFLAGS -L$with_afs/export/lib"
447            LIBS="$LIBS -lBSD $with_afs/lib/afs/util.a"
448            ;;
449        *solaris2.*)
450            LIBS="-z muldefs $LIBS -lresolv -lnsl $with_afs/lib/afs/util.a"
451            ;;
452        *irix*)
453            ;;
454        *osf4*)
455            LDFLAGS="$LDFLAGS -L$with_afs/export/lib"
456            LIBS="$LIBS $with_afs/lib/afs/util.a"
457            ;;
458        *osf5*)
459            LDFLAGS="$LDFLAGS -L$with_afs/export/lib"
460            LIBS="$LIBS $with_afs/lib/afs/util.a"
461            ;;
462        *linux*)
463            LIBS="-z muldefs $LIBS -lnsl -lresolv $with_afs/lib/afs/util.a"
464                    ;;
465        *aix*)
466            LIBS="$LIBS -lnsl -lpthreads -lafsauthent"
467            ;;
468    esac
469    AC_CHECK_FUNC([ka_UserAuthenticate],[AC_DEFINE(AFS)],[result=no])
470    if test $result = no ; then
471        AC_MSG_ERROR(AFS libs not found)
472    fi
473fi
474AC_ARG_WITH([pam],[ 
475  --with-pam              Enable PAM
476  --without-pam           Disable PAM (DEFAULT)],
477[result=yes],[result=no])
478if test $result = yes && test "$with_pam" != "no" ; then
479    AC_CHECK_HEADERS(security/pam_appl.h)
480    if test $ac_cv_header_security_pam_appl_h = yes; then
481        AC_DEFINE(USE_PAM)
482        LIBS="$LIBS -lpam"
483        AC_SEARCH_LIBS([dlopen], [dl])
484    else
485        AC_MSG_ERROR(Could not find)
486    fi
487else
488    dnl crypt should be provided with AFS
489    dnl if not AFS and not PAM, must include libcrypt
490    AC_CHECK_FUNC([crypt],[result=yes],[result=no])
491    if test $result = no ; then
492        LIBS="$LIBS -lcrypt"
493        unset ac_cv_func_crypt
494        AC_CHECK_FUNC([crypt],,[AC_MSG_ERROR(Cannot find function crypt)])
495    fi
496fi
497dnl ===========================================================================
498dnl Now check for the authentication module used
499dnl ===========================================================================
500AC_ARG_WITH([gsi],[ 
501  --with-gsi              Enable GSI authentication module: automatic search in $GLOBUS_LOCATION or "/opt/globus"
502  --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
503  --without-gsi           Disable GSI authentication module (DEFAULT)])
504AC_ARG_WITH([globus-flavor],[
505  --with-globus-flavor=FLAVOR   search GSI libs in include/FLAVOR, gcc32dbg if not defined])
506
507dnl
508if test "$enable_authentication" = "certificates" ; then
509
510    with_gfw="../gfw"
511    (cd $with_gfw; ./configure -q)
512    CPPFLAGS="$CPPFLAGS -I$with_gfw"
513    GFWLIB="$with_gfw/libgfw.a"
514dnl    CERTOBJS="$CERTOBJS $with_gfw/gfw-misc.o $with_gfw/gfw_init.o $with_gfw/gfw_accept.o $with_gfw/gfw_acquire.o"
515
516    if test "$with_gsi" = "" ; then
517        if test "$GLOBUS_LOCATION" = "" ; then
518            with_gsi="/opt/globus"
519        else
520            with_gsi="$GLOBUS_LOCATION"
521        fi
522    fi
523
524    if test "$with_globus_flavor" != "" ; then
525      GSI_FLAVOR="$with_globus_flavor"
526    else
527      GSI_FLAVOR="gcc32dbg"
528    fi
529
530    AC_MSG_CHECKING(Globus toolkit version)
531    OLDLDFLAGS=$LDFLAGS
532    LDFLAGS="$LDFLAGS -L$with_gsi/lib"
533    ls $with_gsi/lib/libglobus_ssl_utils* > /dev/null 2>&1
534    if test $? -eq 0 ; then
535        AC_MSG_RESULT(2.0)
536        AC_CHECK_LIB([globus_gssapi_gsi_$GSI_FLAVOR],[gss_accept_sec_context],[result=yes],[result=no],[-lglobus_ssl_utils_$GSI_FLAVOR -lssl_$GSI_FLAVOR -lcrypto_$GSI_FLAVOR])
537        if test $result = no ; then
538            GSI_FLAVOR="vendorcc32dbg"
539            AC_CHECK_LIB([globus_gssapi_gsi_$GSI_FLAVOR],[gss_accept_sec_context],[result=yes],[AC_MSG_ERROR(Cannot find GSI)],[-lglobus_ssl_utils_$GSI_FLAVOR -lssl_$GSI_FLAVOR -lcrypto_$GSI_FLAVOR])
540        fi
541        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"
542    else
543        AC_MSG_RESULT(>=2.2)
544        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 -lglobus_gss_assist_$GSI_FLAVOR])
545        if test $result = no ; then
546            GSI_FLAVOR="vendorcc32dbg"
547            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 -lglobus_gss_assist_$GSI_FLAVOR])
548        fi
549        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 $with_gsi/lib/libglobus_gss_assist_$GSI_FLAVOR.a"
550    fi
551
552    if test "$GSI_FLAVOR" = "gcc32dbg" ; then
553      case $host in
554        *solaris2.*)
555            GCCLIB=`gcc --print-libgcc-file-name`
556            LIBS="$LIBS $GCCLIB"
557            ;;
558      esac
559    fi
560    AC_CHECK_LIB([globus_gss_assist_$GSI_FLAVOR],[globus_gss_assist_gridmap],[LIBS="$LIBS $with_gsi/lib/libglobus_gss_assist_$GSI_FLAVOR.a"],[AC_MSG_ERROR(Cannot find globus gss-assist)])
561
562    LDFLAGS=$OLDLDFLAGS
563    CPPFLAGS="$CPPFLAGS -I$with_gsi/include/$GSI_FLAVOR"
564
565    dnl define WITH_SSL as this external library is provided with Globus
566    AC_DEFINE(WITH_SSL)
567    AC_DEFINE(CERTIFICATE_AUTH)
568    CERTOBJS="$CERTOBJS bbftpd_cert.o"
569    AC_ARG_WITH([x509-user-cert],[ 
570        --with-x509-user-cert             Location of the certificate (DEFAULT=/etc/grid-security/hostcert.pem)],
571        [result=yes],[result=no])
572    if test $result = no || test "$with_x509_user_cert" = "no" || test "$with_x509_user_cert" = "yes" ; then
573        with_x509_user_cert="/etc/grid-security/hostcert.pem"
574    fi
575    AC_ARG_WITH([x509-user-key],[ 
576        --with-x509-user-key             Location of the private key (DEFAULT=/etc/grid-security/hostkey.pem)],
577        [result=yes],[result=no])
578    if test $result = no || test "$with_x509_user_key" = "no" || test "$with_x509_user_key" = "yes" ; then
579        with_x509_user_key="/etc/grid-security/hostkey.pem"
580    fi
581    AC_ARG_WITH([x509-cert-dir],[ 
582        --with-x509-cert-dir             Location of the certificates (DEFAULT=/etc/grid-security/certificates)],
583        [result=yes],[result=no])
584    if test $result = no || test "$with_x509_cert_dir" = "no" || test "$with_x509_cert_dir" = "yes" ; then
585        with_x509_cert_dir="/etc/grid-security/certificates"
586    fi
587    AC_ARG_WITH([gridmap],[ 
588        --with-gridmap             Location of the gridmap file (DEFAULT=/etc/grid-security/grid-mapfile)],
589        [result=yes],[result=no])
590    if test $result = no || test "$with_gridmap" = "no" || test "$with_gridmap" = "yes" ; then
591        with_gridmap="/etc/grid-security/grid-mapfile"
592    fi
593else
594    if test "$enable_authentication" = "private" ; then
595        PRIVOBJS="$PRIVOBJS bbftpd_private.o bbftpd_private_user.o"
596        AC_DEFINE(PRIVATE_AUTH)
597    fi
598fi
599
600dnl ===========================================================================
601dnl Now check for HPSS
602dnl ===========================================================================
603
604#AC_ARG_WITH([hpss],[ 
605#  --with-hpss             Enable HPSS Interface: automatic search (DEFAULT) in /usr/local
606#  --with-hpss=DIR         Enable HPSS interface: search libhpss in DIR/lib
607#  --without-hpss          Disable HPSS interface],
608#[result=yes],[result=no])
609#if test $result = no ; then
610#    with_hpss="no"
611#fi
612#if test "$with_hpss" != "no" ; then
613#    if test "$with_hpss" = "yes" ; then
614#        $with_hpss="/usr/local"
615#    fi
616#    AC_CHECK_FILE([$with_hpss/lib/libhpss.a],[LIBS="$LIBS $with_hpss/lib/libhpss.a"],[AC_MSG_ERROR(libhpss.a not found in $with_hpss/lib)])
617#fi
618
619
620dnl ===========================================================================
621dnl Now check for RFIO
622dnl ===========================================================================
623
624AC_ARG_WITH([rfio],[ 
625  --with-rfio             Enable RFIO interface: automatic search (DEFAULT) in /usr/local
626  --with-rfio=DIR         Enable RFIO interface: search libshift in DIR/lib and .h in DIR/include
627  --without-rfio          Disable RFIO interface],
628[result=yes],[result=no])
629if test $result = no ; then
630    with_rfio="yes"
631fi
632if test "$with_rfio" != "no" ; then
633    if test "$with_rfio" = "yes" ; then
634       CCIN2P3_CHECK_RFIO([RFIOOBJS="bbftpd_retr_rfio.o bbftpd_store_rfio.o sendafilerfio.o"],[AC_MSG_WARN(RFIO not installed)])
635    else
636       CCIN2P3_CHECK_RFIO([RFIOOBJS="bbftpd_retr_rfio.o bbftpd_store_rfio.o sendafilerfio.o"],[AC_MSG_WARN(RFIO not installed)],[$with_rfio])
637    fi
638fi
639
640dnl ===========================================================================
641dnl Now check for the additional librairies
642dnl ===========================================================================
643dnl Openssl is not necessary as it is provided with Globus
644AC_ARG_ENABLE([authentication],[ 
645  --enable-authentication=certificates      Enable the certificates authentication module
646  --enable-authentication=private           Use a private authentication module ONLY
647  --disable-authentication                  Use ssh and password modules ONLY (DEFAULT)])
648if test "$enable_authentication" != "certificates" ; then
649    AC_ARG_WITH([ssl],[ 
650  --with-ssl              Enable encoding: automatic search (DEFAULT)
651  --with-ssl=DIR          Enable encoding: search OpenSSL lib in DIR/lib and .h in DIR/include/openssl],
652[result=yes],[result=no])
653    if test $result = no ; then
654        with_ssl="yes"
655    fi
656    if test "$with_ssl" != "no" ; then
657        if test "$with_ssl" = "yes" ; then
658            AC_CHECK_LIB([crypto],[RSA_private_decrypt],[result=yes],[AC_MSG_ERROR(libcrypto not found)])
659            LIBS="$LIBS -lcrypto"
660        else
661            AC_CHECK_FILE([$with_ssl/lib/libcrypto.a],[result=yes],[AC_MSG_ERROR(libcrypto.a not found in $with_ssl/lib)])
662            LIBS="$LIBS $with_ssl/lib/libcrypto.a"
663            CPPFLAGS="$CPPFLAGS -I$with_ssl/include"
664        fi
665        if test $result = yes ; then
666            AC_CHECK_HEADERS([openssl/rsa.h],[AC_DEFINE(WITH_SSL)],[AC_MSG_ERROR(openssl/rsa.h not found in $INCLUDE)])
667        fi
668        # Some crypto require -ldl...
669        AC_SEARCH_LIBS([dlopen], [dl])
670    else
671        AC_MSG_ERROR(BBFTPD must be compiled with SSL)
672    fi
673fi
674
675dnl ===========================================================================
676dnl Include GZIP as compression library if needed
677dnl ===========================================================================
678dnl
679AC_ARG_WITH([gzip],[ 
680  --with-gzip             Enable compression: automatic search (DEFAULT)
681  --with-gzip=DIR         Enable compression: search Zlib libs in DIR/lib and Zlib inc in DIR/include
682  --without-gzip          Disable compression],
683[result=yes],[result=no])
684if test $result = no ; then
685    with_gzip="yes"
686fi
687if test "$with_gzip" != "no" ; then
688    if test "$with_gzip" = "yes" ; then
689        AC_CHECK_LIB([z],[compress],[result=yes],[AC_MSG_WARN(zlib not found: compression not enabled)])
690        if test $result = yes ; then
691            LIBS="$LIBS -lz"
692        fi
693    else
694        AC_CHECK_FILE([$with_gzip/lib/libz.a],[result=yes],[AC_MSG_ERROR(libz.a not found)])
695        LIBS="$LIBS $with_gzip/lib/libz.a"
696        CPPFLAGS="$CPPFLAGS -I$with_gzip/include"
697    fi
698    if test $result = yes ; then
699        AC_CHECK_HEADERS([zlib.h zconf.h],[AC_DEFINE(WITH_GZIP)],[AC_MSG_ERROR(include files not found in $CPPFLAGS)])
700    fi
701fi
702
703dnl =============================================================================
704dnl Other options
705dnl =============================================================================
706
707AC_ARG_WITH([ephemeral-ports-range],[
708  --with-ephemeral-ports-range=MIN:MAX     Defines a range for ephemeral ports (MIN-MAX) in passive mode
709  --without-ephemeral-ports-range          Use the default range for ephemeral ports in passive mode (DEFAULT)],
710[result=yes],[result=no])
711if test $result = yes ; then
712    if test "$with_ephemeral_ports_range" != "no" ; then
713                AC_MSG_CHECKING([Port range])
714        if test "$with_ephemeral_ports_range" = "yes" ; then
715                    AC_MSG_ERROR([You must provide a range when using --with-ephemeral-ports-range option])
716        else
717                AC_TRY_RUN([
718                    int main() {
719                                        int min_port, max_port;
720                        char *range="$with_ephemeral_ports_range" ;
721                        sscanf(range,"%d:%d",&min_port, &max_port) ;
722                        return (min_port > max_port) ;
723                }],[ AC_MSG_RESULT([OK])], [ AC_MSG_ERROR([$with_ephemeral_ports_range is not a valid port range])])
724                AC_DEFINE_UNQUOTED(PORT_RANGE, "$with_ephemeral_ports_range")
725                fi
726    fi
727fi
728
729AC_SUBST(CERTOBJS)
730AC_SUBST(GFWLIB)
731AC_SUBST(PRIVOBJS)
732AC_SUBST(RFIOOBJS)
733AC_SUBST(with_x509_user_cert)
734AC_SUBST(with_x509_user_key)
735AC_SUBST(with_x509_cert_dir)
736AC_SUBST(with_gridmap)
737AC_OUTPUT(Makefile startup)
Note: See TracBrowser for help on using the repository browser.