bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

port of findutils to GNU/FreeBSD


From: Bruno Haible
Subject: port of findutils to GNU/FreeBSD
Date: Mon, 15 Jul 2002 14:33:10 +0200 (CEST)

To make GNU findutils 4.1.7 work on GNU/FreeBSD (i.e. FreeBSD kernel
with glibc2) the following patches are necessary.


1) Update config.guess and config.sub to the newest ones,
   ftp://ftp.gnu.org/pub/gnu/config.


2) The autoconf tests would succeed for both FSTYPE_MNTENT (BSD 4.3 API)
and FSTYPE_STATFS (BSD 4.4 API). The situation on FreeBSD is as follows:
The kernel supports the BSD 4.4 API, and therefore an /etc/mtab does not
exist on FreeBSD anymore. And glibc offers the BSD 4.3 <mntent.h> API.
But it does not make sense to use it, because there is no /etc/mtab.

2002-07-13  Bruno Haible  <address@hidden>

        * configure.in: Prefer the 4.4BSD API to the 4.3BSD API, because the
        latter needs an /etc/mtab, which some 4.4BSD systems don't have.

diff -r -c3 findutils-4.1.7.bak/configure.in findutils-4.1.7/configure.in
*** findutils-4.1.7.bak/configure.in    Sun May 20 23:12:34 2001
--- findutils-4.1.7/configure.in        Sat Jul 13 12:54:40 2002
***************
*** 59,68 ****
  #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS, 1, [Define to use AIX3 
statfs to get filesystem type.]) fstype=AIX)
  fi
  if test $fstype = no; then  
! AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT, 1, [Define to use 
4.3BSD getmntent to get filesystem type.]) fstype=4.3BSD)
  fi
  if test $fstype = no; then  
! AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS, 1, [Define to 
use 4.4BSD and OSF1 statfs to get filesystem type.]) fstype=4.4BSD/OSF1)
  fi
  if test $fstype = no; then  
  AC_TRY_CPP([#include <sys/mount.h>
--- 59,68 ----
  #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS, 1, [Define to use AIX3 
statfs to get filesystem type.]) fstype=AIX)
  fi
  if test $fstype = no; then  
! AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS, 1, [Define to 
use 4.4BSD and OSF1 statfs to get filesystem type.]) fstype=4.4BSD/OSF1)
  fi
  if test $fstype = no; then  
! AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT, 1, [Define to use 
4.3BSD getmntent to get filesystem type.]) fstype=4.3BSD)
  fi
  if test $fstype = no; then  
  AC_TRY_CPP([#include <sys/mount.h>


3) A compilation error in find/fstype.c: FreeBSD does not have the MOUNT_UFS
macro; it doesn't need to because instead it sets the f_fstypename in
'struct statfs' to "ufs". The fix is to not compile the fstype_to_string
function when it is not used.

2002-07-13  Bruno Haible  <address@hidden>

        * find/fstype.c (fstype_to_string): Don't define this function if
        HAVE_F_FSTYPENAME_IN_STATFS is defined.

diff -r -c3 findutils-4.1.7.bak/find/fstype.c findutils-4.1.7/find/fstype.c
*** findutils-4.1.7.bak/find/fstype.c   Sun May 20 22:39:37 2001
--- findutils-4.1.7/find/fstype.c       Sat Jul 13 13:18:57 2002
***************
*** 74,79 ****
--- 74,80 ----
  #include <sys/param.h>                /* NetBSD needs this.  */
  #include <sys/mount.h>
  
+ #ifndef HAVE_F_FSTYPENAME_IN_STATFS
  #ifndef MFSNAMELEN            /* NetBSD defines this.  */
  static char *
  fstype_to_string (t)
***************
*** 126,131 ****
--- 127,133 ----
  #endif /* !INITMOUNTNAMES */
  }
  #endif /* !MFSNAMELEN */
+ #endif /* !HAVE_F_FSTYPENAME_IN_STATFS */
  #endif /* FSTYPE_STATFS */
  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]