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

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

I found the CCIN2P3 autoconf macros in src/bbftp-*/includes, therefore
I've uncommented the tests in configure.in.

Use autoconf -I../includes
to regenerate configure when needed.

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