pkgsrc-Bugs archive

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

pkg/45043: pkgtools/libnbcompat minix support



>Number:         45043
>Category:       pkg
>Synopsis:       pkgtools/libnbcompat minix support
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 10 14:40:00 +0000 2011
>Originator:     Thomas Cort
>Release:        N/A
>Organization:
Minix3
>Environment:
Minix 192.168.122.210 3.2.0 i686
>Description:
libnbcompat doesn't compile on Minix because Minix lacks the st_blksize member 
of struct statf. Additionally, some Minix systems use GNU ar (gar) instead of 
ar.
>How-To-Repeat:
Attempt to compile libnbcompat on Minix.
>Fix:
diff --git a/pkgtools/libnbcompat/files/configure 
b/pkgtools/libnbcompat/files/configure
index abef6f2..8f97e66 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -3724,8 +3724,10 @@ fi
   test -n "$AWK" && break
 done
 
-# Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
+for ac_prog in gar ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with 
args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_AR+set}" = set; then :
@@ -3741,7 +3743,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x 
"$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AR="ar"
+    ac_cv_prog_AR="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" 
>&5
     break 2
   fi
@@ -3761,6 +3763,9 @@ $as_echo "no" >&6; }
 fi
 
 
+  test -n "$AR" && break
+done
+
 
 AUTOCONF=${AUTOCONF-"$srcdir/missing --run autoconf"}
 
@@ -6397,6 +6402,19 @@ fi
 fi
 
 
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" 
"ac_cv_member_struct_stat_st_blksize" " #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
+:
+else
+  :
+fi
+
 ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" 
"ac_cv_member_struct_statfs_f_flags" " #include <sys/statfs.h>
 "
 if test "x$ac_cv_member_struct_statfs_f_flags" = x""yes; then :
diff --git a/pkgtools/libnbcompat/files/configure.ac 
b/pkgtools/libnbcompat/files/configure.ac
index afb5ace..3f2ab3e 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -18,7 +18,7 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_RANLIB
 AC_PROG_AWK
-AC_CHECK_PROG(AR, ar, ar)
+AC_CHECK_PROGS(AR, [gar ar])
 
 AUTOCONF=${AUTOCONF-"$srcdir/missing --run autoconf"}
 AC_SUBST(AUTOCONF)
@@ -386,6 +386,8 @@ AC_CHECK_FUNCS([getpassphrase getpgrp memmove select])
 
 AC_CHECK_FUNC(getpgrp, [AC_FUNC_GETPGRP])
 
+AC_CHECK_MEMBERS([struct stat.st_blksize], [:], [:],
+       [ #include <sys/stat.h> ])
 AC_CHECK_MEMBERS([struct statfs.f_flags], [:], [:],
        [ #include <sys/statfs.h> ])
 AC_CHECK_MEMBERS([struct statfs.f_fsize], [:], [:],
diff --git a/pkgtools/libnbcompat/files/db/btree/bt_open.c 
b/pkgtools/libnbcompat/files/db/btree/bt_open.c
index bbf11a4..a990b16 100644
--- a/pkgtools/libnbcompat/files/db/btree/bt_open.c
+++ b/pkgtools/libnbcompat/files/db/btree/bt_open.c
@@ -260,7 +260,11 @@ __bt_open(const char *fname, int flags, mode_t mode, const 
BTREEINFO *openinfo,
                 * Don't overflow the page offset type.
                 */
                if (b.psize == 0) {
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
                        b.psize = sb.st_blksize;
+#else
+                       b.psize = 1024;
+#endif
                        if (b.psize < MINPSIZE)
                                b.psize = MINPSIZE;
                        if (b.psize > MAX_PAGE_OFFSET + 1)
diff --git a/pkgtools/libnbcompat/files/db/hash/hash.c 
b/pkgtools/libnbcompat/files/db/hash/hash.c
index d3fa75f..8606181 100644
--- a/pkgtools/libnbcompat/files/db/hash/hash.c
+++ b/pkgtools/libnbcompat/files/db/hash/hash.c
@@ -304,7 +304,11 @@ init_hash(HTAB *hashp, const char *file, const HASHINFO 
*info)
        if (file != NULL) {
                if (stat(file, &statbuf))
                        return (NULL);
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
                hashp->BSIZE = MIN(statbuf.st_blksize, MAX_BSIZE);
+#else
+               hashp->BSIZE = MIN(1024, MAX_BSIZE);
+#endif
                hashp->BSHIFT = __log2((uint32_t)hashp->BSIZE);
        }
 
diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in 
b/pkgtools/libnbcompat/files/nbcompat/config.h.in
index 2445893..7fbcf47 100644
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in
@@ -388,6 +388,9 @@
 /* Define to 1 if the system has the type `struct sockaddr_storage'. */
 #undef HAVE_STRUCT_SOCKADDR_STORAGE
 
+/* Define to 1 if `st_blksize' is a member of `struct statf'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
 /* Define to 1 if `f_flags' is a member of `struct statfs'. */
 #undef HAVE_STRUCT_STATFS_F_FLAGS
 



Home | Main Index | Thread Index | Old Index