23 |
AC_CHECK_HEADER(locale.h, AC_DEFINE(HAVE_LOCALE_H)) |
AC_CHECK_HEADER(locale.h, AC_DEFINE(HAVE_LOCALE_H)) |
24 |
AC_CHECK_HEADER(langinfo.h, AC_DEFINE(HAVE_LANGINFO_H)) |
AC_CHECK_HEADER(langinfo.h, AC_DEFINE(HAVE_LANGINFO_H)) |
25 |
AC_CHECK_HEADER(iconv.h, AC_DEFINE(HAVE_ICONV_H)) |
AC_CHECK_HEADER(iconv.h, AC_DEFINE(HAVE_ICONV_H)) |
26 |
|
AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H)) |
27 |
|
|
28 |
rpath="" |
rpath="" |
29 |
|
|
391 |
TYPE_SOCKLEN_T |
TYPE_SOCKLEN_T |
392 |
|
|
393 |
# |
# |
394 |
|
# statfs stuff |
395 |
|
# |
396 |
|
AC_CHECK_HEADERS(sys/vfs.h) |
397 |
|
AC_CHECK_HEADERS(sys/statvfs.h) |
398 |
|
AC_CHECK_HEADERS(sys/statfs.h) |
399 |
|
AC_CHECK_HEADERS(sys/param.h) |
400 |
|
AC_CHECK_HEADERS(sys/mount.h) |
401 |
|
|
402 |
|
################################################# |
403 |
|
# these tests are taken from the GNU fileutils package |
404 |
|
AC_CHECKING(how to get filesystem space usage) |
405 |
|
space=no |
406 |
|
|
407 |
|
# Test for statvfs64. |
408 |
|
if test $space = no; then |
409 |
|
# SVR4 |
410 |
|
AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64, |
411 |
|
[AC_TRY_RUN([ |
412 |
|
#if defined(HAVE_UNISTD_H) |
413 |
|
#include <unistd.h> |
414 |
|
#endif |
415 |
|
#include <sys/types.h> |
416 |
|
#include <sys/statvfs.h> |
417 |
|
main () |
418 |
|
{ |
419 |
|
struct statvfs64 fsd; |
420 |
|
exit (statvfs64 (".", &fsd)); |
421 |
|
}], |
422 |
|
fu_cv_sys_stat_statvfs64=yes, |
423 |
|
fu_cv_sys_stat_statvfs64=no, |
424 |
|
fu_cv_sys_stat_statvfs64=cross)]) |
425 |
|
if test $fu_cv_sys_stat_statvfs64 = yes; then |
426 |
|
space=yes |
427 |
|
AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available]) |
428 |
|
fi |
429 |
|
fi |
430 |
|
|
431 |
|
# Perform only the link test since it seems there are no variants of the |
432 |
|
# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) |
433 |
|
# because that got a false positive on SCO OSR5. Adding the declaration |
434 |
|
# of a `struct statvfs' causes this test to fail (as it should) on such |
435 |
|
# systems. That system is reported to work fine with STAT_STATFS4 which |
436 |
|
# is what it gets when this test fails. |
437 |
|
if test $space = no; then |
438 |
|
# SVR4 |
439 |
|
AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs, |
440 |
|
[AC_TRY_LINK([#include <sys/types.h> |
441 |
|
#include <sys/statvfs.h>], |
442 |
|
[struct statvfs fsd; statvfs (0, &fsd);], |
443 |
|
fu_cv_sys_stat_statvfs=yes, |
444 |
|
fu_cv_sys_stat_statvfs=no)]) |
445 |
|
if test $fu_cv_sys_stat_statvfs = yes; then |
446 |
|
space=yes |
447 |
|
AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available]) |
448 |
|
fi |
449 |
|
fi |
450 |
|
|
451 |
|
if test $space = no; then |
452 |
|
# DEC Alpha running OSF/1 |
453 |
|
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) |
454 |
|
AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1, |
455 |
|
[AC_TRY_RUN([ |
456 |
|
#include <sys/param.h> |
457 |
|
#include <sys/types.h> |
458 |
|
#include <sys/mount.h> |
459 |
|
main () |
460 |
|
{ |
461 |
|
struct statfs fsd; |
462 |
|
fsd.f_fsize = 0; |
463 |
|
exit (statfs (".", &fsd, sizeof (struct statfs))); |
464 |
|
}], |
465 |
|
fu_cv_sys_stat_statfs3_osf1=yes, |
466 |
|
fu_cv_sys_stat_statfs3_osf1=no, |
467 |
|
fu_cv_sys_stat_statfs3_osf1=no)]) |
468 |
|
|
469 |
|
|
470 |
|
#C_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1) |
471 |
|
if test $fu_cv_sys_stat_statfs3_osf1 = yes; then |
472 |
|
space=yes |
473 |
|
AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments]) |
474 |
|
fi |
475 |
|
fi |
476 |
|
|
477 |
|
if test $space = no; then |
478 |
|
# AIX |
479 |
|
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl |
480 |
|
member (AIX, 4.3BSD)]) |
481 |
|
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize, |
482 |
|
[AC_TRY_RUN([ |
483 |
|
#ifdef HAVE_SYS_PARAM_H |
484 |
|
#include <sys/param.h> |
485 |
|
#endif |
486 |
|
#ifdef HAVE_SYS_MOUNT_H |
487 |
|
#include <sys/mount.h> |
488 |
|
#endif |
489 |
|
#ifdef HAVE_SYS_VFS_H |
490 |
|
#include <sys/vfs.h> |
491 |
|
#endif |
492 |
|
main () |
493 |
|
{ |
494 |
|
struct statfs fsd; |
495 |
|
fsd.f_bsize = 0; |
496 |
|
exit (statfs (".", &fsd)); |
497 |
|
}], |
498 |
|
fu_cv_sys_stat_statfs2_bsize=yes, |
499 |
|
fu_cv_sys_stat_statfs2_bsize=no, |
500 |
|
fu_cv_sys_stat_statfs2_bsize=no)]) |
501 |
|
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize) |
502 |
|
if test $fu_cv_sys_stat_statfs2_bsize = yes; then |
503 |
|
space=yes |
504 |
|
AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property]) |
505 |
|
fi |
506 |
|
fi |
507 |
|
|
508 |
|
if test $space = no; then |
509 |
|
# SVR3 |
510 |
|
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) |
511 |
|
AC_CACHE_VAL(fu_cv_sys_stat_statfs4, |
512 |
|
[AC_TRY_RUN([#include <sys/types.h> |
513 |
|
#include <sys/statfs.h> |
514 |
|
main () |
515 |
|
{ |
516 |
|
struct statfs fsd; |
517 |
|
exit (statfs (".", &fsd, sizeof fsd, 0)); |
518 |
|
}], |
519 |
|
fu_cv_sys_stat_statfs4=yes, |
520 |
|
fu_cv_sys_stat_statfs4=no, |
521 |
|
fu_cv_sys_stat_statfs4=no)]) |
522 |
|
AC_MSG_RESULT($fu_cv_sys_stat_statfs4) |
523 |
|
if test $fu_cv_sys_stat_statfs4 = yes; then |
524 |
|
space=yes |
525 |
|
AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments]) |
526 |
|
fi |
527 |
|
fi |
528 |
|
|
529 |
|
if test $space = no; then |
530 |
|
# 4.4BSD and NetBSD |
531 |
|
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl |
532 |
|
member (4.4BSD and NetBSD)]) |
533 |
|
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, |
534 |
|
[AC_TRY_RUN([#include <sys/types.h> |
535 |
|
#ifdef HAVE_SYS_PARAM_H |
536 |
|
#include <sys/param.h> |
537 |
|
#endif |
538 |
|
#ifdef HAVE_SYS_MOUNT_H |
539 |
|
#include <sys/mount.h> |
540 |
|
#endif |
541 |
|
main () |
542 |
|
{ |
543 |
|
struct statfs fsd; |
544 |
|
fsd.f_fsize = 0; |
545 |
|
exit (statfs (".", &fsd)); |
546 |
|
}], |
547 |
|
fu_cv_sys_stat_statfs2_fsize=yes, |
548 |
|
fu_cv_sys_stat_statfs2_fsize=no, |
549 |
|
fu_cv_sys_stat_statfs2_fsize=no)]) |
550 |
|
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) |
551 |
|
if test $fu_cv_sys_stat_statfs2_fsize = yes; then |
552 |
|
space=yes |
553 |
|
AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize]) |
554 |
|
fi |
555 |
|
fi |
556 |
|
|
557 |
|
if test $space = no; then |
558 |
|
# Ultrix |
559 |
|
AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) |
560 |
|
AC_CACHE_VAL(fu_cv_sys_stat_fs_data, |
561 |
|
[AC_TRY_RUN([#include <sys/types.h> |
562 |
|
#ifdef HAVE_SYS_PARAM_H |
563 |
|
#include <sys/param.h> |
564 |
|
#endif |
565 |
|
#ifdef HAVE_SYS_MOUNT_H |
566 |
|
#include <sys/mount.h> |
567 |
|
#endif |
568 |
|
#ifdef HAVE_SYS_FS_TYPES_H |
569 |
|
#include <sys/fs_types.h> |
570 |
|
#endif |
571 |
|
main () |
572 |
|
{ |
573 |
|
struct fs_data fsd; |
574 |
|
/* Ultrix's statfs returns 1 for success, |
575 |
|
0 for not mounted, -1 for failure. */ |
576 |
|
exit (statfs (".", &fsd) != 1); |
577 |
|
}], |
578 |
|
fu_cv_sys_stat_fs_data=yes, |
579 |
|
fu_cv_sys_stat_fs_data=no, |
580 |
|
fu_cv_sys_stat_fs_data=no)]) |
581 |
|
AC_MSG_RESULT($fu_cv_sys_stat_fs_data) |
582 |
|
if test $fu_cv_sys_stat_fs_data = yes; then |
583 |
|
space=yes |
584 |
|
AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available]) |
585 |
|
fi |
586 |
|
fi |
587 |
|
|
588 |
|
statxfs_includes="\ |
589 |
|
$ac_includes_default |
590 |
|
#if HAVE_SYS_STATVFS_H |
591 |
|
# include <sys/statvfs.h> |
592 |
|
#endif |
593 |
|
#if HAVE_SYS_VFS_H |
594 |
|
# include <sys/vfs.h> |
595 |
|
#endif |
596 |
|
#if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H |
597 |
|
# if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H |
598 |
|
/* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */ |
599 |
|
# include <sys/param.h> |
600 |
|
# include <sys/mount.h> |
601 |
|
# elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H |
602 |
|
/* Ultrix 4.4 needs these for the declaration of struct statfs. */ |
603 |
|
# include <netinet/in.h> |
604 |
|
# include <nfs/nfs_clnt.h> |
605 |
|
# include <nfs/vfs.h> |
606 |
|
# endif |
607 |
|
#endif |
608 |
|
" |
609 |
|
|
610 |
|
AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes]) |
611 |
|
AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes]) |
612 |
|
AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes]) |
613 |
|
AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes]) |
614 |
|
|
615 |
|
|
616 |
|
# mntent |
617 |
|
# |
618 |
|
AC_CHECK_HEADER(mntent.h, AC_DEFINE(HAVE_MNTENT_H)) |
619 |
|
AC_CHECK_FUNCS(setmntent) |
620 |
|
|
621 |
|
# |
622 |
# IPv6 |
# IPv6 |
623 |
# |
# |
624 |
AC_ARG_WITH(ipv6, |
AC_ARG_WITH(ipv6, |