summaryrefslogtreecommitdiff
path: root/pkgtools/libnbcompat
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2004-03-11 13:28:45 +0000
committergrant <grant@pkgsrc.org>2004-03-11 13:28:45 +0000
commit361bc94452dad5d41d99329e31640f494811406f (patch)
tree70f2016753c86d522ebf3c5cb1693dba3b6bf540 /pkgtools/libnbcompat
parent84c610dfde8b63ad409038564b77faf508ab3e17 (diff)
downloadpkgsrc-361bc94452dad5d41d99329e31640f494811406f.tar.gz
catch up with bootstrap-pkgsrc changes.
- check for existence of fsid_t type, and typedef it if missing - check for existence of struct statvfs.f_basetype field - if <sys/mkdev.h> is included and makedev() is missing, try to use mkdev() - add replacement library file for utimes() by wrappering utime()
Diffstat (limited to 'pkgtools/libnbcompat')
-rwxr-xr-xpkgtools/libnbcompat/files/configure189
-rw-r--r--pkgtools/libnbcompat/files/configure.ac15
-rw-r--r--pkgtools/libnbcompat/files/nbcompat.h9
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/config.h.in9
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/statfs.h6
-rw-r--r--pkgtools/libnbcompat/files/statfs.c6
6 files changed, 228 insertions, 6 deletions
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure
index 4a37305ce4b..cb11c7f3a20 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -5491,6 +5491,80 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking for fsid_t" >&5
+echo $ECHO_N "checking for fsid_t... $ECHO_C" >&6
+if test "${ac_cv_type_fsid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+
+int
+main ()
+{
+if ((fsid_t *) 0)
+ return 0;
+if (sizeof (fsid_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_fsid_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_fsid_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_fsid_t" >&5
+echo "${ECHO_T}$ac_cv_type_fsid_t" >&6
+if test $ac_cv_type_fsid_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FSID_T 1
+_ACEOF
+
+
+fi
+
echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
if test "${ac_cv_c_bigendian+set}" = set; then
@@ -6888,10 +6962,11 @@ done
+
for ac_func in err fgetln fparseln fseeko getenv inet_ntop \
inet_pton isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \
poll setprogname snprintf strdup strerror strlcat strlcpy \
- strmode strptime strsep strtoll timegm usleep
+ strmode strptime strsep strtoll timegm usleep utimes
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -9109,6 +9184,118 @@ _ACEOF
*) LIBOBJS="$LIBOBJS statfs.$ac_objext" ;;
esac
+ echo "$as_me:$LINENO: checking for struct statvfs.f_basetype" >&5
+echo $ECHO_N "checking for struct statvfs.f_basetype... $ECHO_C" >&6
+if test "${ac_cv_member_struct_statvfs_f_basetype+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/statvfs.h>
+
+int
+main ()
+{
+static struct statvfs ac_aggr;
+if (ac_aggr.f_basetype)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_statvfs_f_basetype=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/statvfs.h>
+
+int
+main ()
+{
+static struct statvfs ac_aggr;
+if (sizeof ac_aggr.f_basetype)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_statvfs_f_basetype=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_statvfs_f_basetype=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_statvfs_f_basetype" >&5
+echo "${ECHO_T}$ac_cv_member_struct_statvfs_f_basetype" >&6
+if test $ac_cv_member_struct_statvfs_f_basetype = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATVFS_F_BASETYPE 1
+_ACEOF
+
+
+fi
+
fi
if test $ac_cv_type_long_long = yes; then
diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac
index 308359a1c92..0d5cf823295 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.36 2004/02/14 04:47:13 simonb Exp $
+dnl $NetBSD: configure.ac,v 1.37 2004/03/11 13:28:45 grant Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
@@ -114,6 +114,16 @@ AC_CHECK_TYPES([long long, int8_t, int16_t, int32_t, int64_t, u_int8_t, u_int16_
#if HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
+AC_CHECK_TYPES([fsid_t],[],[],
+[#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif])
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(off_t, 0)
@@ -125,7 +135,7 @@ AC_FUNC_VPRINTF
AC_REPLACE_FUNCS([err fgetln fparseln fseeko getenv inet_ntop \
inet_pton isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \
poll setprogname snprintf strdup strerror strlcat strlcpy \
- strmode strptime strsep strtoll timegm usleep])
+ strmode strptime strsep strtoll timegm usleep utimes])
AC_CHECK_FUNCS([setgroupent setgrent setpassent setpwent])
AC_CHECK_FUNCS([bcopy bzero memset memcpy setlocale])
@@ -219,6 +229,7 @@ if test $pkg_use_nbcompat_statfs = yes; then
Define to 1 if the `statfs' function is built into the library.
])
AC_LIBOBJ(statfs)
+ AC_CHECK_MEMBERS([struct statvfs.f_basetype],[],[],[#include <sys/statvfs.h>])
fi
if test $ac_cv_type_long_long = yes; then
diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h
index 45c32a19016..ad77c2e4275 100644
--- a/pkgtools/libnbcompat/files/nbcompat.h
+++ b/pkgtools/libnbcompat/files/nbcompat.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nbcompat.h,v 1.31 2004/01/14 08:58:41 grant Exp $ */
+/* $NetBSD: nbcompat.h,v 1.32 2004/03/11 13:28:45 grant Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -233,6 +233,9 @@ struct { \
#if HAVE_SYS_MKDEV_H
# include <sys/mkdev.h>
+# if !defined(makedev) && defined(mkdev)
+# define makedev mkdev
+# endif
#endif
#if HAVE_SYS_MOUNT_H
@@ -600,4 +603,8 @@ void *setmode(const char *);
mode_t getmode(const void *, mode_t);
#endif
+#ifndef HAVE_UTIMES
+int utimes(const char *, const struct timeval *);
+#endif
+
#endif /* _NBCOMPAT_H */
diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in
index 1b332a08d26..a37a1ee6336 100644
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in
@@ -49,6 +49,9 @@
/* Define to 1 if you have the `fseeko' function. */
#undef HAVE_FSEEKO
+/* Define to 1 if the system has the type `fsid_t'. */
+#undef HAVE_FSID_T
+
/* Define to 1 if you have the <fts.h> header file. */
#undef HAVE_FTS_H
@@ -279,6 +282,9 @@
/* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL
+/* Define to 1 if `f_basetype' is member of `struct statvfs'. */
+#undef HAVE_STRUCT_STATVFS_F_BASETYPE
+
/* Define to 1 if you have the `strunvis' function. */
#undef HAVE_STRUNVIS
@@ -387,6 +393,9 @@
/* Define to 1 if you have the <util.h> header file. */
#undef HAVE_UTIL_H
+/* Define to 1 if you have the `utimes' function. */
+#undef HAVE_UTIMES
+
/* Define to 1 if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
diff --git a/pkgtools/libnbcompat/files/nbcompat/statfs.h b/pkgtools/libnbcompat/files/nbcompat/statfs.h
index 388ad975f7a..1495f74315b 100644
--- a/pkgtools/libnbcompat/files/nbcompat/statfs.h
+++ b/pkgtools/libnbcompat/files/nbcompat/statfs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: statfs.h,v 1.1 2003/09/03 13:35:53 jlam Exp $ */
+/* $NetBSD: statfs.h,v 1.2 2004/03/11 13:28:45 grant Exp $ */
#ifndef _NBCOMPAT_STATFS_H
#define _NBCOMPAT_STATFS_H
@@ -26,6 +26,10 @@
#define MNAMELEN 90 /* length of buffer for returned name */
#endif
+#if !HAVE_FSID_T
+typedef struct { int32_t val[2]; } fsid_t;
+#endif
+
struct statfs {
short f_type; /* type of file system */
u_short f_flags; /* copy of mount flags */
diff --git a/pkgtools/libnbcompat/files/statfs.c b/pkgtools/libnbcompat/files/statfs.c
index 4d1668ad1e0..60831dd3bf9 100644
--- a/pkgtools/libnbcompat/files/statfs.c
+++ b/pkgtools/libnbcompat/files/statfs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: statfs.c,v 1.4 2003/09/06 23:03:04 grant Exp $ */
+/* $NetBSD: statfs.c,v 1.5 2004/03/11 13:28:45 grant Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -112,8 +112,12 @@ vfs2fs(struct statfs *sfs, const struct statvfs *vfs)
sfs->f_ffree = vfs->f_ffree;
(void) memcpy(&sfs->f_fsid.val[0], &vfs->f_fsid, sizeof(fsid_t));
sfs->f_owner = 0; /* XXX: root always here */
+#if HAVE_STRUCT_STATVFS_F_BASETYPE
(void)strncpy(sfs->f_fstypename,
vfs->f_basetype, sizeof(sfs->f_fstypename));
+#else
+ sfs->f_fstypename[0] = '\0';
+#endif
sfs->f_mntonname[0] = '\0'; /* XXX: */
sfs->f_mntfromname[0] = '\0'; /* XXX: */
}