diff options
author | joerg <joerg> | 2008-10-06 12:36:19 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-10-06 12:36:19 +0000 |
commit | 5c89e56fe3e0ab7602a6a4f8d7990fe8181e7267 (patch) | |
tree | 7ebb15bf3fb03e9d4066fba545dfd34ba973f921 /pkgtools | |
parent | 3035f950f2626728d372a644d94d5fcc5f81fa03 (diff) | |
download | pkgsrc-5c89e56fe3e0ab7602a6a4f8d7990fe8181e7267.tar.gz |
libnbcompat-20080922:
- DESTDIR support
- Add check for inttypes.h and sys/socket.h
- Provide compatibility fallback for netdb.h and the RFC2553 API
(getaddrinfo), supoprting IPv4 only. Code from OpenSSH.
- Use normal autoconf checks for fixed size bit types. Stop using the
older BSD types (u_intXX_t) in libnbcompat.
- Add implementation of shquote (from NetBSD).
- Fix a buglet in the getenv/setenv/unsetenv detection.
- Fix a buglet in the mkdtemp/mkstemp detection.
Diffstat (limited to 'pkgtools')
25 files changed, 1739 insertions, 1548 deletions
diff --git a/pkgtools/libnbcompat/Makefile b/pkgtools/libnbcompat/Makefile index b056fc5bf80..c47b0cc3e1a 100644 --- a/pkgtools/libnbcompat/Makefile +++ b/pkgtools/libnbcompat/Makefile @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.63 2008/09/08 20:20:22 joerg Exp $ +# $NetBSD: Makefile,v 1.64 2008/10/06 12:36:19 joerg Exp $ # # NOTE: If you update this package, it is *mandatory* that you update # pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual # list of tested and supported platforms. # -DISTNAME= libnbcompat-20080908 +DISTNAME= libnbcompat-20080922 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty @@ -14,12 +14,10 @@ MAINTAINER= grant@NetBSD.org HOMEPAGE= http://www.NetBSD.org/ COMMENT= Portable NetBSD compatibility library -NO_PKGTOOLS_REQD_CHECK= yes -NO_CHECKSUM= yes -NO_MTREE= yes +PKG_DESTDIR_SUPPORT= user-destdir GNU_CONFIGURE= yes -MAKE_ENV+= BINMODE=${BINMODE} +MAKE_ENV+= LIBMODE=${LIBMODE} do-extract: @${CP} -R ${FILESDIR} ${WRKSRC} diff --git a/pkgtools/libnbcompat/PLIST b/pkgtools/libnbcompat/PLIST index 847c87cf3a9..a8a948f927d 100644 --- a/pkgtools/libnbcompat/PLIST +++ b/pkgtools/libnbcompat/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.14 2007/05/07 16:38:47 joerg Exp $ +@comment $NetBSD: PLIST,v 1.15 2008/10/06 12:36:19 joerg Exp $ include/nbcompat.h include/nbcompat/assert.h include/nbcompat/cdefs.h @@ -14,7 +14,7 @@ include/nbcompat/grp.h include/nbcompat/limits.h include/nbcompat/md5.h include/nbcompat/nbconfig.h -include/nbcompat/nbtypes.h +include/nbcompat/netdb.h include/nbcompat/param.h include/nbcompat/paths.h include/nbcompat/poll.h diff --git a/pkgtools/libnbcompat/files/Makefile.in b/pkgtools/libnbcompat/files/Makefile.in index ad5ce648573..a17d5c3a3ab 100644 --- a/pkgtools/libnbcompat/files/Makefile.in +++ b/pkgtools/libnbcompat/files/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.33 2007/05/07 16:38:47 joerg Exp $ +# $NetBSD: Makefile.in,v 1.34 2008/10/06 12:36:19 joerg Exp $ # srcdir= @srcdir@ @@ -12,7 +12,7 @@ CFLAGS= -I$(srcdir) -I. @INCLUDES@ @CFLAGS@ CPPFLAGS= @CPPFLAGS@ DEFS= @DEFS@ INSTALL= @INSTALL@ -BINMODE?= 555 +LIBMODE?= 644 LDFLAGS= @LDFLAGS@ AWK= @AWK@ @@ -36,7 +36,7 @@ INCS= nbcompat.h \ nbcompat/limits.h \ nbcompat/md5.h \ nbcompat/nbconfig.h \ - nbcompat/nbtypes.h \ + nbcompat/netdb.h \ nbcompat/param.h \ nbcompat/paths.h \ nbcompat/poll.h \ @@ -64,9 +64,9 @@ OBJS= @LIBOBJS@ LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ COMPILE= $(CC) $(CPPFLAGS) $(CFLAGS) -all: nbcompat/nbtypes.h nbcompat/nbconfig.h $(LIB) +all: nbcompat/nbconfig.h $(LIB) -.c.o: nbcompat/nbtypes.h +.c.o: $(COMPILE) $(DEFS) -c $< $(LIB): $(OBJS) @@ -76,26 +76,19 @@ $(LIB): $(OBJS) nbcompat/nbconfig.h: nbcompat/config.h nbcompat.awk $(AWK) -f nbcompat.awk nbcompat/config.h > $@ -nbcompat/nbtypes.h: bits - ./bits $@ - -bits: bits.c - $(COMPILE) $(DEFS) -c bits.c - $(LINK) bits.o - install: - $(INSTALL) -m 755 -d $(prefix)/lib - $(INSTALL) -m $(BINMODE) ${LIB} $(prefix)/lib - $(RANLIB) $(prefix)/lib/$(LIB) - $(INSTALL) -m 755 -d $(prefix)/include - $(INSTALL) -m 755 -d $(prefix)/include/nbcompat + $(INSTALL) -m 755 -d ${DESTDIR}$(prefix)/lib + $(INSTALL) -m $(LIBMODE) ${LIB} ${DESTDIR}$(prefix)/lib + $(RANLIB) ${DESTDIR}$(prefix)/lib/$(LIB) + $(INSTALL) -m 755 -d ${DESTDIR}$(prefix)/include + $(INSTALL) -m 755 -d ${DESTDIR}$(prefix)/include/nbcompat @for file in $(INCS); do \ - echo "$(INSTALL) -m 444 $$file $(prefix)/include/$$file"; \ - $(INSTALL) -m 444 $$file $(prefix)/include/$$file; \ + echo "$(INSTALL) -m 444 $$file ${DESTDIR}$(prefix)/include/$$file"; \ + $(INSTALL) -m 444 $$file ${DESTDIR}$(prefix)/include/$$file; \ done clean: - rm -f *.a *.o bits nbcompat/nbtypes.h nbcompat/nbcompat.h + rm -f *.a *.o bits nbcompat/nbcompat.h distclean: clean rm -f Makefile config.log config.status configure.lineno diff --git a/pkgtools/libnbcompat/files/bits.c b/pkgtools/libnbcompat/files/bits.c deleted file mode 100644 index 9d3842a2304..00000000000 --- a/pkgtools/libnbcompat/files/bits.c +++ /dev/null @@ -1,196 +0,0 @@ -/* $NetBSD: bits.c,v 1.7 2007/09/04 09:47:38 obache Exp $ */ - -/* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. - */ - -#include "nbcompat/config.h" -#if 0 -__RCSID("$NetBSD: bits.c,v 1.7 2007/09/04 09:47:38 obache Exp $"); -#endif -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <ctype.h> - -#define BITSIZE(TYPE) \ -{ \ - int b = 0; TYPE x = 1, zero = 0; char *pre = "u"; \ - char tmp[128], tmp2[128]; \ - while(x){ x <<= 1; b++; if(x < zero) pre=""; } \ - if(b >= len){ \ - int tabs; \ - sprintf(tmp, "%sint%d_t" , pre, len); \ - sprintf(tmp2, "typedef %s %s;", #TYPE, tmp); \ - fprintf(f, "#undef %s\n", tmp); \ - tabs = 5 - strlen(tmp2) / 8; \ - fprintf(f, "%s", tmp2); \ - while(tabs-- > 0) fprintf(f, "\t"); \ - fprintf(f, "/* %2d bits */\n", b); \ - return; \ - } \ -} - -/* - * work around rpl_malloc from nbcompat_config.h, since we don't need the - * replacement malloc() here - */ -#if ! HAVE_MALLOC -#undef malloc -void *malloc(); -#endif - -#ifndef HAVE___ATTRIBUTE__ -#define __attribute__(x) -#endif - -static void -try_signed(FILE *f, int len) __attribute__ ((unused)); - -static void -try_unsigned(FILE *f, int len) __attribute__ ((unused)); - -static int -print_bt(FILE *f, int flag) __attribute__ ((unused)); - -static void -try_signed(FILE *f, int len) -{ - BITSIZE(signed char); - BITSIZE(short); - BITSIZE(int); - BITSIZE(long); -#if HAVE_LONG_LONG - BITSIZE(long long); -#endif - fprintf(f, "/* There is no %d bit type */\n", len); -} - -static void -try_unsigned(FILE *f, int len) -{ - BITSIZE(unsigned char); - BITSIZE(unsigned short); - BITSIZE(unsigned int); - BITSIZE(unsigned long); -#if HAVE_LONG_LONG - BITSIZE(unsigned long long); -#endif - fprintf(f, "/* There is no %d bit type */\n", len); -} - -int main(int argc, char **argv) -{ - FILE *f; - char *fn, *hb; - - if(argc < 2){ - fn = "bits.h"; - hb = "__BITS_H__"; - f = stdout; - } else { - char *p; - fn = argv[1]; - hb = malloc(strlen(fn) + 5); - sprintf(hb, "__%s__", fn); - for(p = hb; *p; p++){ - if(!isalnum((unsigned char)*p)) - *p = '_'; - } - f = fopen(argv[1], "w"); - } - fprintf(f, "/* %s -- this file was generated by\n", fn); - fprintf(f, " %*s %s */\n\n", (int)strlen(fn), "", - "$Id: bits.c,v 1.7 2007/09/04 09:47:38 obache Exp $"); - fprintf(f, "#ifndef %s\n", hb); - fprintf(f, "#define %s\n", hb); - fprintf(f, "\n"); -#if HAVE_SYS_TYPES_H - fprintf(f, "#include <sys/types.h>\n"); -#endif -#if HAVE_INTTYPES_H - fprintf(f, "#include <inttypes.h>\n"); -#endif -#if HAVE_SYS_BITYPES_H - fprintf(f, "#include <sys/bitypes.h>\n"); -#endif -#if HAVE_BIND_BITYPES_H - fprintf(f, "#include <bind/bitypes.h>\n"); -#endif -#if HAVE_NETINET_IN6_MACHTYPES_H - fprintf(f, "#include <netinet/in6_machtypes.h>\n"); -#endif - fprintf(f, "\n"); - -#ifndef HAVE_INT8_T - try_signed (f, 8); -#endif /* HAVE_INT8_T */ -#ifndef HAVE_INT16_T - try_signed (f, 16); -#endif /* HAVE_INT16_T */ -#ifndef HAVE_INT32_T - try_signed (f, 32); -#endif /* HAVE_INT32_T */ -#ifndef HAVE_INT64_T - try_signed (f, 64); -#endif /* HAVE_INT64_T */ - -#ifndef HAVE_UINT8_T - try_unsigned (f, 8); -#endif /* HAVE_UINT8_T */ -#ifndef HAVE_UINT16_T - try_unsigned (f, 16); -#endif /* HAVE_UINT16_T */ -#ifndef HAVE_UINT32_T - try_unsigned (f, 32); -#endif /* HAVE_UINT32_T */ -#ifndef HAVE_UINT64_T - try_unsigned (f, 64); -#endif /* HAVE_UINT64_T */ - -#define X(S) fprintf(f, "typedef uint" #S "_t u_int" #S "_t;\n") -#ifndef HAVE_U_INT8_T - X(8); -#endif /* HAVE_U_INT8_T */ -#ifndef HAVE_U_INT16_T - X(16); -#endif /* HAVE_U_INT16_T */ -#ifndef HAVE_U_INT32_T - X(32); -#endif /* HAVE_U_INT32_T */ -#ifndef HAVE_U_INT64_T - X(64); -#endif /* HAVE_U_INT64_T */ - - fprintf(f, "#endif /* %s */\n", hb); - return 0; -} diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index 07b6a411426..fd8f7bd913f 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -3950,159 +3950,6 @@ done -for ac_header in inttypes.h sys/types.h sys/bitypes.h bind/bitypes.h \ - netinet/in6_machtypes.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to grant@NetBSD.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - @@ -4147,10 +3994,11 @@ done for ac_header in alloca.h assert.h ctype.h dirent.h err.h errno.h fcntl.h \ - fnmatch.h fts.h grp.h libutil.h limits.h machine/endian.h ndir.h \ - paths.h pwd.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h \ - string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \ - sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/stat.h \ + fnmatch.h fts.h grp.h inttypes.h libutil.h limits.h \ + machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \ + stdarg.h stddef.h stdint.h stdio.h \ + stdlib.h string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \ + sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/socket.h sys/stat.h \ sys/statfs.h sys/statvfs.h sys/time.h sys/ttycom.h sys/types.h \ sys/uio.h sys/vfs.h termcap.h time.h tzfile.h unistd.h \ util.h utime.h @@ -6947,165 +6795,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: checking for long long" >&5 -$as_echo_n "checking for long long... " >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_long_long=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif -int -main () -{ -if (sizeof (long long)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - -int -main () -{ -if (sizeof ((long long))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -$as_echo "$ac_cv_type_long_long" >&6; } -if test $ac_cv_type_long_long = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for long double" >&5 -$as_echo_n "checking for long double... " >&6; } -if test "${ac_cv_type_long_double+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for int8_t" >&5 +$as_echo_n "checking for int8_t... " >&6; } +if test "${ac_cv_c_int8_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_long_double=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int8_t=no + for ac_type in 'int8_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (long double)) - return 0; +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + ; return 0; } @@ -7134,25 +6845,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof ((long double))) - return 0; +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; return 0; } @@ -7180,135 +6880,11 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_long_double=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 -$as_echo "$ac_cv_type_long_double" >&6; } -if test $ac_cv_type_long_double = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_DOUBLE 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for int8_t" >&5 -$as_echo_n "checking for int8_t... " >&6; } -if test "${ac_cv_type_int8_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_int8_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - -int -main () -{ -if (sizeof (int8_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + case $ac_type in + int8_t) ac_cv_c_int8_t=yes ;; + *) ac_cv_c_int8_t=$ac_type ;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif -int -main () -{ -if (sizeof ((int8_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_int8_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -7320,48 +6896,43 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int8_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5 -$as_echo "$ac_cv_type_int8_t" >&6; } -if test $ac_cv_type_int8_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int8_t" >&5 +$as_echo "$ac_cv_c_int8_t" >&6; } + case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) cat >>confdefs.h <<_ACEOF -#define HAVE_INT8_T 1 +#define int8_t $ac_cv_c_int8_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for int16_t" >&5 + { $as_echo "$as_me:$LINENO: checking for int16_t" >&5 $as_echo_n "checking for int16_t... " >&6; } -if test "${ac_cv_type_int16_t+set}" = set; then +if test "${ac_cv_c_int16_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_int16_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int16_t=no + for ac_type in 'int16_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (int16_t)) - return 0; +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + ; return 0; } @@ -7390,25 +6961,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof ((int16_t))) - return 0; +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; return 0; } @@ -7436,7 +6996,11 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int16_t=yes + case $ac_type in + int16_t) ac_cv_c_int16_t=yes ;; + *) ac_cv_c_int16_t=$ac_type ;; +esac + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -7448,48 +7012,43 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int16_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 -$as_echo "$ac_cv_type_int16_t" >&6; } -if test $ac_cv_type_int16_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int16_t" >&5 +$as_echo "$ac_cv_c_int16_t" >&6; } + case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) cat >>confdefs.h <<_ACEOF -#define HAVE_INT16_T 1 +#define int16_t $ac_cv_c_int16_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for int32_t" >&5 + { $as_echo "$as_me:$LINENO: checking for int32_t" >&5 $as_echo_n "checking for int32_t... " >&6; } -if test "${ac_cv_type_int32_t+set}" = set; then +if test "${ac_cv_c_int32_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_int32_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int32_t=no + for ac_type in 'int32_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (int32_t)) - return 0; +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + ; return 0; } @@ -7518,25 +7077,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof ((int32_t))) - return 0; +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; return 0; } @@ -7564,7 +7112,11 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int32_t=yes + case $ac_type in + int32_t) ac_cv_c_int32_t=yes ;; + *) ac_cv_c_int32_t=$ac_type ;; +esac + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -7576,48 +7128,43 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int32_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 -$as_echo "$ac_cv_type_int32_t" >&6; } -if test $ac_cv_type_int32_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 +$as_echo "$ac_cv_c_int32_t" >&6; } + case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) cat >>confdefs.h <<_ACEOF -#define HAVE_INT32_T 1 +#define int32_t $ac_cv_c_int32_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for int64_t" >&5 + { $as_echo "$as_me:$LINENO: checking for int64_t" >&5 $as_echo_n "checking for int64_t... " >&6; } -if test "${ac_cv_type_int64_t+set}" = set; then +if test "${ac_cv_c_int64_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_int64_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int64_t=no + for ac_type in 'int64_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (int64_t)) - return 0; +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + ; return 0; } @@ -7646,25 +7193,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof ((int64_t))) - return 0; +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; return 0; } @@ -7692,7 +7228,11 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int64_t=yes + case $ac_type in + int64_t) ac_cv_c_int64_t=yes ;; + *) ac_cv_c_int64_t=$ac_type ;; +esac + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -7704,95 +7244,43 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int64_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -$as_echo "$ac_cv_type_int64_t" >&6; } -if test $ac_cv_type_int64_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 +$as_echo "$ac_cv_c_int64_t" >&6; } + case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) cat >>confdefs.h <<_ACEOF -#define HAVE_INT64_T 1 +#define int64_t $ac_cv_c_int64_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for u_int8_t" >&5 -$as_echo_n "checking for u_int8_t... " >&6; } -if test "${ac_cv_type_u_int8_t+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for uint8_t" >&5 +$as_echo_n "checking for uint8_t... " >&6; } +if test "${ac_cv_c_uint8_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_u_int8_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_uint8_t=no + for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (u_int8_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif +static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)]; +test_array [0] = 0 -int -main () -{ -if (sizeof ((u_int8_t))) - return 0; ; return 0; } @@ -7815,15 +7303,11 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_u_int8_t=yes -fi + case $ac_type in + uint8_t) ac_cv_c_uint8_t=yes ;; + *) ac_cv_c_uint8_t=$ac_type ;; +esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7832,223 +7316,48 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint8_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5 -$as_echo "$ac_cv_type_u_int8_t" >&6; } -if test $ac_cv_type_u_int8_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_U_INT8_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for u_int16_t" >&5 -$as_echo_n "checking for u_int16_t... " >&6; } -if test "${ac_cv_type_u_int16_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_u_int16_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - -int -main () -{ -if (sizeof (u_int16_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5 +$as_echo "$ac_cv_c_uint8_t" >&6; } + case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) -int -main () -{ -if (sizeof ((u_int16_t))) - return 0; - ; - return 0; -} +cat >>confdefs.h <<\_ACEOF +#define _UINT8_T 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_u_int16_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 -$as_echo "$ac_cv_type_u_int16_t" >&6; } -if test $ac_cv_type_u_int16_t = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_U_INT16_T 1 +#define uint8_t $ac_cv_c_uint8_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for u_int32_t" >&5 -$as_echo_n "checking for u_int32_t... " >&6; } -if test "${ac_cv_type_u_int32_t+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for uint16_t" >&5 +$as_echo_n "checking for uint16_t... " >&6; } +if test "${ac_cv_c_uint16_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_u_int32_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_uint16_t=no + for ac_type in 'uint16_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (u_int32_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif +static int test_array [1 - 2 * !(($ac_type) -1 >> (16 - 1) == 1)]; +test_array [0] = 0 -int -main () -{ -if (sizeof ((u_int32_t))) - return 0; ; return 0; } @@ -8071,15 +7380,11 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_u_int32_t=yes -fi + case $ac_type in + uint16_t) ac_cv_c_uint16_t=yes ;; + *) ac_cv_c_uint16_t=$ac_type ;; +esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -8088,95 +7393,44 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint16_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -$as_echo "$ac_cv_type_u_int32_t" >&6; } -if test $ac_cv_type_u_int32_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint16_t" >&5 +$as_echo "$ac_cv_c_uint16_t" >&6; } + case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + cat >>confdefs.h <<_ACEOF -#define HAVE_U_INT32_T 1 +#define uint16_t $ac_cv_c_uint16_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for u_int64_t" >&5 -$as_echo_n "checking for u_int64_t... " >&6; } -if test "${ac_cv_type_u_int64_t+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 +$as_echo_n "checking for uint32_t... " >&6; } +if test "${ac_cv_c_uint32_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_u_int64_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_uint32_t=no + for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (u_int64_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif +static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; +test_array [0] = 0 -int -main () -{ -if (sizeof ((u_int64_t))) - return 0; ; return 0; } @@ -8199,15 +7453,11 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_u_int64_t=yes -fi + case $ac_type in + uint32_t) ac_cv_c_uint32_t=yes ;; + *) ac_cv_c_uint32_t=$ac_type ;; +esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -8216,223 +7466,48 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint32_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -$as_echo "$ac_cv_type_u_int64_t" >&6; } -if test $ac_cv_type_u_int64_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_U_INT64_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for uint8_t" >&5 -$as_echo_n "checking for uint8_t... " >&6; } -if test "${ac_cv_type_uint8_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_uint8_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - -int -main () -{ -if (sizeof (uint8_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +$as_echo "$ac_cv_c_uint32_t" >&6; } + case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) -int -main () -{ -if (sizeof ((uint8_t))) - return 0; - ; - return 0; -} +cat >>confdefs.h <<\_ACEOF +#define _UINT32_T 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint8_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 -$as_echo "$ac_cv_type_uint8_t" >&6; } -if test $ac_cv_type_uint8_t = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_UINT8_T 1 +#define uint32_t $ac_cv_c_uint32_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for uint16_t" >&5 -$as_echo_n "checking for uint16_t... " >&6; } -if test "${ac_cv_type_uint16_t+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 +$as_echo_n "checking for uint64_t... " >&6; } +if test "${ac_cv_c_uint64_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_uint16_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_uint64_t=no + for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif - +$ac_includes_default int main () { -if (sizeof (uint16_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#if HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_BITYPES_H -#include <sys/bitypes.h> -#endif +static int test_array [1 - 2 * !(($ac_type) -1 >> (64 - 1) == 1)]; +test_array [0] = 0 -int -main () -{ -if (sizeof ((uint16_t))) - return 0; ; return 0; } @@ -8455,15 +7530,11 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint16_t=yes -fi + case $ac_type in + uint64_t) ac_cv_c_uint64_t=yes ;; + *) ac_cv_c_uint64_t=$ac_type ;; +esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -8472,23 +7543,32 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint64_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 -$as_echo "$ac_cv_type_uint16_t" >&6; } -if test $ac_cv_type_uint16_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 +$as_echo "$ac_cv_c_uint64_t" >&6; } + case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT16_T 1 +cat >>confdefs.h <<\_ACEOF +#define _UINT64_T 1 _ACEOF -fi -{ $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 -$as_echo_n "checking for uint32_t... " >&6; } -if test "${ac_cv_type_uint32_t+set}" = set; then +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +{ $as_echo "$as_me:$LINENO: checking for long long" >&5 +$as_echo_n "checking for long long... " >&6; } +if test "${ac_cv_type_long_long+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_uint32_t=no + ac_cv_type_long_long=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8512,7 +7592,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -if (sizeof (uint32_t)) +if (sizeof (long long)) return 0; ; return 0; @@ -8559,7 +7639,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -if (sizeof ((uint32_t))) +if (sizeof ((long long))) return 0; ; return 0; @@ -8588,7 +7668,7 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uint32_t=yes + ac_cv_type_long_long=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -8601,22 +7681,22 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -$as_echo "$ac_cv_type_uint32_t" >&6; } -if test $ac_cv_type_uint32_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +$as_echo "$ac_cv_type_long_long" >&6; } +if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_UINT32_T 1 +#define HAVE_LONG_LONG 1 _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 -$as_echo_n "checking for uint64_t... " >&6; } -if test "${ac_cv_type_uint64_t+set}" = set; then +{ $as_echo "$as_me:$LINENO: checking for long double" >&5 +$as_echo_n "checking for long double... " >&6; } +if test "${ac_cv_type_long_double+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_uint64_t=no + ac_cv_type_long_double=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8640,7 +7720,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -if (sizeof (uint64_t)) +if (sizeof (long double)) return 0; ; return 0; @@ -8687,7 +7767,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -if (sizeof ((uint64_t))) +if (sizeof ((long double))) return 0; ; return 0; @@ -8716,7 +7796,7 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uint64_t=yes + ac_cv_type_long_double=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -8729,12 +7809,12 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -$as_echo "$ac_cv_type_uint64_t" >&6; } -if test $ac_cv_type_uint64_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 +$as_echo "$ac_cv_type_long_double" >&6; } +if test $ac_cv_type_long_double = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_UINT64_T 1 +#define HAVE_LONG_DOUBLE 1 _ACEOF @@ -11137,10 +10217,11 @@ fi + for ac_func in asprintf err fgetln fnmatch fparseln getenv isblank \ lchflags lchmod lchown lutimes mkdtemp mkstemp setenv setgroupent \ - setpassent setprogname snprintf statvfs strdup strerror strlcat \ - strlcpy strmode strsep strtoll unsetenv usleep utimes warn + setpassent setprogname shquote snprintf statvfs strdup strerror \ + strlcat strlcpy strmode strsep strtoll unsetenv usleep utimes warn do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -11249,10 +10330,536 @@ done +need_getaddrinfo=no +{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } +if test "${ac_cv_type_socklen_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/socket.h> + +int +main () +{ +if (sizeof (socklen_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/socket.h> + +int +main () +{ +if (sizeof ((socklen_t))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test $ac_cv_type_socklen_t = yes; then -for ac_func in getenv setenv unsetenv +cat >>confdefs.h <<_ACEOF +#define HAVE_SOCKLEN_T 1 +_ACEOF + + +fi + +{ $as_echo "$as_me:$LINENO: checking for struct addrinfo" >&5 +$as_echo_n "checking for struct addrinfo... " >&6; } +if test "${ac_cv_type_struct_addrinfo+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_struct_addrinfo=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netdb.h> + +int +main () +{ +if (sizeof (struct addrinfo)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netdb.h> + +int +main () +{ +if (sizeof ((struct addrinfo))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_addrinfo=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 +$as_echo "$ac_cv_type_struct_addrinfo" >&6; } +if test $ac_cv_type_struct_addrinfo = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_ADDRINFO 1 +_ACEOF + + +fi + +{ $as_echo "$as_me:$LINENO: checking for struct in6_addr" >&5 +$as_echo_n "checking for struct in6_addr... " >&6; } +if test "${ac_cv_type_struct_in6_addr+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_struct_in6_addr=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netinet/in.h> + +int +main () +{ +if (sizeof (struct in6_addr)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netinet/in.h> + +int +main () +{ +if (sizeof ((struct in6_addr))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_in6_addr=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_in6_addr" >&5 +$as_echo "$ac_cv_type_struct_in6_addr" >&6; } +if test $ac_cv_type_struct_in6_addr = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_IN6_ADDR 1 +_ACEOF + + +fi + +{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 +$as_echo_n "checking for struct sockaddr_in6... " >&6; } +if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_struct_sockaddr_in6=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netinet/in.h> + +int +main () +{ +if (sizeof (struct sockaddr_in6)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netinet/in.h> + +int +main () +{ +if (sizeof ((struct sockaddr_in6))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_sockaddr_in6=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5 +$as_echo "$ac_cv_type_struct_sockaddr_in6" >&6; } +if test $ac_cv_type_struct_sockaddr_in6 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_IN6 1 +_ACEOF + + +fi + +{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5 +$as_echo_n "checking for struct sockaddr_storage... " >&6; } +if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_struct_sockaddr_storage=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/socket.h> + +int +main () +{ +if (sizeof (struct sockaddr_storage)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/socket.h> + +int +main () +{ +if (sizeof ((struct sockaddr_storage))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_sockaddr_storage=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5 +$as_echo "$ac_cv_type_struct_sockaddr_storage" >&6; } +if test $ac_cv_type_struct_sockaddr_storage = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +_ACEOF + + +fi + + + + +for ac_func in getnameinfo gai_strerror getaddrinfo do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -11349,19 +10956,134 @@ if test `eval 'as_val=${'$as_ac_var'} _ACEOF : else + need_getaddrinfo=yes +fi +done +if test $need_getaddrinfo = yes; then case " $LIBOBJS " in - *" findenv.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS findenv.$ac_objext" + *" getaddrinfo.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext" ;; esac - break +fi + +need_findenv=no + + + +for ac_func in getenv setenv unsetenv +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if test `eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + : +else + need_findenv=yes fi done +if test $need_findenv = yes; then + case " $LIBOBJS " in + *" findenv.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS findenv.$ac_objext" + ;; +esac + +fi +need_gettemp=no for ac_func in mkdtemp mkstemp @@ -11461,18 +11183,18 @@ if test `eval 'as_val=${'$as_ac_var'} _ACEOF : else + need_gettemp=yes +fi +done +if test $need_gettemp = yes; then case " $LIBOBJS " in *" gettemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS gettemp.$ac_objext" ;; esac - break - fi -done - @@ -11579,6 +11301,8 @@ fi done +need_setmode=no + for ac_func in getmode setmode do diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac index a445381c3f0..99bc8a68449 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -1,4 +1,4 @@ -dnl $NetBSD: configure.ac,v 1.65 2008/09/12 13:47:26 joerg Exp $ +dnl $NetBSD: configure.ac,v 1.66 2008/10/06 12:36:20 joerg Exp $ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) @@ -32,15 +32,12 @@ dnl Checks for header files. AC_HEADER_STDC AC_HEADER_TIME -dnl Used by bits.c to check for sizes of integer types -AC_CHECK_HEADERS([inttypes.h sys/types.h sys/bitypes.h bind/bitypes.h \ - netinet/in6_machtypes.h]) - AC_CHECK_HEADERS([alloca.h assert.h ctype.h dirent.h err.h errno.h fcntl.h \ - fnmatch.h fts.h grp.h libutil.h limits.h machine/endian.h ndir.h \ - paths.h pwd.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h \ - string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \ - sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/stat.h \ + fnmatch.h fts.h grp.h inttypes.h libutil.h limits.h \ + machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \ + stdarg.h stddef.h stdint.h stdio.h \ + stdlib.h string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \ + sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/socket.h sys/stat.h \ sys/statfs.h sys/statvfs.h sys/time.h sys/ttycom.h sys/types.h \ sys/uio.h sys/vfs.h termcap.h time.h tzfile.h unistd.h \ util.h utime.h @@ -199,7 +196,15 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_C___ATTRIBUTE__ AC_TYPE_SIZE_T AC_TYPE_UINTPTR_T -AC_CHECK_TYPES([long long, long double, int8_t, int16_t, int32_t, int64_t, u_int8_t, u_int16_t, u_int32_t, u_int64_t, uint8_t, uint16_t, uint32_t, uint64_t],[],[], +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_CHECK_TYPES([long long, long double],[],[], [#if STDC_HEADERS #include <stdlib.h> #include <stddef.h> @@ -239,21 +244,38 @@ AC_CHECK_DECLS([snprintf, vasprintf], [], [], [#include <stdio.h>]) AC_REPLACE_FUNCS([asprintf err fgetln fnmatch fparseln getenv isblank \ lchflags lchmod lchown lutimes mkdtemp mkstemp setenv setgroupent \ - setpassent setprogname snprintf statvfs strdup strerror strlcat \ - strlcpy strmode strsep strtoll unsetenv usleep utimes warn + setpassent setprogname shquote snprintf statvfs strdup strerror \ + strlcat strlcpy strmode strsep strtoll unsetenv usleep utimes warn ]) -AC_CHECK_FUNCS([getenv setenv unsetenv], [:], [ +need_getaddrinfo=no +AC_CHECK_TYPES([socklen_t], [], [], [[#include <sys/socket.h>]]) +AC_CHECK_TYPES([struct addrinfo], [], [], [[#include <netdb.h>]]) +AC_CHECK_TYPES([struct in6_addr], [], [], [[#include <netinet/in.h>]]) +AC_CHECK_TYPES([struct sockaddr_in6], [], [], [[#include <netinet/in.h>]]) +AC_CHECK_TYPES([struct sockaddr_storage], [], [], [[#include <sys/socket.h>]]) +dnl Assume that freeaddrinfo is only missing if getaddrinfo is also missing +AC_CHECK_FUNCS([getnameinfo gai_strerror getaddrinfo], [:], + [need_getaddrinfo=yes]) +if test $need_getaddrinfo = yes; then + AC_LIBOBJ(getaddrinfo) +fi + +need_findenv=no +AC_CHECK_FUNCS([getenv setenv unsetenv], [:], [need_findenv=yes]) +if test $need_findenv = yes; then AC_LIBOBJ(findenv) - break -]) +fi -AC_CHECK_FUNCS([mkdtemp mkstemp], [:], [ +need_gettemp=no +AC_CHECK_FUNCS([mkdtemp mkstemp], [:], [ need_gettemp=yes ]) +if test $need_gettemp = yes; then AC_LIBOBJ(gettemp) - break -]) +fi AC_CHECK_FUNCS([bcopy bzero memset memcpy setlocale]) + +need_setmode=no AC_CHECK_FUNCS([getmode setmode], [:], [need_setmode=yes]) if test $need_setmode = yes; then diff --git a/pkgtools/libnbcompat/files/getaddrinfo.c b/pkgtools/libnbcompat/files/getaddrinfo.c new file mode 100644 index 00000000000..5791d42e3fe --- /dev/null +++ b/pkgtools/libnbcompat/files/getaddrinfo.c @@ -0,0 +1,235 @@ +/* + * Copyright (C) 2000-2003 Damien Miller. All rights reserved. + * Copyright (C) 1999 WIDE Project. 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. Neither the name of the project 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 PROJECT 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 PROJECT 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. + */ + +/* + * Pseudo-implementation of RFC2553 name / address resolution functions + * + * But these functions are not implemented correctly. The minimum subset + * is implemented for ssh use only. For example, this routine assumes + * that ai_family is AF_INET. Don't use it for another purpose. + */ + + +#include <nbcompat.h> + +#include <nbcompat/netdb.h> +#include <stdlib.h> +#include <string.h> + +#include <netinet/in.h> +#include <arpa/inet.h> + +#ifndef HAVE_GETNAMEINFO +int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, + size_t hostlen, char *serv, size_t servlen, int flags) +{ + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct hostent *hp; + char tmpserv[16]; + + if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET) + return (EAI_FAMILY); + if (serv != NULL) { + snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin->sin_port)); + if (strlcpy(serv, tmpserv, servlen) >= servlen) + return (EAI_MEMORY); + } + + if (host != NULL) { + if (flags & NI_NUMERICHOST) { + if (strlcpy(host, inet_ntoa(sin->sin_addr), + hostlen) >= hostlen) + return (EAI_MEMORY); + else + return (0); + } else { + hp = gethostbyaddr((char *)&sin->sin_addr, + sizeof(struct in_addr), AF_INET); + if (hp == NULL) + return (EAI_NODATA); + + if (strlcpy(host, hp->h_name, hostlen) >= hostlen) + return (EAI_MEMORY); + else + return (0); + } + } + return (0); +} +#endif /* !HAVE_GETNAMEINFO */ + +#ifndef HAVE_GAI_STRERROR +char * +gai_strerror(int err) +{ + switch (err) { + case EAI_NODATA: + return ("no address associated with name"); + case EAI_MEMORY: + return ("memory allocation failure"); + case EAI_NONAME: + return ("nodename nor servname provided, or not known"); + case EAI_FAMILY: + return ("ai_family not supported"); + case EAI_AGAIN: + return ("temparary failure"); + case EAI_FAIL: + return ("unrecoverable failure"); + default: + return ("unknown/invalid error"); + } +} +#endif /* !HAVE_GAI_STRERROR */ + +#ifndef HAVE_GETADDRINFO +void +freeaddrinfo(struct addrinfo *ai) +{ + struct addrinfo *next; + + for(; ai != NULL;) { + next = ai->ai_next; + free(ai); + ai = next; + } +} + +static struct +addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints) +{ + struct addrinfo *ai; + + ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in)); + if (ai == NULL) + return (NULL); + + memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in)); + + ai->ai_addr = (struct sockaddr *)(ai + 1); + /* XXX -- ssh doesn't use sa_len */ + ai->ai_addrlen = sizeof(struct sockaddr_in); + ai->ai_addr->sa_family = ai->ai_family = AF_INET; + + ((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port; + ((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr; + + /* XXX: the following is not generally correct, but does what we want */ + if (hints->ai_socktype) + ai->ai_socktype = hints->ai_socktype; + else + ai->ai_socktype = SOCK_STREAM; + + if (hints->ai_protocol) + ai->ai_protocol = hints->ai_protocol; + + return (ai); +} + +int +getaddrinfo(const char *hostname, const char *servname, + const struct addrinfo *hints, struct addrinfo **res) +{ + struct hostent *hp; + struct servent *sp; + struct in_addr in; + int i; + long int port; + u_long addr; + + port = 0; + if (hints && hints->ai_family != AF_UNSPEC && + hints->ai_family != AF_INET) + return (EAI_FAMILY); + if (servname != NULL) { + char *cp; + + port = strtol(servname, &cp, 10); + if (port > 0 && port <= 65535 && *cp == '\0') + port = htons(port); + else if ((sp = getservbyname(servname, NULL)) != NULL) + port = sp->s_port; + else + port = 0; + } + + if (hints && hints->ai_flags & AI_PASSIVE) { + addr = htonl(0x00000000); + if (hostname && inet_aton(hostname, &in) != 0) + addr = in.s_addr; + *res = malloc_ai(port, addr, hints); + if (*res == NULL) + return (EAI_MEMORY); + return (0); + } + + if (!hostname) { + *res = malloc_ai(port, htonl(0x7f000001), hints); + if (*res == NULL) + return (EAI_MEMORY); + return (0); + } + + if (inet_aton(hostname, &in)) { + *res = malloc_ai(port, in.s_addr, hints); + if (*res == NULL) + return (EAI_MEMORY); + return (0); + } + + /* Don't try DNS if AI_NUMERICHOST is set */ + if (hints && hints->ai_flags & AI_NUMERICHOST) + return (EAI_NONAME); + + hp = gethostbyname(hostname); + if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { + struct addrinfo *cur, *prev; + + cur = prev = *res = NULL; + for (i = 0; hp->h_addr_list[i]; i++) { + struct in_addr *in = (struct in_addr *)hp->h_addr_list[i]; + + cur = malloc_ai(port, in->s_addr, hints); + if (cur == NULL) { + if (*res != NULL) + freeaddrinfo(*res); + return (EAI_MEMORY); + } + if (prev) + prev->ai_next = cur; + else + *res = cur; + + prev = cur; + } + return (0); + } + + return (EAI_NODATA); +} +#endif /* !HAVE_GETADDRINFO */ diff --git a/pkgtools/libnbcompat/files/md5c.c b/pkgtools/libnbcompat/files/md5c.c index b3b1ee93441..0a07dd06db8 100644 --- a/pkgtools/libnbcompat/files/md5c.c +++ b/pkgtools/libnbcompat/files/md5c.c @@ -1,4 +1,4 @@ -/* $NetBSD: md5c.c,v 1.6 2004/08/23 03:32:12 jlam Exp $ */ +/* $NetBSD: md5c.c,v 1.7 2008/10/06 12:36:20 joerg Exp $ */ /* * This file is derived from the RSA Data Security, Inc. MD5 Message-Digest @@ -62,8 +62,8 @@ #endif typedef unsigned char *POINTER; -typedef u_int16_t UINT2; -typedef u_int32_t UINT4; +typedef uint16_t UINT2; +typedef uint32_t UINT4; /* * Constants for MD5Transform routine. diff --git a/pkgtools/libnbcompat/files/mdXhl.c b/pkgtools/libnbcompat/files/mdXhl.c index 2fece0841e6..cd2222fc2c8 100644 --- a/pkgtools/libnbcompat/files/mdXhl.c +++ b/pkgtools/libnbcompat/files/mdXhl.c @@ -1,4 +1,4 @@ -/* $NetBSD: mdXhl.c,v 1.1 2004/08/23 03:32:12 jlam Exp $ */ +/* $NetBSD: mdXhl.c,v 1.2 2008/10/06 12:36:20 joerg Exp $ */ /* * ---------------------------------------------------------------------------- @@ -51,7 +51,7 @@ MDNAME(End)(ctx, buf) MDNAME(Final)(digest, ctx); for (i = 0; i < 16; i++) { - buf[i+i] = hex[(u_int32_t)digest[i] >> 4]; + buf[i+i] = hex[(uint32_t)digest[i] >> 4]; buf[i+i+1] = hex[digest[i] & 0x0f]; } diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h index 41be3a5958a..60f07050b6b 100644 --- a/pkgtools/libnbcompat/files/nbcompat.h +++ b/pkgtools/libnbcompat/files/nbcompat.h @@ -1,4 +1,4 @@ -/* $NetBSD: nbcompat.h,v 1.40 2008/05/19 12:52:57 joerg Exp $ */ +/* $NetBSD: nbcompat.h,v 1.41 2008/10/06 12:36:20 joerg Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -27,7 +27,6 @@ */ #include <nbcompat/nbconfig.h> -#include <nbcompat/nbtypes.h> #include <nbcompat/cdefs.h> #include <nbcompat/limits.h> diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in index 6717d647e43..6ef7445cb58 100644 --- a/pkgtools/libnbcompat/files/nbcompat/config.h.in +++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in @@ -97,12 +97,21 @@ /* Define to 1 if you have the <fts.h> header file. */ #undef HAVE_FTS_H +/* Define to 1 if you have the `gai_strerror' function. */ +#undef HAVE_GAI_STRERROR + +/* Define to 1 if you have the `getaddrinfo' function. */ +#undef HAVE_GETADDRINFO + /* Define to 1 if you have the `getenv' function. */ #undef HAVE_GETENV /* Define to 1 if you have the `getmode' function. */ #undef HAVE_GETMODE +/* Define to 1 if you have the `getnameinfo' function. */ +#undef HAVE_GETNAMEINFO + /* Define to 1 if you have the <getopt.h> header file. */ #undef HAVE_GETOPT_H @@ -124,18 +133,6 @@ /* Define to 1 if you have the <grp.h> header file. */ #undef HAVE_GRP_H -/* Define to 1 if the system has the type `int16_t'. */ -#undef HAVE_INT16_T - -/* Define to 1 if the system has the type `int32_t'. */ -#undef HAVE_INT32_T - -/* Define to 1 if the system has the type `int64_t'. */ -#undef HAVE_INT64_T - -/* Define to 1 if the system has the type `int8_t'. */ -#undef HAVE_INT8_T - /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H @@ -236,6 +233,9 @@ /* Define to 1 if you have the <ndir.h> header file. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the <netdb.h> header file. */ +#undef HAVE_NETDB_H + /* Define to 1 if you have the <netinet/in6_machtypes.h> header file. */ #undef HAVE_NETINET_IN6_MACHTYPES_H @@ -291,12 +291,18 @@ /* Define to 1 if you have the <sha2.h> header file. */ #undef HAVE_SHA2_H +/* Define to 1 if you have the `shquote' function. */ +#undef HAVE_SHQUOTE + /* Define to 1 if you have the <signal.h> header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF +/* Define to 1 if the system has the type `socklen_t'. */ +#undef HAVE_SOCKLEN_T + /* Define to 1 if you have the `statvfs' function. */ #undef HAVE_STATVFS @@ -348,9 +354,21 @@ /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL +/* Define to 1 if the system has the type `struct addrinfo'. */ +#undef HAVE_STRUCT_ADDRINFO + /* Define to 1 if `d_namlen' is member of `struct dirent'. */ #undef HAVE_STRUCT_DIRENT_D_NAMLEN +/* Define to 1 if the system has the type `struct in6_addr'. */ +#undef HAVE_STRUCT_IN6_ADDR + +/* Define to 1 if the system has the type `struct sockaddr_in6'. */ +#undef HAVE_STRUCT_SOCKADDR_IN6 + +/* Define to 1 if the system has the type `struct sockaddr_storage'. */ +#undef HAVE_STRUCT_SOCKADDR_STORAGE + /* Define to 1 if `f_flags' is member of `struct statfs'. */ #undef HAVE_STRUCT_STATFS_F_FLAGS @@ -405,6 +423,9 @@ /* Define to 1 if you have the <sys/queue.h> header file. */ #undef HAVE_SYS_QUEUE_H +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + /* Define to 1 if you have the <sys/statfs.h> header file. */ #undef HAVE_SYS_STATFS_H @@ -441,18 +462,6 @@ /* Define to 1 if you have the `uid_from_user' function. */ #undef HAVE_UID_FROM_USER -/* Define to 1 if the system has the type `uint16_t'. */ -#undef HAVE_UINT16_T - -/* Define to 1 if the system has the type `uint32_t'. */ -#undef HAVE_UINT32_T - -/* Define to 1 if the system has the type `uint64_t'. */ -#undef HAVE_UINT64_T - -/* Define to 1 if the system has the type `uint8_t'. */ -#undef HAVE_UINT8_T - /* Define to 1 if the system has the type `uintptr_t'. */ #undef HAVE_UINTPTR_T @@ -480,18 +489,6 @@ /* Define to 1 if you have the <utime.h> header file. */ #undef HAVE_UTIME_H -/* Define to 1 if the system has the type `u_int16_t'. */ -#undef HAVE_U_INT16_T - -/* Define to 1 if the system has the type `u_int32_t'. */ -#undef HAVE_U_INT32_T - -/* Define to 1 if the system has the type `u_int64_t'. */ -#undef HAVE_U_INT64_T - -/* Define to 1 if the system has the type `u_int8_t'. */ -#undef HAVE_U_INT8_T - /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK @@ -557,6 +554,37 @@ # undef WORDS_BIGENDIAN #endif +/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef int16_t + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +#undef int8_t + /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc @@ -566,6 +594,22 @@ /* Define to `unsigned int' if <sys/types.h> does not define. */ #undef size_t +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t + /* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t diff --git a/pkgtools/libnbcompat/files/nbcompat/fts.h b/pkgtools/libnbcompat/files/nbcompat/fts.h index 21449aacb9f..6294bb84481 100644 --- a/pkgtools/libnbcompat/files/nbcompat/fts.h +++ b/pkgtools/libnbcompat/files/nbcompat/fts.h @@ -1,4 +1,4 @@ -/* $NetBSD: fts.h,v 1.5 2007/07/31 13:17:34 joerg Exp $ */ +/* $NetBSD: fts.h,v 1.6 2008/10/06 12:36:20 joerg Exp $ */ /* * Copyright (c) 1989, 1993 @@ -77,7 +77,7 @@ typedef struct _ftsent { ino_t fts_ino; /* inode */ dev_t fts_dev; /* device */ #ifdef __LIBC12_SOURCE__ - u_int16_t fts_nlink; /* link count */ + uint16_t fts_nlink; /* link count */ #else nlink_t fts_nlink; /* link count */ #endif diff --git a/pkgtools/libnbcompat/files/nbcompat/md5.h b/pkgtools/libnbcompat/files/nbcompat/md5.h index 25721cda8ce..d0565aaf78a 100644 --- a/pkgtools/libnbcompat/files/nbcompat/md5.h +++ b/pkgtools/libnbcompat/files/nbcompat/md5.h @@ -1,4 +1,4 @@ -/* $NetBSD: md5.h,v 1.3 2008/02/12 13:43:24 joerg Exp $ */ +/* $NetBSD: md5.h,v 1.4 2008/10/06 12:36:20 joerg Exp $ */ /* * This file is derived from the RSA Data Security, Inc. MD5 Message-Digest @@ -37,18 +37,18 @@ /* MD5 context. */ typedef struct MD5Context { - u_int32_t state[4]; /* state (ABCD) */ - u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + uint32_t state[4]; /* state (ABCD) */ + uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD5_CTX; __BEGIN_DECLS -void MD5Init __P((MD5_CTX *)); -void MD5Update __P((MD5_CTX *, const unsigned char *, unsigned int)); -void MD5Final __P((unsigned char[16], MD5_CTX *)); -char *MD5End __P((MD5_CTX *, char *)); -char *MD5File __P((const char *, char *)); -char *MD5Data __P((const unsigned char *, unsigned int, char *)); +void MD5Init(MD5_CTX *); +void MD5Update(MD5_CTX *, const unsigned char *, unsigned int); +void MD5Final(unsigned char[16], MD5_CTX *); +char *MD5End(MD5_CTX *, char *); +char *MD5File(const char *, char *); +char *MD5Data(const unsigned char *, unsigned int, char *); __END_DECLS #endif /* !_NBCOMPAT_SYS_MD5_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/netdb.h b/pkgtools/libnbcompat/files/nbcompat/netdb.h new file mode 100644 index 00000000000..8d826816e81 --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/netdb.h @@ -0,0 +1,187 @@ +/* $Id: netdb.h,v 1.1 2008/10/06 12:36:20 joerg Exp $ */ + +/* + * Copyright (C) 2000-2003 Damien Miller. All rights reserved. + * Copyright (C) 1999 WIDE Project. 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. Neither the name of the project 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 PROJECT 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 PROJECT 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. + */ + +/* + * Pseudo-implementation of RFC2553 name / address resolution functions + * + * But these functions are not implemented correctly. The minimum subset + * is implemented for ssh use only. For example, this routine assumes + * that ai_family is AF_INET. Don't use it for another purpose. + */ + +#ifndef _NBCOMPAT_NETDB_H +#define _NBCOMPAT_NETDB_H + +#include <sys/types.h> +#if defined(HAVE_NETDB_H) +# include <netdb.h> +#endif +#if defined(HAVE_SYS_SOCKET_H) +# include <sys/socket.h> +#endif + +/* + * First, socket and INET6 related definitions + */ +#ifndef HAVE_STRUCT_SOCKADDR_STORAGE +# define _SS_MAXSIZE 128 /* Implementation specific max size */ +# define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr)) +struct sockaddr_storage { + struct sockaddr ss_sa; + char __ss_pad2[_SS_PADSIZE]; +}; +# define ss_family ss_sa.sa_family +#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ + +#ifndef IN6_IS_ADDR_LOOPBACK +# define IN6_IS_ADDR_LOOPBACK(a) \ + (((uint32_t *)(a))[0] == 0 && ((uint32_t *)(a))[1] == 0 && \ + ((uint32_t *)(a))[2] == 0 && ((uint32_t *)(a))[3] == htonl(1)) +#endif /* !IN6_IS_ADDR_LOOPBACK */ + +#ifndef IN6_IS_ADDR_V4MAPPED +#define IN6_IS_ADDR_V4MAPPED(a) \ + (((uint32_t *)(a))[0] == 0 && ((uint32_t *)(a))[1] == 0 && \ + ((uint32_t *)(a))[2] == ntohl(0x0000ffff)) +#endif + +#ifndef INET6_ADDRSTRLEN +#define INET6_ADDRSTRLEN 46 +#endif + +#ifndef HAVE_SOCKLEN_T +typedef unsigned int socklen_t; +#endif + +#ifndef HAVE_STRUCT_IN6_ADDR +struct in6_addr { + uint8_t s6_addr[16]; +}; +#endif /* !HAVE_STRUCT_IN6_ADDR */ + +#ifndef HAVE_STRUCT_SOCKADDR_IN6 +struct sockaddr_in6 { + unsigned short sin6_family; + uint16_t sin6_port; + uint32_t sin6_flowinfo; + struct in6_addr sin6_addr; + uint32_t sin6_scope_id; +}; +#endif /* !HAVE_STRUCT_SOCKADDR_IN6 */ + +#ifndef AF_INET6 +/* Define it to something that should never appear */ +#define AF_INET6 AF_MAX +#endif + +/* + * Next, RFC2553 name / address resolution API + */ + +#ifndef NI_NUMERICHOST +# define NI_NUMERICHOST (1) +#endif +#ifndef NI_NAMEREQD +# define NI_NAMEREQD (1<<1) +#endif +#ifndef NI_NUMERICSERV +# define NI_NUMERICSERV (1<<2) +#endif + +#ifndef AI_PASSIVE +# define AI_PASSIVE (1) +#endif +#ifndef AI_CANONNAME +# define AI_CANONNAME (1<<1) +#endif +#ifndef AI_NUMERICHOST +# define AI_NUMERICHOST (1<<2) +#endif + +#ifndef NI_MAXSERV +# define NI_MAXSERV 32 +#endif /* !NI_MAXSERV */ +#ifndef NI_MAXHOST +# define NI_MAXHOST 1025 +#endif /* !NI_MAXHOST */ + +#ifndef EAI_NODATA +# define EAI_NODATA (INT_MAX - 1) +#endif +#ifndef EAI_MEMORY +# define EAI_MEMORY (INT_MAX - 2) +#endif +#ifndef EAI_NONAME +# define EAI_NONAME (INT_MAX - 3) +#endif +#ifndef EAI_SYSTEM +# define EAI_SYSTEM (INT_MAX - 4) +#endif +#ifndef EAI_FAMILY +# define EAI_FAMILY (INT_MAX - 5) +#endif +#ifndef EAI_AGAIN +# define EAI_AGAIN (INT_MAX - 6) +#endif +#ifndef EAI_FAIL +# define EAI_FAIL (INT_MAX - 7) +#endif + +#ifndef HAVE_STRUCT_ADDRINFO +struct addrinfo { + int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ + int ai_family; /* PF_xxx */ + int ai_socktype; /* SOCK_xxx */ + int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ + size_t ai_addrlen; /* length of ai_addr */ + char *ai_canonname; /* canonical name for hostname */ + struct sockaddr *ai_addr; /* binary address */ + struct addrinfo *ai_next; /* next structure in linked list */ +}; +#endif /* !HAVE_STRUCT_ADDRINFO */ + +#ifndef HAVE_GETADDRINFO +void freeaddrinfo(struct addrinfo *); +int getaddrinfo(const char *, const char *, + const struct addrinfo *, struct addrinfo **); +#endif /* !HAVE_GETADDRINFO */ + +#if !defined(HAVE_GAI_STRERROR) +char *gai_strerror(int); +#endif /* !HAVE_GAI_STRERROR */ + +#ifndef HAVE_GETNAMEINFO +int getnameinfo(const struct sockaddr *, size_t, char *, size_t, + char *, size_t, int); +#endif /* !HAVE_GETNAMEINFO */ + +#endif /* !_FAKE_RFC2553_H */ + diff --git a/pkgtools/libnbcompat/files/nbcompat/rmd160.h b/pkgtools/libnbcompat/files/nbcompat/rmd160.h index 5c3e9fe3472..7f37272231e 100644 --- a/pkgtools/libnbcompat/files/nbcompat/rmd160.h +++ b/pkgtools/libnbcompat/files/nbcompat/rmd160.h @@ -1,4 +1,4 @@ -/* $NetBSD: rmd160.h,v 1.4 2008/02/12 13:43:24 joerg Exp $ */ +/* $NetBSD: rmd160.h,v 1.5 2008/10/06 12:36:20 joerg Exp $ */ /********************************************************************\ * @@ -28,16 +28,16 @@ #define RMD160_DIGEST_STRING_LENGTH 41 typedef struct { - u_int32_t state[5]; /* state (ABCDE) */ - u_int32_t length[2]; /* number of bits */ + uint32_t state[5]; /* state (ABCDE) */ + uint32_t length[2]; /* number of bits */ unsigned char bbuffer[64]; /* overflow buffer */ - u_int32_t buflen; /* number of chars in bbuffer */ + uint32_t buflen; /* number of chars in bbuffer */ } RMD160_CTX; __BEGIN_DECLS void RMD160Init(RMD160_CTX *); -void RMD160Transform(u_int32_t[5], const u_int32_t[16]); -void RMD160Update(RMD160_CTX *, const unsigned char *, u_int32_t); +void RMD160Transform(uint32_t[5], const uint32_t[16]); +void RMD160Update(RMD160_CTX *, const unsigned char *, uint32_t); void RMD160Final(unsigned char[20], RMD160_CTX *); char *RMD160End(RMD160_CTX *, char *); char *RMD160File(char *, char *); diff --git a/pkgtools/libnbcompat/files/nbcompat/sha1.h b/pkgtools/libnbcompat/files/nbcompat/sha1.h index e4e926731bf..ae2a19d534c 100644 --- a/pkgtools/libnbcompat/files/nbcompat/sha1.h +++ b/pkgtools/libnbcompat/files/nbcompat/sha1.h @@ -1,4 +1,4 @@ -/* $NetBSD: sha1.h,v 1.4 2008/02/12 13:43:24 joerg Exp $ */ +/* $NetBSD: sha1.h,v 1.5 2008/10/06 12:36:20 joerg Exp $ */ /* * SHA-1 in C @@ -13,19 +13,19 @@ #define SHA1_DIGEST_STRING_LENGTH 41 typedef struct { - u_int32_t state[5]; - u_int32_t count[2]; + uint32_t state[5]; + uint32_t count[2]; unsigned char buffer[64]; } SHA1_CTX; __BEGIN_DECLS -void SHA1Transform __P((u_int32_t state[5], const unsigned char buffer[64])); -void SHA1Init __P((SHA1_CTX *context)); -void SHA1Update __P((SHA1_CTX *context, const unsigned char *data, unsigned int len)); -void SHA1Final __P((unsigned char digest[20], SHA1_CTX *context)); -char *SHA1End __P((SHA1_CTX *, char *)); -char *SHA1File __P((char *, char *)); -char *SHA1Data __P((const unsigned char *, size_t, char *)); +void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); +void SHA1Init(SHA1_CTX *context); +void SHA1Update(SHA1_CTX *context, const unsigned char *data, unsigned int len); +void SHA1Final(unsigned char digest[20], SHA1_CTX *context); +char *SHA1End(SHA1_CTX *, char *); +char *SHA1File(char *, char *); +char *SHA1Data(const unsigned char *, size_t, char *); __END_DECLS #endif /* _NBCOMPAT_SYS_SHA1_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/sha2.h b/pkgtools/libnbcompat/files/nbcompat/sha2.h index e675858237c..a52c7e626c4 100644 --- a/pkgtools/libnbcompat/files/nbcompat/sha2.h +++ b/pkgtools/libnbcompat/files/nbcompat/sha2.h @@ -95,24 +95,24 @@ char *SHA512_File(char *, char *); #else /* SHA2_USE_INTTYPES_H */ void SHA256_Init(SHA256_CTX *); -void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t); -void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); +void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t); +void SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); char* SHA256_End(SHA256_CTX*, unsigned char *); -char* SHA256_Data(const u_int8_t*, size_t, unsigned char *); +char* SHA256_Data(const uint8_t*, size_t, unsigned char *); char *SHA256_File(char *, char *); void SHA384_Init(SHA384_CTX*); -void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t); -void SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); +void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t); +void SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); -char* SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); +char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); char *SHA384_File(char *, char *); void SHA512_Init(SHA512_CTX*); -void SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t); -void SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); +void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t); +void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); -char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); +char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); char *SHA512_File(char *, char *); #endif /* SHA2_USE_INTTYPES_H */ diff --git a/pkgtools/libnbcompat/files/nbcompat/stdlib.h b/pkgtools/libnbcompat/files/nbcompat/stdlib.h index db280a76910..e0e82782323 100644 --- a/pkgtools/libnbcompat/files/nbcompat/stdlib.h +++ b/pkgtools/libnbcompat/files/nbcompat/stdlib.h @@ -1,4 +1,4 @@ -/* $NetBSD: stdlib.h,v 1.3 2008/04/29 05:46:08 martin Exp $ */ +/* $NetBSD: stdlib.h,v 1.4 2008/10/06 12:36:20 joerg Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -65,4 +65,8 @@ long long strtoll(const char *, char **, int); # define NO_LONG_LONG 1 #endif /* ! HAVE_WORKING_LONG_LONG */ +#if !HAVE_SHQUOTE +size_t shquote(const char *, char *, size_t); +#endif + #endif /* !_NBCOMPAT_STDLIB_H_ */ diff --git a/pkgtools/libnbcompat/files/private/regex2.h b/pkgtools/libnbcompat/files/private/regex2.h index 9404bc24e7d..9f6767c16ad 100644 --- a/pkgtools/libnbcompat/files/private/regex2.h +++ b/pkgtools/libnbcompat/files/private/regex2.h @@ -1,4 +1,4 @@ -/* $NetBSD: regex2.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ +/* $NetBSD: regex2.h,v 1.2 2008/10/06 12:36:20 joerg Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -109,16 +109,16 @@ * In state representations, an operator's bit is on to signify a state * immediately *preceding* "execution" of that operator. */ -typedef u_int32_t sop; /* strip operator */ +typedef uint32_t sop; /* strip operator */ typedef int sopno; -#define OPRMASK ((u_int32_t)0xf8000000UL) -#define OPDMASK ((u_int32_t)0x07ffffffUL) -#define OPSHIFT ((unsigned)27) +#define OPRMASK ((uint32_t)0xf8000000UL) +#define OPDMASK ((uint32_t)0x07ffffffUL) +#define OPSHIFT ((unsigned int)27) #define OP(n) ((n)&OPRMASK) #define OPND(n) ((int)((n)&OPDMASK)) #define SOP(op, opnd) ((op)|(opnd)) -#define OPC(n) (((u_int32_t)(n))<<OPSHIFT) +#define OPC(n) (((uint32_t)(n))<<OPSHIFT) /* operators meaning operand */ /* (back, fwd are offsets) */ #define OEND OPC(1) /* endmarker - */ diff --git a/pkgtools/libnbcompat/files/rmd160.c b/pkgtools/libnbcompat/files/rmd160.c index 86ad4cce884..e98aa1590bb 100644 --- a/pkgtools/libnbcompat/files/rmd160.c +++ b/pkgtools/libnbcompat/files/rmd160.c @@ -1,4 +1,4 @@ -/* $NetBSD: rmd160.c,v 1.7 2007/07/31 13:17:33 joerg Exp $ */ +/* $NetBSD: rmd160.c,v 1.8 2008/10/06 12:36:20 joerg Exp $ */ /********************************************************************\ * @@ -25,7 +25,7 @@ #include <nbcompat.h> #include <nbcompat/cdefs.h> #ifndef lint -__RCSID("$NetBSD: rmd160.c,v 1.7 2007/07/31 13:17:33 joerg Exp $"); +__RCSID("$NetBSD: rmd160.c,v 1.8 2008/10/06 12:36:20 joerg Exp $"); #endif /* not lint */ /* header files */ @@ -69,10 +69,10 @@ __weak_alias(RMD160Final,_RMD160Final) /* collect four bytes into one word: */ #define BYTES_TO_DWORD(strptr) \ - (((u_int32_t) *((strptr)+3) << 24) | \ - ((u_int32_t) *((strptr)+2) << 16) | \ - ((u_int32_t) *((strptr)+1) << 8) | \ - ((u_int32_t) *(strptr))) + (((uint32_t) *((strptr)+3) << 24) | \ + ((uint32_t) *((strptr)+2) << 16) | \ + ((uint32_t) *((strptr)+1) << 8) | \ + ((uint32_t) *(strptr))) /* ROL(x, n) cyclically rotates x over n bits to the left */ /* x must be of an unsigned 32 bits type and 0 <= n < 32. */ @@ -158,10 +158,10 @@ RMD160Init(RMD160_CTX *context) /********************************************************************/ void -RMD160Transform(u_int32_t state[5], const u_int32_t block[16]) +RMD160Transform(uint32_t state[5], const uint32_t block[16]) { - u_int32_t aa, bb, cc, dd, ee; - u_int32_t aaa, bbb, ccc, ddd, eee; + uint32_t aa, bb, cc, dd, ee; + uint32_t aaa, bbb, ccc, ddd, eee; _DIAGASSERT(state != NULL); _DIAGASSERT(block != NULL); @@ -364,13 +364,13 @@ RMD160Transform(u_int32_t state[5], const u_int32_t block[16]) /********************************************************************/ void -RMD160Update(RMD160_CTX *context, const unsigned char *data, u_int32_t nbytes) +RMD160Update(RMD160_CTX *context, const unsigned char *data, uint32_t nbytes) { - u_int32_t X[16]; - u_int32_t ofs = 0; - u_int32_t i; + uint32_t X[16]; + uint32_t ofs = 0; + uint32_t i; #if BYTE_ORDER != LITTLE_ENDIAN - u_int32_t j; + uint32_t j; #endif _DIAGASSERT(context != NULL); @@ -426,10 +426,10 @@ RMD160Update(RMD160_CTX *context, const unsigned char *data, u_int32_t nbytes) void RMD160Final(unsigned char digest[20], RMD160_CTX *context) { - u_int32_t i; - u_int32_t X[16]; + uint32_t i; + uint32_t X[16]; #if BYTE_ORDER != LITTLE_ENDIAN - u_int32_t j; + uint32_t j; #endif _DIAGASSERT(digest != NULL); diff --git a/pkgtools/libnbcompat/files/rmd160hl.c b/pkgtools/libnbcompat/files/rmd160hl.c index a2841eaa158..cfda34866e4 100644 --- a/pkgtools/libnbcompat/files/rmd160hl.c +++ b/pkgtools/libnbcompat/files/rmd160hl.c @@ -1,4 +1,4 @@ -/* $NetBSD: rmd160hl.c,v 1.7 2007/07/31 13:17:33 joerg Exp $ */ +/* $NetBSD: rmd160hl.c,v 1.8 2008/10/06 12:36:20 joerg Exp $ */ /* rmd160hl.c * ---------------------------------------------------------------------------- @@ -18,7 +18,7 @@ #include <nbcompat.h> #include <nbcompat/cdefs.h> #ifndef lint -__RCSID("$NetBSD: rmd160hl.c,v 1.7 2007/07/31 13:17:33 joerg Exp $"); +__RCSID("$NetBSD: rmd160hl.c,v 1.8 2008/10/06 12:36:20 joerg Exp $"); #endif /* not lint */ #include <nbcompat/types.h> @@ -65,7 +65,7 @@ RMD160End(RMD160_CTX *ctx, char *buf) RMD160Final(digest,ctx); for (i = 0; i < 20; i++) { - p[i + i] = hex[(u_int32_t)digest[i] >> 4]; + p[i + i] = hex[(uint32_t)digest[i] >> 4]; p[i + i + 1] = hex[digest[i] & 0x0f]; } p[i + i] = '\0'; diff --git a/pkgtools/libnbcompat/files/sha1.c b/pkgtools/libnbcompat/files/sha1.c index 4698a827d78..e47ebc9b0cc 100644 --- a/pkgtools/libnbcompat/files/sha1.c +++ b/pkgtools/libnbcompat/files/sha1.c @@ -1,4 +1,4 @@ -/* $NetBSD: sha1.c,v 1.7 2007/07/31 13:17:33 joerg Exp $ */ +/* $NetBSD: sha1.c,v 1.8 2008/10/06 12:36:20 joerg Exp $ */ /* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */ /* @@ -93,10 +93,10 @@ typedef union { #endif #ifdef SPARC64_GCC_WORKAROUND -void do_R01(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *); -void do_R2(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *); -void do_R3(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *); -void do_R4(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *); +void do_R01(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *); +void do_R2(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *); +void do_R3(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *); +void do_R4(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *); #define nR0(v,w,x,y,z,i) R0(*v,*w,*x,*y,*z,i) #define nR1(v,w,x,y,z,i) R1(*v,*w,*x,*y,*z,i) @@ -105,7 +105,7 @@ void do_R4(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, #define nR4(v,w,x,y,z,i) R4(*v,*w,*x,*y,*z,i) void -do_R01(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *block) +do_R01(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *block) { nR0(a,b,c,d,e, 0); nR0(e,a,b,c,d, 1); nR0(d,e,a,b,c, 2); nR0(c,d,e,a,b, 3); nR0(b,c,d,e,a, 4); nR0(a,b,c,d,e, 5); nR0(e,a,b,c,d, 6); nR0(d,e,a,b,c, 7); @@ -115,7 +115,7 @@ do_R01(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHA } void -do_R2(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *block) +do_R2(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *block) { nR2(a,b,c,d,e,20); nR2(e,a,b,c,d,21); nR2(d,e,a,b,c,22); nR2(c,d,e,a,b,23); nR2(b,c,d,e,a,24); nR2(a,b,c,d,e,25); nR2(e,a,b,c,d,26); nR2(d,e,a,b,c,27); @@ -125,7 +125,7 @@ do_R2(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR } void -do_R3(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *block) +do_R3(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *block) { nR3(a,b,c,d,e,40); nR3(e,a,b,c,d,41); nR3(d,e,a,b,c,42); nR3(c,d,e,a,b,43); nR3(b,c,d,e,a,44); nR3(a,b,c,d,e,45); nR3(e,a,b,c,d,46); nR3(d,e,a,b,c,47); @@ -135,7 +135,7 @@ do_R3(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR } void -do_R4(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR64LONG16 *block) +do_R4(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, CHAR64LONG16 *block) { nR4(a,b,c,d,e,60); nR4(e,a,b,c,d,61); nR4(d,e,a,b,c,62); nR4(c,d,e,a,b,63); nR4(b,c,d,e,a,64); nR4(a,b,c,d,e,65); nR4(e,a,b,c,d,66); nR4(d,e,a,b,c,67); @@ -149,10 +149,10 @@ do_R4(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d, u_int32_t *e, CHAR * Hash a single 512-bit block. This is the core of the algorithm. */ void SHA1Transform(state, buffer) - u_int32_t state[5]; + uint32_t state[5]; const unsigned char buffer[64]; { - u_int32_t a, b, c, d, e; + uint32_t a, b, c, d, e; CHAR64LONG16 *block; #ifdef SHA1HANDSOFF diff --git a/pkgtools/libnbcompat/files/sha1hl.c b/pkgtools/libnbcompat/files/sha1hl.c index f8fc2533766..e65417dd2a2 100644 --- a/pkgtools/libnbcompat/files/sha1hl.c +++ b/pkgtools/libnbcompat/files/sha1hl.c @@ -1,4 +1,4 @@ -/* $NetBSD: sha1hl.c,v 1.7 2007/07/31 13:17:33 joerg Exp $ */ +/* $NetBSD: sha1hl.c,v 1.8 2008/10/06 12:36:20 joerg Exp $ */ /* sha1hl.c * ---------------------------------------------------------------------------- @@ -42,7 +42,7 @@ #if !HAVE_SHA1_H #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: sha1hl.c,v 1.7 2007/07/31 13:17:33 joerg Exp $"); +__RCSID("$NetBSD: sha1hl.c,v 1.8 2008/10/06 12:36:20 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ #if 0 @@ -72,7 +72,7 @@ SHA1End(ctx, buf) SHA1Final(digest,ctx); for (i = 0; i < 20; i++) { - p[i + i] = hex[((u_int32_t)digest[i]) >> 4]; + p[i + i] = hex[((uint32_t)digest[i]) >> 4]; p[i + i + 1] = hex[digest[i] & 0x0f]; } p[i + i] = '\0'; diff --git a/pkgtools/libnbcompat/files/shquote.c b/pkgtools/libnbcompat/files/shquote.c new file mode 100644 index 00000000000..28f07ae4092 --- /dev/null +++ b/pkgtools/libnbcompat/files/shquote.c @@ -0,0 +1,181 @@ +/* $NetBSD: shquote.c,v 1.1 2008/10/06 12:36:20 joerg Exp $ */ + +/* + * Copyright (c) 2001 Christopher G. Demetriou + * 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 for the + * NetBSD Project. See http://www.NetBSD.org/ for + * information about NetBSD. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. + * + * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> + */ + +#include <nbcompat.h> + +/* + * Define SHQUOTE_USE_MULTIBYTE if you want shquote() to handle multibyte + * characters using mbrtowc(). + * + * Please DO NOT rip this #ifdef out of the code. It's also here to help + * portability. + */ +#undef SHQUOTE_USE_MULTIBYTE + +#include <nbcompat/stdlib.h> +#include <string.h> +#ifdef SHQUOTE_USE_MULTIBYTE +#include <limits.h> +#include <stdio.h> +#include <wchar.h> +#endif + +/* + * shquote(): + * + * Requotes arguments so that they'll be interpreted properly by the + * shell (/bin/sh). + * + * Wraps single quotes around the string, and replaces single quotes + * in the string with the sequence: + * '\'' + * + * Returns the number of characters required to hold the resulting quoted + * argument. + * + * The buffer supplied is filled in and NUL-terminated. If 'bufsize' + * indicates that the buffer is too short to hold the output string, the + * first (bufsize - 1) bytes of quoted argument are filled in and the + * buffer is NUL-terminated. + * + * Changes could be made to optimize the length of strings output by this + * function: + * + * * if there are no metacharacters or whitespace in the input, + * the output could be the input string. + */ + +#ifdef SHQUOTE_USE_MULTIBYTE + +#define XLATE_OUTCH(x) wcrtomb(outch, (x), &mbso) +#define XLATE_INCH() \ + do { \ + n = mbrtowc(&c, arg, MB_CUR_MAX, &mbsi); \ + } while (/*LINTED const cond*/0) + +#else + +#define XLATE_OUTCH(x) (outch[0] = (x), 1) +#define XLATE_INCH() \ + do { \ + n = ((c = *arg) != '\0') ? 1 : 0; \ + } while (/*LINTED const cond*/0) + +#endif + +#define PUT(x) \ + do { \ + outchlen = XLATE_OUTCH(x); \ + if (outchlen == (size_t)-1) \ + goto bad; \ + rv += outchlen; \ + if (bufsize != 0) { \ + if (bufsize < outchlen || \ + (bufsize == outchlen && \ + outch[outchlen - 1] != '\0')) { \ + *buf = '\0'; \ + bufsize = 0; \ + } else { \ + memcpy(buf, outch, outchlen); \ + buf += outchlen; \ + bufsize -= outchlen; \ + } \ + } \ + } while (/*LINTED const cond*/0) + +size_t +shquote(const char *arg, char *buf, size_t bufsize) +{ +#ifdef SHQUOTE_USE_MULTIBYTE + char outch[MB_LEN_MAX]; + mbstate_t mbsi, mbso; + wchar_t c, lastc; + size_t outchlen; +#else + char outch[1]; + char c, lastc; + size_t outchlen; +#endif + size_t rv; + int n; + + rv = 0; + lastc = 0; +#ifdef SHQUOTE_USE_MULTIBYTE + memset(&mbsi, 0, sizeof mbsi); + memset(&mbso, 0, sizeof mbso); +#endif + + if (*arg != '\'') + PUT('\''); + for (;;) { + XLATE_INCH(); + if (n <= 0) + break; + arg += n; + lastc = c; + + if (c == '\'') { + if (rv != 0) + PUT('\''); + PUT('\\'); + PUT('\''); + for (;;) { + XLATE_INCH(); + if (n <= 0 || c != '\'') + break; + PUT('\\'); + PUT('\''); + arg += n; + } + if (n > 0) + PUT('\''); + } else + PUT(c); + } + if (lastc != '\'') + PUT('\''); + + /* Put multibyte or NUL terminator, but don't count the NUL. */ + PUT('\0'); + rv--; + + return rv; + +bad: + /* A multibyte character encoding or decoding error occurred. */ + return (size_t)-1; +} diff --git a/pkgtools/libnbcompat/files/vis.c b/pkgtools/libnbcompat/files/vis.c index bc31f3652ce..7040739b8d5 100644 --- a/pkgtools/libnbcompat/files/vis.c +++ b/pkgtools/libnbcompat/files/vis.c @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.10 2007/07/31 13:17:34 joerg Exp $ */ +/* $NetBSD: vis.c,v 1.11 2008/10/06 12:36:20 joerg Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -68,7 +68,7 @@ #include <nbcompat.h> #include <nbcompat/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.10 2007/07/31 13:17:34 joerg Exp $"); +__RCSID("$NetBSD: vis.c,v 1.11 2008/10/06 12:36:20 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ #if 0 @@ -200,8 +200,8 @@ do { \ } \ if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { \ *dst++ = '\\'; \ - *dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 6) & 03) + '0'; \ - *dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 3) & 07) + '0'; \ + *dst++ = (unsigned char)(((uint32_t)(unsigned char)c >> 6) & 03) + '0'; \ + *dst++ = (unsigned char)(((uint32_t)(unsigned char)c >> 3) & 07) + '0'; \ *dst++ = (c & 07) + '0'; \ } else { \ if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\'; \ |