summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/atf/libatf-c++/tests/Makefile3
-rw-r--r--lib/atf/libatf-c++/tests/detail/Makefile2
-rw-r--r--lib/atf/libatf-c/tests/Makefile3
-rw-r--r--lib/atf/libatf-c/tests/detail/Makefile2
-rw-r--r--lib/atf/tests/Makefile2
-rw-r--r--lib/atf/tests/test-programs/Makefile2
-rw-r--r--lib/csu/amd64/Makefile6
-rw-r--r--lib/csu/arm/Makefile6
-rw-r--r--lib/csu/i386-elf/Makefile6
-rw-r--r--lib/csu/mips/Makefile6
-rw-r--r--lib/csu/powerpc/Makefile6
-rw-r--r--lib/csu/powerpc64/Makefile6
-rw-r--r--lib/csu/sparc64/Makefile5
-rw-r--r--lib/libalias/libalias/Makefile2
-rw-r--r--lib/libalias/modules/Makefile2
-rw-r--r--lib/libalias/modules/Makefile.inc2
-rw-r--r--lib/libarchive/Makefile2
-rw-r--r--lib/libarchive/config_freebsd.h1
-rw-r--r--lib/libarchive/tests/Makefile18
-rw-r--r--lib/libauditd/Makefile2
-rw-r--r--lib/libbegemot/Makefile2
-rw-r--r--lib/libblocksruntime/Makefile2
-rw-r--r--lib/libbluetooth/Makefile2
-rw-r--r--lib/libbsm/Makefile2
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile2
-rw-r--r--lib/libbz2/Makefile2
-rw-r--r--lib/libc++/Makefile6
-rw-r--r--lib/libc/db/hash/hash_page.c13
-rw-r--r--lib/libc/gen/nice.336
-rw-r--r--lib/libc/gen/nice.c16
-rw-r--r--lib/libc/string/memmem.322
-rw-r--r--lib/libc/string/memmem.c6
-rw-r--r--lib/libc/sys/recv.255
-rw-r--r--lib/libc/tests/Makefile3
-rw-r--r--lib/libc/tests/Makefile.netbsd-tests6
-rw-r--r--lib/libc/tests/c063/Makefile5
-rw-r--r--lib/libc/tests/db/Makefile8
-rw-r--r--lib/libc/tests/gen/Makefile14
-rw-r--r--lib/libc/tests/gen/execve/Makefile6
-rw-r--r--lib/libc/tests/gen/posix_spawn/Makefile6
-rw-r--r--lib/libc/tests/hash/Makefile8
-rw-r--r--lib/libc/tests/inet/Makefile5
-rw-r--r--lib/libc/tests/locale/Makefile2
-rw-r--r--lib/libc/tests/net/Makefile2
-rw-r--r--lib/libc/tests/net/getaddrinfo/Makefile4
-rw-r--r--lib/libc/tests/regex/Makefile2
-rw-r--r--lib/libc/tests/rpc/Makefile1
-rw-r--r--lib/libc/tests/setjmp/Makefile4
-rw-r--r--lib/libc/tests/ssp/Makefile6
-rw-r--r--lib/libc/tests/stdio/Makefile5
-rw-r--r--lib/libc/tests/stdio/open_memstream2_test.c (renamed from lib/libc/tests/stdio/open_memstream_test.c)0
-rw-r--r--lib/libc/tests/stdio/printbasic_test.c22
-rw-r--r--lib/libc/tests/stdio/printfloat_test.c19
-rw-r--r--lib/libc/tests/stdlib/Makefile10
-rw-r--r--lib/libc/tests/string/Makefile2
-rw-r--r--lib/libc/tests/sys/Makefile13
-rw-r--r--lib/libc/tests/sys/mlock_helper.c114
-rw-r--r--lib/libc/tests/termios/Makefile2
-rw-r--r--lib/libc/tests/time/Makefile2
-rw-r--r--lib/libc/tests/tls/Makefile1
-rw-r--r--lib/libc/tests/tls/dso/Makefile1
-rw-r--r--lib/libc/tests/ttyio/Makefile2
-rw-r--r--lib/libc_nonshared/Makefile6
-rw-r--r--lib/libcam/Makefile7
-rw-r--r--lib/libcom_err/Makefile2
-rw-r--r--lib/libcompat/Makefile2
-rw-r--r--lib/libcrypt/tests/Makefile2
-rw-r--r--lib/libcxxrt/Makefile2
-rw-r--r--lib/libexecinfo/Makefile2
-rw-r--r--lib/libexpat/Makefile2
-rw-r--r--lib/libgssapi/Makefile2
-rw-r--r--lib/libiconv_modules/Makefile.inc4
-rw-r--r--lib/libiconv_modules/mapper_parallel/Makefile2
-rw-r--r--lib/libkiconv/Makefile2
-rw-r--r--lib/libldns/Makefile2
-rw-r--r--lib/liblzma/Makefile6
-rw-r--r--lib/libmagic/Makefile2
-rw-r--r--lib/libmilter/Makefile2
-rw-r--r--lib/libmp/Makefile4
-rw-r--r--lib/libmp/tests/Makefile2
-rw-r--r--lib/libngatm/Makefile4
-rw-r--r--lib/libnv/tests/Makefile2
-rw-r--r--lib/libopie/Makefile2
-rw-r--r--lib/libpam/libpam/Makefile6
-rw-r--r--lib/libpam/libpam/tests/Makefile19
-rw-r--r--lib/libpam/modules/Makefile.inc4
-rw-r--r--lib/libpam/modules/pam_passwdqc/Makefile2
-rw-r--r--lib/libpam/modules/pam_ssh/Makefile2
-rw-r--r--lib/libpcap/Makefile2
-rw-r--r--lib/libprocstat/zfs/Makefile22
-rw-r--r--lib/librpcsec_gss/Makefile6
-rw-r--r--lib/librpcsvc/Makefile2
-rw-r--r--lib/librt/tests/Makefile6
-rw-r--r--lib/libsbuf/Makefile2
-rw-r--r--lib/libsm/Makefile2
-rw-r--r--lib/libsmb/Makefile2
-rw-r--r--lib/libsmdb/Makefile2
-rw-r--r--lib/libsmutil/Makefile2
-rw-r--r--lib/libstdthreads/Makefile2
-rw-r--r--lib/libtelnet/Makefile2
-rw-r--r--lib/libthr/Makefile12
-rw-r--r--lib/libthr/support/Makefile.inc12
-rw-r--r--lib/libthr/tests/Makefile5
-rw-r--r--lib/libthr/tests/dlopen/Makefile2
-rw-r--r--lib/libthr/tests/dlopen/dso/Makefile2
-rw-r--r--lib/libthread_db/Makefile2
-rw-r--r--lib/libufs/Makefile2
-rw-r--r--lib/libulog/Makefile2
-rw-r--r--lib/libunbound/Makefile4
-rw-r--r--lib/libutil/Makefile2
-rw-r--r--lib/libutil/tests/Makefile2
-rw-r--r--lib/libypclnt/Makefile6
-rw-r--r--lib/libz/Symbol.map11
-rw-r--r--lib/libz/Versions.def3
-rw-r--r--lib/libz/zlib.pc2
-rw-r--r--lib/msun/tests/Makefile13
-rw-r--r--lib/msun/tests/fmaxmin_test.c22
-rw-r--r--lib/ncurses/config.mk12
-rw-r--r--lib/ncurses/form/Makefile2
-rw-r--r--lib/ncurses/formw/Makefile2
-rw-r--r--lib/ncurses/menu/Makefile2
-rw-r--r--lib/ncurses/menuw/Makefile2
-rw-r--r--lib/ncurses/ncurses/Makefile2
-rw-r--r--lib/ncurses/ncursesw/Makefile4
-rw-r--r--lib/ncurses/panel/Makefile2
-rw-r--r--lib/ncurses/panelw/Makefile2
-rw-r--r--lib/tests/Makefile4
127 files changed, 474 insertions, 335 deletions
diff --git a/lib/atf/libatf-c++/tests/Makefile b/lib/atf/libatf-c++/tests/Makefile
index 5f5a575..a069bb1 100644
--- a/lib/atf/libatf-c++/tests/Makefile
+++ b/lib/atf/libatf-c++/tests/Makefile
@@ -2,10 +2,9 @@
.include <bsd.init.mk>
-TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++
TESTS_SUBDIRS= detail
-ATF= ${.CURDIR:H:H:H:H}/contrib/atf
+ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c++
.PATH: ${ATF}/atf-c++/detail
diff --git a/lib/atf/libatf-c++/tests/detail/Makefile b/lib/atf/libatf-c++/tests/detail/Makefile
index 69c3e7b..f7d672e 100644
--- a/lib/atf/libatf-c++/tests/detail/Makefile
+++ b/lib/atf/libatf-c++/tests/detail/Makefile
@@ -4,7 +4,7 @@
TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++/detail
-ATF= ${.CURDIR:H:H:H:H:H}/contrib/atf
+ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c++/detail
CFLAGS+= -DATF_C_TESTS_BASE='"${TESTSBASE}/lib/atf/libatf-c"'
diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile
index d5b6dc0..e864c2e 100644
--- a/lib/atf/libatf-c/tests/Makefile
+++ b/lib/atf/libatf-c/tests/Makefile
@@ -2,10 +2,9 @@
.include <bsd.init.mk>
-TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c
TESTS_SUBDIRS= detail
-ATF= ${.CURDIR:H:H:H:H}/contrib/atf
+ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c
.PATH: ${ATF}/atf-c/detail
diff --git a/lib/atf/libatf-c/tests/detail/Makefile b/lib/atf/libatf-c/tests/detail/Makefile
index 02c1f2b..e47fd56 100644
--- a/lib/atf/libatf-c/tests/detail/Makefile
+++ b/lib/atf/libatf-c/tests/detail/Makefile
@@ -4,7 +4,7 @@
TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c/detail
-ATF= ${.CURDIR:H:H:H:H:H}/contrib/atf
+ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c/detail
CFLAGS+= -DATF_INCLUDEDIR='"${INCLUDEDIR}"'
diff --git a/lib/atf/tests/Makefile b/lib/atf/tests/Makefile
index 7bc96c9..dc79bb3 100644
--- a/lib/atf/tests/Makefile
+++ b/lib/atf/tests/Makefile
@@ -4,7 +4,7 @@
TESTSDIR= ${TESTSBASE}/lib/atf
-.PATH: ${.CURDIR:H:H:H}/tests
+.PATH: ${SRCTOP}/tests
KYUAFILE= yes
SUBDIR= test-programs
diff --git a/lib/atf/tests/test-programs/Makefile b/lib/atf/tests/test-programs/Makefile
index b0c1c23..aa30826 100644
--- a/lib/atf/tests/test-programs/Makefile
+++ b/lib/atf/tests/test-programs/Makefile
@@ -5,7 +5,7 @@
TESTSDIR= ${TESTSBASE}/lib/atf/test-programs
KYUAFILE= yes
-ATF= ${.CURDIR:H:H:H:H}/contrib/atf
+ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/test-programs
CFLAGS+= -I${ATF}
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile
index 80d14a7..7341aec 100644
--- a/lib/csu/amd64/Makefile
+++ b/lib/csu/amd64/Makefile
@@ -1,12 +1,12 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../common
+.PATH: ${.CURDIR:H}/common
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include
+CFLAGS+= -I${.CURDIR:H}/common \
+ -I${SRCTOP}/lib/libc/include
CFLAGS+= -fno-omit-frame-pointer
all: ${OBJS}
diff --git a/lib/csu/arm/Makefile b/lib/csu/arm/Makefile
index bf4c7b1..ca21fdb 100644
--- a/lib/csu/arm/Makefile
+++ b/lib/csu/arm/Makefile
@@ -1,12 +1,12 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../common
+.PATH: ${.CURDIR:H}/common
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include
+CFLAGS+= -I${.CURDIR:H}/common \
+ -I${SRCTOP}/lib/libc/include
all: ${OBJS}
diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386-elf/Makefile
index f26db15..dd387b9 100644
--- a/lib/csu/i386-elf/Makefile
+++ b/lib/csu/i386-elf/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../common
+.PATH: ${.CURDIR:H}/common
SRCS= crti.S crtn.S
FILES= ${SRCS:N*.h:R:S/$/.o/g} gcrt1.o crt1.o Scrt1.o
@@ -8,8 +8,8 @@ FILESOWN= ${LIBOWN}
FILESGRP= ${LIBGRP}
FILESMODE= ${LIBMODE}
FILESDIR= ${LIBDIR}
-CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include
+CFLAGS+= -I${.CURDIR:H}/common \
+ -I${SRCTOP}/lib/libc/include
CLEANFILES= ${FILES} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s
diff --git a/lib/csu/mips/Makefile b/lib/csu/mips/Makefile
index bf4c7b1..ca21fdb 100644
--- a/lib/csu/mips/Makefile
+++ b/lib/csu/mips/Makefile
@@ -1,12 +1,12 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../common
+.PATH: ${.CURDIR:H}/common
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include
+CFLAGS+= -I${.CURDIR:H}/common \
+ -I${SRCTOP}/lib/libc/include
all: ${OBJS}
diff --git a/lib/csu/powerpc/Makefile b/lib/csu/powerpc/Makefile
index bf4c7b1..ca21fdb 100644
--- a/lib/csu/powerpc/Makefile
+++ b/lib/csu/powerpc/Makefile
@@ -1,12 +1,12 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../common
+.PATH: ${.CURDIR:H}/common
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include
+CFLAGS+= -I${.CURDIR:H}/common \
+ -I${SRCTOP}/lib/libc/include
all: ${OBJS}
diff --git a/lib/csu/powerpc64/Makefile b/lib/csu/powerpc64/Makefile
index 123391e..b579db0 100644
--- a/lib/csu/powerpc64/Makefile
+++ b/lib/csu/powerpc64/Makefile
@@ -1,12 +1,12 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../common
+.PATH: ${.CURDIR:H}/common
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include \
+CFLAGS+= -I${.CURDIR:H}/common \
+ -I${SRCTOP}/lib/libc/include \
-mlongcall
all: ${OBJS}
diff --git a/lib/csu/sparc64/Makefile b/lib/csu/sparc64/Makefile
index 7f8dd7a..6561997 100644
--- a/lib/csu/sparc64/Makefile
+++ b/lib/csu/sparc64/Makefile
@@ -1,11 +1,12 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../common
+.PATH: ${.CURDIR:H}/common
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../../libc/include
+CFLAGS+= -I${.CURDIR:H}/common \
+ -I${SRCTOP}/lib/libc/include
all: ${OBJS}
diff --git a/lib/libalias/libalias/Makefile b/lib/libalias/libalias/Makefile
index 00b4ed8..c192bc5 100644
--- a/lib/libalias/libalias/Makefile
+++ b/lib/libalias/libalias/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../sys/netinet/libalias
+.PATH: ${SRCTOP}/sys/netinet/libalias
LIB= alias
SHLIBDIR?= /lib
diff --git a/lib/libalias/modules/Makefile b/lib/libalias/modules/Makefile
index dc66ad2..24333ea6 100644
--- a/lib/libalias/modules/Makefile
+++ b/lib/libalias/modules/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include "${.CURDIR}/../../../sys/modules/libalias/modules/modules.inc"
+.include "${SRCTOP}/sys/modules/libalias/modules/modules.inc"
SUBDIR= ${MODULES}
diff --git a/lib/libalias/modules/Makefile.inc b/lib/libalias/modules/Makefile.inc
index 23df02d..730f374 100644
--- a/lib/libalias/modules/Makefile.inc
+++ b/lib/libalias/modules/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../../sys/netinet/libalias
+.PATH: ${SRCTOP}/sys/netinet/libalias
SHLIBDIR?= /lib
LIB?= alias_${NAME}
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index ffb2e97..2cf1633 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
.include <bsd.own.mk>
-LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
+LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
LIB= archive
DPADD= ${LIBZ} ${LIBBZ2} ${LIBLZMA} ${LIBPTHREAD} ${LIBBSDXML}
diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h
index c82c8cc..24e2d75 100644
--- a/lib/libarchive/config_freebsd.h
+++ b/lib/libarchive/config_freebsd.h
@@ -39,6 +39,7 @@
#define HAVE_ACL_SET_FILE 1
#define HAVE_ACL_SET_LINK_NP 1
#define HAVE_ACL_USER 1
+#define HAVE_ACL_TYPE_NFS4 1
#define HAVE_ARC4RANDOM_BUF 1
#define HAVE_EXTATTR_GET_FILE 1
#define HAVE_EXTATTR_LIST_FILE 1
diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile
index 58c642e..eed7b97 100644
--- a/lib/libarchive/tests/Makefile
+++ b/lib/libarchive/tests/Makefile
@@ -21,11 +21,12 @@ CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
.PATH: ${LIBARCHIVEDIR}/libarchive/test
TESTS_SRCS= \
- test_acl_freebsd_nfs4.c \
- test_acl_freebsd_posix1e.c \
test_acl_nfs4.c \
test_acl_pax.c \
+ test_acl_platform_nfs4.c \
+ test_acl_platform_posix1e.c \
test_acl_posix1e.c \
+ test_acl_text.c \
test_archive_api_feature.c \
test_archive_clear_error.c \
test_archive_cmdline.c \
@@ -74,7 +75,7 @@ TESTS_SRCS= \
test_compat_plexus_archiver_tar.c \
test_compat_solaris_tar_acl.c \
test_compat_solaris_pax_sparse.c \
- test_compat_star_acl_posix1e.c \
+ test_compat_star_acl.c \
test_compat_tar_hardlink.c \
test_compat_uudecode.c \
test_compat_uudecode_large.c \
@@ -319,7 +320,8 @@ list.h: ${TESTS_SRCS} Makefile
CLEANFILES+= list.h list.h.tmp
FILES+= README
-FILES+= test_acl_pax.tar.uu
+FILES+= test_acl_pax_posix1e.tar.uu
+FILES+= test_acl_pax_nfs4.tar.uu
FILES+= test_archive_string_conversion.txt.Z.uu
FILES+= test_compat_bzip2_1.tbz.uu
FILES+= test_compat_bzip2_2.tbz.uu
@@ -327,6 +329,7 @@ FILES+= test_compat_cpio_1.cpio.uu
FILES+= test_compat_gtar_1.tar.uu
FILES+= test_compat_gtar_2.tar.uu
FILES+= test_compat_gzip_1.tgz.uu
+FILES+= test_compat_gzip_2.tgz.uu
FILES+= test_compat_lz4_1.tar.lz4.uu
FILES+= test_compat_lz4_2.tar.lz4.uu
FILES+= test_compat_lz4_3.tar.lz4.uu
@@ -339,7 +342,6 @@ FILES+= test_compat_lz4_B6.tar.lz4.uu
FILES+= test_compat_lz4_B6BD.tar.lz4.uu
FILES+= test_compat_lz4_B7.tar.lz4.uu
FILES+= test_compat_lz4_B7BD.tar.lz4.uu
-FILES+= test_compat_gzip_2.tgz.uu
FILES+= test_compat_lzip_1.tlz.uu
FILES+= test_compat_lzip_2.tlz.uu
FILES+= test_compat_lzma_1.tlz.uu
@@ -356,6 +358,7 @@ FILES+= test_compat_plexus_archiver_tar.tar.uu
FILES+= test_compat_solaris_pax_sparse_1.pax.Z.uu
FILES+= test_compat_solaris_pax_sparse_2.pax.Z.uu
FILES+= test_compat_solaris_tar_acl.tar.uu
+FILES+= test_compat_star_acl_nfs4.tar.uu
FILES+= test_compat_star_acl_posix1e.tar.uu
FILES+= test_compat_tar_hardlink_1.tar.uu
FILES+= test_compat_uudecode_large.tar.Z.uu
@@ -486,7 +489,7 @@ FILES+= test_read_format_rar_compress_normal.rar.uu
FILES+= test_read_format_rar_encryption_data.rar.uu
FILES+= test_read_format_rar_encryption_header.rar.uu
FILES+= test_read_format_rar_encryption_partially.rar.uu
-FILES+= test_read_format_rar_invalid1.rar.uu
+FILES+= test_read_format_rar_invalid1.rar.uu
FILES+= test_read_format_rar_multi_lzss_blocks.rar.uu
FILES+= test_read_format_rar_multivolume.part0001.rar.uu
FILES+= test_read_format_rar_multivolume.part0002.rar.uu
@@ -521,7 +524,7 @@ FILES+= test_read_format_zip_filename_koi8r.zip.uu
FILES+= test_read_format_zip_filename_utf8_jp.zip.uu
FILES+= test_read_format_zip_filename_utf8_ru.zip.uu
FILES+= test_read_format_zip_filename_utf8_ru2.zip.uu
-FILES+= test_read_format_zip_high_compression.zip.uu
+FILES+= test_read_format_zip_high_compression.zip.uu
FILES+= test_read_format_zip_jar.jar.uu
FILES+= test_read_format_zip_length_at_end.zip.uu
FILES+= test_read_format_zip_mac_metadata.zip.uu
@@ -547,6 +550,7 @@ FILES+= test_read_large_splitted_rar_ab.uu
FILES+= test_read_large_splitted_rar_ac.uu
FILES+= test_read_large_splitted_rar_ad.uu
FILES+= test_read_large_splitted_rar_ae.uu
+FILES+= test_read_pax_schily_xattr.tar.uu
FILES+= test_read_splitted_rar_aa.uu
FILES+= test_read_splitted_rar_ab.uu
FILES+= test_read_splitted_rar_ac.uu
diff --git a/lib/libauditd/Makefile b/lib/libauditd/Makefile
index cee1850..0c93cc6 100644
--- a/lib/libauditd/Makefile
+++ b/lib/libauditd/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
#
-OPENBSMDIR= ${.CURDIR}/../../contrib/openbsm
+OPENBSMDIR= ${SRCTOP}/contrib/openbsm
LIBAUDITDDIR= ${OPENBSMDIR}/libauditd
LIBBSMDIR= ${OPENBSMDIR}/libbsm
diff --git a/lib/libbegemot/Makefile b/lib/libbegemot/Makefile
index 27baf56..0f917c6 100644
--- a/lib/libbegemot/Makefile
+++ b/lib/libbegemot/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-LIBBEGEMOT_DIR=${.CURDIR}/../../contrib/libbegemot
+LIBBEGEMOT_DIR=${SRCTOP}/contrib/libbegemot
.PATH: ${LIBBEGEMOT_DIR}
diff --git a/lib/libblocksruntime/Makefile b/lib/libblocksruntime/Makefile
index 01a78fe..3dee852 100644
--- a/lib/libblocksruntime/Makefile
+++ b/lib/libblocksruntime/Makefile
@@ -5,7 +5,7 @@ SHLIB_MAJOR=0
CFLAGS+=-I${.CURDIR}
WARNS?= 2
-.PATH: ${.CURDIR}/../../contrib/compiler-rt/BlocksRuntime
+.PATH: ${SRCTOP}/contrib/compiler-rt/BlocksRuntime
INCS= Block.h Block_private.h
SRCS= data.c runtime.c
diff --git a/lib/libbluetooth/Makefile b/lib/libbluetooth/Makefile
index 7e21892..7a2e134 100644
--- a/lib/libbluetooth/Makefile
+++ b/lib/libbluetooth/Makefile
@@ -5,7 +5,7 @@ LIB= bluetooth
MAN= bluetooth.3
WARNS?= 2
-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys
+CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys
SHLIB_MAJOR= 4
diff --git a/lib/libbsm/Makefile b/lib/libbsm/Makefile
index 2e0dbe1..90fbc27 100644
--- a/lib/libbsm/Makefile
+++ b/lib/libbsm/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
#
-OPENBSMDIR= ${.CURDIR}/../../contrib/openbsm
+OPENBSMDIR= ${SRCTOP}/contrib/openbsm
LIBBSMDIR= ${OPENBSMDIR}/libbsm
LIB= bsm
diff --git a/lib/libbsnmp/libbsnmp/Makefile b/lib/libbsnmp/libbsnmp/Makefile
index a756f90..708e3ee 100644
--- a/lib/libbsnmp/libbsnmp/Makefile
+++ b/lib/libbsnmp/libbsnmp/Makefile
@@ -4,7 +4,7 @@
.include <bsd.own.mk>
-CONTRIB= ${.CURDIR}/../../../contrib/bsnmp/lib
+CONTRIB= ${SRCTOP}/contrib/bsnmp/lib
.PATH: ${CONTRIB}
LIB= bsnmp
diff --git a/lib/libbz2/Makefile b/lib/libbz2/Makefile
index b505927..2521009 100644
--- a/lib/libbz2/Makefile
+++ b/lib/libbz2/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-BZ2DIR= ${.CURDIR}/../../contrib/bzip2
+BZ2DIR= ${SRCTOP}/contrib/bzip2
.PATH: ${BZ2DIR}
LIB= bz2
diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile
index 8c804a3..48cfe27 100644
--- a/lib/libc++/Makefile
+++ b/lib/libc++/Makefile
@@ -2,9 +2,9 @@
.include <bsd.own.mk>
-LIBCXXRTDIR= ${.CURDIR}/../../contrib/libcxxrt
-HDRDIR= ${.CURDIR}/../../contrib/libc++/include
-SRCDIR= ${.CURDIR}/../../contrib/libc++/src
+LIBCXXRTDIR= ${SRCTOP}/contrib/libcxxrt
+HDRDIR= ${SRCTOP}/contrib/libc++/include
+SRCDIR= ${SRCTOP}/contrib/libc++/src
CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR}
.PATH: ${SRCDIR}
diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c
index 8040419..f9a7289 100644
--- a/lib/libc/db/hash/hash_page.c
+++ b/lib/libc/db/hash/hash_page.c
@@ -572,7 +572,9 @@ __get_page(HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_disk,
int
__put_page(HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_bitmap)
{
- int fd, page, size, wsize;
+ int fd, page, size;
+ ssize_t wsize;
+ char pbuf[MAX_BSIZE];
size = hashp->BSIZE;
if ((hashp->fp == -1) && open_temp(hashp))
@@ -582,15 +584,18 @@ __put_page(HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_bitmap)
if (hashp->LORDER != BYTE_ORDER) {
int i, max;
+ memcpy(pbuf, p, size);
if (is_bitmap) {
max = hashp->BSIZE >> 2; /* divide by 4 */
for (i = 0; i < max; i++)
- M_32_SWAP(((int *)p)[i]);
+ M_32_SWAP(((int *)pbuf)[i]);
} else {
- max = ((u_int16_t *)p)[0] + 2;
+ uint16_t *bp = (uint16_t *)(void *)pbuf;
+ max = bp[0] + 2;
for (i = 0; i <= max; i++)
- M_16_SWAP(((u_int16_t *)p)[i]);
+ M_16_SWAP(bp[i]);
}
+ p = pbuf;
}
if (is_bucket)
page = BUCKET_TO_PAGE(bucket);
diff --git a/lib/libc/gen/nice.3 b/lib/libc/gen/nice.3
index 9c39b78..8ce13af 100644
--- a/lib/libc/gen/nice.3
+++ b/lib/libc/gen/nice.3
@@ -28,7 +28,7 @@
.\" @(#)nice.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd February 28, 2015
.Dt NICE 3
.Os
.Sh NAME
@@ -48,20 +48,48 @@ This interface is obsoleted by
.Pp
The
.Fn nice
-function obtains the scheduling priority of the process
-from the system and sets it to the priority value specified in
-.Fa incr .
+function adds
+.Fa incr
+to the scheduling priority of the process.
The priority is a value in the range -20 to 20.
The default priority is 0; lower priorities cause more favorable scheduling.
Only the super-user may lower priorities.
.Pp
Children inherit the priority of their parent processes via
.Xr fork 2 .
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn nice
+returns 0, and
+.Va errno
+is unchanged.
+Otherwise, \-1 is returned, the process' nice value is not changed, and
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+The
+.Fn nice
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EPERM
+The
+.Fa incr
+argument is negative and the caller does not have appropriate privileges.
+.El
.Sh SEE ALSO
.Xr nice 1 ,
.Xr fork 2 ,
.Xr setpriority 2 ,
.Xr renice 8
+.Sh STANDARDS
+The
+.Fn nice
+function conforms to
+.St -p1003.1-2008
+except for the return value.
+This implementation returns 0 upon successful completion but
+the standard requires returning the new nice value,
+which could be \-1.
.Sh HISTORY
A
.Fn nice
diff --git a/lib/libc/gen/nice.c b/lib/libc/gen/nice.c
index e8375e8..ba9524b 100644
--- a/lib/libc/gen/nice.c
+++ b/lib/libc/gen/nice.c
@@ -43,14 +43,20 @@ __FBSDID("$FreeBSD$");
* Backwards compatible nice.
*/
int
-nice(incr)
- int incr;
+nice(int incr)
{
- int prio;
+ int saverrno, prio;
+ saverrno = errno;
errno = 0;
prio = getpriority(PRIO_PROCESS, 0);
- if (prio == -1 && errno)
+ if (prio == -1 && errno != 0)
return (-1);
- return (setpriority(PRIO_PROCESS, 0, prio + incr));
+ if (setpriority(PRIO_PROCESS, 0, prio + incr) == -1) {
+ if (errno == EACCES)
+ errno = EPERM;
+ return (-1);
+ }
+ errno = saverrno;
+ return (0);
}
diff --git a/lib/libc/string/memmem.3 b/lib/libc/string/memmem.3
index 73c267c..fb341f4 100644
--- a/lib/libc/string/memmem.3
+++ b/lib/libc/string/memmem.3
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 24, 2005
+.Dd May 26, 2015
.Dt MEMMEM 3
.Os
.Sh NAME
@@ -51,14 +51,12 @@ in the byte string
.Fa big .
.Sh RETURN VALUES
If
-.Fa big_len
-is smaller than
-.Fa little_len ,
-if
.Fa little_len
-is 0, if
-.Fa big_len
-is 0 or if
+is zero
+.Fa big
+is returned (that is, an empty little is deemed to match at the beginning of
+big);
+if
.Fa little
occurs nowhere in
.Fa big ,
@@ -84,3 +82,11 @@ function first appeared in
.Sh BUGS
This function was broken in Linux libc up to and including version 5.0.9
and in GNU libc prior to version 2.1.
+Prior to
+.Fx 11.0
+.Nm
+returned
+.Dv NULL
+when
+.Fa little_len
+equals 0.
diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c
index 72e6517..3fd05df 100644
--- a/lib/libc/string/memmem.c
+++ b/lib/libc/string/memmem.c
@@ -42,9 +42,9 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
const char *cl = (const char *)l;
const char *cs = (const char *)s;
- /* we need something to compare */
- if (l_len == 0 || s_len == 0)
- return NULL;
+ /* empty "s" matches the beginning of "l" */
+ if (s_len == 0)
+ return (void *)cl;
/* "s" must be smaller or equal to "l" */
if (l_len < s_len)
diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2
index e0a1f04..7ad7aa7 100644
--- a/lib/libc/sys/recv.2
+++ b/lib/libc/sys/recv.2
@@ -28,7 +28,7 @@
.\" @(#)recv.2 8.3 (Berkeley) 2/21/94
.\" $FreeBSD$
.\"
-.Dd March 19, 2013
+.Dd February 3, 2017
.Dt RECV 2
.Os
.Sh NAME
@@ -218,57 +218,10 @@ with no data buffer provided immediately after an
.Fn accept
system call.
.Pp
-Open file descriptors are now passed as ancillary data for
+With
.Dv AF_UNIX
-domain sockets, with
-.Fa cmsg_level
-set to
-.Dv SOL_SOCKET
-and
-.Fa cmsg_type
-set to
-.Dv SCM_RIGHTS .
-The close-on-exec flag on received descriptors is set according to the
-.Dv MSG_CMSG_CLOEXEC
-flag passed to
-.Fn recvmsg .
-.Pp
-Process credentials can also be passed as ancillary data for
-.Dv AF_UNIX
-domain sockets using a
-.Fa cmsg_type
-of
-.Dv SCM_CREDS .
-In this case,
-.Fa cmsg_data
-should be a structure of type
-.Fa cmsgcred ,
-which is defined in
-.In sys/socket.h
-as follows:
-.Bd -literal
-struct cmsgcred {
- pid_t cmcred_pid; /* PID of sending process */
- uid_t cmcred_uid; /* real UID of sending process */
- uid_t cmcred_euid; /* effective UID of sending process */
- gid_t cmcred_gid; /* real GID of sending process */
- short cmcred_ngroups; /* number or groups */
- gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
-};
-.Ed
-.Pp
-If a sender supplies ancillary data with enough space for the above struct
-tagged as
-.Dv SCM_CREDS
-control message type to the
-.Fn sendmsg
-system call, then kernel will fill in the credential information of the
-sending process and deliver it to the receiver.
-Since receiver usually has no control over a sender, this method of retrieving
-credential information isn't reliable.
-For reliable retrieval of remote side credentials it is advised to use the
-.Dv LOCAL_CREDS
-socket option on the receiving socket.
+domain sockets, ancillary data can be used to pass file descriptors and
+process credentials.
See
.Xr unix 4
for details.
diff --git a/lib/libc/tests/Makefile b/lib/libc/tests/Makefile
index 9b89152..3a7adc4 100644
--- a/lib/libc/tests/Makefile
+++ b/lib/libc/tests/Makefile
@@ -2,8 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc
-
SUBDIR= tls_dso
TESTS_SUBDIRS= c063
@@ -17,6 +15,7 @@ TESTS_SUBDIRS+= nss
TESTS_SUBDIRS+= regex
TESTS_SUBDIRS+= resolv
TESTS_SUBDIRS+= rpc
+TESTS_SUBDIRS+= setjmp
TESTS_SUBDIRS+= stdio
TESTS_SUBDIRS+= stdlib
TESTS_SUBDIRS+= string
diff --git a/lib/libc/tests/Makefile.netbsd-tests b/lib/libc/tests/Makefile.netbsd-tests
index 56472fb..18b0276 100644
--- a/lib/libc/tests/Makefile.netbsd-tests
+++ b/lib/libc/tests/Makefile.netbsd-tests
@@ -1,8 +1,8 @@
# $FreeBSD$
-OBJTOP?= ${.OBJDIR:H:H:H:H}
-SRCTOP?= ${.CURDIR:H:H:H:H}
-TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/lib/libc/${.CURDIR:T}
+TESTSRC:= ${SRCTOP}/contrib/netbsd-tests/${RELDIR:C/libc\/tests/libc/}
+
+TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/}
WARNS?= 2
diff --git a/lib/libc/tests/c063/Makefile b/lib/libc/tests/c063/Makefile
index b81f575..c890eda 100644
--- a/lib/libc/tests/c063/Makefile
+++ b/lib/libc/tests/c063/Makefile
@@ -1,8 +1,6 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libc/c063
-
-#TODO: t_o_search, t_utimensat
+#TODO: t_o_search
NETBSD_ATF_TESTS_C= faccessat_test
NETBSD_ATF_TESTS_C+= fchmodat_test
@@ -18,6 +16,7 @@ NETBSD_ATF_TESTS_C+= readlinkat_test
NETBSD_ATF_TESTS_C+= renameat_test
NETBSD_ATF_TESTS_C+= symlinkat_test
NETBSD_ATF_TESTS_C+= unlinkat_test
+NETBSD_ATF_TESTS_C+= utimensat
CFLAGS+= -D_INCOMPLETE_XOPEN_C063
diff --git a/lib/libc/tests/db/Makefile b/lib/libc/tests/db/Makefile
index ed1d6ca..c056384 100644
--- a/lib/libc/tests/db/Makefile
+++ b/lib/libc/tests/db/Makefile
@@ -1,18 +1,20 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libc/db
-
BINDIR= ${TESTSDIR}
PROGS= h_db
+PROGS+= h_lfsr
FILESDIR= ${TESTSDIR}
-FILES= README
+FILES+= README
+NETBSD_ATF_TESTS_C+= db_hash_seq_test
NETBSD_ATF_TESTS_SH+= db_test
ATF_TESTS_SH_SED_db_test= -e 's,/bin/csh,/bin/cat,g'
+CFLAGS+= -I${SRCTOP}/lib/libc/db/btree
+
.include "../Makefile.netbsd-tests"
.include <bsd.test.mk>
diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile
index 91097ef..ac9f8e0 100644
--- a/lib/libc/tests/gen/Makefile
+++ b/lib/libc/tests/gen/Makefile
@@ -2,8 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/gen
-
ATF_TESTS_C+= arc4random_test
ATF_TESTS_C+= fmtcheck2_test
ATF_TESTS_C+= fmtmsg_test
@@ -14,10 +12,20 @@ ATF_TESTS_C+= popen_test
ATF_TESTS_C+= posix_spawn_test
ATF_TESTS_C+= wordexp_test
-# TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep
+# TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid,
# TODO: t_siginfo (fixes require further inspection)
# TODO: t_sethostname_test (consistently screws up the hostname)
+CFLAGS+= -DTEST_LONG_DOUBLE
+
+# Not sure why this isn't defined for all architectures, since most
+# have long double.
+.if ${MACHINE_CPUARCH} == "aarch64" || \
+ ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+CFLAGS+= -D__HAVE_LONG_DOUBLE
+.endif
+
NETBSD_ATF_TESTS_C= alarm_test
NETBSD_ATF_TESTS_C+= assert_test
NETBSD_ATF_TESTS_C+= basedirname_test
diff --git a/lib/libc/tests/gen/execve/Makefile b/lib/libc/tests/gen/execve/Makefile
index 2106a15..5e8bc6f 100644
--- a/lib/libc/tests/gen/execve/Makefile
+++ b/lib/libc/tests/gen/execve/Makefile
@@ -1,13 +1,7 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H:H:H}
-TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/gen/${.CURDIR:T}
-
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/gen/execve
-
NETBSD_ATF_TESTS_C= execve_test
.include "../../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/gen/posix_spawn/Makefile b/lib/libc/tests/gen/posix_spawn/Makefile
index f20bbd7..9bb2cf1 100644
--- a/lib/libc/tests/gen/posix_spawn/Makefile
+++ b/lib/libc/tests/gen/posix_spawn/Makefile
@@ -1,13 +1,7 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H:H:H}
-TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/gen/${.CURDIR:T}
-
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/gen/posix_spawn
-
BINDIR= ${TESTSDIR}
NETBSD_ATF_TESTS_C= fileactions_test
diff --git a/lib/libc/tests/hash/Makefile b/lib/libc/tests/hash/Makefile
index 4c64c70..7fb8fb6 100644
--- a/lib/libc/tests/hash/Makefile
+++ b/lib/libc/tests/hash/Makefile
@@ -2,11 +2,11 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/hash
-
NETBSD_ATF_TESTS_C=
.if ${MK_OPENSSL} != "no"
+# XXX: doesn't compile
+#NETBSD_ATF_TESTS_C+= hmac_test
NETBSD_ATF_TESTS_C+= sha2_test
.endif
@@ -29,8 +29,8 @@ LDADD+= -lmd
DPADD.sha2_test+= ${LIBCRYPTO}
LDADD.sha2_test+= -lcrypto
-CFLAGS.sha2_test+= -I${.CURDIR}/../../../../crypto/openssh/openbsd-compat
-CFLAGS.sha2_test+= -I${.CURDIR}/../../../../crypto/openssh
+CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh/openbsd-compat
+CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/inet/Makefile b/lib/libc/tests/inet/Makefile
index a15b96a..fa4499c 100644
--- a/lib/libc/tests/inet/Makefile
+++ b/lib/libc/tests/inet/Makefile
@@ -2,9 +2,8 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/inet
-
-NETBSD_ATF_TESTS_C= inet_network_test
+NETBSD_ATF_TESTS_C+= inet_addr_test
+NETBSD_ATF_TESTS_C+= inet_network_test
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/locale/Makefile b/lib/libc/tests/locale/Makefile
index d15fd5e..e05cbae 100644
--- a/lib/libc/tests/locale/Makefile
+++ b/lib/libc/tests/locale/Makefile
@@ -2,8 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/locale
-
ATF_TESTS_C+= btowc_test
ATF_TESTS_C+= c16rtomb_test
ATF_TESTS_C+= iswctype_test
diff --git a/lib/libc/tests/net/Makefile b/lib/libc/tests/net/Makefile
index fb76f26..bee179f 100644
--- a/lib/libc/tests/net/Makefile
+++ b/lib/libc/tests/net/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libc/net
-
ATF_TESTS_C+= ether_test
ATF_TESTS_C+= eui64_aton_test
ATF_TESTS_C+= eui64_ntoa_test
diff --git a/lib/libc/tests/net/getaddrinfo/Makefile b/lib/libc/tests/net/getaddrinfo/Makefile
index a6b9eb1..d21d336 100644
--- a/lib/libc/tests/net/getaddrinfo/Makefile
+++ b/lib/libc/tests/net/getaddrinfo/Makefile
@@ -1,13 +1,9 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/net/${.CURDIR:T}
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/net/getaddrinfo
-
BINDIR= ${TESTSDIR}
.error "This testcase needs to be ported to FreeBSD (the output from getaddrinfo_test differs from NetBSD)"
diff --git a/lib/libc/tests/regex/Makefile b/lib/libc/tests/regex/Makefile
index 37b3277..fa60f6e 100644
--- a/lib/libc/tests/regex/Makefile
+++ b/lib/libc/tests/regex/Makefile
@@ -4,8 +4,6 @@
BINDIR= ${TESTSDIR}
-TESTSDIR= ${TESTSBASE}/lib/libc/regex
-
IMPLEMENTATION?= -DREGEX_SPENCER
CFLAGS.h_regex+=-I${TESTSRC} -I${.CURDIR:H:H}/regex
diff --git a/lib/libc/tests/rpc/Makefile b/lib/libc/tests/rpc/Makefile
index 153626b..f9819d3 100644
--- a/lib/libc/tests/rpc/Makefile
+++ b/lib/libc/tests/rpc/Makefile
@@ -1,6 +1,5 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libc/rpc
SRCS.xdr_test= ${RPCSRC:.x=_xdr.c} t_xdr.c ${RPCSRC:.x=.h} \
h_testbits.h
diff --git a/lib/libc/tests/setjmp/Makefile b/lib/libc/tests/setjmp/Makefile
index e303726..ac962c2 100644
--- a/lib/libc/tests/setjmp/Makefile
+++ b/lib/libc/tests/setjmp/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libc/setjmp
-
NETBSD_ATF_TESTS_C= setjmp_test
NETBSD_ATF_TESTS_C+= threadjmp_test
@@ -10,4 +8,6 @@ LDADD.threadjmp_test+= -lpthread
WARNS?= 4
+.include "../Makefile.netbsd-tests"
+
.include <bsd.test.mk>
diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile
index cf767ce..ec7a82a 100644
--- a/lib/libc/tests/ssp/Makefile
+++ b/lib/libc/tests/ssp/Makefile
@@ -2,8 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/ssp
-
NO_WERROR=
WARNS?= 2
@@ -26,7 +24,11 @@ PROGS+= h_getcwd
PROGS+= h_memcpy
PROGS+= h_memmove
PROGS+= h_memset
+# This testcase doesn't run properly when not compiled with -fsantize=bounds
+# with clang, which is currently contingent on a compiler_rt update
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500
PROGS+= h_raw
+.endif
PROGS+= h_read
PROGS+= h_readlink
PROGS+= h_snprintf
diff --git a/lib/libc/tests/stdio/Makefile b/lib/libc/tests/stdio/Makefile
index 06ceb46..495bb17 100644
--- a/lib/libc/tests/stdio/Makefile
+++ b/lib/libc/tests/stdio/Makefile
@@ -2,15 +2,13 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/stdio
-
ATF_TESTS_C+= fdopen_test
ATF_TESTS_C+= fmemopen2_test
ATF_TESTS_C+= fopen2_test
ATF_TESTS_C+= freopen_test
ATF_TESTS_C+= getdelim_test
ATF_TESTS_C+= mkostemp_test
-ATF_TESTS_C+= open_memstream_test
+ATF_TESTS_C+= open_memstream2_test
ATF_TESTS_C+= open_wmemstream_test
ATF_TESTS_C+= perror_test
ATF_TESTS_C+= print_positional_test
@@ -26,6 +24,7 @@ NETBSD_ATF_TESTS_C+= fmemopen_test
NETBSD_ATF_TESTS_C+= fopen_test
NETBSD_ATF_TESTS_C+= fputc_test
NETBSD_ATF_TESTS_C+= mktemp_test
+NETBSD_ATF_TESTS_C+= open_memstream_test
NETBSD_ATF_TESTS_C+= popen_test
NETBSD_ATF_TESTS_C+= printf_test
NETBSD_ATF_TESTS_C+= scanf_test
diff --git a/lib/libc/tests/stdio/open_memstream_test.c b/lib/libc/tests/stdio/open_memstream2_test.c
index 3c9e3ec..3c9e3ec 100644
--- a/lib/libc/tests/stdio/open_memstream_test.c
+++ b/lib/libc/tests/stdio/open_memstream2_test.c
diff --git a/lib/libc/tests/stdio/printbasic_test.c b/lib/libc/tests/stdio/printbasic_test.c
index 7f7c6cb..322e747 100644
--- a/lib/libc/tests/stdio/printbasic_test.c
+++ b/lib/libc/tests/stdio/printbasic_test.c
@@ -78,22 +78,19 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...)
va_copy(ap2, ap);
smash_stack();
vsnprintf(s, sizeof(s), fmt, ap);
- if (strcmp(result, s) != 0) {
- atf_tc_fail(
- "printf(\"%s\", %s) ==> [%s], expected [%s]",
- fmt, argstr, s, result);
- }
+ ATF_CHECK_MSG(strcmp(result, s) == 0,
+ "printf(\"%s\", %s) ==> [%s], expected [%s]",
+ fmt, argstr, s, result);
smash_stack();
mbstowcs(ws, s, BUF - 1);
mbstowcs(wfmt, fmt, BUF - 1);
mbstowcs(wresult, result, BUF - 1);
vswprintf(ws, sizeof(ws) / sizeof(ws[0]), wfmt, ap2);
- if (wcscmp(wresult, ws) != 0) {
- atf_tc_fail(
- "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
- wfmt, argstr, ws, wresult);
- }
+ ATF_CHECK_MSG(wcscmp(wresult, ws) == 0,
+ "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
+ wfmt, argstr, ws, wresult);
+
va_end(ap);
va_end(ap2);
}
@@ -114,6 +111,11 @@ ATF_TC_BODY(int_within_limits, tc)
testfmt("-1", "%jd", (intmax_t)-1);
testfmt(S_UINT64MAX, "%ju", UINT64_MAX);
+ if (sizeof(ptrdiff_t) != sizeof(uintmax_t))
+ atf_tc_expect_fail("the %%t qualifier is broken on 32-bit "
+ "platforms where there's a mismatch between ptrdiff_t and "
+ "uintmax_t's type width; bug # 191674");
+
testfmt("-1", "%td", (ptrdiff_t)-1);
testfmt(S_SIZEMAX, "%tu", (size_t)-1);
diff --git a/lib/libc/tests/stdio/printfloat_test.c b/lib/libc/tests/stdio/printfloat_test.c
index 8c02bec..6655680 100644
--- a/lib/libc/tests/stdio/printfloat_test.c
+++ b/lib/libc/tests/stdio/printfloat_test.c
@@ -70,22 +70,19 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...)
va_copy(ap2, ap);
smash_stack();
vsnprintf(s, sizeof(s), fmt, ap);
- if (strcmp(result, s) != 0) {
- atf_tc_fail(
- "printf(\"%s\", %s) ==> [%s], expected [%s]",
- fmt, argstr, s, result);
- }
+ ATF_CHECK_MSG(strcmp(result, s) == 0,
+ "printf(\"%s\", %s) ==> [%s], expected [%s]",
+ fmt, argstr, s, result);
smash_stack();
mbstowcs(ws, s, BUF - 1);
mbstowcs(wfmt, fmt, BUF - 1);
mbstowcs(wresult, result, BUF - 1);
vswprintf(ws, sizeof(ws) / sizeof(ws[0]), wfmt, ap2);
- if (wcscmp(wresult, ws) != 0) {
- atf_tc_fail(
- "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
- wfmt, argstr, ws, wresult);
- }
+ ATF_CHECK_MSG(wcscmp(wresult, ws) == 0,
+ "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
+ wfmt, argstr, ws, wresult);
+
va_end(ap);
va_end(ap2);
}
@@ -318,7 +315,7 @@ ATF_TC_BODY(hexadecimal_floating_point, tc)
testfmt("0x1p-1074", "%a", 0x1p-1074);
testfmt("0x1.2345p-1024", "%a", 0x1.2345p-1024);
-#if (LDBL_MANT_DIG == 64) && !defined(__i386__)
+#if (LDBL_MANT_DIG == 64)
testfmt("0x1.921fb54442d18468p+1", "%La", 0x3.243f6a8885a308dp0L);
testfmt("0x1p-16445", "%La", 0x1p-16445L);
testfmt("0x1.30ecap-16381", "%La", 0x9.8765p-16384L);
diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile
index 15d8cbc..1548fac 100644
--- a/lib/libc/tests/stdlib/Makefile
+++ b/lib/libc/tests/stdlib/Makefile
@@ -10,9 +10,15 @@ ATF_TESTS_CXX+= cxa_thread_atexit_test
ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test
.endif
-TESTSDIR= ${TESTSBASE}/lib/libc/stdlib
+# Not sure why this isn't defined for all architectures, since most
+# have long double.
+.if ${MACHINE_CPUARCH} == "aarch64" || \
+ ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+CFLAGS+= -D__HAVE_LONG_DOUBLE
+.endif
-# TODO: t_getenv_thread, t_mi_vector_hash
+# TODO: t_getenv_thread, t_mi_vector_hash, t_strtoi
NETBSD_ATF_TESTS_C+= abs_test
NETBSD_ATF_TESTS_C+= atoi_test
NETBSD_ATF_TESTS_C+= div_test
diff --git a/lib/libc/tests/string/Makefile b/lib/libc/tests/string/Makefile
index 3f97edc..14044f4 100644
--- a/lib/libc/tests/string/Makefile
+++ b/lib/libc/tests/string/Makefile
@@ -5,8 +5,6 @@ ATF_TESTS_C+= strerror2_test
ATF_TESTS_C+= wcscasecmp_test
ATF_TESTS_C+= wcsnlen_test
-TESTSDIR= ${TESTSBASE}/lib/libc/string
-
# TODO: popcount, stresep
NETBSD_ATF_TESTS_C+= memchr_test
diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile
index 39aec1f..be2f4e7 100644
--- a/lib/libc/tests/sys/Makefile
+++ b/lib/libc/tests/sys/Makefile
@@ -2,13 +2,12 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/sys
-
ATF_TESTS_C+= queue_test
# TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg,
# swapcontext
NETBSD_ATF_TESTS_C+= access_test
+NETBSD_ATF_TESTS_C+= bind_test
NETBSD_ATF_TESTS_C+= chroot_test
NETBSD_ATF_TESTS_C+= clock_gettime_test
NETBSD_ATF_TESTS_C+= connect_test
@@ -21,6 +20,7 @@ NETBSD_ATF_TESTS_C+= getlogin_test
NETBSD_ATF_TESTS_C+= getpid_test
NETBSD_ATF_TESTS_C+= getrusage_test
NETBSD_ATF_TESTS_C+= getsid_test
+NETBSD_ATF_TESTS_C+= getsockname_test
NETBSD_ATF_TESTS_C+= gettimeofday_test
NETBSD_ATF_TESTS_C+= issetugid_test
NETBSD_ATF_TESTS_C+= kevent_test
@@ -43,6 +43,7 @@ NETBSD_ATF_TESTS_C+= nanosleep_test
NETBSD_ATF_TESTS_C+= pipe_test
NETBSD_ATF_TESTS_C+= pipe2_test
NETBSD_ATF_TESTS_C+= poll_test
+NETBSD_ATF_TESTS_C+= posix_fallocate_test
NETBSD_ATF_TESTS_C+= revoke_test
NETBSD_ATF_TESTS_C+= select_test
NETBSD_ATF_TESTS_C+= setrlimit_test
@@ -57,6 +58,9 @@ NETBSD_ATF_TESTS_C+= truncate_test
NETBSD_ATF_TESTS_C+= ucontext_test
NETBSD_ATF_TESTS_C+= umask_test
NETBSD_ATF_TESTS_C+= unlink_test
+NETBSD_ATF_TESTS_C+= wait_test
+NETBSD_ATF_TESTS_C+= wait_noproc_test
+NETBSD_ATF_TESTS_C+= wait_noproc_wnohang_test
NETBSD_ATF_TESTS_C+= write_test
DPADD.getpid_test+= ${LIBPTHREAD}
@@ -64,8 +68,13 @@ LDADD.getpid_test+= -lpthread
DPADD.timer_create_test+= ${LIBRT}
LDADD.timer_create_test+= -lrt
+CSTD?= c99
+
.include "../Makefile.netbsd-tests"
+SRCS.mlock_test+= mlock_helper.c
+SRCS.setrlimit_test+= mlock_helper.c
+
.if ${COMPILER_TYPE} == "gcc"
WARNS?= 3
.else
diff --git a/lib/libc/tests/sys/mlock_helper.c b/lib/libc/tests/sys/mlock_helper.c
new file mode 100644
index 0000000..7fa40d1
--- /dev/null
+++ b/lib/libc/tests/sys/mlock_helper.c
@@ -0,0 +1,114 @@
+/*-
+ * Copyright (C) 2016 Bryan Drewery <bdrewery@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Helper for mlock(3) to avoid EAGAIN errors
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <limits.h>
+
+#define VM_MAX_WIRED "vm.max_wired"
+
+static void
+vm_max_wired_sysctl(int *old_value, int *new_value)
+{
+ size_t old_len;
+ size_t new_len = (new_value == NULL ? 0 : sizeof(int));
+
+ if (old_value == NULL)
+ printf("Setting the new value to %d\n", *new_value);
+ else {
+ ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len,
+ new_value, new_len) == 0,
+ "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
+ }
+
+ ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len,
+ new_value, new_len) == 0,
+ "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
+
+ if (old_value != NULL)
+ printf("Saved the old value (%d)\n", *old_value);
+}
+
+void
+set_vm_max_wired(int new_value)
+{
+ FILE *fp;
+ int old_value;
+
+ fp = fopen(VM_MAX_WIRED, "w");
+ if (fp == NULL) {
+ atf_tc_skip("could not open %s for writing: %s",
+ VM_MAX_WIRED, strerror(errno));
+ return;
+ }
+
+ vm_max_wired_sysctl(&old_value, NULL);
+
+ ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0,
+ "saving %s failed", VM_MAX_WIRED);
+
+ fclose(fp);
+
+ vm_max_wired_sysctl(NULL, &new_value);
+}
+
+void
+restore_vm_max_wired(void)
+{
+ FILE *fp;
+ int saved_max_wired;
+
+ fp = fopen(VM_MAX_WIRED, "r");
+ if (fp == NULL) {
+ perror("fopen failed\n");
+ return;
+ }
+
+ if (fscanf(fp, "%d", &saved_max_wired) != 1) {
+ perror("fscanf failed\n");
+ fclose(fp);
+ return;
+ }
+
+ fclose(fp);
+ printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired);
+
+ if (saved_max_wired == 0) /* This will cripple the test host */
+ return;
+
+ vm_max_wired_sysctl(NULL, &saved_max_wired);
+}
diff --git a/lib/libc/tests/termios/Makefile b/lib/libc/tests/termios/Makefile
index 9a3fd66..0495d68 100644
--- a/lib/libc/tests/termios/Makefile
+++ b/lib/libc/tests/termios/Makefile
@@ -2,8 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/termios
-
NETBSD_ATF_TESTS_C= tcsetpgrp_test
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/time/Makefile b/lib/libc/tests/time/Makefile
index c2a55df..feb543d 100644
--- a/lib/libc/tests/time/Makefile
+++ b/lib/libc/tests/time/Makefile
@@ -2,8 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/time
-
NETBSD_ATF_TESTS_C= mktime_test
NETBSD_ATF_TESTS_C+= strptime_test
diff --git a/lib/libc/tests/tls/Makefile b/lib/libc/tests/tls/Makefile
index e224895..b6b6719 100644
--- a/lib/libc/tests/tls/Makefile
+++ b/lib/libc/tests/tls/Makefile
@@ -2,7 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/tls
.if !defined(NO_PIC)
SUBDIR+= dso
.endif
diff --git a/lib/libc/tests/tls/dso/Makefile b/lib/libc/tests/tls/dso/Makefile
index 466f950..9b698cd 100644
--- a/lib/libc/tests/tls/dso/Makefile
+++ b/lib/libc/tests/tls/dso/Makefile
@@ -1,7 +1,6 @@
# $FreeBSD$
OBJTOP= ${.OBJDIR:H:H:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/tls/${.CURDIR:T}
LIB= h_tls_dlopen
diff --git a/lib/libc/tests/ttyio/Makefile b/lib/libc/tests/ttyio/Makefile
index a1f320d..242f332 100644
--- a/lib/libc/tests/ttyio/Makefile
+++ b/lib/libc/tests/ttyio/Makefile
@@ -2,8 +2,6 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib/libc/ttyio
-
# TODO: ptm_test
NETBSD_ATF_TESTS_C= ttyio_test
diff --git a/lib/libc_nonshared/Makefile b/lib/libc_nonshared/Makefile
index 4c2a945..d32f365 100644
--- a/lib/libc_nonshared/Makefile
+++ b/lib/libc_nonshared/Makefile
@@ -6,7 +6,7 @@
# bsd.lib.mk doesn't have an easy way to express that.
NO_PROFILE?=
.include <bsd.own.mk>
-NO_PIC=
+NO_PIC=
# -fpic on some platforms, -fPIC on others.
CFLAGS+=${PICFLAG} -DPIC -fvisibility=hidden
@@ -18,9 +18,9 @@ LIBC_NONSHARED_SRCS=
SRCS= __stub.c
.if ${MK_ICONV} == "yes"
-.PATH: ${.CURDIR}/../libc/iconv
+.PATH: ${SRCTOP}/lib/libc/iconv
.include "Makefile.iconv"
-CFLAGS+=-I${.CURDIR}/../libc/iconv
+CFLAGS+=-I${SRCTOP}/lib/libc/iconv
.endif
SRCS+= ${LIBC_NONSHARED_SRCS}
diff --git a/lib/libcam/Makefile b/lib/libcam/Makefile
index 9a21dde..af28912 100644
--- a/lib/libcam/Makefile
+++ b/lib/libcam/Makefile
@@ -36,11 +36,10 @@ MLINKS+= cam.3 cam_open_device.3 \
cam_cdbparse.3 csio_encode_visit.3 \
cam_cdbparse.3 buff_encode_visit.3
-.PATH: ${.CURDIR}/../../sys/cam/scsi ${.CURDIR}/../../sys/cam/ata \
- ${.CURDIR}/../../sys/cam
+.PATH: ${SRCTOP}/sys/cam/scsi ${SRCTOP}/sys/cam/ata \
+ ${SRCTOP}/sys/cam
-SDIR= ${.CURDIR}/../../sys
-CFLAGS+= -I${.CURDIR} -I${SDIR}
+CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys
SHLIB_MAJOR= 6
diff --git a/lib/libcom_err/Makefile b/lib/libcom_err/Makefile
index 78014ad..c19b2a8 100644
--- a/lib/libcom_err/Makefile
+++ b/lib/libcom_err/Makefile
@@ -4,7 +4,7 @@ LIB= com_err
SRCS= com_err.c error.c
INCS= ${COM_ERRDIR}/com_err.h ${COM_ERRDIR}/com_right.h
MAN= com_err.3
-COM_ERRDIR= ${.CURDIR}/../../contrib/com_err
+COM_ERRDIR= ${SRCTOP}/contrib/com_err
CFLAGS+= -I${COM_ERRDIR}
LDFLAGS= -Wl,--no-undefined
diff --git a/lib/libcompat/Makefile b/lib/libcompat/Makefile
index fca86c7..a7d56a7 100644
--- a/lib/libcompat/Makefile
+++ b/lib/libcompat/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
LIB= compat
-CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS -I${.CURDIR}/../libc/locale
+CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS -I${SRCTOP}/lib/libc/locale
NO_PIC=
WARNS?= 0
diff --git a/lib/libcrypt/tests/Makefile b/lib/libcrypt/tests/Makefile
index 65ebd66..8e3fc2e 100644
--- a/lib/libcrypt/tests/Makefile
+++ b/lib/libcrypt/tests/Makefile
@@ -4,8 +4,6 @@ SRCTOP= ${.CURDIR:H:H:H}
OBJTOP= ${.OBJDIR:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libcrypt
-TESTSDIR= ${TESTSBASE}/lib/libcrypt
-
NETBSD_ATF_TESTS_C+= crypt_test
CFLAGS+= -I${.CURDIR:H}
diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile
index d197361..1d14cfe 100644
--- a/lib/libcxxrt/Makefile
+++ b/lib/libcxxrt/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCDIR= ${.CURDIR}/../../contrib/libcxxrt
+SRCDIR= ${SRCTOP}/contrib/libcxxrt
SHLIB_MAJOR= 1
SHLIBDIR?= /lib
diff --git a/lib/libexecinfo/Makefile b/lib/libexecinfo/Makefile
index 81fa82a..15520c2 100644
--- a/lib/libexecinfo/Makefile
+++ b/lib/libexecinfo/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-LIBEXECINFO= ${.CURDIR}/../../contrib/libexecinfo
+LIBEXECINFO= ${SRCTOP}/contrib/libexecinfo
LIB= execinfo
SHLIB_MAJOR= 1
diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile
index 9b641c1..389453d 100644
--- a/lib/libexpat/Makefile
+++ b/lib/libexpat/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-EXPAT= ${.CURDIR}/../../contrib/expat
+EXPAT= ${SRCTOP}/contrib/expat
LIB= bsdxml
SHLIBDIR?= /lib
diff --git a/lib/libgssapi/Makefile b/lib/libgssapi/Makefile
index 3f016b4..3094631 100644
--- a/lib/libgssapi/Makefile
+++ b/lib/libgssapi/Makefile
@@ -2,7 +2,7 @@
LIB= gssapi
SHLIB_MAJOR= 10
-VERSION_DEF= ${.CURDIR}/../libc/Versions.def
+VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
SRCS=
diff --git a/lib/libiconv_modules/Makefile.inc b/lib/libiconv_modules/Makefile.inc
index 3b25374..d24c616 100644
--- a/lib/libiconv_modules/Makefile.inc
+++ b/lib/libiconv_modules/Makefile.inc
@@ -1,10 +1,10 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../libc/iconv
+.PATH: ${SRCTOP}/lib/libc/iconv
SHLIB_MAJOR= 4
WARNS?= 6
-CFLAGS+= -I${.CURDIR}/../../libc/iconv
+CFLAGS+= -I${SRCTOP}/lib/libc/iconv
CFLAGS+= -Dbool=_Bool
diff --git a/lib/libiconv_modules/mapper_parallel/Makefile b/lib/libiconv_modules/mapper_parallel/Makefile
index b79c3ad..0008665 100644
--- a/lib/libiconv_modules/mapper_parallel/Makefile
+++ b/lib/libiconv_modules/mapper_parallel/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../mapper_serial
+.PATH: ${.CURDIR:H}/mapper_serial
SHLIB= mapper_parallel
SRCS+= citrus_mapper_serial.c
diff --git a/lib/libkiconv/Makefile b/lib/libkiconv/Makefile
index bda505e..650f7e0 100644
--- a/lib/libkiconv/Makefile
+++ b/lib/libkiconv/Makefile
@@ -16,7 +16,7 @@ MLINKS+= kiconv.3 kiconv_add_xlat16_cspair.3 \
kiconv.3 kiconv_add_xlat16_cspairs.3 \
kiconv.3 kiconv_add_xlat16_table.3
-CFLAGS+= -I${.CURDIR}/../../sys
+CFLAGS+= -I${SRCTOP}/sys
WARNS?= 1
diff --git a/lib/libldns/Makefile b/lib/libldns/Makefile
index db4b989..5c9eed4 100644
--- a/lib/libldns/Makefile
+++ b/lib/libldns/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
# Vendor sources and generated files
-LDNSDIR = ${.CURDIR}/../../contrib/ldns
+LDNSDIR = ${SRCTOP}/contrib/ldns
.PATH: ${LDNSDIR} ${LDNSDIR}/compat
diff --git a/lib/liblzma/Makefile b/lib/liblzma/Makefile
index c78933a..24ed42c 100644
--- a/lib/liblzma/Makefile
+++ b/lib/liblzma/Makefile
@@ -1,9 +1,9 @@
# $FreeBSD$
LIB= lzma
-LZMADIR= ${.CURDIR}/../../contrib/xz/src/liblzma
+LZMADIR= ${SRCTOP}/contrib/xz/src/liblzma
-.PATH: ${LZMADIR}/../common
+.PATH: ${LZMADIR:H}/common
SRCS+= tuklib_physmem.c tuklib_cpucores.c
.PATH: ${LZMADIR}/api/lzma
@@ -144,7 +144,7 @@ CFLAGS+= -DHAVE_CONFIG_H \
-I${LZMADIR}/lzma \
-I${LZMADIR}/delta \
-I${LZMADIR}/simple \
- -I${LZMADIR}/../common
+ -I${LZMADIR:H}/common
DPADD+= ${LIBPTHREAD}
LDADD+= -lpthread
diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile
index 935a0ef..08ad9b4 100644
--- a/lib/libmagic/Makefile
+++ b/lib/libmagic/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
# Copyright (c) David E. O'Brien, 2000-2004, 2006, 2009
-CONTRDIR= ${.CURDIR}/../../contrib/file
+CONTRDIR= ${SRCTOP}/contrib/file
.PATH: ${CONTRDIR}/src
.PATH: ${CONTRDIR}/doc
diff --git a/lib/libmilter/Makefile b/lib/libmilter/Makefile
index 0e625d0..00c0548 100644
--- a/lib/libmilter/Makefile
+++ b/lib/libmilter/Makefile
@@ -2,7 +2,7 @@
.include <bsd.own.mk>
-SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
+SENDMAIL_DIR=${SRCTOP}/contrib/sendmail
.PATH: ${SENDMAIL_DIR}/libmilter ${SENDMAIL_DIR}/libsm
CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I.
diff --git a/lib/libmp/Makefile b/lib/libmp/Makefile
index 67f6edd..08a52f5 100644
--- a/lib/libmp/Makefile
+++ b/lib/libmp/Makefile
@@ -10,9 +10,9 @@ MAN= libmp.3
INCS= mp.h
SRCS= mpasbn.c
-CFLAGS+= -I${.CURDIR}/../../crypto
+CFLAGS+= -I${SRCTOP}/crypto
-VERSION_DEF= ${.CURDIR}/../libc/Versions.def
+VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
.if ${MK_TESTS} != "no"
diff --git a/lib/libmp/tests/Makefile b/lib/libmp/tests/Makefile
index 0f591eb..d556347 100644
--- a/lib/libmp/tests/Makefile
+++ b/lib/libmp/tests/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libmp
-
TAP_TESTS_C+= legacy_test
DPADD+= ${LIBCRYPTO} ${LIBMP}
diff --git a/lib/libngatm/Makefile b/lib/libngatm/Makefile
index 85294b0..47dc716 100644
--- a/lib/libngatm/Makefile
+++ b/lib/libngatm/Makefile
@@ -7,8 +7,8 @@ SHLIB_MAJOR= 4
MAN= libngatm.3 uniaddr.3 unifunc.3 unimsg.3 unisap.3 unistruct.3
# source of the library lives in contrib
-SDIR= ${.CURDIR}/../../sys
-CTRB= ${.CURDIR}/../../contrib/ngatm
+SDIR= ${SRCTOP}/sys
+CTRB= ${SRCTOP}/contrib/ngatm
LIBBASE= ${SDIR}/contrib/ngatm
CFLAGS+= -I${LIBBASE} -I${.OBJDIR} -I${CTRB}/libngatm
diff --git a/lib/libnv/tests/Makefile b/lib/libnv/tests/Makefile
index d8e0904..870b7df 100644
--- a/lib/libnv/tests/Makefile
+++ b/lib/libnv/tests/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libnv
-
ATF_TESTS_CXX= \
dnv_tests \
nv_tests \
diff --git a/lib/libopie/Makefile b/lib/libopie/Makefile
index 647bfee..dd21192 100644
--- a/lib/libopie/Makefile
+++ b/lib/libopie/Makefile
@@ -2,7 +2,7 @@
#
# $FreeBSD$
#
-OPIE_DIST?= ${.CURDIR}/../../contrib/opie
+OPIE_DIST?= ${SRCTOP}/contrib/opie
DIST_DIR= ${OPIE_DIST}/${.CURDIR:T}
SHLIB_MAJOR= 7
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
index 105748e..8f11ac2 100644
--- a/lib/libpam/libpam/Makefile
+++ b/lib/libpam/libpam/Makefile
@@ -35,7 +35,7 @@
#
# $FreeBSD$
-OPENPAM= ${.CURDIR}/../../../contrib/openpam
+OPENPAM= ${SRCTOP}/contrib/openpam
.PATH: ${OPENPAM}/include ${OPENPAM}/lib/libpam ${OPENPAM}/doc/man
LIB= pam
@@ -198,4 +198,8 @@ DPSRCS= openpam_static.c
INCS= ${HEADERS} ${ADD_HEADERS}
INCSDIR= ${INCLUDEDIR}/security
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.lib.mk>
diff --git a/lib/libpam/libpam/tests/Makefile b/lib/libpam/libpam/tests/Makefile
new file mode 100644
index 0000000..a581392
--- /dev/null
+++ b/lib/libpam/libpam/tests/Makefile
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+OPENPAM= ${SRCTOP}/contrib/openpam
+.PATH: ${OPENPAM}/t
+
+TESTSDIR = ${TESTSBASE}/lib/libpam
+
+COMMONSRC = t_file.c t_main.c
+.for test in t_openpam_ctype t_openpam_readlinev t_openpam_readword
+TAP_TESTS_C += ${test}
+SRCS.${test} = ${test}.c ${COMMONSRC}
+.endfor
+CFLAGS +=-I${OPENPAM}/include -I${OPENPAM}/lib/libpam -I${OPENPAM}/t
+WARNS ?= 6
+
+DPADD = ${LIBPAM}
+LDADD = ${MINUSLPAM}
+
+.include <bsd.test.mk>
diff --git a/lib/libpam/modules/Makefile.inc b/lib/libpam/modules/Makefile.inc
index 8ff6ca6..f11c4ca 100644
--- a/lib/libpam/modules/Makefile.inc
+++ b/lib/libpam/modules/Makefile.inc
@@ -1,11 +1,11 @@
# $FreeBSD$
-PAMDIR= ${.CURDIR}/../../../../contrib/openpam
+PAMDIR= ${SRCTOP}/contrib/openpam
NO_INSTALLLIB=
NO_PROFILE=
-CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam
+CFLAGS+= -I${PAMDIR}/include -I${SRCTOP}/lib/libpam
# This is nasty.
# For the static case, libpam.a depends on the modules.
diff --git a/lib/libpam/modules/pam_passwdqc/Makefile b/lib/libpam/modules/pam_passwdqc/Makefile
index c9cc30e..97bffeb 100644
--- a/lib/libpam/modules/pam_passwdqc/Makefile
+++ b/lib/libpam/modules/pam_passwdqc/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCDIR= ${.CURDIR}/../../../../contrib/pam_modules/pam_passwdqc
+SRCDIR= ${SRCTOP}/contrib/pam_modules/pam_passwdqc
.PATH: ${SRCDIR}
LIB= pam_passwdqc
diff --git a/lib/libpam/modules/pam_ssh/Makefile b/lib/libpam/modules/pam_ssh/Makefile
index 56f3781..8cb4cb9 100644
--- a/lib/libpam/modules/pam_ssh/Makefile
+++ b/lib/libpam/modules/pam_ssh/Makefile
@@ -1,7 +1,7 @@
# PAM module for SSH
# $FreeBSD$
-SSHDIR= ${.CURDIR}/../../../../crypto/openssh
+SSHDIR= ${SRCTOP}/crypto/openssh
LIB= pam_ssh
MAN= pam_ssh.8
diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile
index e7401a85..d9d9b4fe 100644
--- a/lib/libpcap/Makefile
+++ b/lib/libpcap/Makefile
@@ -110,7 +110,7 @@ SHLIB_MAJOR= 8
#
# Magic to grab sources out of src/contrib
#
-PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap
+PCAP_DISTDIR?=${SRCTOP}/contrib/libpcap
CFLAGS+=-I${PCAP_DISTDIR}
.PATH: ${PCAP_DISTDIR}
.PATH: ${PCAP_DISTDIR}/bpf/net
diff --git a/lib/libprocstat/zfs/Makefile b/lib/libprocstat/zfs/Makefile
index 9200f02..a58f298 100644
--- a/lib/libprocstat/zfs/Makefile
+++ b/lib/libprocstat/zfs/Makefile
@@ -1,21 +1,21 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/..
+.PATH: ${.CURDIR:H}
SRCS= zfs.c
OBJS= zfs.o
WARNS?= 1
-CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
-CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
-CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
-CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
-CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
-CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
-CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
-CFLAGS+= -I${.CURDIR}/..
+CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris
+CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
+CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem
+CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common
+CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs
+CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
+CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common
+CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys
+CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head
+CFLAGS+= -I${.CURDIR:H}
CFLAGS+= -DNEED_SOLARIS_BOOLEAN
all: ${OBJS}
diff --git a/lib/librpcsec_gss/Makefile b/lib/librpcsec_gss/Makefile
index cc14a7b..223b684 100644
--- a/lib/librpcsec_gss/Makefile
+++ b/lib/librpcsec_gss/Makefile
@@ -8,11 +8,11 @@ SRCS+= rpcsec_gss.c rpcsec_gss_prot.c rpcsec_gss_conf.c rpcsec_gss_misc.c \
DPADD+= ${LIBGSSAPI}
LDADD+= -lgssapi
-VERSION_DEF= ${.CURDIR}/../libc/Versions.def
+VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
-CFLAGS+= -I${.CURDIR}/../../include
-CFLAGS+= -I${.CURDIR}/../../libc_rpc
+CFLAGS+= -I${SRCTOP}/include
+CFLAGS+= -I${SRCTOP}/lib/libc_rpc
NO_PROFILE=
MAN= rpcsec_gss.3
diff --git a/lib/librpcsvc/Makefile b/lib/librpcsvc/Makefile
index 9c9e3ae..0bce2a8 100644
--- a/lib/librpcsvc/Makefile
+++ b/lib/librpcsvc/Makefile
@@ -3,7 +3,7 @@
.include <bsd.own.mk>
-.PATH: ${.CURDIR}/../../include/rpcsvc
+.PATH: ${SRCTOP}/include/rpcsvc
LIB= rpcsvc
diff --git a/lib/librt/tests/Makefile b/lib/librt/tests/Makefile
index 224f52e..3d3f98c 100644
--- a/lib/librt/tests/Makefile
+++ b/lib/librt/tests/Makefile
@@ -1,11 +1,5 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H}
-TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/librt
-
-TESTSDIR= ${TESTSBASE}/lib/librt
-
DPADD+= ${LIBRT}
LDADD+= -lrt
diff --git a/lib/libsbuf/Makefile b/lib/libsbuf/Makefile
index 98ceeb6..260ae81 100644
--- a/lib/libsbuf/Makefile
+++ b/lib/libsbuf/Makefile
@@ -9,6 +9,6 @@ SHLIB_MAJOR = 6
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
VERSION_DEF= ${.CURDIR}/Version.def
-.PATH: ${.CURDIR}/../../sys/kern
+.PATH: ${SRCTOP}/sys/kern
.include <bsd.lib.mk>
diff --git a/lib/libsm/Makefile b/lib/libsm/Makefile
index 012e033..6e9516e 100644
--- a/lib/libsm/Makefile
+++ b/lib/libsm/Makefile
@@ -2,7 +2,7 @@
.include <bsd.own.mk>
-SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
+SENDMAIL_DIR=${SRCTOP}/contrib/sendmail
.PATH: ${SENDMAIL_DIR}/libsm
CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I.
diff --git a/lib/libsmb/Makefile b/lib/libsmb/Makefile
index e464a8f..5644a83 100644
--- a/lib/libsmb/Makefile
+++ b/lib/libsmb/Makefile
@@ -2,7 +2,7 @@
.include <bsd.own.mk>
-CONTRIBDIR= ${.CURDIR}/../../contrib/smbfs
+CONTRIBDIR= ${SRCTOP}/contrib/smbfs
.PATH: ${CONTRIBDIR}/lib/smb
LIB= smb
diff --git a/lib/libsmdb/Makefile b/lib/libsmdb/Makefile
index 976282c..0116634 100644
--- a/lib/libsmdb/Makefile
+++ b/lib/libsmdb/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
+SENDMAIL_DIR=${SRCTOP}/contrib/sendmail
.PATH: ${SENDMAIL_DIR}/libsmdb
CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I.
diff --git a/lib/libsmutil/Makefile b/lib/libsmutil/Makefile
index b7e5a69..32f8a5d 100644
--- a/lib/libsmutil/Makefile
+++ b/lib/libsmutil/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
+SENDMAIL_DIR=${SRCTOP}/contrib/sendmail
.PATH: ${SENDMAIL_DIR}/libsmutil
CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I.
diff --git a/lib/libstdthreads/Makefile b/lib/libstdthreads/Makefile
index 544eeb0..d2eed8a 100644
--- a/lib/libstdthreads/Makefile
+++ b/lib/libstdthreads/Makefile
@@ -35,7 +35,7 @@ MLINKS= thrd_create.3 call_once.3 \
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
-VERSION_DEF= ${.CURDIR}/../libc/Versions.def
+VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
.include <bsd.lib.mk>
diff --git a/lib/libtelnet/Makefile b/lib/libtelnet/Makefile
index 1cf52a0..bab5fa9 100644
--- a/lib/libtelnet/Makefile
+++ b/lib/libtelnet/Makefile
@@ -3,7 +3,7 @@
.include <bsd.own.mk>
-TELNETDIR= ${.CURDIR}/../../contrib/telnet
+TELNETDIR= ${SRCTOP}/contrib/telnet
.PATH: ${TELNETDIR}/libtelnet
LIB= telnet
diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile
index 8b333dd..a7d2868 100644
--- a/lib/libthr/Makefile
+++ b/lib/libthr/Makefile
@@ -17,13 +17,13 @@ LIB=thr
SHLIB_MAJOR= 3
WARNS?= 3
CFLAGS+=-DPTHREAD_KERNEL
-CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \
- -I${.CURDIR}/../../include
+CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR}/thread \
+ -I${SRCTOP}/include
CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include
CFLAGS+=-I${.CURDIR}/sys
-CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf
-CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH}
-CFLAGS+=-I${.CURDIR}/../libthread_db
+CFLAGS+=-I${SRCTOP}/libexec/rtld-elf
+CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH}
+CFLAGS+=-I${SRCTOP}/lib/libthread_db
CFLAGS+=-Winline
.ifndef NO_THREAD_UNWIND_STACK
@@ -33,7 +33,7 @@ CFLAGS+=-D_PTHREAD_FORCED_UNWIND
LDFLAGS+=-Wl,-znodelete
-VERSION_DEF=${.CURDIR}/../libc/Versions.def
+VERSION_DEF=${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS=${.CURDIR}/pthread.map
MAN= libthr.3
diff --git a/lib/libthr/support/Makefile.inc b/lib/libthr/support/Makefile.inc
index 35a15f8..14b3131 100644
--- a/lib/libthr/support/Makefile.inc
+++ b/lib/libthr/support/Makefile.inc
@@ -1,15 +1,15 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string
+.PATH: ${.CURDIR}/support ${SRCTOP}/lib/libc/gen ${SRCTOP}/lib/libc/string
# libc must search machine_arch, then machine_cpuarch, but libthr has all its
# code implemented in machine_cpuarch. Cope.
-.if exists(${.CURDIR}/../libc/${MACHINE_ARCH}/sys)
-.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys
-CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH}
+.if exists(${SRCTOP}/lib/libc/${MACHINE_ARCH}/sys)
+.PATH: ${SRCTOP}/lib/libc/${MACHINE_ARCH}/sys
+CFLAGS+= -I${SRCTOP}/lib/libc/${MACHINE_ARCH}
.else
-.PATH: ${.CURDIR}/../libc/${MACHINE_CPUARCH}/sys
-CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH}
+.PATH: ${SRCTOP}/lib/libc/${MACHINE_CPUARCH}/sys
+CFLAGS+= -I${SRCTOP}/lib/libc/${MACHINE_CPUARCH}
.endif
SYSCALLS= thr_new
diff --git a/lib/libthr/tests/Makefile b/lib/libthr/tests/Makefile
index 50f07f0..cd8f868 100644
--- a/lib/libthr/tests/Makefile
+++ b/lib/libthr/tests/Makefile
@@ -1,11 +1,7 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread
-TESTSDIR= ${TESTSBASE}/lib/libthr
-
# TODO: t_name (missing pthread_getname_np support in FreeBSD)
NETBSD_ATF_TESTS_C= barrier_test
NETBSD_ATF_TESTS_C+= cond_test
@@ -26,6 +22,7 @@ NETBSD_ATF_TESTS_C+= sigsuspend_test
NETBSD_ATF_TESTS_C+= siglongjmp_test
NETBSD_ATF_TESTS_C+= sleep_test
NETBSD_ATF_TESTS_C+= swapcontext_test
+NETBSD_ATF_TESTS_C+= timedmutex_test
NETBSD_ATF_TESTS_SH= atexit_test
NETBSD_ATF_TESTS_SH+= cancel_test
diff --git a/lib/libthr/tests/dlopen/Makefile b/lib/libthr/tests/dlopen/Makefile
index 0764bfa..0893192 100644
--- a/lib/libthr/tests/dlopen/Makefile
+++ b/lib/libthr/tests/dlopen/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen
.include <bsd.own.mk>
diff --git a/lib/libthr/tests/dlopen/dso/Makefile b/lib/libthr/tests/dlopen/dso/Makefile
index 080dec9..dce7d38 100644
--- a/lib/libthr/tests/dlopen/dso/Makefile
+++ b/lib/libthr/tests/dlopen/dso/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen/dso
SHLIB= h_pthread_dlopen
diff --git a/lib/libthread_db/Makefile b/lib/libthread_db/Makefile
index b612f4f..b5e18747 100644
--- a/lib/libthread_db/Makefile
+++ b/lib/libthread_db/Makefile
@@ -14,7 +14,7 @@ CFLAGS+=-I. -I${.CURDIR}
SYM_MAPS+=${.CURDIR}/Symbol.map
SYMBOL_MAPS=${SYM_MAPS}
-VERSION_DEF=${.CURDIR}/../libc/Versions.def
+VERSION_DEF=${SRCTOP}/lib/libc/Versions.def
# Unfortunately, clang gives an incorrect warning about alignment in
# arch/i386/libpthread_md.c, so turn that off for now.
diff --git a/lib/libufs/Makefile b/lib/libufs/Makefile
index 78832d8..c809241 100644
--- a/lib/libufs/Makefile
+++ b/lib/libufs/Makefile
@@ -17,7 +17,7 @@ MLINKS+= ufs_disk_close.3 ufs_disk_fillout.3
MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3
MLINKS+= ufs_disk_close.3 ufs_disk_write.3
-.PATH: ${.CURDIR}/../../sys/ufs/ffs
+.PATH: ${SRCTOP}/sys/ufs/ffs
WARNS?= 2
diff --git a/lib/libulog/Makefile b/lib/libulog/Makefile
index 074d9db..b5de8f0 100644
--- a/lib/libulog/Makefile
+++ b/lib/libulog/Makefile
@@ -22,7 +22,7 @@ MLINKS+=ulog_login.3 ulog_login_pseudo.3 \
DPADD= ${LIBMD}
LDADD= -lmd
-VERSION_DEF= ${.CURDIR}/../libc/Versions.def
+VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
.if ${MK_INSTALLLIB} != "no"
diff --git a/lib/libunbound/Makefile b/lib/libunbound/Makefile
index 3c66181..e2471bf 100644
--- a/lib/libunbound/Makefile
+++ b/lib/libunbound/Makefile
@@ -1,8 +1,8 @@
# $FreeBSD$
# Vendor sources and generated files
-LDNSDIR= ${.CURDIR}/../../contrib/ldns
-UNBOUNDDIR= ${.CURDIR}/../../contrib/unbound
+LDNSDIR= ${SRCTOP}/contrib/ldns
+UNBOUNDDIR= ${SRCTOP}/contrib/unbound
# Hold my beer and watch this
.PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/compat ${UNBOUNDDIR}/dns64 ${UNBOUNDDIR}/iterator ${UNBOUNDDIR}/sldns ${UNBOUNDDIR}/libunbound ${UNBOUNDDIR}/services ${UNBOUNDDIR}/services/cache ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/data ${UNBOUNDDIR}/util/storage ${UNBOUNDDIR}/validator
diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile
index 4e10729..11ebb3f 100644
--- a/lib/libutil/Makefile
+++ b/lib/libutil/Makefile
@@ -24,7 +24,7 @@ CFLAGS+= -DLIBC_SCCS
CFLAGS+= -DINET6
.endif
-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/
+CFLAGS+= -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/
MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \
humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \
diff --git a/lib/libutil/tests/Makefile b/lib/libutil/tests/Makefile
index 31b6c54..92540c9 100644
--- a/lib/libutil/tests/Makefile
+++ b/lib/libutil/tests/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-TESTSDIR= ${TESTSBASE}/lib/libutil
-
TAP_TESTS_C+= flopen_test
TAP_TESTS_C+= grp_test
TAP_TESTS_C+= humanize_number_test
diff --git a/lib/libypclnt/Makefile b/lib/libypclnt/Makefile
index 2e302f1..636c9b6 100644
--- a/lib/libypclnt/Makefile
+++ b/lib/libypclnt/Makefile
@@ -23,9 +23,9 @@ GENSRCS=yp.h \
yppasswd_private_xdr.c
RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C
-RPCSRC= ${.CURDIR}/../../include/rpcsvc/yp.x
-RPCSRC_PW= ${.CURDIR}/../../include/rpcsvc/yppasswd.x
-RPCSRC_PRIV= ${.CURDIR}/../../usr.sbin/rpc.yppasswdd/yppasswd_private.x
+RPCSRC= ${SRCTOP}/include/rpcsvc/yp.x
+RPCSRC_PW= ${SRCTOP}/include/rpcsvc/yppasswd.x
+RPCSRC_PRIV= ${SRCTOP}/usr.sbin/rpc.yppasswdd/yppasswd_private.x
yp.h: ${RPCSRC}
${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
diff --git a/lib/libz/Symbol.map b/lib/libz/Symbol.map
index b117cdd..abff432 100644
--- a/lib/libz/Symbol.map
+++ b/lib/libz/Symbol.map
@@ -2,6 +2,17 @@
* $FreeBSD: head/lib/libz/Symbol.map 206709 2010-04-16 20:07:24Z delphij $
*/
+ZLIB_1.2.9 {
+ inflateCodesUsed;
+ inflateValidate;
+ uncompress2;
+ gzfread;
+ gzfwrite;
+ deflateGetDictionary;
+ adler32_z;
+ crc32_z;
+};
+
ZLIB_1.2.7.1 {
inflateGetDictionary;
gzvprintf;
diff --git a/lib/libz/Versions.def b/lib/libz/Versions.def
index f8e6425..12df26e 100644
--- a/lib/libz/Versions.def
+++ b/lib/libz/Versions.def
@@ -9,6 +9,9 @@ ZLIB_1.2.7.0 {
ZLIB_1.2.7.1 {
} ZLIB_1.2.7.0;
+ZLIB_1.2.9 {
+} ZLIB_1.2.7.1;
+
FBSD_1.2 {
} ZLIB_1.2.4.0;
diff --git a/lib/libz/zlib.pc b/lib/libz/zlib.pc
index 63a214f..b9ad734 100644
--- a/lib/libz/zlib.pc
+++ b/lib/libz/zlib.pc
@@ -7,7 +7,7 @@ includedir=${prefix}/include
Name: zlib
Description: zlib compression library
-Version: 1.2.8
+Version: 1.2.10
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile
index a82f29f..318fc7b 100644
--- a/lib/msun/tests/Makefile
+++ b/lib/msun/tests/Makefile
@@ -1,13 +1,11 @@
# $FreeBSD$
-OBJTOP= ${.OBJDIR:H:H:H}
-SRCTOP= ${.CURDIR:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libm
-TESTSDIR= ${TESTSBASE}/lib/msun
-
# All architectures on FreeBSD have fenv.h
CFLAGS+= -DHAVE_FENV_H
+# For isqemu.h
+CFLAGS+= -I${TESTSRC:H}/libc/gen
.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
CFLAGS+= -D__HAVE_LONG_DOUBLE
@@ -18,12 +16,15 @@ NETBSD_ATF_TESTS_C+= asin_test
NETBSD_ATF_TESTS_C+= atan_test
NETBSD_ATF_TESTS_C+= cbrt_test
NETBSD_ATF_TESTS_C+= ceil_test
+NETBSD_ATF_TESTS_C+= casinh_test
NETBSD_ATF_TESTS_C+= cos_test
NETBSD_ATF_TESTS_C+= cosh_test
NETBSD_ATF_TESTS_C+= erf_test
NETBSD_ATF_TESTS_C+= exp_test
NETBSD_ATF_TESTS_C+= fmod_test
+NETBSD_ATF_TESTS_C+= fe_round_test
NETBSD_ATF_TESTS_C+= infinity_test
+NETBSD_ATF_TESTS_C+= ilogb_test
NETBSD_ATF_TESTS_C+= ldexp_test
NETBSD_ATF_TESTS_C+= log_test
NETBSD_ATF_TESTS_C+= pow_test
@@ -44,7 +45,7 @@ TAP_TESTS_C+= exponential_test
TAP_TESTS_C+= fenv_test
TAP_TESTS_C+= fma_test
TAP_TESTS_C+= fmaxmin_test
-TAP_TESTS_C+= ilogb_test
+TAP_TESTS_C+= ilogb2_test
TAP_TESTS_C+= invtrig_test
TAP_TESTS_C+= invctrig_test
TAP_TESTS_C+= logarithm_test
@@ -70,6 +71,8 @@ DPADD+= ${LIBM}
IGNORE_PRAGMA=
+SRCS.ilogb2_test= ilogb_test.c
+
# Copied from lib/msun/Makefile
.if ${MACHINE_CPUARCH} == "i386"
ARCH_SUBDIR= i387
diff --git a/lib/msun/tests/fmaxmin_test.c b/lib/msun/tests/fmaxmin_test.c
index 7ddcc87..24056b0 100644
--- a/lib/msun/tests/fmaxmin_test.c
+++ b/lib/msun/tests/fmaxmin_test.c
@@ -86,6 +86,8 @@ testall_r(long double big, long double small)
return (ok);
}
+const char *comment = NULL;
+
/*
* Test all the functions: fmaxf, fmax, fmaxl, fminf, fmin, and fminl,
* in all rounding modes and with the arguments in different orders.
@@ -107,10 +109,18 @@ testall(int testnum, long double big, long double small)
break;
}
}
- printf("%sok %d - big = %.20Lg, small = %.20Lg\n",
- (i == 4) ? "" : "not ", testnum, big, small);
+ printf("%sok %d - big = %.20Lg, small = %.20Lg%s\n",
+ (i == 4) ? "" : "not ", testnum, big, small,
+ comment == NULL ? "" : comment);
}
+/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */
+#if defined(__clang__) && \
+ ((__clang_major__ > 3)) || \
+ ((__clang_major__ == 3 && __clang_minor__ >= 8))
+#define affected_by_bug_208703
+#endif
+
int
main(int argc, char *argv[])
{
@@ -122,15 +132,23 @@ main(int argc, char *argv[])
testall(3, nextafterf(42.0, INFINITY), 42.0);
testall(4, -5.0, -5.0);
testall(5, -3.0, -4.0);
+#ifdef affected_by_bug_208703
+ comment = "# TODO: testcase 6-7 fails invariant with clang 3.8+ (bug 208703)";
+#endif
testall(6, 1.0, NAN);
testall(7, INFINITY, NAN);
+ comment = NULL;
testall(8, INFINITY, 1.0);
testall(9, -3.0, -INFINITY);
testall(10, 3.0, -INFINITY);
+#ifdef affected_by_bug_208703
+ comment = "# TODO: testcase 11-12 fails invariant with clang 3.8+ (bug 208703)";
+#endif
testall(11, NAN, NAN);
/* This test isn't strictly required to work by C99. */
testall(12, 0.0, -0.0);
+ comment = NULL;
return (0);
}
diff --git a/lib/ncurses/config.mk b/lib/ncurses/config.mk
index d01e17a..d15be86 100644
--- a/lib/ncurses/config.mk
+++ b/lib/ncurses/config.mk
@@ -2,25 +2,25 @@
# This Makefile is shared by libncurses, libform, libmenu, libpanel.
-NCURSES_DIR= ${.CURDIR}/../../../contrib/ncurses
+NCURSES_DIR= ${SRCTOP}/contrib/ncurses
.if defined(ENABLE_WIDEC)
LIB_SUFFIX= w
CFLAGS+= -D_XOPEN_SOURCE_EXTENDED -DENABLE_WIDEC
-NCURSES_CFG_H= ${.CURDIR}/../ncurses/ncurses_cfg.h
+NCURSES_CFG_H= ${.CURDIR:H}/ncurses/ncurses_cfg.h
.else
LIB_SUFFIX=
NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h
.endif
CFLAGS+= -I.
-.if exists(${.OBJDIR}/../ncurses${LIB_SUFFIX})
-CFLAGS+= -I${.OBJDIR}/../ncurses${LIB_SUFFIX}
+.if exists(${.OBJDIR:H}/ncurses${LIB_SUFFIX})
+CFLAGS+= -I${.OBJDIR:H}/ncurses${LIB_SUFFIX}
.endif
-CFLAGS+= -I${.CURDIR}/../ncurses${LIB_SUFFIX}
+CFLAGS+= -I${.CURDIR:H}/ncurses${LIB_SUFFIX}
# for ${NCURSES_CFG_H}
-CFLAGS+= -I${.CURDIR}/../ncurses
+CFLAGS+= -I${.CURDIR:H}/ncurses
CFLAGS+= -I${NCURSES_DIR}/include
CFLAGS+= -I${NCURSES_DIR}/ncurses
diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile
index b79dc41..5af3d2a 100644
--- a/lib/ncurses/form/Makefile
+++ b/lib/ncurses/form/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include "${.CURDIR}/../config.mk"
+.include "${.CURDIR:H}/config.mk"
SRCDIR= ${NCURSES_DIR}/form
diff --git a/lib/ncurses/formw/Makefile b/lib/ncurses/formw/Makefile
index 5488503..3ec7637 100644
--- a/lib/ncurses/formw/Makefile
+++ b/lib/ncurses/formw/Makefile
@@ -2,4 +2,4 @@
ENABLE_WIDEC=
-.include "${.CURDIR}/../form/Makefile"
+.include "${.CURDIR:H}/form/Makefile"
diff --git a/lib/ncurses/menu/Makefile b/lib/ncurses/menu/Makefile
index 3aac081..fb5afd2 100644
--- a/lib/ncurses/menu/Makefile
+++ b/lib/ncurses/menu/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include "${.CURDIR}/../config.mk"
+.include "${.CURDIR:H}/config.mk"
SRCDIR= ${NCURSES_DIR}/menu
diff --git a/lib/ncurses/menuw/Makefile b/lib/ncurses/menuw/Makefile
index d5a100f..d6df563 100644
--- a/lib/ncurses/menuw/Makefile
+++ b/lib/ncurses/menuw/Makefile
@@ -2,4 +2,4 @@
ENABLE_WIDEC=
-.include "${.CURDIR}/../menu/Makefile"
+.include "${.CURDIR:H}/menu/Makefile"
diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile
index ee4d89e..afd0f40 100644
--- a/lib/ncurses/ncurses/Makefile
+++ b/lib/ncurses/ncurses/Makefile
@@ -8,7 +8,7 @@ NO_MAN=
.include <bsd.own.mk>
-.include "${.CURDIR}/../config.mk"
+.include "${.CURDIR:H}/config.mk"
LIB= ncurses${LIB_SUFFIX}
SHLIB_MAJOR= 8
diff --git a/lib/ncurses/ncursesw/Makefile b/lib/ncurses/ncursesw/Makefile
index 277c90b..5f6040e 100644
--- a/lib/ncurses/ncursesw/Makefile
+++ b/lib/ncurses/ncursesw/Makefile
@@ -2,6 +2,6 @@
ENABLE_WIDEC=
-.PATH: ${.CURDIR}/../ncurses
+.PATH: ${.CURDIR:H}/ncurses
-.include "${.CURDIR}/../ncurses/Makefile"
+.include "${.CURDIR:H}/ncurses/Makefile"
diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile
index 7929aed..881f31a 100644
--- a/lib/ncurses/panel/Makefile
+++ b/lib/ncurses/panel/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include "${.CURDIR}/../config.mk"
+.include "${.CURDIR:H}/config.mk"
SRCDIR= ${NCURSES_DIR}/panel
diff --git a/lib/ncurses/panelw/Makefile b/lib/ncurses/panelw/Makefile
index 7642e34..2585738 100644
--- a/lib/ncurses/panelw/Makefile
+++ b/lib/ncurses/panelw/Makefile
@@ -2,4 +2,4 @@
ENABLE_WIDEC=
-.include "${.CURDIR}/../panel/Makefile"
+.include "${.CURDIR:H}/panel/Makefile"
diff --git a/lib/tests/Makefile b/lib/tests/Makefile
index 935fd70..a0e63e5 100644
--- a/lib/tests/Makefile
+++ b/lib/tests/Makefile
@@ -2,9 +2,7 @@
.include <bsd.own.mk>
-TESTSDIR= ${TESTSBASE}/lib
-
-.PATH: ${.CURDIR:H:H}/tests
+.PATH: ${SRCTOP}/tests
KYUAFILE= yes
.include <bsd.test.mk>
OpenPOWER on IntegriCloud