NetBSD-Bugs archive

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

Re: toolchain/41435 (build.sh tools from netbsd-4 fails on cygwin-1.7.0)



The following reply was made to PR toolchain/41435; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: netbsd-bugs%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost, 
tsutsui%NetBSD.org@localhost,
        jmcneill%invisible.ca@localhost
Subject: Re: toolchain/41435 (build.sh tools from netbsd-4 fails on 
cygwin-1.7.0)
Date: Fri, 22 Jan 2010 02:38:00 +0900

 > Synopsis: build.sh tools from netbsd-4 fails on cygwin-1.7.0
  :
 > Needs more workaround for struct winsize in getarg.c and get_window_size.c.
 
 Here is a revised patch:
 
 - prepare src/tools/asn1_compile/roken.h based on
   src/crypto/dist/heimdal/lib/roken/roken.h.in
   and use it to build src/tools/asn1_compile and src/tools/compile_et
   (it has #includes for roken-common.h and decls for get_windows_size.c)
 - add checks for system headers used in the new
   src/tools/asn1_compile/roken.h into src/tools/compat/configure.ac
 - add a check for HAVE_STRUCT_WINSIZE to src/tools/compat/configure.ac
   taken from src/crypto/dist/heimdal/cf/krb-struct-winsize.m4
 
 Tested on NetBSD/i386 5.99.22 and Cygwin 1.7.1.
 
 Note this patch doesn't include generated files so regenerate
 src/tools/compat/configure and src/tools/compat/nbtool_config.h.in
 per description in src/tools/compat/configure.ac after applying patch.
 
 
 Index: tools/asn1_compile/Makefile
 ===================================================================
 RCS file: /cvsroot/src/tools/asn1_compile/Makefile,v
 retrieving revision 1.4
 diff -u -r1.4 Makefile
 --- tools/asn1_compile/Makefile        8 Dec 2002 20:19:57 -0000       1.4
 +++ tools/asn1_compile/Makefile        21 Jan 2010 16:35:47 -0000
 @@ -2,5 +2,6 @@
  
  HOSTPROGNAME= ${_TOOL_PREFIX}asn1_compile
  HOST_SRCDIR=  lib/libasn1/asn1_compile
 +HOST_CPPFLAGS+=       -I${.CURDIR}
  
  .include "${.CURDIR}/../Makefile.host"
 Index: tools/compat/configure.ac
 ===================================================================
 RCS file: /cvsroot/src/tools/compat/configure.ac,v
 retrieving revision 1.71
 diff -u -r1.71 configure.ac
 --- tools/compat/configure.ac  15 Jan 2010 11:26:25 -0000      1.71
 +++ tools/compat/configure.ac  21 Jan 2010 16:35:48 -0000
 @@ -81,8 +81,7 @@
  AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h \
        getopt.h features.h malloc.h sys/poll.h stddef.h)
  AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h 
sys/endian.h \
 -      sys/featuretest.h err.h inttypes.h libgen.h paths.h stdint.h util.h \
 -      resolv.h arpa/nameser.h,,
 +      sys/featuretest.h err.h inttypes.h libgen.h paths.h stdint.h util.h,,
        [test -f include/$ac_header || touch include/$ac_header])
  AC_CHECK_HEADERS(rpc/types.h netconfig.h,,
        [echo '#include "nbtool_config.h"' >include/$ac_header.new
 @@ -225,4 +224,25 @@
      )
  ])
  
 +# Check headers required by heimdal/lib/roken for asn1_compile and compile_et
 +AC_CHECK_HEADERS(resolv.h syslog.h arpa/nameser.h \
 +      bind/bitypes.h sys/bitypes.h netinet/in6_machtypes.h \
 +      netinet/in.h netinet/in6.h netinet6/in6.h sys/uio.h)
 +
 +# Check struct winsize required by asn1_compile and compile_et in heimdal
 +AC_MSG_CHECKING(for struct winsize)
 +AC_CACHE_VAL(ac_cv_struct_winsize, [
 +ac_cv_struct_winsize=no
 +for i in sys/ioctl.h termios.h; do
 +AC_EGREP_HEADER(
 +struct[[      ]]*winsize,dnl
 +$i, ac_cv_struct_winsize=yes; break)dnl
 +done
 +])
 +if test "$ac_cv_struct_winsize" = "yes"; then
 +      AC_DEFINE(HAVE_STRUCT_WINSIZE, 1,
 +      [Define if struct winsize is declared in <sys/ioctl.h> or <termios.h>])
 +fi
 +AC_MSG_RESULT($ac_cv_struct_winsize)
 +
  AC_OUTPUT
 Index: tools/compile_et/Makefile
 ===================================================================
 RCS file: /cvsroot/src/tools/compile_et/Makefile,v
 retrieving revision 1.5
 diff -u -r1.5 Makefile
 --- tools/compile_et/Makefile  16 Nov 2003 14:14:18 -0000      1.5
 +++ tools/compile_et/Makefile  21 Jan 2010 16:35:48 -0000
 @@ -3,7 +3,7 @@
  HOSTPROGNAME= ${_TOOL_PREFIX}compile_et
  HOST_SRCDIR=  usr.bin/compile_et
  HOST_SRCS=    getarg.c print_version.c warnerr.c strupr.c get_window_size.c
 -HOST_CPPFLAGS=        -I${DIST}/heimdal/lib/roken
 +HOST_CPPFLAGS=        -I${.CURDIR}/../asn1_compile -I${DIST}/heimdal/lib/roken
  
  # uncommon library functions
  .PATH: ${.CURDIR}/../../lib/libc/string
 --- /dev/null  2010-01-22 01:27:36.000000000 +0900
 +++ tools/asn1_compile/roken.h 2010-01-21 04:44:35.000000000 +0900
 @@ -0,0 +1,156 @@
 +#ifndef __ROKEN_H__
 +#define __ROKEN_H__
 +
 +/* -*- C -*- */
 +/*
 + * Copyright (c) 1995-2005 Kungliga Tekniska H skolan
 + * (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.
 + */
 +
 +/* $Heimdal: roken.h.in 18612 2006-10-19 16:35:16Z lha $
 +   $NetBSD: roken.h.in,v 1.5 2008/03/22 08:37:21 mlelstv Exp $ */
 +
 +#include "nbtool_config.h"
 +
 +#include <stdio.h>
 +#include <stdlib.h>
 +#include <stdarg.h>
 +#ifdef HAVE_STDINT_H
 +#include <stdint.h>
 +#endif
 +#include <string.h>
 +#include <signal.h>
 +
 +#ifdef _AIX
 +struct ether_addr;
 +struct sockaddr_dl;
 +#endif
 +#ifdef HAVE_SYS_PARAM_H
 +#include <sys/param.h>
 +#endif
 +#ifdef HAVE_INTTYPES_H
 +#include <inttypes.h>
 +#endif
 +#ifdef HAVE_SYS_TYPES_H
 +#include <sys/types.h>
 +#endif
 +#ifdef HAVE_SYS_BITYPES_H
 +#include <sys/bitypes.h>
 +#endif
 +#ifdef HAVE_BIND_BITYPES_H
 +#include <bind/bitypes.h>
 +#endif
 +#ifdef HAVE_NETINET_IN6_MACHTYPES_H
 +#include <netinet/in6_machtypes.h>
 +#endif
 +#ifdef HAVE_UNISTD_H
 +#include <unistd.h>
 +#endif
 +#ifdef HAVE_SYS_SOCKET_H
 +#include <sys/socket.h>
 +#endif
 +#ifdef HAVE_SYS_UIO_H
 +#include <sys/uio.h>
 +#endif
 +#ifdef HAVE_GRP_H
 +#include <grp.h>
 +#endif
 +#ifdef HAVE_SYS_STAT_H
 +#include <sys/stat.h>
 +#endif
 +#ifdef HAVE_NETINET_IN_H
 +#include <netinet/in.h>
 +#endif
 +#ifdef HAVE_NETINET_IN6_H
 +#include <netinet/in6.h>
 +#endif
 +#ifdef HAVE_NETINET6_IN6_H
 +#include <netinet6/in6.h>
 +#endif
 +#ifdef HAVE_ARPA_INET_H
 +#include <arpa/inet.h>
 +#endif
 +#ifdef HAVE_NETDB_H
 +#include <netdb.h>
 +#endif
 +#ifdef HAVE_ARPA_NAMESER_H
 +#include <arpa/nameser.h>
 +#endif
 +#ifdef HAVE_RESOLV_H
 +#include <resolv.h>
 +#endif
 +#ifdef HAVE_SYSLOG_H
 +#include <syslog.h>
 +#endif
 +#ifdef HAVE_FCNTL_H
 +#include <fcntl.h>
 +#endif
 +#ifdef HAVE_ERRNO_H
 +#include <errno.h>
 +#endif
 +#include <err.h>
 +#ifdef HAVE_TERMIOS_H
 +#include <termios.h>
 +#endif
 +#if defined(HAVE_SYS_IOCTL_H) && SunOS != 40
 +#include <sys/ioctl.h>
 +#endif
 +#ifdef TIME_WITH_SYS_TIME
 +#include <sys/time.h>
 +#include <time.h>
 +#elif defined(HAVE_SYS_TIME_H)
 +#include <sys/time.h>
 +#else
 +#include <time.h>
 +#endif
 +#ifdef HAVE_STRINGS_H
 +#include <strings.h>
 +#endif
 +
 +#ifdef HAVE_PATHS_H
 +#include <paths.h>
 +#endif
 +
 +#include <roken-common.h>
 +
 +#ifndef HAVE_STRUCT_WINSIZE
 +struct winsize {
 +      unsigned short ws_row, ws_col;
 +      unsigned short ws_xpixel, ws_ypixel;
 +};
 +#endif
 +
 +int ROKEN_LIB_FUNCTION get_window_size(int fd, struct winsize *);
 +
 +ROKEN_CPP_END
 +#define ROKEN_VERSION 1.1
 +
 +#endif /* __ROKEN_H__ */
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index