diff options
author | grant <grant> | 2003-09-11 11:26:09 +0000 |
---|---|---|
committer | grant <grant> | 2003-09-11 11:26:09 +0000 |
commit | 3b8a81938b9f3914ef7a74f17f495d9b4f9d25dd (patch) | |
tree | 708e41abb6d9f89bb33342cc2a638bf6c9f254bd /pkgtools | |
parent | ed4ae531aaf6f6ecabaac6334567396bd1d544f6 (diff) | |
download | pkgsrc-3b8a81938b9f3914ef7a74f17f495d9b4f9d25dd.tar.gz |
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 (limited to 'pkgtools')
-rwxr-xr-x | pkgtools/libnbcompat/files/configure | 83 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/configure.ac | 21 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in | 6 |
3 files changed, 50 insertions, 60 deletions
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index 5ae56fb1066..c0c858886d5 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -7604,13 +7604,9 @@ fi 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 confdefs.h >>conftest.$ac_ext 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 @@ extern "C" #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 @@ char (*f) () = $ac_func; int main () { -return f != $ac_func; +return f != statfs; ; return 0; } @@ -7669,31 +7665,24 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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 - +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 -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 + 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 confdefs.h >>conftest.$ac_ext 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 @@ extern "C" #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 @@ char (*f) () = $ac_func; int main () { -return f != $ac_func; +return f != statvfs; ; return 0; } @@ -7752,34 +7741,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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 +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" >&5 -echo "$as_me: error: statfs can't be implemented" >&2;} + { { 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 + ;; + *) + pkg_use_nbcompat_statfs=no + ;; + esac fi -done if test $pkg_use_nbcompat_statfs = yes; then diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac index 35b22ff937f..bfec381adbd 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -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_CHECK_FUNC(sl_init, [ [:] , [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 --git a/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in b/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in index cd78beedb05..65938b3bede 100644 --- a/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in +++ b/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in @@ -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 |