Re: Problem building mc on SuSE 6.2



   Date: Tue, 28 Sep 1999 15:51:09 -0500
   From: Miguel de Icaza <miguel@gnu.org>

   > This problem in subshell.c seems to be because the check for grantpt
   > succeeds.  grantpt is found in my libc.so.6 (glibc 2.1).  The fact
   > that it was found cached doesn't really matter; my system hasn't
   > changed since I last built it (and indeed it does exist, so that test
   > is at least in principle correct).
   > 
   > #ifdef HAVE_GRANTPT
   > #   include <stropts.h> /* For I_PUSH			      */
   > #else
   > #   include <grp.h>	/* For the group struct & getgrnam()  */
   > #endif
   > 
   > I'm not sure what the best fix is for this.  Certainly the use of
   > I_PUSH is not conditionalized on HAVE_GRANTPT.  Maybe it should be
   > something like this?
   > 
   > #if defined(HAVE_GRANTPT) && !defined(__osf__) && !defined(linux) && !defined(__linux__)

   No, actually the fix would be to autoconf for stropts.h and if so, use
   the I_PUSH variant.

   Can you submit a fix?

Here goes.  It turns out that there were also problems with statfs
(independent); this patch fixes both problems.

diff -rc xxxxxxx/mc-4.5.39/configure.in mc-4.5.39/configure.in
*** xxxxxxx/mc-4.5.39/configure.in	Thu Sep 23 13:01:07 1999
--- mc-4.5.39/configure.in	Wed Sep 29 21:04:06 1999
***************
*** 222,227 ****
--- 222,232 ----
  AC_CHECK_HEADERS(sys/select.h)
  
  dnl
+ dnl We really want to check for stropts.h
+ dnl
+ AC_CHECK_HEADERS(stropts.h)
+ 
+ dnl
  dnl On SCO and some SVR4, crypt is on libcrypt.a
  dnl         grantpt in  libpt.a
  dnl
diff -rc xxxxxxx/mc-4.5.39/mc-aclocal.m4 mc-4.5.39/mc-aclocal.m4
*** xxxxxxx/mc-4.5.39/mc-aclocal.m4	Thu Sep 23 13:01:07 1999
--- mc-4.5.39/mc-aclocal.m4	Wed Sep 29 22:00:05 1999
***************
*** 775,786 ****
      AC_CHECKING(how to get filesystem space usage)
      space=no
  
!     # Here we'll compromise a little (and perform only the link test)
!     # since it seems there are no variants of the statvfs function.
      if test $space = no; then
        # SVR4
!       AC_CHECK_FUNCS(statvfs)
!       if test $ac_cv_func_statvfs = yes; then
  	space=yes
  	AC_DEFINE(STAT_STATVFS)
        fi
--- 775,795 ----
      AC_CHECKING(how to get filesystem space usage)
      space=no
  
!     # Perform only the link test since it seems there are no variants of the
!     # statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
!     # because that got a false positive on SCO OSR5.  Adding the declaration
!     # of a `struct statvfs' causes this test to fail (as it should) on such
!     # systems.  That system is reported to work fine with STAT_STATFS4 which
!     # is what it gets when this test fails.
      if test $space = no; then
        # SVR4
!       AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
! 		     [AC_TRY_LINK([#include <sys/types.h>
!     #include <sys/statvfs.h>],
! 				  [struct statvfs fsd; statvfs (0, &fsd);],
! 				  fu_cv_sys_stat_statvfs=yes,
! 				  fu_cv_sys_stat_statvfs=no)])
!       if test $fu_cv_sys_stat_statvfs = yes; then
  	space=yes
  	AC_DEFINE(STAT_STATVFS)
        fi
diff -rc xxxxxxx/mc-4.5.39/src/subshell.c mc-4.5.39/src/subshell.c
*** xxxxxxx/mc-4.5.39/src/subshell.c	Thu Sep 23 13:01:20 1999
--- mc-4.5.39/src/subshell.c	Wed Sep 29 21:09:49 1999
***************
*** 62,68 ****
  #   define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
  #endif
  
! #ifdef HAVE_GRANTPT
  #   include <stropts.h> /* For I_PUSH			      */
  #else
  #   include <grp.h>	/* For the group struct & getgrnam()  */
--- 62,68 ----
  #   define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
  #endif
  
! #ifdef HAVE_STROPTS_H
  #   include <stropts.h> /* For I_PUSH			      */
  #else
  #   include <grp.h>	/* For the group struct & getgrnam()  */

-- 
Robert Krawitz <rlk@alum.mit.edu>      http://www.tiac.net/users/rlk/

Tall Clubs International  --  http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail lpf@uunet.uu.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton



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