summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-09-06 12:21:45 +0000
committerjlam <jlam@pkgsrc.org>2003-09-06 12:21:45 +0000
commit7943cdd0f824a6ba674be111e74293ce8a05729a (patch)
tree0efe919910d18e90b91b61e99a6188c92dfd2d0b /pkgtools
parent44ee1a54b6a93fe077cb5b881494546d7dcc71b8 (diff)
downloadpkgsrc-7943cdd0f824a6ba674be111e74293ce8a05729a.tar.gz
Modify autoconf tests so that we'll reliably implement BSD statfs()
using statvfs() on systems that provide it. I'm assuming that the SVR4 statvfs() is a standardized call across systems that have it. This should allow IRIX to build the statfs call into libnbcompat.
Diffstat (limited to 'pkgtools')
-rwxr-xr-xpkgtools/libnbcompat/files/configure84
-rw-r--r--pkgtools/libnbcompat/files/configure.ac21
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in6
3 files changed, 60 insertions, 51 deletions
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure
index d1f4256e532..54a392d280a 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -7601,11 +7601,14 @@ echo "${ECHO_T}$pkg_cv_INT_SL_ADD" >&6
fi
-
pkg_use_nbcompat_statfs=yes
-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
+
+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 $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -7616,7 +7619,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 statfs (); below.
+ which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
@@ -7631,14 +7634,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 statfs ();
+char $ac_func ();
/* 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_statfs) || defined (__stub___statfs)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-char (*f) () = statfs;
+char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
@@ -7647,7 +7650,7 @@ char (*f) () = statfs;
int
main ()
{
-return f != statfs;
+return f != $ac_func;
;
return 0;
}
@@ -7664,24 +7667,31 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_func_statfs=yes
+ eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_func_statfs=no
+eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-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
+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
+
- 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
+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 $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -7692,7 +7702,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 statvfs (); below.
+ which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
@@ -7707,14 +7717,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 statvfs ();
+char $ac_func ();
/* 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_statvfs) || defined (__stub___statvfs)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-char (*f) () = statvfs;
+char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
@@ -7723,7 +7733,7 @@ char (*f) () = statvfs;
int
main ()
{
-return f != statvfs;
+return f != $ac_func;
;
return 0;
}
@@ -7740,34 +7750,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_func_statvfs=yes
+ eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_func_statvfs=no
+eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-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
- :
+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 correctly" >&5
-echo "$as_me: error: statfs can't be implemented correctly" >&2;}
+ { { echo "$as_me:$LINENO: error: statfs can't be implemented" >&5
+echo "$as_me: error: statfs can't be implemented" >&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 ba85ebab24d..219fd7a1f01 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -163,21 +163,14 @@ AC_CHECK_FUNC(sl_init, [
[:] , [AC_LIBOBJ(sl_init)])
])
-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 SVR4 defines a statvfs(2) system call that can be wrapped into the
+dnl BSD statfs(2).
+dnl
pkg_use_nbcompat_statfs=yes
-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
+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)
+ ])
])
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 aa0dc8fa207..8adfad995b5 100644
--- a/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in
@@ -240,6 +240,12 @@
/* 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