summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2010-04-20 00:32:22 +0000
committerjoerg <joerg@pkgsrc.org>2010-04-20 00:32:22 +0000
commit9d74fbeccc87146ef7783559030f0898c5d1537f (patch)
tree6693eeff6a87d838af8f6c73d442644de0d10792 /pkgtools
parent4f208343bf68d01dad0186f43852f8d6efc96156 (diff)
downloadpkgsrc-9d74fbeccc87146ef7783559030f0898c5d1537f.tar.gz
Add workaround for broken pread/pwrite. This is needed at least on
HP-UX.
Diffstat (limited to 'pkgtools')
-rwxr-xr-xpkgtools/libnbcompat/files/configure209
-rw-r--r--pkgtools/libnbcompat/files/configure.ac15
-rw-r--r--pkgtools/libnbcompat/files/db/hash/hash.c8
-rw-r--r--pkgtools/libnbcompat/files/db/hash/hash_page.c11
-rw-r--r--pkgtools/libnbcompat/files/db/mpool/mpool.c11
-rw-r--r--pkgtools/libnbcompat/files/db/pread.c12
-rw-r--r--pkgtools/libnbcompat/files/db/pwrite.c12
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/config.h.in19
8 files changed, 207 insertions, 90 deletions
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure
index f0917ad3e38..abef6f2fc73 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -1,12 +1,14 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for libnbcompat 20080605.
+# Generated by GNU Autoconf 2.65 for libnbcompat 20080605.
#
# Report bugs to <grant@NetBSD.org>.
#
+#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
-# Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -527,7 +529,8 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-exec 7<&0 </dev/null 6>&1
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -1304,7 +1307,7 @@ Some influential environment variables:
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
@@ -1375,7 +1378,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libnbcompat configure 20080605
-generated by GNU Autoconf 2.64
+generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1422,7 +1425,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
@@ -1468,7 +1471,7 @@ fi
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_link
@@ -1505,7 +1508,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
@@ -1547,7 +1550,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_run
@@ -1848,6 +1851,8 @@ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
for ac_type in int$2_t 'int' 'long int' \
'long long int' 'short int' 'signed char'; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1856,7 +1861,8 @@ $ac_includes_default
int
main ()
{
-static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << ($2 - 2)) - 1) * 2 + 1))];
+static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
+ 0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
test_array [0] = 0
;
@@ -1870,8 +1876,9 @@ $ac_includes_default
int
main ()
{
-static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << ($2 - 2)) - 1) * 2 + 1)
- < ($ac_type) (((($ac_type) 1 << ($2 - 2)) - 1) * 2 + 2))];
+static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
+ ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
test_array [0] = 0
;
@@ -1919,6 +1926,8 @@ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
'unsigned long long int' 'unsigned short int' 'unsigned char'; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1927,7 +1936,7 @@ $ac_includes_default
int
main ()
{
-static int test_array [1 - 2 * !(($ac_type) -1 >> ($2 - 1) == 1)];
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
test_array [0] = 0
;
@@ -2132,7 +2141,7 @@ rm -f conftest.val
fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_compute_int
@@ -2197,7 +2206,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libnbcompat $as_me 20080605, which was
-generated by GNU Autoconf 2.64. Invocation command line was
+generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -2450,7 +2459,7 @@ fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
- if test -r "$ac_site_file"; then
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
@@ -2459,9 +2468,9 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
@@ -3008,32 +3017,30 @@ $as_echo "$ac_try_echo"; } >&5
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
- rm -f conftest.er1 conftest.err
fi
+ rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
+
int
main ()
{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
@@ -3095,10 +3102,10 @@ test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
if test -z "$ac_file"; then :
- $as_echo "$as_me: failed program was:" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@@ -3106,51 +3113,18 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ as_fn_set_status 77
as_fn_error "C compiler cannot create executables
See \`config.log' for more details." "$LINENO" 5; }; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
@@ -3183,13 +3157,72 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." "$LINENO" 5; }
fi
-rm -f conftest$ac_cv_exeext
+rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if test "${ac_cv_objext+set}" = set; then :
@@ -4622,6 +4655,17 @@ esac
fi
+case $host in
+*-*-hpux*)
+ $as_echo "#define BROKEN_PREAD 1" >>confdefs.h
+
+
+ $as_echo "#define BROKEN_PWRITE 1" >>confdefs.h
+
+
+ ;;
+esac
+
# Check whether --enable-db was given.
if test "${enable_db+set}" = set; then :
enableval=$enable_db;
@@ -5794,7 +5838,12 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-ac_cv_func_warn=no
+case $host_os in
+darwin*)
+ # NetBSD PR 38488: warnx(3) escapes certain characters like \n
+ ac_cv_func_warn=no
+ ;;
+esac
for ac_func in asprintf err fgetln fnmatch fparseln getenv isblank \
lchflags lchmod lchown lutimes mkdtemp mkstemp setenv setgroupent \
@@ -7151,7 +7200,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by libnbcompat $as_me 20080605, which was
-generated by GNU Autoconf 2.64. Invocation command line was
+generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -7190,6 +7239,7 @@ Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
@@ -7209,10 +7259,11 @@ Report bugs to <grant@NetBSD.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libnbcompat config.status 20080605
-configured by $0, generated by GNU Autoconf 2.64,
- with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.65,
+ with options \\"\$ac_cs_config\\"
Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
@@ -7249,6 +7300,8 @@ do
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
@@ -7429,7 +7482,7 @@ s/'"$ac_delim"'$//
t delim
:nl
h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
@@ -7443,7 +7496,7 @@ s/.\{148\}//
t nl
:delim
h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac
index a238595adf8..24d112777e3 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.76 2010/02/20 15:21:35 joerg Exp $
+dnl $NetBSD: configure.ac,v 1.77 2010/04/20 00:32:22 joerg Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
@@ -133,6 +133,19 @@ AC_CHECK_FUNC(SHA512_File, [:], [
AC_LIBOBJ(sha2hl)
])
+case $host in
+*-*-hpux*)
+ AC_DEFINE(BROKEN_PREAD)
+ AH_TEMPLATE([BROKEN_PREAD], [
+ Define to 1 if the `pread' function is broken.
+])
+ AC_DEFINE(BROKEN_PWRITE)
+ AH_TEMPLATE([BROKEN_PWRITE], [
+ Define to 1 if the `pwrite' function is broken.
+])
+ ;;
+esac
+
AC_ARG_ENABLE([db],
[AS_HELP_STRING([--enable-db], [include DB implementation])])
AC_SUBST(WITH_DB, $enable_db)
diff --git a/pkgtools/libnbcompat/files/db/hash/hash.c b/pkgtools/libnbcompat/files/db/hash/hash.c
index d2d0872ff2f..50c149927d5 100644
--- a/pkgtools/libnbcompat/files/db/hash/hash.c
+++ b/pkgtools/libnbcompat/files/db/hash/hash.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.c,v 1.2 2008/10/30 19:27:20 joerg Exp $ */
+/* $NetBSD: hash.c,v 1.3 2010/04/20 00:32:23 joerg Exp $ */
/* NetBSD: hash.c,v 1.30 2008/09/11 12:58:00 joerg Exp */
/*-
@@ -36,7 +36,7 @@
#include <nbcompat.h>
#include <nbcompat/cdefs.h>
-__RCSID("$NetBSD: hash.c,v 1.2 2008/10/30 19:27:20 joerg Exp $");
+__RCSID("$NetBSD: hash.c,v 1.3 2010/04/20 00:32:23 joerg Exp $");
#include <nbcompat/param.h>
#include <sys/stat.h>
@@ -54,6 +54,10 @@ __RCSID("$NetBSD: hash.c,v 1.2 2008/10/30 19:27:20 joerg Exp $");
#include "page.h"
#include "extern.h"
+#ifdef BROKEN_PWRITE
+#include "../pwrite.c"
+#endif
+
#define __UNCONST(a) ((void *)(size_t)(const void *)(a))
static int alloc_segs(HTAB *, int);
diff --git a/pkgtools/libnbcompat/files/db/hash/hash_page.c b/pkgtools/libnbcompat/files/db/hash/hash_page.c
index f717f79a7ab..ba0d2b8b94a 100644
--- a/pkgtools/libnbcompat/files/db/hash/hash_page.c
+++ b/pkgtools/libnbcompat/files/db/hash/hash_page.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hash_page.c,v 1.5 2009/05/07 00:23:45 schmonz Exp $ */
+/* $NetBSD: hash_page.c,v 1.6 2010/04/20 00:32:23 joerg Exp $ */
/* NetBSD: hash_page.c,v 1.23 2008/09/11 12:58:00 joerg Exp */
/*-
@@ -36,7 +36,7 @@
#include <nbcompat.h>
#include <nbcompat/cdefs.h>
-__RCSID("$NetBSD: hash_page.c,v 1.5 2009/05/07 00:23:45 schmonz Exp $");
+__RCSID("$NetBSD: hash_page.c,v 1.6 2010/04/20 00:32:23 joerg Exp $");
/*
* PACKAGE: hashing
@@ -71,6 +71,13 @@ __RCSID("$NetBSD: hash_page.c,v 1.5 2009/05/07 00:23:45 schmonz Exp $");
#include "page.h"
#include "extern.h"
+#ifdef BROKEN_PREAD
+#include "../pread.c"
+#endif
+#ifdef BROKEN_PWRITE
+#include "../pwrite.c"
+#endif
+
static uint32_t *fetch_bitmap(HTAB *, int);
static uint32_t first_free(uint32_t);
static int open_temp(HTAB *);
diff --git a/pkgtools/libnbcompat/files/db/mpool/mpool.c b/pkgtools/libnbcompat/files/db/mpool/mpool.c
index 4154ae053a1..8b8325218df 100644
--- a/pkgtools/libnbcompat/files/db/mpool/mpool.c
+++ b/pkgtools/libnbcompat/files/db/mpool/mpool.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mpool.c,v 1.4 2010/01/24 12:29:48 obache Exp $ */
+/* $NetBSD: mpool.c,v 1.5 2010/04/20 00:32:23 joerg Exp $ */
/* NetBSD: mpool.c,v 1.18 2008/09/11 12:58:00 joerg Exp */
/*-
@@ -33,7 +33,7 @@
#include <nbcompat.h>
#include <nbcompat/cdefs.h>
-__RCSID("$NetBSD: mpool.c,v 1.4 2010/01/24 12:29:48 obache Exp $");
+__RCSID("$NetBSD: mpool.c,v 1.5 2010/04/20 00:32:23 joerg Exp $");
#include <nbcompat/queue.h>
#include <sys/stat.h>
@@ -69,6 +69,13 @@ static BKT *mpool_bkt(MPOOL *);
static BKT *mpool_look(MPOOL *, pgno_t);
static int mpool_write(MPOOL *, BKT *);
+#ifdef BROKEN_PREAD
+#include "../pread.c"
+#endif
+#ifdef BROKEN_PWRITE
+#include "../pwrite.c"
+#endif
+
/*
* mpool_open --
* Initialize a memory pool.
diff --git a/pkgtools/libnbcompat/files/db/pread.c b/pkgtools/libnbcompat/files/db/pread.c
new file mode 100644
index 00000000000..81189750c7d
--- /dev/null
+++ b/pkgtools/libnbcompat/files/db/pread.c
@@ -0,0 +1,12 @@
+/* $NetBSD: pread.c,v 1.1 2010/04/20 00:32:22 joerg Exp $ */
+
+static ssize_t
+working_pread(int fd, void *buf, size_t nbytes, off_t off)
+{
+ if (lseek(fd, off, SEEK_SET) == -1)
+ return -1;
+ return read(fd, buf, nbytes);
+}
+
+#undef pread
+#define pread(fd, buf, nbytes, off) working_pread(fd, buf, nbytes,off)
diff --git a/pkgtools/libnbcompat/files/db/pwrite.c b/pkgtools/libnbcompat/files/db/pwrite.c
new file mode 100644
index 00000000000..d5dcbd52b4f
--- /dev/null
+++ b/pkgtools/libnbcompat/files/db/pwrite.c
@@ -0,0 +1,12 @@
+/* $NetBSD: pwrite.c,v 1.1 2010/04/20 00:32:23 joerg Exp $ */
+
+static ssize_t
+working_pwrite(int fd, const void *buf, size_t nbytes, off_t off)
+{
+ if (lseek(fd, off, SEEK_SET) == -1)
+ return -1;
+ return write(fd, buf, nbytes);
+}
+
+#undef pwrite
+#define pwrite(fd, buf, nbytes, off) working_pwrite(fd, buf, nbytes,off)
diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in
index 7412c3bb595..24458931076 100644
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in
@@ -3,6 +3,12 @@
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
+/* Define to 1 if the `pread' function is broken. */
+#undef BROKEN_PREAD
+
+/* Define to 1 if the `pwrite' function is broken. */
+#undef BROKEN_PWRITE
+
/* Define to 1 if the `getpgrp' function requires zero arguments. */
#undef GETPGRP_VOID
@@ -62,7 +68,7 @@
/* Define if dirfd is either a function or a macro. */
#undef HAVE_DIRFD
-/* Define to 1 if `dd_fd' is member of `DIR'. */
+/* Define to 1 if `dd_fd' is a member of `DIR'. */
#undef HAVE_DIR_DD_FD
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
@@ -367,7 +373,7 @@
/* Define to 1 if the system has the type `struct addrinfo'. */
#undef HAVE_STRUCT_ADDRINFO
-/* Define to 1 if `d_namlen' is member of `struct dirent'. */
+/* Define to 1 if `d_namlen' is a member of `struct dirent'. */
#undef HAVE_STRUCT_DIRENT_D_NAMLEN
/* Define to 1 if the system has the type `struct in6_addr'. */
@@ -382,13 +388,13 @@
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#undef HAVE_STRUCT_SOCKADDR_STORAGE
-/* Define to 1 if `f_flags' is member of `struct statfs'. */
+/* Define to 1 if `f_flags' is a member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_FLAGS
-/* Define to 1 if `f_fsize' is member of `struct statfs'. */
+/* Define to 1 if `f_fsize' is a member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_FSIZE
-/* Define to 1 if `f_iosize' is member of `struct statfs'. */
+/* Define to 1 if `f_iosize' is a member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_IOSIZE
/* Define to 1 if you have the `strunvis' function. */
@@ -547,6 +553,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION