diff options
author | jlam <jlam@pkgsrc.org> | 2003-09-03 13:11:11 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-09-03 13:11:11 +0000 |
commit | 16ddd24bdb727e793ce7987f2532f167aa4e4afb (patch) | |
tree | dee374cdf0dbf8f7aacba0cb9b2b20618f68c830 /pkgtools/libnbcompat | |
parent | f90ace6498739ae9023c5ad0c47f76a0c477391c (diff) | |
download | pkgsrc-16ddd24bdb727e793ce7987f2532f167aa4e4afb.tar.gz |
Update pkgtools/libnbcompat to 20030826. Changes from previous version:
* Properly declare statfs() and fstatfs() if we use the libnbcompat
versions.
* Move some headers into a private directory in the installed
location so that they don't override headers of the same name
on the system.
* Define TAILQ_HEAD_INITIALIZER if it doesn't exist.
* Add a poll() implementation using select() for poll()-less systems.
Thanks for Charles Blundell for the implementation!
* Fix the vis.h check for systems whose vis() is not as featureful
as NetBSD's.
Diffstat (limited to 'pkgtools/libnbcompat')
31 files changed, 468 insertions, 274 deletions
diff --git a/pkgtools/libnbcompat/Makefile b/pkgtools/libnbcompat/Makefile index c9c5731e5d2..8e740ce41fa 100644 --- a/pkgtools/libnbcompat/Makefile +++ b/pkgtools/libnbcompat/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.15 2003/09/03 07:07:04 jlam Exp $ +# $NetBSD: Makefile,v 1.16 2003/09/03 13:11:11 jlam Exp $ # -DISTNAME= libnbcompat-20030825 +DISTNAME= libnbcompat-20030826 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty @@ -20,6 +20,7 @@ GNU_CONFIGURE= # defined PKG_INFO= PKG_DBDIR=${PKG_DBDIR} ${PKG_INFO_CMD} PKG_CREATE= PKG_DBDIR=${PKG_DBDIR} ${PKG_CREATE_CMD} +PKG_DELETE= PKG_DBDIR=${PKG_DBDIR} ${PKG_DELETE_CMD} do-extract: @${CP} -Rp ${FILESDIR} ${WRKSRC} diff --git a/pkgtools/libnbcompat/PLIST b/pkgtools/libnbcompat/PLIST index cf7bd3d2117..85ee5cd4da3 100644 --- a/pkgtools/libnbcompat/PLIST +++ b/pkgtools/libnbcompat/PLIST @@ -1,14 +1,17 @@ -@comment $NetBSD: PLIST,v 1.7 2003/09/03 06:16:08 tron Exp $ -include/libnbcompat/err.h +@comment $NetBSD: PLIST,v 1.8 2003/09/03 13:11:12 jlam Exp $ include/libnbcompat/extern.h include/libnbcompat/ftpglob.h -include/libnbcompat/fts.h include/libnbcompat/getopt.h include/libnbcompat/md5.h include/libnbcompat/mtree.h include/libnbcompat/nbcompat.h -include/libnbcompat/nbconfig.h -include/libnbcompat/nbtypes.h +include/libnbcompat/nbcompat/err.h +include/libnbcompat/nbcompat/fts.h +include/libnbcompat/nbcompat/nbconfig.h +include/libnbcompat/nbcompat/nbtypes.h +include/libnbcompat/nbcompat/poll.h +include/libnbcompat/nbcompat/statfs.h +include/libnbcompat/nbcompat/vis.h include/libnbcompat/pack_dev.h include/libnbcompat/pwcache.h include/libnbcompat/rmd160.h @@ -16,8 +19,8 @@ include/libnbcompat/sha1.h include/libnbcompat/sha2.h include/libnbcompat/stat_flags.h include/libnbcompat/util.h -include/libnbcompat/vis.h lib/libnbcompat.a +@dirrm include/libnbcompat/nbcompat @dirrm include/libnbcompat @unexec ${RMDIR} -p %D/include 2>/dev/null || ${TRUE} @unexec ${RMDIR} -p %D/lib 2>/dev/null || ${TRUE} diff --git a/pkgtools/libnbcompat/buildlink2.mk b/pkgtools/libnbcompat/buildlink2.mk index 647b958a42b..6604c1636e6 100644 --- a/pkgtools/libnbcompat/buildlink2.mk +++ b/pkgtools/libnbcompat/buildlink2.mk @@ -1,9 +1,9 @@ -# $NetBSD: buildlink2.mk,v 1.8 2003/09/02 22:19:03 jlam Exp $ +# $NetBSD: buildlink2.mk,v 1.9 2003/09/03 13:11:12 jlam Exp $ .if !defined(LIBNBCOMPAT_BUILDLINK2_MK) LIBNBCOMPAT_BUILDLINK2_MK= # defined -BUILDLINK_DEPENDS.libnbcompat?= libnbcompat>=20030823 +BUILDLINK_DEPENDS.libnbcompat?= libnbcompat>=20030826 BUILDLINK_PKGSRCDIR.libnbcompat?= ../../pkgtools/libnbcompat BUILDLINK_DEPMETHOD.libnbcompat?= build @@ -11,6 +11,7 @@ BUILDLINK_PACKAGES+= libnbcompat EVAL_PREFIX+= BUILDLINK_PREFIX.libnbcompat=libnbcompat BUILDLINK_PREFIX.libnbcompat_DEFAULT= ${LOCALBASE} +BUILDLINK_FILES.libnbcompat= include/libnbcompat/*/* BUILDLINK_FILES.libnbcompat+= include/libnbcompat/* BUILDLINK_FILES.libnbcompat+= lib/libnbcompat.* diff --git a/pkgtools/libnbcompat/files/Makefile.in b/pkgtools/libnbcompat/files/Makefile.in index 4ba227eea1a..b2e8f6ed2a7 100644 --- a/pkgtools/libnbcompat/files/Makefile.in +++ b/pkgtools/libnbcompat/files/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.12 2003/09/03 03:43:45 jlam Exp $ +# $NetBSD: Makefile.in,v 1.13 2003/09/03 13:11:13 jlam Exp $ # srcdir= @srcdir@ @@ -7,7 +7,7 @@ VPATH= @srcdir@ SHELL= /bin/sh CC= @CC@ -CFLAGS= -I${srcdir} -I. @INCLUDES@ @CFLAGS@ +CFLAGS= -I$(srcdir) -I. @INCLUDES@ @CFLAGS@ CPPFLAGS= @CPPFLAGS@ DEFS= @DEFS@ INSTALL= @INSTALL@ @@ -19,32 +19,34 @@ RANLIB= @RANLIB@ LIB= libnbcompat.a -INCS= err.h extern.h ftpglob.h fts.h getopt.h md5.h mtree.h \ - nbcompat.h nbtypes.h pack_dev.h pwcache.h \ - rmd160.h sha1.h sha2.h stat_flags.h util.h vis.h +INCS= extern.h ftpglob.h getopt.h md5.h mtree.h nbcompat.h \ + nbcompat/err.h nbcompat/fts.h nbcompat/nbtypes.h \ + nbcompat/poll.h nbcompat/statfs.h nbcompat/vis.h \ + pack_dev.h pwcache.h rmd160.h sha1.h sha2.h stat_flags.h \ + util.h OBJS= @LIBOBJS@ \ md5c.o md5hl.o rmd160.o rmd160hl.o sha1.o sha1hl.o \ - sha2.o sha2hl.o unvis.o vis.o setmode.o __fts13.o \ - getid.o misc.o pack_dev.o spec.o setmode.o stat_flags.o \ - pwcache.o getopt_long.o + sha2.o sha2hl.o setmode.o __fts13.o getid.o misc.o \ + pack_dev.o spec.o setmode.o stat_flags.o pwcache.o \ + getopt_long.o LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ COMPILE= $(CC) $(CPPFLAGS) $(CFLAGS) .PHONY: all install clean distclean -all: nbtypes.h nbconfig.hi ${LIB} +all: nbcompat/nbtypes.h nbcompat/nbconfig.hi $(LIB) -.c.o: nbtypes.h +.c.o: nbcompat/nbtypes.h $(COMPILE) $(DEFS) -c $< -${LIB}: ${OBJS} - ${AR} cr $@ ${OBJS} - ${RANLIB} $@ +$(LIB): $(OBJS) + $(AR) cr $@ $(OBJS) + $(RANLIB) $@ -nbconfig.hi: nbconfig.h - ${AWK} ' \ +nbcompat/nbconfig.hi: nbcompat/nbconfig.h + $(AWK) ' \ BEGIN { process = 1 } \ /NBCOMPAT template section follows\./ { process = 0 } \ /^\#[ ]*define[ ]+PACKAGE_.*/ { next } \ @@ -60,27 +62,28 @@ nbconfig.hi: nbconfig.h } \ } \ { print } \ - ' nbconfig.h > $@ + ' nbcompat/nbconfig.h > $@ -nbtypes.h: bits - ./bits nbtypes.h +nbcompat/nbtypes.h: bits + ./bits $@ bits: bits.c - ${CC} -o bits bits.c + $(CC) -o bits bits.c install: - ${INSTALL} -m 555 ${LIB} ${prefix}/lib - ${RANLIB} ${prefix}/lib/${LIB} - ${INSTALL} -m 755 -d ${prefix}/include/libnbcompat - @for file in ${INCS}; do \ - echo "${INSTALL} -m 444 $$file ${prefix}/include/libnbcompat/$$file"; \ - ${INSTALL} -m 444 $$file ${prefix}/include/libnbcompat/$$file; \ + $(INSTALL) -m 555 ${LIB} $(prefix)/lib + $(RANLIB) $(prefix)/lib/$(LIB) + $(INSTALL) -m 755 -d $(prefix)/include/libnbcompat + $(INSTALL) -m 755 -d $(prefix)/include/libnbcompat/nbcompat + @for file in $(INCS); do \ + echo "$(INSTALL) -m 444 $$file $(prefix)/include/libnbcompat/$$file"; \ + $(INSTALL) -m 444 $$file $(prefix)/include/libnbcompat/$$file; \ done - ${INSTALL} -m 444 nbconfig.hi ${prefix}/include/libnbcompat/nbconfig.h + $(INSTALL) -m 444 nbcompat/nbconfig.hi $(prefix)/include/libnbcompat/nbcompat/nbconfig.h clean: - rm -f *.a *.o bits nbtypes.h + rm -f *.a *.o bits nbcompat/nbtypes.h nbcompat/nbcompat.hi distclean: clean - rm -f Makefile config.log config.status configure.lineno nbconfig.h - + rm -f Makefile config.log config.status configure.lineno + rm -f nbcompat/nbconfig.h diff --git a/pkgtools/libnbcompat/files/__fts13.c b/pkgtools/libnbcompat/files/__fts13.c index 1be8e3cbd99..7bba7587f4b 100644 --- a/pkgtools/libnbcompat/files/__fts13.c +++ b/pkgtools/libnbcompat/files/__fts13.c @@ -1,4 +1,4 @@ -/* $NetBSD: __fts13.c,v 1.3 2003/09/01 15:31:15 jlam Exp $ */ +/* $NetBSD: __fts13.c,v 1.4 2003/09/03 13:11:13 jlam Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -30,7 +30,7 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif #if HAVE_SYS_CDEFS_H @@ -41,12 +41,16 @@ #if 0 static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #else -__RCSID("$NetBSD: __fts13.c,v 1.3 2003/09/01 15:31:15 jlam Exp $"); +__RCSID("$NetBSD: __fts13.c,v 1.4 2003/09/03 13:11:13 jlam Exp $"); #endif #endif /* LIBC_SCCS and not lint */ +#if HAVE_SYS_PARAM_H #include <sys/param.h> +#endif +#if HAVE_SYS_STAT_H #include <sys/stat.h> +#endif #if HAVE_ASSERT_H #include <assert.h> @@ -56,7 +60,9 @@ __RCSID("$NetBSD: __fts13.c,v 1.3 2003/09/01 15:31:15 jlam Exp $"); #include <dirent.h> #endif +#if HAVE_ERRNO_H #include <errno.h> +#endif #if HAVE_FCNTL_H #include <fcntl.h> @@ -66,11 +72,17 @@ __RCSID("$NetBSD: __fts13.c,v 1.3 2003/09/01 15:31:15 jlam Exp $"); #include <limits.h> #endif -#include "fts.h" +#include "nbcompat/fts.h" +#if HAVE_STDLIB_H #include <stdlib.h> +#endif +#if HAVE_STRING_H #include <string.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> +#endif #if !HAVE_CONFIG_H #define HAVE_STRUCT_DIRENT_D_NAMLEN 1 diff --git a/pkgtools/libnbcompat/files/bits.c b/pkgtools/libnbcompat/files/bits.c index f8920171554..acb3069b684 100644 --- a/pkgtools/libnbcompat/files/bits.c +++ b/pkgtools/libnbcompat/files/bits.c @@ -31,9 +31,9 @@ * SUCH DAMAGE. */ -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #if 0 -__RCSID("$Id: bits.c,v 1.3 2003/09/01 15:31:15 jlam Exp $"); +__RCSID("$Id: bits.c,v 1.4 2003/09/03 13:11:13 jlam Exp $"); #endif #include <stdio.h> #include <string.h> @@ -127,7 +127,7 @@ int main(int argc, char **argv) } fprintf(f, "/* %s -- this file was generated by\n", fn); fprintf(f, " %*s %s */\n\n", (int)strlen(fn), "", - "$Id: bits.c,v 1.3 2003/09/01 15:31:15 jlam Exp $"); + "$Id: bits.c,v 1.4 2003/09/03 13:11:13 jlam Exp $"); fprintf(f, "#ifndef %s\n", hb); fprintf(f, "#define %s\n", hb); fprintf(f, "\n"); diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index d68b9a75da5..7b60fe2cfb1 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -1274,7 +1274,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_config_headers="$ac_config_headers nbconfig.h" + ac_config_headers="$ac_config_headers nbcompat/nbconfig.h" test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" @@ -3166,7 +3166,6 @@ done - for ac_header in arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \ errno.h fcntl.h fts.h inttypes.h libutil.h limits.h \ machine/endian.h memory.h ndir.h netdb.h netinet/in6_machtypes.h \ @@ -3175,7 +3174,7 @@ for ac_header in arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \ sys/endian.h sys/file.h sys/mkdev.h sys/mount.h sys/ndir.h \ sys/param.h sys/poll.h sys/queue.h sys/time.h sys/ttycom.h \ sys/stat.h sys/statvfs.h sys/vfs.h sys/types.h sys/vfs.h termcap.h \ - termios.h time.h tzfile.h unistd.h util.h utmp.h vis.h + termios.h time.h tzfile.h unistd.h util.h utmp.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -3317,6 +3316,201 @@ fi done +pkg_use_nbcompat_vis=yes +if test "${ac_cv_header_vis_h+set}" = set; then + echo "$as_me:$LINENO: checking for vis.h" >&5 +echo $ECHO_N "checking for vis.h... $ECHO_C" >&6 +if test "${ac_cv_header_vis_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_vis_h" >&5 +echo "${ECHO_T}$ac_cv_header_vis_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking vis.h usability" >&5 +echo $ECHO_N "checking vis.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <vis.h> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking vis.h presence" >&5 +echo $ECHO_N "checking vis.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <vis.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: vis.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: vis.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: vis.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: vis.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: vis.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: vis.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: vis.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: vis.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: vis.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: vis.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for vis.h" >&5 +echo $ECHO_N "checking for vis.h... $ECHO_C" >&6 +if test "${ac_cv_header_vis_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_vis_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_vis_h" >&5 +echo "${ECHO_T}$ac_cv_header_vis_h" >&6 + +fi +if test $ac_cv_header_vis_h = yes; then + + + echo "$as_me:$LINENO: checking for VIS_WHITE in vis.h" >&5 +echo $ECHO_N "checking for VIS_WHITE in vis.h... $ECHO_C" >&6 +if test "${pkg_cv_have_vis_white+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + #include <sys/types.h> + #include <vis.h> +int +main () +{ + int X = VIS_WHITE ; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + pkg_cv_have_vis_white=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + pkg_cv_have_vis_white=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $pkg_cv_have_vis_white" >&5 +echo "${ECHO_T}$pkg_cv_have_vis_white" >&6 + if test "x$pkg_cv_have_vis_white" = "xyes"; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_VIS_H 1 +_ACEOF + + else + pkg_use_nbcompat_vis=no + : + fi + + +fi + + + echo "$as_me:$LINENO: checking for __attribute__" >&5 echo $ECHO_N "checking for __attribute__... $ECHO_C" >&6 @@ -5558,9 +5752,10 @@ done + for ac_func in err fgetln fparseln fseeko getenv glob inet_ntop \ inet_pton isblank lchflags lchmod lchown lutimes mkstemp \ - mkdtemp setenv setprogname snprintf strdup strerror \ + mkdtemp poll setenv setprogname snprintf strdup strerror \ strlcat strlcpy strmode strptime strsep strtoll timegm \ usleep do @@ -6168,11 +6363,22 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - + pkg_use_nbcompat_vis=no +else + pkg_use_nbcompat_vis=yes fi done +if test $pkg_use_nbcompat_vis = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_NBCOMPAT_VIS 1 +_ACEOF + + LIBOBJS="$LIBOBJS vis.$ac_objext" + LIBOBJS="$LIBOBJS unvis.$ac_objext" +fi + @@ -6550,7 +6756,6 @@ echo "$as_me:$LINENO: result: $ac_cv_func_sl_init" >&5 echo "${ECHO_T}$ac_cv_func_sl_init" >&6 if test $ac_cv_func_sl_init = yes; then - if test $ac_cv_func_sl_init = yes; then echo "$as_me:$LINENO: checking if sl_add() returns int" >&5 echo $ECHO_N "checking if sl_add() returns int... $ECHO_C" >&6 @@ -6605,13 +6810,12 @@ echo "${ECHO_T}$pkg_cv_INT_SL_ADD" >&6 : fi - fi fi -pkg_have_nbcompat_statfs=yes +pkg_use_nbcompat_statfs=yes echo "$as_me:$LINENO: checking for statfs" >&5 echo $ECHO_N "checking for statfs... $ECHO_C" >&6 if test "${ac_cv_func_statfs+set}" = set; then @@ -6772,14 +6976,14 @@ fi ;; *) - pkg_have_nbcompat_statfs=no + pkg_use_nbcompat_statfs=no ;; esac fi -if test $pkg_have_nbcompat_statfs = yes; then +if test $pkg_use_nbcompat_statfs = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NBCOMPAT_STATFS 1 _ACEOF @@ -6995,65 +7199,6 @@ done fi -if test $ac_cv_header_vis_h = yes; then - - echo "$as_me:$LINENO: checking for VIS_WHITE in vis.h" >&5 -echo $ECHO_N "checking for VIS_WHITE in vis.h... $ECHO_C" >&6 -if test "${pkg_cv_have_vis_white+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - #include <sys/types.h> - #include <vis.h> -int -main () -{ - int X = VIS_WHITE ; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - pkg_cv_have_vis_white=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - pkg_cv_have_vis_white=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $pkg_cv_have_vis_white" >&5 -echo "${ECHO_T}$pkg_cv_have_vis_white" >&6 - if test "x$pkg_cv_have_vis_white" = "xyes"; then - : - else - ac_cv_header_vis_h=no - : - fi - -fi - echo "$as_me:$LINENO: checking for optarg declaration" >&5 echo $ECHO_N "checking for optarg declaration... $ECHO_C" >&6 @@ -7704,7 +7849,7 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "nbconfig.h" ) CONFIG_HEADERS="$CONFIG_HEADERS nbconfig.h" ;; + "nbcompat/nbconfig.h" ) CONFIG_HEADERS="$CONFIG_HEADERS nbcompat/nbconfig.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac index 8adabf362fd..3b7d89ed913 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) AC_INIT([libnbcompat], [20030823], [grant@NetBSD.org]) -AC_CONFIG_HEADER(nbconfig.h) +AC_CONFIG_HEADER(nbcompat/nbconfig.h) AC_ARG_PROGRAM AC_CANONICAL_HOST @@ -38,7 +38,20 @@ AC_CHECK_HEADERS([arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \ sys/endian.h sys/file.h sys/mkdev.h sys/mount.h sys/ndir.h \ sys/param.h sys/poll.h sys/queue.h sys/time.h sys/ttycom.h \ sys/stat.h sys/statvfs.h sys/vfs.h sys/types.h sys/vfs.h termcap.h \ - termios.h time.h tzfile.h unistd.h util.h utmp.h vis.h]) + termios.h time.h tzfile.h unistd.h util.h utmp.h]) + +dnl Check that this vis.h has *vis()-related functions because Solaris' +dnl vis.h doesn't. Also, only consider the header found if it defines +dnl all of the functions that we need. +dnl +pkg_use_nbcompat_vis=yes +AC_CHECK_HEADER(vis.h, [ + AC_MSG_TRY_COMPILE([for VIS_WHITE in vis.h], pkg_cv_have_vis_white, + [ #include <sys/types.h> + #include <vis.h> ], + [ int X = VIS_WHITE ], + [ AC_DEFINE(HAVE_VIS_H) ], [ pkg_use_nbcompat_vis=no ]) +]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C___ATTRIBUTE__ @@ -67,7 +80,7 @@ AC_FUNC_VPRINTF AC_REPLACE_FUNCS([err fgetln fparseln fseeko getenv glob inet_ntop \ inet_pton isblank lchflags lchmod lchown lutimes mkstemp \ - mkdtemp setenv setprogname snprintf strdup strerror \ + mkdtemp poll setenv setprogname snprintf strdup strerror \ strlcat strlcpy strmode strptime strsep strtoll timegm \ usleep]) @@ -78,7 +91,15 @@ AC_CHECK_FUNCS([getmode setmode]) AC_CHECK_FUNCS([gid_from_group group_from_gid pwcache_groupdb pwcache_userdb \ uid_from_user user_from_uid]) -AC_CHECK_FUNCS([strunvis strvis strsvis]) +AC_CHECK_FUNCS([strunvis strvis strsvis], + [pkg_use_nbcompat_vis=no], + [pkg_use_nbcompat_vis=yes]) + +if test $pkg_use_nbcompat_vis = yes; then + AC_DEFINE(HAVE_NBCOMPAT_VIS) + AC_LIBOBJ(vis) + AC_LIBOBJ(unvis) +fi AC_CHECK_FUNCS([getpassphrase getpgrp memmove poll select]) AC_CHECK_FUNCS([getopt_long]) @@ -86,19 +107,17 @@ AC_CHECK_FUNCS([getopt_long]) AC_CHECK_FUNC(getpgrp, [AC_FUNC_GETPGRP]) AC_CHECK_FUNC(sl_init, [ - if test $ac_cv_func_sl_init = yes; then - AC_MSG_TRY_COMPILE(if sl_add() returns int, - pkg_cv_INT_SL_ADD, - [ #include <stringlist.h> ], - [ int f = sl_add((StringList *)0, "foo") ], - [:] , [AC_LIBOBJ(sl_init)]) - fi + AC_MSG_TRY_COMPILE([if sl_add() returns int], + pkg_cv_INT_SL_ADD, + [ #include <stringlist.h> ], + [ int f = sl_add((StringList *)0, "foo") ], + [:] , [AC_LIBOBJ(sl_init)]) ]) dnl Solaris 2.7 and 2.8 have statfs(2), but it is deprecated, and has a dnl different interface from NetBSD's statfs. -pkg_have_nbcompat_statfs=yes +pkg_use_nbcompat_statfs=yes AC_CHECK_FUNC(statfs, [ case $host_os in sunos*|solaris*) @@ -107,12 +126,12 @@ AC_CHECK_FUNC(statfs, [ ]) ;; *) - pkg_have_nbcompat_statfs=no + pkg_use_nbcompat_statfs=no ;; esac ]) -if test $pkg_have_nbcompat_statfs = yes; then +if test $pkg_use_nbcompat_statfs = yes; then AC_DEFINE(HAVE_NBCOMPAT_STATFS, 1) AC_LIBOBJ(statfs) fi @@ -164,14 +183,6 @@ dnl support because we don't know how to display it. fi -if test $ac_cv_header_vis_h = yes; then - AC_MSG_TRY_COMPILE(for VIS_WHITE in vis.h, - pkg_cv_have_vis_white, [ - #include <sys/types.h> - #include <vis.h> ], [ int X = VIS_WHITE ], [:], - ac_cv_header_vis_h=no ) -fi - AC_MSG_TRY_COMPILE(for optarg declaration, ftp_cv_HAVE_OPTARG_D, [ #include <stdlib.h> #include <unistd.h> ], [ char *X = optarg ], [:], [AC_DEFINE(HAVE_OPTARG_D, 1)]) @@ -181,8 +192,14 @@ AC_MSG_TRY_COMPILE(for optind declaration, ftp_cv_HAVE_OPTIND_D, [ #include <unistd.h> ], [ int X = optind ], [:] [AC_DEFINE(HAVE_OPTIND_D, 1)]) AH_BOTTOM([ +/* Define to 1 if you have the <vis.h> header file. */ +#undef HAVE_VIS_H + /* NBCOMPAT template section follows. */ +/* Define to 1 if the `vis' function is built into the library. */ +#undef HAVE_NBCOMPAT_VIS + /* Define to 1 if the `statfs' function is built into the library. */ #undef HAVE_NBCOMPAT_STATFS diff --git a/pkgtools/libnbcompat/files/extern.h b/pkgtools/libnbcompat/files/extern.h index fa996c9288b..9d726defcee 100644 --- a/pkgtools/libnbcompat/files/extern.h +++ b/pkgtools/libnbcompat/files/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.4 2003/09/01 15:31:17 jlam Exp $ */ +/* $NetBSD: extern.h,v 1.5 2003/09/03 13:11:14 jlam Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -35,8 +35,7 @@ * @(#)extern.h 8.1 (Berkeley) 6/6/93 */ -#include <nbconfig.h> -#include <nbtypes.h> +#include <nbcompat.h> #include <mtree.h> @@ -48,9 +47,13 @@ #include <err.h> #endif +#if HAVE_FTS_H #include <fts.h> +#endif +#if HAVE_VIS_H #include <vis.h> +#endif #if HAVE_NETDB_H /* For MAXHOSTNAMELEN on some platforms. */ diff --git a/pkgtools/libnbcompat/files/getopt.h b/pkgtools/libnbcompat/files/getopt.h index 0b6df9374cb..ea2b61d12d9 100644 --- a/pkgtools/libnbcompat/files/getopt.h +++ b/pkgtools/libnbcompat/files/getopt.h @@ -1,4 +1,4 @@ -/* $NetBSD: getopt.h,v 1.2 2003/09/01 15:31:17 jlam Exp $ */ +/* $NetBSD: getopt.h,v 1.3 2003/09/03 13:11:14 jlam Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -39,13 +39,15 @@ #ifndef _GETOPT_H_ #define _GETOPT_H_ -#include <nbconfig.h> +#include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif +#if HAVE_UNISTD_H #include <unistd.h> +#endif /* * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions @@ -70,8 +72,8 @@ struct option { }; __BEGIN_DECLS -int getopt_long __P((int, char * const *, const char *, - const struct option *, int *)); +int getopt_long (int, char * const *, const char *, + const struct option *, int *); __END_DECLS #endif diff --git a/pkgtools/libnbcompat/files/getopt_long.c b/pkgtools/libnbcompat/files/getopt_long.c index 64692fd7911..4775517dd2a 100644 --- a/pkgtools/libnbcompat/files/getopt_long.c +++ b/pkgtools/libnbcompat/files/getopt_long.c @@ -1,4 +1,4 @@ -/* $NetBSD: getopt_long.c,v 1.3 2003/09/01 15:31:17 jlam Exp $ */ +/* $NetBSD: getopt_long.c,v 1.4 2003/09/03 13:11:14 jlam Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif #if HAVE_SYS_CDEFS_H @@ -45,7 +45,7 @@ #endif #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getopt_long.c,v 1.3 2003/09/01 15:31:17 jlam Exp $"); +__RCSID("$NetBSD: getopt_long.c,v 1.4 2003/09/03 13:11:14 jlam Exp $"); #endif /* LIBC_SCCS and not lint */ /* #include "namespace.h" */ diff --git a/pkgtools/libnbcompat/files/md5c.c b/pkgtools/libnbcompat/files/md5c.c index efddd0c2547..17701e7ad5c 100644 --- a/pkgtools/libnbcompat/files/md5c.c +++ b/pkgtools/libnbcompat/files/md5c.c @@ -1,4 +1,4 @@ -/* $NetBSD: md5c.c,v 1.2 2003/09/01 15:31:17 jlam Exp $ */ +/* $NetBSD: md5c.c,v 1.3 2003/09/03 13:11:14 jlam Exp $ */ /* * This file is derived from the RSA Data Security, Inc. MD5 Message-Digest @@ -30,10 +30,10 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #if defined(_KERNEL) || defined(_STANDALONE) #include <lib/libkern/libkern.h> diff --git a/pkgtools/libnbcompat/files/md5hl.c b/pkgtools/libnbcompat/files/md5hl.c index 917e2052de8..48c2dca0cc3 100644 --- a/pkgtools/libnbcompat/files/md5hl.c +++ b/pkgtools/libnbcompat/files/md5hl.c @@ -1,4 +1,4 @@ -/* $NetBSD: md5hl.c,v 1.2 2003/09/01 15:31:17 jlam Exp $ */ +/* $NetBSD: md5hl.c,v 1.3 2003/09/03 13:11:14 jlam Exp $ */ /* * Written by Jason R. Thorpe <thorpej@netbsd.org>, April 29, 1997. @@ -6,11 +6,11 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif /* #include "namespace.h" */ -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #define MDALGORITHM MD5 @@ -20,7 +20,7 @@ #define _DIAGASSERT(cond) assert(cond) #endif -/* $NetBSD: md5hl.c,v 1.2 2003/09/01 15:31:17 jlam Exp $ */ +/* $NetBSD: md5hl.c,v 1.3 2003/09/03 13:11:14 jlam Exp $ */ /* * ---------------------------------------------------------------------------- diff --git a/pkgtools/libnbcompat/files/namespace.h b/pkgtools/libnbcompat/files/namespace.h index 81c2611c20f..408f4f9ca02 100644 --- a/pkgtools/libnbcompat/files/namespace.h +++ b/pkgtools/libnbcompat/files/namespace.h @@ -1,4 +1,4 @@ -/* $NetBSD: namespace.h,v 1.2 2003/09/01 15:31:18 jlam Exp $ */ +/* $NetBSD: namespace.h,v 1.3 2003/09/03 13:11:14 jlam Exp $ */ /*- * Copyright (c) 1997-2002 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #ifndef _NAMESPACE_H_ #define _NAMESPACE_H_ -#include <nbconfig.h> +#include "nbcompat/nbconfig.h" #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h index 29def5890c2..e26e99d999a 100644 --- a/pkgtools/libnbcompat/files/nbcompat.h +++ b/pkgtools/libnbcompat/files/nbcompat.h @@ -1,9 +1,43 @@ +/* $NetBSD: nbcompat.h,v 1.14 2003/09/03 13:11:14 jlam Exp $ */ + +/*- + * Copyright (c) 2003 The NetBSD Foundation, Inc. + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + #ifndef _NBCOMPAT_H #define _NBCOMPAT_H -#include <nbconfig.h> - -#include <nbtypes.h> +#include <nbcompat/nbconfig.h> +#include <nbcompat/nbtypes.h> #include <sys/types.h> #include <sys/param.h> @@ -32,16 +66,12 @@ #include <termios.h> #include <unistd.h> -#if HAVE_POLL -# if HAVE_POLL_H -# include <poll.h> -# elif HAVE_SYS_POLL_H -# include <sys/poll.h> -# endif -#elif HAVE_SELECT -# define USE_SELECT +#if HAVE_POLL_H +# include <poll.h> +#elif HAVE_SYS_POLL_H +# include <sys/poll.h> #else -# error "no poll() or select() found" +# include <nbcompat/poll.h> #endif #if HAVE_DIRENT_H @@ -62,7 +92,7 @@ #if HAVE_FTS_H # include <fts.h> #else -# include "fts.h" +# include <nbcompat/fts.h> #endif #if TIME_WITH_SYS_TIME @@ -165,6 +195,10 @@ struct { \ } while (/*CONSTCOND*/0) #endif /* HAVE_SYS_QUEUE_H */ +#ifndef TAILQ_HEAD_INITIALIZER +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } +#endif #ifndef TAILQ_EMPTY #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) #endif @@ -187,6 +221,8 @@ struct { \ #if HAVE_ERR_H # include <err.h> +#else +# include <nbcompat/err.h> #endif #include <ftpglob.h> @@ -280,10 +316,16 @@ void tputs(const char *, int, int (*)(int)); # include <libutil.h> #endif +#if HAVE_NBCOMPAT_VIS +# ifdef HAVE_VIS_H +# undef HAVE_VIS_H +# endif +#endif + #if HAVE_VIS_H # include <vis.h> #else -# include "vis.h" +# include <nbcompat/vis.h> #endif #if !HAVE_D_NAMLEN @@ -319,10 +361,6 @@ extern int optind; int pclose(FILE *); #endif -#if !HAVE_ERR -#include <err.h> -#endif - #if !HAVE_FGETLN char *fgetln(FILE *, size_t *); #endif @@ -423,6 +461,10 @@ size_t strlcpy(char *, const char *, size_t); char *strsep(char **stringp, const char *delim); #endif +#if HAVE_NBCOMPAT_STATFS +# include <nbcompat/statfs.h> +#endif + #if !HAVE_MEMMOVE # define memmove(a,b,c) bcopy((b),(a),(c)) /* XXX: add others #defines for borken systems? */ diff --git a/pkgtools/libnbcompat/files/pack_dev.c b/pkgtools/libnbcompat/files/pack_dev.c index f5941eb178c..0353ff74bd4 100644 --- a/pkgtools/libnbcompat/files/pack_dev.c +++ b/pkgtools/libnbcompat/files/pack_dev.c @@ -1,4 +1,4 @@ -/* $NetBSD: pack_dev.c,v 1.2 2003/09/01 15:31:19 jlam Exp $ */ +/* $NetBSD: pack_dev.c,v 1.3 2003/09/03 13:11:14 jlam Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -36,17 +36,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: pack_dev.c,v 1.2 2003/09/01 15:31:19 jlam Exp $"); +__RCSID("$NetBSD: pack_dev.c,v 1.3 2003/09/03 13:11:14 jlam Exp $"); #endif /* not lint */ #include <sys/types.h> diff --git a/pkgtools/libnbcompat/files/pwcache.c b/pkgtools/libnbcompat/files/pwcache.c index f22923658b3..42d7f2ad4c2 100644 --- a/pkgtools/libnbcompat/files/pwcache.c +++ b/pkgtools/libnbcompat/files/pwcache.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwcache.c,v 1.3 2003/09/01 15:31:19 jlam Exp $ */ +/* $NetBSD: pwcache.c,v 1.4 2003/09/03 13:11:14 jlam Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -67,7 +67,7 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif #if HAVE_SYS_CDEFS_H @@ -78,7 +78,7 @@ #if 0 static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pwcache.c,v 1.3 2003/09/01 15:31:19 jlam Exp $"); +__RCSID("$NetBSD: pwcache.c,v 1.4 2003/09/03 13:11:14 jlam Exp $"); #endif #endif /* LIBC_SCCS and not lint */ diff --git a/pkgtools/libnbcompat/files/rmd160.c b/pkgtools/libnbcompat/files/rmd160.c index 69f1d8b23c2..ea6bad60d82 100644 --- a/pkgtools/libnbcompat/files/rmd160.c +++ b/pkgtools/libnbcompat/files/rmd160.c @@ -1,4 +1,4 @@ -/* $NetBSD: rmd160.c,v 1.2 2003/09/01 15:31:19 jlam Exp $ */ +/* $NetBSD: rmd160.c,v 1.3 2003/09/03 13:11:15 jlam Exp $ */ /********************************************************************\ * @@ -19,13 +19,13 @@ \********************************************************************/ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #ifndef lint -__RCSID("$NetBSD: rmd160.c,v 1.2 2003/09/01 15:31:19 jlam Exp $"); +__RCSID("$NetBSD: rmd160.c,v 1.3 2003/09/03 13:11:15 jlam Exp $"); #endif /* not lint */ /* header files */ diff --git a/pkgtools/libnbcompat/files/rmd160hl.c b/pkgtools/libnbcompat/files/rmd160hl.c index a2f567a97b2..a0a3cc06617 100644 --- a/pkgtools/libnbcompat/files/rmd160hl.c +++ b/pkgtools/libnbcompat/files/rmd160hl.c @@ -1,4 +1,4 @@ -/* $NetBSD: rmd160hl.c,v 1.2 2003/09/01 15:31:19 jlam Exp $ */ +/* $NetBSD: rmd160hl.c,v 1.3 2003/09/03 13:11:15 jlam Exp $ */ /* rmd160hl.c * ---------------------------------------------------------------------------- @@ -12,13 +12,13 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #ifndef lint -__RCSID("$NetBSD: rmd160hl.c,v 1.2 2003/09/01 15:31:19 jlam Exp $"); +__RCSID("$NetBSD: rmd160hl.c,v 1.3 2003/09/03 13:11:15 jlam Exp $"); #endif /* not lint */ diff --git a/pkgtools/libnbcompat/files/setenv.c b/pkgtools/libnbcompat/files/setenv.c index 3762a7170fc..b81dd0db785 100644 --- a/pkgtools/libnbcompat/files/setenv.c +++ b/pkgtools/libnbcompat/files/setenv.c @@ -1,4 +1,4 @@ -/* $NetBSD: setenv.c,v 1.5 2003/09/01 15:31:19 jlam Exp $ */ +/* $NetBSD: setenv.c,v 1.6 2003/09/03 13:11:15 jlam Exp $ */ /* * Copyright (c) 1987 Regents of the University of California. @@ -31,11 +31,11 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)setenv.c 5.6 (Berkeley) 6/4/91";*/ -static char *rcsid = "$Id: setenv.c,v 1.5 2003/09/01 15:31:19 jlam Exp $"; +static char *rcsid = "$Id: setenv.c,v 1.6 2003/09/03 13:11:15 jlam Exp $"; #endif /* LIBC_SCCS and not lint */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif #if HAVE_STRINGS_H diff --git a/pkgtools/libnbcompat/files/setmode.c b/pkgtools/libnbcompat/files/setmode.c index f39123fb31a..a47b0f15224 100644 --- a/pkgtools/libnbcompat/files/setmode.c +++ b/pkgtools/libnbcompat/files/setmode.c @@ -1,4 +1,4 @@ -/* $NetBSD: setmode.c,v 1.3 2003/09/01 15:31:20 jlam Exp $ */ +/* $NetBSD: setmode.c,v 1.4 2003/09/03 13:11:15 jlam Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -33,7 +33,7 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif #if HAVE_SYS_CDEFS_H @@ -44,7 +44,7 @@ #if 0 static char sccsid[] = "@(#)setmode.c 8.2 (Berkeley) 3/25/94"; #else -__RCSID("$NetBSD: setmode.c,v 1.3 2003/09/01 15:31:20 jlam Exp $"); +__RCSID("$NetBSD: setmode.c,v 1.4 2003/09/03 13:11:15 jlam Exp $"); #endif #endif /* LIBC_SCCS and not lint */ diff --git a/pkgtools/libnbcompat/files/sha1.c b/pkgtools/libnbcompat/files/sha1.c index e517c77a547..5f7dd82a2d4 100644 --- a/pkgtools/libnbcompat/files/sha1.c +++ b/pkgtools/libnbcompat/files/sha1.c @@ -1,4 +1,4 @@ -/* $NetBSD: sha1.c,v 1.2 2003/09/01 15:31:20 jlam Exp $ */ +/* $NetBSD: sha1.c,v 1.3 2003/09/03 13:11:15 jlam Exp $ */ /* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */ /* @@ -16,10 +16,10 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #define SHA1HANDSOFF /* Copies data before messing with it. */ diff --git a/pkgtools/libnbcompat/files/sha1hl.c b/pkgtools/libnbcompat/files/sha1hl.c index 3d98c84f45b..856b2a1ad55 100644 --- a/pkgtools/libnbcompat/files/sha1hl.c +++ b/pkgtools/libnbcompat/files/sha1hl.c @@ -1,4 +1,4 @@ -/* $NetBSD: sha1hl.c,v 1.2 2003/09/01 15:31:20 jlam Exp $ */ +/* $NetBSD: sha1hl.c,v 1.3 2003/09/03 13:11:15 jlam Exp $ */ /* sha1hl.c * ---------------------------------------------------------------------------- @@ -12,10 +12,10 @@ /* #include "namespace.h" */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #if HAVE_FCNTL_H #include <fcntl.h> @@ -35,7 +35,7 @@ #endif #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: sha1hl.c,v 1.2 2003/09/01 15:31:20 jlam Exp $"); +__RCSID("$NetBSD: sha1hl.c,v 1.3 2003/09/03 13:11:15 jlam Exp $"); #endif /* LIBC_SCCS and not lint */ #ifndef _DIAGASSERT diff --git a/pkgtools/libnbcompat/files/sha2.c b/pkgtools/libnbcompat/files/sha2.c index c87c8ea5f84..4348b0f16f7 100644 --- a/pkgtools/libnbcompat/files/sha2.c +++ b/pkgtools/libnbcompat/files/sha2.c @@ -35,10 +35,10 @@ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #include <stdio.h> diff --git a/pkgtools/libnbcompat/files/sha2hl.c b/pkgtools/libnbcompat/files/sha2hl.c index 6b959cc450b..0adcf8756bb 100644 --- a/pkgtools/libnbcompat/files/sha2hl.c +++ b/pkgtools/libnbcompat/files/sha2hl.c @@ -1,4 +1,4 @@ -/* $NetBSD: sha2hl.c,v 1.2 2003/09/01 15:31:20 jlam Exp $ */ +/* $NetBSD: sha2hl.c,v 1.3 2003/09/03 13:11:15 jlam Exp $ */ /* * sha2hl.c @@ -41,13 +41,13 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif -#include <nbtypes.h> +#include "nbcompat/nbtypes.h" #ifndef lint -__RCSID("$NetBSD: sha2hl.c,v 1.2 2003/09/01 15:31:20 jlam Exp $"); +__RCSID("$NetBSD: sha2hl.c,v 1.3 2003/09/03 13:11:15 jlam Exp $"); #endif /* not lint */ diff --git a/pkgtools/libnbcompat/files/spec.c b/pkgtools/libnbcompat/files/spec.c index 08f6bf3beba..39a259c5454 100644 --- a/pkgtools/libnbcompat/files/spec.c +++ b/pkgtools/libnbcompat/files/spec.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.3 2003/09/01 15:31:20 jlam Exp $ */ +/* $NetBSD: spec.c,v 1.4 2003/09/03 13:11:15 jlam Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -75,7 +75,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.3 2003/09/01 15:31:20 jlam Exp $"); +__RCSID("$NetBSD: spec.c,v 1.4 2003/09/03 13:11:15 jlam Exp $"); #endif #endif /* not lint */ @@ -90,7 +90,9 @@ __RCSID("$NetBSD: spec.c,v 1.3 2003/09/01 15:31:20 jlam Exp $"); #include <stdlib.h> #include <string.h> #include <unistd.h> +#if HAVE_VIS_H #include <vis.h> +#endif #include "extern.h" #include "pack_dev.h" diff --git a/pkgtools/libnbcompat/files/stat_flags.c b/pkgtools/libnbcompat/files/stat_flags.c index fc6cfc05a46..991fec529d7 100644 --- a/pkgtools/libnbcompat/files/stat_flags.c +++ b/pkgtools/libnbcompat/files/stat_flags.c @@ -1,4 +1,4 @@ -/* $NetBSD: stat_flags.c,v 1.3 2003/09/01 15:31:21 jlam Exp $ */ +/* $NetBSD: stat_flags.c,v 1.4 2003/09/03 13:11:15 jlam Exp $ */ /*- * Copyright (c) 1993 @@ -29,9 +29,7 @@ * SUCH DAMAGE. */ -#if HAVE_CONFIG_H -#include "nbconfig.h" -#endif +#include "nbcompat.h" #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> @@ -41,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)stat_flags.c 8.2 (Berkeley) 7/28/94"; #else -__RCSID("$NetBSD: stat_flags.c,v 1.3 2003/09/01 15:31:21 jlam Exp $"); +__RCSID("$NetBSD: stat_flags.c,v 1.4 2003/09/03 13:11:15 jlam Exp $"); #endif #endif /* not lint */ @@ -49,11 +47,19 @@ __RCSID("$NetBSD: stat_flags.c,v 1.3 2003/09/01 15:31:21 jlam Exp $"); #define HAVE_STRUCT_STAT_ST_FLAGS 1 #endif +#if HAVE_SYS_TYPES_H #include <sys/types.h> +#endif +#if HAVE_SYS_TYPES_H #include <sys/stat.h> +#endif +#if HAVE_FTS_H #include <fts.h> +#endif #include <stddef.h> +#if HAVE_STRING_H #include <string.h> +#endif #include "stat_flags.h" diff --git a/pkgtools/libnbcompat/files/statfs.c b/pkgtools/libnbcompat/files/statfs.c index a8bac8cd101..b9129ea29e5 100644 --- a/pkgtools/libnbcompat/files/statfs.c +++ b/pkgtools/libnbcompat/files/statfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: statfs.c,v 1.2 2003/09/02 02:05:22 jlam Exp $ */ +/* $NetBSD: statfs.c,v 1.3 2003/09/03 13:11:16 jlam Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,57 +36,14 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif #if HAVE_STRING_H #include <string.h> #endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -#if HAVE_SYS_MOUNT_H -#include <sys/mount.h> -#endif - -#if HAVE_SYS_STATVFS_H -#include <sys/statvfs.h> -#endif - -#if HAVE_SYS_VFS_H -#include <sys/vfs.h> -#endif - -#define MFSNAMELEN 16 /* length of fs type name, including nul */ -#define MNAMELEN 90 /* length of buffer for returned name */ - -struct statfs { - short f_type; /* type of file system */ - u_short f_flags; /* copy of mount flags */ - long f_bsize; /* fundamental file system block size */ - long f_iosize; /* optimal transfer block size */ - long f_blocks; /* total data blocks in file system */ - long f_bfree; /* free blocks in fs */ - long f_bavail; /* free blocks avail to non-superuser */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - uid_t f_owner; /* user that mounted the file system */ - long f_spare[4]; /* spare for later */ - char f_fstypename[MFSNAMELEN]; /* fs type name */ - char f_mntonname[MNAMELEN]; /* directory on which mounted */ - char f_mntfromname[MNAMELEN]; /* mounted file system */ -}; - -#ifndef MNT_RDONLY -#define MNT_RDONLY 0x00000001 /* read only filesystem */ -#endif - -#ifndef MNT_NOSUID -#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */ -#endif +#include "nbcompat/statfs.h" static void vfs2fs(struct statfs *, const struct statvfs *); diff --git a/pkgtools/libnbcompat/files/unvis.c b/pkgtools/libnbcompat/files/unvis.c index d157f0823bc..d6498aad32e 100644 --- a/pkgtools/libnbcompat/files/unvis.c +++ b/pkgtools/libnbcompat/files/unvis.c @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.4 2003/09/01 15:31:21 jlam Exp $ */ +/* $NetBSD: unvis.c,v 1.5 2003/09/03 13:11:16 jlam Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -30,7 +30,7 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif #if HAVE_SYS_CDEFS_H @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.4 2003/09/01 15:31:21 jlam Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.5 2003/09/03 13:11:16 jlam Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -53,7 +53,7 @@ __RCSID("$NetBSD: unvis.c,v 1.4 2003/09/01 15:31:21 jlam Exp $"); #include <assert.h> #include <ctype.h> #include <stdio.h> -#include <vis.h> +#include "nbcompat/vis.h" #ifndef S_GROUND /* diff --git a/pkgtools/libnbcompat/files/util.h b/pkgtools/libnbcompat/files/util.h index 9f235ab21a3..86d1c6f36da 100644 --- a/pkgtools/libnbcompat/files/util.h +++ b/pkgtools/libnbcompat/files/util.h @@ -1,4 +1,4 @@ -/* $NetBSD: util.h,v 1.3 2003/09/03 03:28:29 jlam Exp $ */ +/* $NetBSD: util.h,v 1.4 2003/09/03 13:11:16 jlam Exp $ */ /*- * Copyright (c) 1995 @@ -36,7 +36,7 @@ #ifndef _UTIL_H_ #define _UTIL_H_ -#include <nbconfig.h> +#include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> diff --git a/pkgtools/libnbcompat/files/vis.c b/pkgtools/libnbcompat/files/vis.c index f2ca376d5c0..580ec2e97a6 100644 --- a/pkgtools/libnbcompat/files/vis.c +++ b/pkgtools/libnbcompat/files/vis.c @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.2 2003/09/01 15:31:22 jlam Exp $ */ +/* $NetBSD: vis.c,v 1.3 2003/09/03 13:11:16 jlam Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -35,15 +35,17 @@ */ #if HAVE_CONFIG_H -#include "nbconfig.h" +#include "nbcompat/nbconfig.h" #endif +#include "nbcompat/nbtypes.h" + #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.2 2003/09/01 15:31:22 jlam Exp $"); +__RCSID("$NetBSD: vis.c,v 1.3 2003/09/03 13:11:16 jlam Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -53,11 +55,9 @@ __RCSID("$NetBSD: vis.c,v 1.2 2003/09/01 15:31:22 jlam Exp $"); #include <assert.h> #endif -#include "vis.h" +#include "nbcompat/vis.h" #include <stdlib.h> -#include <nbtypes.h> - #ifndef __ELF__ #define _strsvis strsvis #define _strsvisx strsvisx |