pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/libnbcompat/files back out revision 1.22 whic...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9fcec0f4e1f1
branches:  trunk
changeset: 461129:9fcec0f4e1f1
user:      grant <grant%pkgsrc.org@localhost>
date:      Thu Sep 11 11:26:09 2003 +0000

description:
back out revision 1.22 which broke statfs() on Linux and FreeBSD
systems which have both statfs() and statvfs().

while it would be nice to have an OS-independent way of testing
whether to use our statfs() implementation, in reality it is much more
reliable to only use it where required.

diffstat:

 pkgtools/libnbcompat/files/configure              |  95 ++++++++++------------
 pkgtools/libnbcompat/files/configure.ac           |  21 +++-
 pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in |   6 -
 3 files changed, 56 insertions(+), 66 deletions(-)

diffs (241 lines):

diff -r a672a63925ab -r 9fcec0f4e1f1 pkgtools/libnbcompat/files/configure
--- a/pkgtools/libnbcompat/files/configure      Thu Sep 11 11:14:47 2003 +0000
+++ b/pkgtools/libnbcompat/files/configure      Thu Sep 11 11:26:09 2003 +0000
@@ -7604,13 +7604,9 @@
 
 
 pkg_use_nbcompat_statfs=yes
-
-for ac_func in statvfs
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for statfs" >&5
+echo $ECHO_N "checking for statfs... $ECHO_C" >&6
+if test "${ac_cv_func_statfs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7621,7 +7617,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    which can conflict with char statfs (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 #ifdef __STDC__
@@ -7636,14 +7632,14 @@
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
+char statfs ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_statfs) || defined (__stub___statfs)
 choke me
 #else
-char (*f) () = $ac_func;
+char (*f) () = statfs;
 #endif
 #ifdef __cplusplus
 }
@@ -7652,7 +7648,7 @@
 int
 main ()
 {
-return f != $ac_func;
+return f != statfs;
   ;
   return 0;
 }
@@ -7669,31 +7665,24 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_statfs=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+ac_cv_func_statfs=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- pkg_use_nbcompat_statfs=yes
-else
-
-
-for ac_func in statfs
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: result: $ac_cv_func_statfs" >&5
+echo "${ECHO_T}$ac_cv_func_statfs" >&6
+if test $ac_cv_func_statfs = yes; then
+
+       case $host_os in
+       sunos*|solaris*)
+               echo "$as_me:$LINENO: checking for statvfs" >&5
+echo $ECHO_N "checking for statvfs... $ECHO_C" >&6
+if test "${ac_cv_func_statvfs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7704,7 +7693,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    which can conflict with char statvfs (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 #ifdef __STDC__
@@ -7719,14 +7708,14 @@
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
+char statvfs ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_statvfs) || defined (__stub___statvfs)
 choke me
 #else
-char (*f) () = $ac_func;
+char (*f) () = statvfs;
 #endif
 #ifdef __cplusplus
 }
@@ -7735,7 +7724,7 @@
 int
 main ()
 {
-return f != $ac_func;
+return f != statvfs;
   ;
   return 0;
 }
@@ -7752,34 +7741,34 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_statvfs=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+ac_cv_func_statvfs=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- pkg_use_nbcompat_statfs=no
-else
-
-               { { echo "$as_me:$LINENO: error: statfs can't be implemented" >&5
-echo "$as_me: error: statfs can't be implemented" >&2;}
+echo "$as_me:$LINENO: result: $ac_cv_func_statvfs" >&5
+echo "${ECHO_T}$ac_cv_func_statvfs" >&6
+if test $ac_cv_func_statvfs = yes; then
+  :
+else
+
+                       { { echo "$as_me:$LINENO: error: statfs can't be implemented correctly" >&5
+echo "$as_me: error: statfs can't be implemented correctly" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-done
-
-
-fi
-done
+
+               ;;
+       *)
+               pkg_use_nbcompat_statfs=no
+               ;;
+       esac
+
+fi
 
 
 if test $pkg_use_nbcompat_statfs = yes; then
diff -r a672a63925ab -r 9fcec0f4e1f1 pkgtools/libnbcompat/files/configure.ac
--- a/pkgtools/libnbcompat/files/configure.ac   Thu Sep 11 11:14:47 2003 +0000
+++ b/pkgtools/libnbcompat/files/configure.ac   Thu Sep 11 11:26:09 2003 +0000
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.25 2003/09/06 23:05:41 grant Exp $
+dnl $NetBSD: configure.ac,v 1.26 2003/09/11 11:26:10 grant Exp $
 
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
@@ -166,14 +166,21 @@
                [:] , [AC_LIBOBJ(sl_init)])
 ])
 
-dnl SVR4 defines a statvfs(2) system call that can be wrapped into the
-dnl BSD statfs(2).
+dnl Solaris 2.7 and 2.8 have statfs(2), but it is deprecated, and has a
+dnl different interface from NetBSD's statfs.
 dnl
 pkg_use_nbcompat_statfs=yes
-AC_CHECK_FUNCS([statvfs], [pkg_use_nbcompat_statfs=yes], [
-       AC_CHECK_FUNCS([statfs], [pkg_use_nbcompat_statfs=no], [
-               AC_MSG_ERROR(statfs can't be implemented)
-       ])
+AC_CHECK_FUNC(statfs, [
+       case $host_os in
+       sunos*|solaris*)
+               AC_CHECK_FUNC(statvfs, [:], [
+                       AC_MSG_ERROR(statfs can't be implemented correctly)
+               ])
+               ;;
+       *)
+               pkg_use_nbcompat_statfs=no
+               ;;
+       esac
 ])
 
 if test $pkg_use_nbcompat_statfs = yes; then
diff -r a672a63925ab -r 9fcec0f4e1f1 pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in
--- a/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in Thu Sep 11 11:14:47 2003 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in Thu Sep 11 11:26:09 2003 +0000
@@ -240,12 +240,6 @@
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
-/* Define to 1 if you have the `statfs' function. */
-#undef HAVE_STATFS
-
-/* Define to 1 if you have the `statvfs' function. */
-#undef HAVE_STATVFS
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 



Home | Main Index | Thread Index | Old Index