From c8a0e2f4c688362b79ef1474cea604c8ebd6045d Mon Sep 17 00:00:00 2001 From: Thomas Veerman Date: Wed, 6 Jun 2012 14:46:00 +0000 Subject: [PATCH] Import NetBSD tools and build.sh This commit finalizes support for cross compilation. The tools directory are all links to the actual tools and are built on the host system to build Minix. build.sh is the work horse that takes care of all environment settings. It's slightly adjusted for Minix. The /usr/src/Makefile has additional targets needed for cross compilation. --- Makefile | 8 + build.sh | 2053 ++++ tools/Makefile | 110 + tools/Makefile.gmakehost | 21 + tools/Makefile.gnuhost | 144 + tools/Makefile.gnuwrap | 33 + tools/Makefile.host | 78 + tools/awk/Makefile | 7 + tools/binstall/Makefile | 10 + tools/binutils/Makefile | 74 + tools/binutils/mknative-binutils | 144 + tools/binutils/patches/patch-aa | 13 + tools/binutils/patches/patch-ab | 34 + tools/binutils/patches/patch-ac | 23 + tools/binutils/patches/patch-ad | 29 + tools/binutils/patches/patch-ae | 33 + tools/binutils/patches/patch-af | 94 + tools/binutils/patches/patch-ag | 21 + tools/binutils/patches/patch-ah | 28 + tools/binutils/patches/patch-ai | 330 + tools/binutils/patches/patch-aj | 12 + tools/binutils/patches/patch-am | 13 + tools/binutils/patches/patch-an | 15 + tools/binutils/patches/patch-ao | 16 + tools/binutils/patches/patch-ap | 15 + tools/binutils/patches/patch-ar | 23 + tools/binutils/patches/patch-as | 8 + tools/binutils/patches/patch-at | 6 + tools/binutils/patches/patch-au | 11 + tools/binutils/patches/patch-gas_app.c | 16 + tools/cat/Makefile | 6 + tools/compat/Makefile | 91 + tools/compat/README | 87 + tools/compat/compat_defs.h | 1196 +++ tools/compat/compat_getopt.h | 17 + tools/compat/compat_pwd.h | 63 + tools/compat/configure | 8442 +++++++++++++++++ tools/compat/configure.ac | 236 + tools/compat/crypto/rmd160.h | 5 + tools/compat/crypto/sha2.h | 5 + tools/compat/db.h | 7 + tools/compat/defs.mk.in | 22 + tools/compat/fgetln.c | 106 + tools/compat/flock.c | 76 + tools/compat/fpurge.c | 49 + tools/compat/fts.h | 5 + tools/compat/getline.c | 107 + tools/compat/getmode.c | 57 + tools/compat/glob.h | 5 + tools/compat/issetugid.c | 21 + tools/compat/lchflags.c | 54 + tools/compat/lchmod.c | 54 + tools/compat/lchown.c | 54 + tools/compat/md2.h | 5 + tools/compat/md4.h | 5 + tools/compat/md5.h | 5 + tools/compat/mpool.h | 3 + tools/compat/namespace.h | 14 + tools/compat/nbtool_config.h.in | 643 ++ tools/compat/ndbm.h | 7 + tools/compat/nl_types.h | 5 + tools/compat/pread.c | 55 + tools/compat/putc_unlocked.c | 47 + tools/compat/pwrite.c | 55 + tools/compat/setenv.c | 50 + tools/compat/setgroupent.c | 12 + tools/compat/setpassent.c | 12 + tools/compat/setprogname.c | 54 + tools/compat/snprintf.c | 663 ++ tools/compat/sys/null.h | 3 + tools/compat/sys/queue.h | 3 + tools/compat/sys/rmd160.h | 3 + tools/compat/sys/sha1.h | 5 + tools/compat/sys/sha2.h | 3 + tools/compat/sys/verified_exec.h | 3 + tools/compat/tzfile.h | 3 + tools/compat/ufs/ffs/ffs_extern.h | 3 + tools/compat/ufs/ffs/fs.h | 3 + tools/compat/ufs/ufs/dinode.h | 3 + tools/compat/ufs/ufs/dir.h | 3 + tools/compat/ufs/ufs/quota.h | 3 + tools/compat/ufs/ufs/ufs_bswap.h | 3 + tools/compat/vis.h | 5 + tools/gcc/Makefile | 208 + tools/gcc/README.mknative | 69 + tools/gcc/files/dragonfly-spec.h | 215 + tools/gcc/files/dragonfly.h | 97 + tools/gcc/files/gcov-minix-fs-wrapper.h | 39 + tools/gcc/files/hello.f | 5 + tools/gcc/files/hello.m | 6 + tools/gcc/files/i386-dragonfly.h | 148 + tools/gcc/files/i386-dragonfly64.h | 54 + tools/gcc/files/i386-minix.h | 148 + tools/gcc/files/minix-spec.h | 101 + tools/gcc/files/minix.h | 71 + tools/gcc/files/t-minix | 5 + tools/gcc/files/values.c | 64 + tools/gcc/mknative-gcc | 732 ++ tools/gcc/mknative.common | 91 + tools/gcc/patches/patch-aa | 62 + tools/gcc/patches/patch-ab | 10 + tools/gcc/patches/patch-ac | 82 + tools/gcc/patches/patch-ad | 15 + tools/gcc/patches/patch-ae | 34 + tools/gcc/patches/patch-af | 40 + tools/gcc/patches/patch-ag | 23 + tools/gcc/patches/patch-ai | 20 + tools/gcc/patches/patch-aj | 54 + tools/gcc/patches/patch-ak | 54 + tools/gcc/patches/patch-al | 36 + tools/gcc/patches/patch-am | 36 + tools/gcc/patches/patch-ao | 14 + tools/gcc/patches/patch-gcc_ginclude_stddef.h | 19 + tools/genassym/Makefile | 26 + tools/gmake/Makefile | 16 + tools/host-mkdep/Makefile | 28 + tools/host-mkdep/configure | 2518 +++++ tools/host-mkdep/configure.ac | 18 + tools/host-mkdep/host-mkdep.in | 253 + tools/installboot/Makefile | 11 + tools/lex/Makefile | 21 + tools/m4/Makefile | 18 + tools/m4/bootstrap/Makefile | 24 + tools/m4/bootstrap/parser.c | 649 ++ tools/m4/bootstrap/parser.h | 12 + tools/m4/bootstrap/tokenizer.c | 1899 ++++ tools/make/Makefile.regen | 8 + tools/make/buildmake.sh.in | 23 + tools/make/configure | 2802 ++++++ tools/make/configure.ac | 50 + tools/makewhatis/Makefile | 8 + tools/mkdep/Makefile | 8 + tools/mknod/Makefile | 6 + tools/mktemp/Makefile | 6 + tools/pwd_mkdb/Makefile | 6 + tools/sed/Makefile | 6 + tools/stat/Makefile | 6 + tools/tic/Makefile | 11 + tools/yacc/Makefile | 6 + tools/zic/Makefile | 10 + 140 files changed, 26869 insertions(+) create mode 100755 build.sh create mode 100644 tools/Makefile create mode 100644 tools/Makefile.gmakehost create mode 100644 tools/Makefile.gnuhost create mode 100644 tools/Makefile.gnuwrap create mode 100644 tools/Makefile.host create mode 100644 tools/awk/Makefile create mode 100644 tools/binstall/Makefile create mode 100644 tools/binutils/Makefile create mode 100755 tools/binutils/mknative-binutils create mode 100644 tools/binutils/patches/patch-aa create mode 100644 tools/binutils/patches/patch-ab create mode 100644 tools/binutils/patches/patch-ac create mode 100644 tools/binutils/patches/patch-ad create mode 100644 tools/binutils/patches/patch-ae create mode 100644 tools/binutils/patches/patch-af create mode 100644 tools/binutils/patches/patch-ag create mode 100644 tools/binutils/patches/patch-ah create mode 100644 tools/binutils/patches/patch-ai create mode 100644 tools/binutils/patches/patch-aj create mode 100644 tools/binutils/patches/patch-am create mode 100644 tools/binutils/patches/patch-an create mode 100644 tools/binutils/patches/patch-ao create mode 100644 tools/binutils/patches/patch-ap create mode 100644 tools/binutils/patches/patch-ar create mode 100644 tools/binutils/patches/patch-as create mode 100644 tools/binutils/patches/patch-at create mode 100644 tools/binutils/patches/patch-au create mode 100644 tools/binutils/patches/patch-gas_app.c create mode 100644 tools/cat/Makefile create mode 100644 tools/compat/Makefile create mode 100644 tools/compat/README create mode 100644 tools/compat/compat_defs.h create mode 100644 tools/compat/compat_getopt.h create mode 100644 tools/compat/compat_pwd.h create mode 100755 tools/compat/configure create mode 100644 tools/compat/configure.ac create mode 100644 tools/compat/crypto/rmd160.h create mode 100644 tools/compat/crypto/sha2.h create mode 100644 tools/compat/db.h create mode 100644 tools/compat/defs.mk.in create mode 100644 tools/compat/fgetln.c create mode 100644 tools/compat/flock.c create mode 100644 tools/compat/fpurge.c create mode 100644 tools/compat/fts.h create mode 100644 tools/compat/getline.c create mode 100644 tools/compat/getmode.c create mode 100644 tools/compat/glob.h create mode 100644 tools/compat/issetugid.c create mode 100644 tools/compat/lchflags.c create mode 100644 tools/compat/lchmod.c create mode 100644 tools/compat/lchown.c create mode 100644 tools/compat/md2.h create mode 100644 tools/compat/md4.h create mode 100644 tools/compat/md5.h create mode 100644 tools/compat/mpool.h create mode 100644 tools/compat/namespace.h create mode 100644 tools/compat/nbtool_config.h.in create mode 100644 tools/compat/ndbm.h create mode 100644 tools/compat/nl_types.h create mode 100644 tools/compat/pread.c create mode 100644 tools/compat/putc_unlocked.c create mode 100644 tools/compat/pwrite.c create mode 100644 tools/compat/setenv.c create mode 100644 tools/compat/setgroupent.c create mode 100644 tools/compat/setpassent.c create mode 100644 tools/compat/setprogname.c create mode 100644 tools/compat/snprintf.c create mode 100644 tools/compat/sys/null.h create mode 100644 tools/compat/sys/queue.h create mode 100644 tools/compat/sys/rmd160.h create mode 100644 tools/compat/sys/sha1.h create mode 100644 tools/compat/sys/sha2.h create mode 100644 tools/compat/sys/verified_exec.h create mode 100644 tools/compat/tzfile.h create mode 100644 tools/compat/ufs/ffs/ffs_extern.h create mode 100644 tools/compat/ufs/ffs/fs.h create mode 100644 tools/compat/ufs/ufs/dinode.h create mode 100644 tools/compat/ufs/ufs/dir.h create mode 100644 tools/compat/ufs/ufs/quota.h create mode 100644 tools/compat/ufs/ufs/ufs_bswap.h create mode 100644 tools/compat/vis.h create mode 100644 tools/gcc/Makefile create mode 100644 tools/gcc/README.mknative create mode 100644 tools/gcc/files/dragonfly-spec.h create mode 100644 tools/gcc/files/dragonfly.h create mode 100644 tools/gcc/files/gcov-minix-fs-wrapper.h create mode 100644 tools/gcc/files/hello.f create mode 100644 tools/gcc/files/hello.m create mode 100644 tools/gcc/files/i386-dragonfly.h create mode 100644 tools/gcc/files/i386-dragonfly64.h create mode 100644 tools/gcc/files/i386-minix.h create mode 100644 tools/gcc/files/minix-spec.h create mode 100644 tools/gcc/files/minix.h create mode 100644 tools/gcc/files/t-minix create mode 100644 tools/gcc/files/values.c create mode 100755 tools/gcc/mknative-gcc create mode 100644 tools/gcc/mknative.common create mode 100644 tools/gcc/patches/patch-aa create mode 100644 tools/gcc/patches/patch-ab create mode 100644 tools/gcc/patches/patch-ac create mode 100644 tools/gcc/patches/patch-ad create mode 100644 tools/gcc/patches/patch-ae create mode 100644 tools/gcc/patches/patch-af create mode 100644 tools/gcc/patches/patch-ag create mode 100644 tools/gcc/patches/patch-ai create mode 100644 tools/gcc/patches/patch-aj create mode 100644 tools/gcc/patches/patch-ak create mode 100644 tools/gcc/patches/patch-al create mode 100644 tools/gcc/patches/patch-am create mode 100644 tools/gcc/patches/patch-ao create mode 100644 tools/gcc/patches/patch-gcc_ginclude_stddef.h create mode 100644 tools/genassym/Makefile create mode 100644 tools/gmake/Makefile create mode 100644 tools/host-mkdep/Makefile create mode 100755 tools/host-mkdep/configure create mode 100644 tools/host-mkdep/configure.ac create mode 100644 tools/host-mkdep/host-mkdep.in create mode 100644 tools/installboot/Makefile create mode 100644 tools/lex/Makefile create mode 100644 tools/m4/Makefile create mode 100644 tools/m4/bootstrap/Makefile create mode 100644 tools/m4/bootstrap/parser.c create mode 100644 tools/m4/bootstrap/parser.h create mode 100644 tools/m4/bootstrap/tokenizer.c create mode 100644 tools/make/Makefile.regen create mode 100755 tools/make/buildmake.sh.in create mode 100755 tools/make/configure create mode 100644 tools/make/configure.ac create mode 100644 tools/makewhatis/Makefile create mode 100644 tools/mkdep/Makefile create mode 100644 tools/mknod/Makefile create mode 100644 tools/mktemp/Makefile create mode 100644 tools/pwd_mkdb/Makefile create mode 100644 tools/sed/Makefile create mode 100644 tools/stat/Makefile create mode 100644 tools/tic/Makefile create mode 100644 tools/yacc/Makefile create mode 100644 tools/zic/Makefile diff --git a/Makefile b/Makefile index d37ca4e7c..2876be152 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,15 @@ usage: # etcfiles also creates a directory hierarchy in its # 'make install' target. # + # etcfiles has to be done first. + +distribution: etcfiles includes mkfiles libraries do-libgcc .WAIT dep-all install etcforce + +do-libgcc: .PHONY .MAKE + ${MAKEDIRTARGET} external/gpl3/gcc/lib/libgcc/libgcc all + ${MAKEDIRTARGET} external/gpl3/gcc/lib/libgcc/libgcc install + world: mkfiles etcfiles includes libraries dep-all install etcforce # subdirs where userland utilities and other executables live diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..ee0863d72 --- /dev/null +++ b/build.sh @@ -0,0 +1,2053 @@ +#! /usr/bin/env sh +# $NetBSD: build.sh,v 1.254 2012/02/26 20:32:40 tsutsui Exp $ +# +# Copyright (c) 2001-2011 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Todd Vierling and Luke Mewburn. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# +# Top level build wrapper, to build or cross-build NetBSD. +# + +# +# {{{ Begin shell feature tests. +# +# We try to determine whether or not this script is being run under +# a shell that supports the features that we use. If not, we try to +# re-exec the script under another shell. If we can't find another +# suitable shell, then we print a message and exit. +# + +errmsg='' # error message, if not empty +shelltest=false # if true, exit after testing the shell +re_exec_allowed=true # if true, we may exec under another shell + +# Parse special command line options in $1. These special options are +# for internal use only, are not documented, and are not valid anywhere +# other than $1. +case "$1" in +"--shelltest") + shelltest=true + re_exec_allowed=false + shift + ;; +"--no-re-exec") + re_exec_allowed=false + shift + ;; +esac + +# Solaris /bin/sh, and other SVR4 shells, do not support "!". +# This is the first feature that we test, because subsequent +# tests use "!". +# +if test -z "$errmsg"; then + if ( eval '! false' ) >/dev/null 2>&1 ; then + : + else + errmsg='Shell does not support "!".' + fi +fi + +# Does the shell support functions? +# +if test -z "$errmsg"; then + if ! ( + eval 'somefunction() { : ; }' + ) >/dev/null 2>&1 + then + errmsg='Shell does not support functions.' + fi +fi + +# Does the shell support the "local" keyword for variables in functions? +# +# Local variables are not required by SUSv3, but some scripts run during +# the NetBSD build use them. +# +# ksh93 fails this test; it uses an incompatible syntax involving the +# keywords 'function' and 'typeset'. +# +if test -z "$errmsg"; then + if ! ( + eval 'f() { local v=2; }; v=1; f && test x"$v" = x"1"' + ) >/dev/null 2>&1 + then + errmsg='Shell does not support the "local" keyword in functions.' + fi +fi + +# Does the shell support ${var%suffix}, ${var#prefix}, and their variants? +# +# We don't bother testing for ${var+value}, ${var-value}, or their variants, +# since shells without those are sure to fail other tests too. +# +if test -z "$errmsg"; then + if ! ( + eval 'var=a/b/c ; + test x"${var#*/};${var##*/};${var%/*};${var%%/*}" = \ + x"b/c;c;a/b;a" ;' + ) >/dev/null 2>&1 + then + errmsg='Shell does not support "${var%suffix}" or "${var#prefix}".' + fi +fi + +# Does the shell support IFS? +# +# zsh in normal mode (as opposed to "emulate sh" mode) fails this test. +# +if test -z "$errmsg"; then + if ! ( + eval 'IFS=: ; v=":a b::c" ; set -- $v ; IFS=+ ; + test x"$#;$1,$2,$3,$4;$*" = x"4;,a b,,c;+a b++c"' + ) >/dev/null 2>&1 + then + errmsg='Shell does not support IFS word splitting.' + fi +fi + +# Does the shell support ${1+"$@"}? +# +# Some versions of zsh fail this test, even in "emulate sh" mode. +# +if test -z "$errmsg"; then + if ! ( + eval 'set -- "a a a" "b b b"; set -- ${1+"$@"}; + test x"$#;$1;$2" = x"2;a a a;b b b";' + ) >/dev/null 2>&1 + then + errmsg='Shell does not support ${1+"$@"}.' + fi +fi + +# Does the shell support $(...) command substitution? +# +if test -z "$errmsg"; then + if ! ( + eval 'var=$(echo abc); test x"$var" = x"abc"' + ) >/dev/null 2>&1 + then + errmsg='Shell does not support "$(...)" command substitution.' + fi +fi + +# Does the shell support $(...) command substitution with +# unbalanced parentheses? +# +# Some shells known to fail this test are: NetBSD /bin/ksh (as of 2009-12), +# bash-3.1, pdksh-5.2.14, zsh-4.2.7 in "emulate sh" mode. +# +if test -z "$errmsg"; then + if ! ( + eval 'var=$(case x in x) echo abc;; esac); test x"$var" = x"abc"' + ) >/dev/null 2>&1 + then + # XXX: This test is ignored because so many shells fail it; instead, + # the NetBSD build avoids using the problematic construct. + : ignore 'Shell does not support "$(...)" with unbalanced ")".' + fi +fi + +# Does the shell support getopts or getopt? +# +if test -z "$errmsg"; then + if ! ( + eval 'type getopts || type getopt' + ) >/dev/null 2>&1 + then + errmsg='Shell does not support getopts or getopt.' + fi +fi + +# +# If shelltest is true, exit now, reporting whether or not the shell is good. +# +if $shelltest; then + if test -n "$errmsg"; then + echo >&2 "$0: $errmsg" + exit 1 + else + exit 0 + fi +fi + +# +# If the shell was bad, try to exec a better shell, or report an error. +# +# Loops are broken by passing an extra "--no-re-exec" flag to the new +# instance of this script. +# +if test -n "$errmsg"; then + if $re_exec_allowed; then + for othershell in \ + "${HOST_SH}" /usr/xpg4/bin/sh ksh ksh88 mksh pdksh bash dash + # NOTE: some shells known not to work are: + # any shell using csh syntax; + # Solaris /bin/sh (missing many modern features); + # ksh93 (incompatible syntax for local variables); + # zsh (many differences, unless run in compatibility mode). + do + test -n "$othershell" || continue + if eval 'type "$othershell"' >/dev/null 2>&1 \ + && "$othershell" "$0" --shelltest >/dev/null 2>&1 + then + cat <&2 < $@" | tee -a "${results}" +} + +statusmsg2() +{ + local msg + + msg="${1}" + shift + case "${msg}" in + ????????????????*) ;; + ??????????*) msg="${msg} ";; + ?????*) msg="${msg} ";; + *) msg="${msg} ";; + esac + case "${msg}" in + ?????????????????????*) ;; + ????????????????????) msg="${msg} ";; + ???????????????????) msg="${msg} ";; + ??????????????????) msg="${msg} ";; + ?????????????????) msg="${msg} ";; + ????????????????) msg="${msg} ";; + esac + statusmsg "${msg}$*" +} + +warning() +{ + statusmsg "Warning: $@" +} + +# Find a program in the PATH, and print the result. If not found, +# print a default. If $2 is defined (even if it is an empty string), +# then that is the default; otherwise, $1 is used as the default. +find_in_PATH() +{ + local prog="$1" + local result="${2-"$1"}" + local oldIFS="${IFS}" + local dir + IFS=":" + for dir in ${PATH}; do + if [ -x "${dir}/${prog}" ]; then + result="${dir}/${prog}" + break + fi + done + IFS="${oldIFS}" + echo "${result}" +} + +# Try to find a working POSIX shell, and set HOST_SH to refer to it. +# Assumes that uname_s, uname_m, and PWD have been set. +set_HOST_SH() +{ + # Even if ${HOST_SH} is already defined, we still do the + # sanity checks at the end. + + # Solaris has /usr/xpg4/bin/sh. + # + [ -z "${HOST_SH}" ] && [ x"${uname_s}" = x"SunOS" ] && \ + [ -x /usr/xpg4/bin/sh ] && HOST_SH="/usr/xpg4/bin/sh" + + # Try to get the name of the shell that's running this script, + # by parsing the output from "ps". We assume that, if the host + # system's ps command supports -o comm at all, it will do so + # in the usual way: a one-line header followed by a one-line + # result, possibly including trailing white space. And if the + # host system's ps command doesn't support -o comm, we assume + # that we'll get an error message on stderr and nothing on + # stdout. (We don't try to use ps -o 'comm=' to suppress the + # header line, because that is less widely supported.) + # + # If we get the wrong result here, the user can override it by + # specifying HOST_SH in the environment. + # + [ -z "${HOST_SH}" ] && HOST_SH="$( + (ps -p $$ -o comm | sed -ne "2s/[ ${tab}]*\$//p") 2>/dev/null )" + + # If nothing above worked, use "sh". We will later find the + # first directory in the PATH that has a "sh" program. + # + [ -z "${HOST_SH}" ] && HOST_SH="sh" + + # If the result so far is not an absolute path, try to prepend + # PWD or search the PATH. + # + case "${HOST_SH}" in + /*) : + ;; + */*) HOST_SH="${PWD}/${HOST_SH}" + ;; + *) HOST_SH="$(find_in_PATH "${HOST_SH}")" + ;; + esac + + # If we don't have an absolute path by now, bomb. + # + case "${HOST_SH}" in + /*) : + ;; + *) bomb "HOST_SH=\"${HOST_SH}\" is not an absolute path." + ;; + esac + + # If HOST_SH is not executable, bomb. + # + [ -x "${HOST_SH}" ] || + bomb "HOST_SH=\"${HOST_SH}\" is not executable." + + # If HOST_SH fails tests, bomb. + # ("$0" may be a path that is no longer valid, because we have + # performed "cd $(dirname $0)", so don't use $0 here.) + # + "${HOST_SH}" build.sh --shelltest || + bomb "HOST_SH=\"${HOST_SH}\" failed functionality tests." +} + +# initdefaults -- +# Set defaults before parsing command line options. +# +initdefaults() +{ + makeenv= + makewrapper= + makewrappermachine= + runcmd= + operations= + removedirs= + + [ -d usr.bin/make ] || cd "$(dirname $0)" + [ -d usr.bin/make ] || + bomb "build.sh must be run from the top source level" + [ -f share/mk/bsd.own.mk ] || + bomb "src/share/mk is missing; please re-fetch the source tree" + + # Set various environment variables to known defaults, + # to minimize (cross-)build problems observed "in the field". + # + # LC_ALL=C must be set before we try to parse the output from + # any command. Other variables are set (or unset) here, before + # we parse command line arguments. + # + # These variables can be overridden via "-V var=value" if + # you know what you are doing. + # + unsetmakeenv INFODIR + unsetmakeenv LESSCHARSET + unsetmakeenv MAKEFLAGS + setmakeenv LC_ALL C + + # Find information about the build platform. This should be + # kept in sync with _HOST_OSNAME, _HOST_OSREL, and _HOST_ARCH + # variables in share/mk/bsd.sys.mk. + # + # Note that "uname -p" is not part of POSIX, but we want uname_p + # to be set to the host MACHINE_ARCH, if possible. On systems + # where "uname -p" fails, prints "unknown", or prints a string + # that does not look like an identifier, fall back to using the + # output from "uname -m" instead. + # + uname_s=$(uname -s 2>/dev/null) + uname_r=$(uname -r 2>/dev/null) + uname_m=$(uname -m 2>/dev/null) + uname_p=$(uname -p 2>/dev/null || echo "unknown") + case "${uname_p}" in + ''|unknown|*[^-_A-Za-z0-9]*) uname_p="${uname_m}" ;; + esac + + id_u=$(id -u 2>/dev/null || /usr/xpg4/bin/id -u 2>/dev/null) + + # If $PWD is a valid name of the current directory, POSIX mandates + # that pwd return it by default which causes problems in the + # presence of symlinks. Unsetting PWD is simpler than changing + # every occurrence of pwd to use -P. + # + # XXX Except that doesn't work on Solaris. Or many Linuces. + # + unset PWD + TOP=$(/bin/pwd -P 2>/dev/null || /bin/pwd 2>/dev/null) + + # The user can set HOST_SH in the environment, or we try to + # guess an appropriate value. Then we set several other + # variables from HOST_SH. + # + set_HOST_SH + setmakeenv HOST_SH "${HOST_SH}" + setmakeenv BSHELL "${HOST_SH}" + setmakeenv CONFIG_SHELL "${HOST_SH}" + + # Set defaults. + # + toolprefix=nb + + # Some systems have a small ARG_MAX. -X prevents make(1) from + # exporting variables in the environment redundantly. + # + case "${uname_s}" in + Darwin | FreeBSD | CYGWIN*) + MAKEFLAGS="-X ${MAKEFLAGS}" + ;; + esac + + # do_{operation}=true if given operation is requested. + # + do_expertmode=false + do_rebuildmake=false + do_removedirs=false + do_tools=false + do_cleandir=false + do_obj=false + do_build=false + do_distribution=false + do_release=false + do_kernel=false + do_releasekernel=false + do_modules=false + do_installmodules=false + do_install=false + do_sets=false + do_sourcesets=false + do_syspkgs=false + do_iso_image=false + do_iso_image_source=false + do_live_image=false + do_install_image=false + do_params=false + do_rump=false + + # done_{operation}=true if given operation has been done. + # + done_rebuildmake=false + + # Create scratch directory + # + tmpdir="${TMPDIR-/tmp}/nbbuild$$" + mkdir "${tmpdir}" || bomb "Cannot mkdir: ${tmpdir}" + trap "cd /; rm -r -f \"${tmpdir}\"" 0 + results="${tmpdir}/build.sh.results" + + # Set source directories + # + setmakeenv NETBSDSRCDIR "${TOP}" + + # Make sure KERNOBJDIR is an absolute path if defined + # + case "${KERNOBJDIR}" in + ''|/*) ;; + *) KERNOBJDIR="${TOP}/${KERNOBJDIR}" + setmakeenv KERNOBJDIR "${KERNOBJDIR}" + ;; + esac + + # Find the version of NetBSD + # + DISTRIBVER="$(${HOST_SH} ${TOP}/sys/conf/osrelease.sh)" + + # Set the BUILDSEED to NetBSD-"N" + # + setmakeenv BUILDSEED "MINIX-$(${HOST_SH} ${TOP}/sys/conf/osrelease.sh -m)" + + # Set MKARZERO to "yes" + # + setmakeenv MKARZERO "no" + +} + +getarch() +{ + # Translate some MACHINE name aliases (known only to build.sh) + # into proper MACHINE and MACHINE_ARCH names. Save the alias + # name in makewrappermachine. + # + case "${MACHINE}" in + + evbarm-e[bl]) + makewrappermachine=${MACHINE} + # MACHINE_ARCH is "arm" or "armeb", not "armel" + MACHINE_ARCH=arm${MACHINE##*-} + MACHINE_ARCH=${MACHINE_ARCH%el} + MACHINE=${MACHINE%-e[bl]} + ;; + + evbmips-e[bl]|sbmips-e[bl]) + makewrappermachine=${MACHINE} + MACHINE_ARCH=mips${MACHINE##*-} + MACHINE=${MACHINE%-e[bl]} + ;; + + evbmips64-e[bl]|sbmips64-e[bl]) + makewrappermachine=${MACHINE} + MACHINE_ARCH=mips64${MACHINE##*-} + MACHINE=${MACHINE%64-e[bl]} + ;; + + evbsh3-e[bl]) + makewrappermachine=${MACHINE} + MACHINE_ARCH=sh3${MACHINE##*-} + MACHINE=${MACHINE%-e[bl]} + ;; + + esac + + # Translate a MACHINE into a default MACHINE_ARCH. + # + case "${MACHINE}" in + + acorn26|acorn32|cats|hpcarm|iyonix|netwinder|shark|zaurus) + MACHINE_ARCH=arm + ;; + + evbarm) # unspecified MACHINE_ARCH gets LE + MACHINE_ARCH=${MACHINE_ARCH:=arm} + ;; + + hp700) + MACHINE_ARCH=hppa + ;; + + sun2) + MACHINE_ARCH=m68000 + ;; + + amiga|atari|cesfic|hp300|luna68k|mac68k|mvme68k|news68k|next68k|sun3|x68k) + MACHINE_ARCH=m68k + ;; + + evbmips|sbmips) # no default MACHINE_ARCH + ;; + + sgimips64) + makewrappermachine=${MACHINE} + MACHINE=${MACHINE%64} + MACHINE_ARCH=mips64eb + ;; + + ews4800mips|mipsco|newsmips|sgimips|emips) + MACHINE_ARCH=mipseb + ;; + + algor64|arc64|cobalt64|pmax64) + makewrappermachine=${MACHINE} + MACHINE=${MACHINE%64} + MACHINE_ARCH=mips64el + ;; + + algor|arc|cobalt|hpcmips|pmax) + MACHINE_ARCH=mipsel + ;; + + evbppc64|macppc64|ofppc64) + makewrappermachine=${MACHINE} + MACHINE=${MACHINE%64} + MACHINE_ARCH=powerpc64 + ;; + + amigappc|bebox|evbppc|ibmnws|macppc|mvmeppc|ofppc|prep|rs6000|sandpoint) + MACHINE_ARCH=powerpc + ;; + + evbsh3) # no default MACHINE_ARCH + ;; + + mmeye) + MACHINE_ARCH=sh3eb + ;; + + dreamcast|hpcsh|landisk) + MACHINE_ARCH=sh3el + ;; + + amd64) + MACHINE_ARCH=x86_64 + ;; + + alpha|i386|sparc|sparc64|vax|ia64) + MACHINE_ARCH=${MACHINE} + ;; + + *) + bomb "Unknown target MACHINE: ${MACHINE}" + ;; + + esac +} + +validatearch() +{ + # Ensure that the MACHINE_ARCH exists (and is supported by build.sh). + # + case "${MACHINE_ARCH}" in + + alpha|arm|armeb|hppa|i386|m68000|m68k|mipse[bl]|mips64e[bl]|powerpc|powerpc64|sh3e[bl]|sparc|sparc64|vax|x86_64|ia64) + ;; + + "") + bomb "No MACHINE_ARCH provided" + ;; + + *) + bomb "Unknown target MACHINE_ARCH: ${MACHINE_ARCH}" + ;; + + esac + + # Determine valid MACHINE_ARCHs for MACHINE + # + case "${MACHINE}" in + + evbarm) + arches="arm armeb" + ;; + + algor|arc|cobalt|pmax) + arches="mipsel mips64el" + ;; + + evbmips|sbmips) + arches="mipseb mipsel mips64eb mips64el" + ;; + + sgimips) + arches="mipseb mips64eb" + ;; + + evbsh3) + arches="sh3eb sh3el" + ;; + + macppc|evbppc|ofppc) + arches="powerpc powerpc64" + ;; + *) + oma="${MACHINE_ARCH}" + getarch + arches="${MACHINE_ARCH}" + MACHINE_ARCH="${oma}" + ;; + + esac + + # Ensure that MACHINE_ARCH supports MACHINE + # + archok=false + for a in ${arches}; do + if [ "${a}" = "${MACHINE_ARCH}" ]; then + archok=true + break + fi + done + ${archok} || + bomb "MACHINE_ARCH '${MACHINE_ARCH}' does not support MACHINE '${MACHINE}'" +} + +# nobomb_getmakevar -- +# Given the name of a make variable in $1, print make's idea of the +# value of that variable, or return 1 if there's an error. +# +nobomb_getmakevar() +{ + [ -x "${make}" ] || return 1 + "${make}" -m ${TOP}/share/mk -s -B -f- _x_ < +.include +EOF +} + +# bomb_getmakevar -- +# Given the name of a make variable in $1, print make's idea of the +# value of that variable, or bomb if there's an error. +# +bomb_getmakevar() +{ + [ -x "${make}" ] || bomb "bomb_getmakevar $1: ${make} is not executable" + nobomb_getmakevar "$1" || bomb "bomb_getmakevar $1: ${make} failed" +} + +# getmakevar -- +# Given the name of a make variable in $1, print make's idea of the +# value of that variable, or print a literal '$' followed by the +# variable name if ${make} is not executable. This is intended for use in +# messages that need to be readable even if $make hasn't been built, +# such as when build.sh is run with the "-n" option. +# +getmakevar() +{ + if [ -x "${make}" ]; then + bomb_getmakevar "$1" + else + echo "\$$1" + fi +} + +setmakeenv() +{ + eval "$1='$2'; export $1" + makeenv="${makeenv} $1" +} + +unsetmakeenv() +{ + eval "unset $1" + makeenv="${makeenv} $1" +} + +# Given a variable name in $1, modify the variable in place as follows: +# For each space-separated word in the variable, call resolvepath. +resolvepaths() +{ + local var="$1" + local val + eval val=\"\${${var}}\" + local newval='' + local word + for word in ${val}; do + resolvepath word + newval="${newval}${newval:+ }${word}" + done + eval ${var}=\"\${newval}\" +} + +# Given a variable name in $1, modify the variable in place as follows: +# Convert possibly-relative path to absolute path by prepending +# ${TOP} if necessary. Also delete trailing "/", if any. +resolvepath() +{ + local var="$1" + local val + eval val=\"\${${var}}\" + case "${val}" in + /) + ;; + /*) + val="${val%/}" + ;; + *) + val="${TOP}/${val%/}" + ;; + esac + eval ${var}=\"\${val}\" +} + +usage() +{ + if [ -n "$*" ]; then + echo "" + echo "${progname}: $*" + fi + cat <<_usage_ + +Usage: ${progname} [-EhnorUuxy] [-a arch] [-B buildid] [-C cdextras] + [-D dest] [-j njob] [-M obj] [-m mach] [-N noisy] + [-O obj] [-R release] [-S seed] [-T tools] + [-V var=[value]] [-w wrapper] [-X x11src] [-Y extsrcsrc] + [-Z var] + operation [...] + + Build operations (all imply "obj" and "tools"): + build Run "make build". + distribution Run "make distribution" (includes DESTDIR/etc/ files). + release Run "make release" (includes kernels & distrib media). + + Other operations: + help Show this message and exit. + makewrapper Create ${toolprefix}make-\${MACHINE} wrapper and ${toolprefix}make. + Always performed. + cleandir Run "make cleandir". [Default unless -u is used] + obj Run "make obj". [Default unless -o is used] + tools Build and install tools. + install=idir Run "make installworld" to \`idir' to install all sets + except \`etc'. Useful after "distribution" or "release" + kernel=conf Build kernel with config file \`conf' + releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR. + installmodules=idir Run "make installmodules" to \`idir' to install all + kernel modules. + modules Build kernel modules. + rumptest Do a linktest for rump (for developers). + sets Create binary sets in + RELEASEDIR/RELEASEMACHINEDIR/binary/sets. + DESTDIR should be populated beforehand. + sourcesets Create source sets in RELEASEDIR/source/sets. + syspkgs Create syspkgs in + RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. + iso-image Create CD-ROM image in RELEASEDIR/iso. + iso-image-source Create CD-ROM image with source in RELEASEDIR/iso. + live-image Create bootable live image in + RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage. + install-image Create bootable installation image in + RELEASEDIR/RELEASEMACHINEDIR/installation/installimage. + params Display various make(1) parameters. + + Options: + -a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE] + -B buildid Set BUILDID to buildid. + -C cdextras Append cdextras to CDEXTRA variable for inclusion on CD-ROM. + -D dest Set DESTDIR to dest. [Default: destdir.MACHINE] + -E Set "expert" mode; disables various safety checks. + Should not be used without expert knowledge of the build system. + -h Print this help message. + -j njob Run up to njob jobs in parallel; see make(1) -j. + -M obj Set obj root directory to obj; sets MAKEOBJDIRPREFIX. + Unsets MAKEOBJDIR. + -m mach Set MACHINE to mach; not required if NetBSD native. + -N noisy Set the noisyness (MAKEVERBOSE) level of the build: + 0 Minimal output ("quiet") + 1 Describe what is occurring + 2 Describe what is occurring and echo the actual command + 3 Ignore the effect of the "@" prefix in make commands + 4 Trace shell commands using the shell's -x flag + [Default: 2] + -n Show commands that would be executed, but do not execute them. + -O obj Set obj root directory to obj; sets a MAKEOBJDIR pattern. + Unsets MAKEOBJDIRPREFIX. + -o Set MKOBJDIRS=no; do not create objdirs at start of build. + -R release Set RELEASEDIR to release. [Default: releasedir] + -r Remove contents of TOOLDIR and DESTDIR before building. + -S seed Set BUILDSEED to seed. [Default: NetBSD-majorversion] + -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in + the environment, ${toolprefix}make will be (re)built + unconditionally. + -U Set MKUNPRIVED=yes; build without requiring root privileges, + install from an UNPRIVED build with proper file permissions. + -u Set MKUPDATE=yes; do not run "make cleandir" first. + Without this, everything is rebuilt, including the tools. + -V var=[value] Set variable \`var' to \`value'. + -w wrapper Create ${toolprefix}make script as wrapper. + [Default: \${TOOLDIR}/bin/${toolprefix}make-\${MACHINE}] + -X x11src Set X11SRCDIR to x11src. [Default: /usr/xsrc] + -x Set MKX11=yes; build X11 from X11SRCDIR + -Y extsrcsrc Set EXTSRCSRCDIR to extsrcsrc. [Default: /usr/extsrc] + -y Set MKEXTSRC=yes; build extsrc from EXTSRCSRCDIR + -Z var Unset ("zap") variable \`var'. + +_usage_ + exit 1 +} + +parseoptions() +{ + opts='a:B:C:D:Ehj:M:m:N:nO:oR:rS:T:UuV:w:X:xY:yZ:' + opt_a=no + + if type getopts >/dev/null 2>&1; then + # Use POSIX getopts. + # + getoptcmd='getopts ${opts} opt && opt=-${opt}' + optargcmd=':' + optremcmd='shift $((${OPTIND} -1))' + else + type getopt >/dev/null 2>&1 || + bomb "Shell does not support getopts or getopt" + + # Use old-style getopt(1) (doesn't handle whitespace in args). + # + args="$(getopt ${opts} $*)" + [ $? = 0 ] || usage + set -- ${args} + + getoptcmd='[ $# -gt 0 ] && opt="$1" && shift' + optargcmd='OPTARG="$1"; shift' + optremcmd=':' + fi + + # Parse command line options. + # + while eval ${getoptcmd}; do + case ${opt} in + + -a) + eval ${optargcmd} + MACHINE_ARCH=${OPTARG} + opt_a=yes + ;; + + -B) + eval ${optargcmd} + BUILDID=${OPTARG} + ;; + + -C) + eval ${optargcmd}; resolvepaths OPTARG + CDEXTRA="${CDEXTRA}${CDEXTRA:+ }${OPTARG}" + ;; + + -D) + eval ${optargcmd}; resolvepath OPTARG + setmakeenv DESTDIR "${OPTARG}" + ;; + + -E) + do_expertmode=true + ;; + + -j) + eval ${optargcmd} + parallel="-j ${OPTARG}" + ;; + + -M) + eval ${optargcmd}; resolvepath OPTARG + case "${OPTARG}" in + \$*) usage "-M argument must not begin with '\$'" + ;; + *\$*) # can use resolvepath, but can't set TOP_objdir + resolvepath OPTARG + ;; + *) resolvepath OPTARG + TOP_objdir="${OPTARG}${TOP}" + ;; + esac + unsetmakeenv MAKEOBJDIR + setmakeenv MAKEOBJDIRPREFIX "${OPTARG}" + ;; + + # -m overrides MACHINE_ARCH unless "-a" is specified + -m) + eval ${optargcmd} + MACHINE="${OPTARG}" + [ "${opt_a}" != "yes" ] && getarch + ;; + + -N) + eval ${optargcmd} + case "${OPTARG}" in + 0|1|2|3|4) + setmakeenv MAKEVERBOSE "${OPTARG}" + ;; + *) + usage "'${OPTARG}' is not a valid value for -N" + ;; + esac + ;; + + -n) + runcmd=echo + ;; + + -O) + eval ${optargcmd} + case "${OPTARG}" in + *\$*) usage "-O argument must not contain '\$'" + ;; + *) resolvepath OPTARG + TOP_objdir="${OPTARG}" + ;; + esac + unsetmakeenv MAKEOBJDIRPREFIX + setmakeenv MAKEOBJDIR "\${.CURDIR:C,^$TOP,$OPTARG,}" + ;; + + -o) + MKOBJDIRS=no + ;; + + -R) + eval ${optargcmd}; resolvepath OPTARG + setmakeenv RELEASEDIR "${OPTARG}" + ;; + + -r) + do_removedirs=true + do_rebuildmake=true + ;; + + -S) + eval ${optargcmd} + setmakeenv BUILDSEED "${OPTARG}" + ;; + + -T) + eval ${optargcmd}; resolvepath OPTARG + TOOLDIR="${OPTARG}" + export TOOLDIR + ;; + + -U) + setmakeenv MKUNPRIVED yes + ;; + + -u) + setmakeenv MKUPDATE yes + ;; + + -V) + eval ${optargcmd} + case "${OPTARG}" in + # XXX: consider restricting which variables can be changed? + [a-zA-Z_][a-zA-Z_0-9]*=*) + setmakeenv "${OPTARG%%=*}" "${OPTARG#*=}" + ;; + *) + usage "-V argument must be of the form 'var=[value]'" + ;; + esac + ;; + + -w) + eval ${optargcmd}; resolvepath OPTARG + makewrapper="${OPTARG}" + ;; + + -X) + eval ${optargcmd}; resolvepath OPTARG + setmakeenv X11SRCDIR "${OPTARG}" + ;; + + -x) + setmakeenv MKX11 yes + ;; + + -Y) + eval ${optargcmd}; resolvepath OPTARG + setmakeenv EXTSRCSRCDIR "${OPTARG}" + ;; + + -y) + setmakeenv MKEXTSRC yes + ;; + + -Z) + eval ${optargcmd} + # XXX: consider restricting which variables can be unset? + unsetmakeenv "${OPTARG}" + ;; + + --) + break + ;; + + -'?'|-h) + usage + ;; + + esac + done + + # Validate operations. + # + eval ${optremcmd} + while [ $# -gt 0 ]; do + op=$1; shift + operations="${operations} ${op}" + + case "${op}" in + + help) + usage + ;; + + makewrapper|cleandir|obj|tools|build|distribution|release|sets|sourcesets|syspkgs|params) + ;; + + iso-image) + op=iso_image # used as part of a variable name + ;; + + iso-image-source) + op=iso_image_source # used as part of a variable name + ;; + + live-image) + op=live_image # used as part of a variable name + ;; + + install-image) + op=install_image # used as part of a variable name + ;; + + kernel=*|releasekernel=*) + arg=${op#*=} + op=${op%%=*} + [ -n "${arg}" ] || + bomb "Must supply a kernel name with \`${op}=...'" + ;; + + modules) + op=modules + ;; + + install=*|installmodules=*) + arg=${op#*=} + op=${op%%=*} + [ -n "${arg}" ] || + bomb "Must supply a directory with \`install=...'" + ;; + + rump|rumptest) + op=${op} + ;; + + *) + usage "Unknown operation \`${op}'" + ;; + + esac + eval do_${op}=true + done + [ -n "${operations}" ] || usage "Missing operation to perform." + + # Set up MACHINE*. On a NetBSD host, these are allowed to be unset. + # + if [ -z "${MACHINE}" ]; then + [ "${uname_s}" = "Minix" ] || + bomb "MACHINE must be set, or -m must be used, for cross builds." + MACHINE=${uname_m} + fi + [ -n "${MACHINE_ARCH}" ] || getarch + validatearch + + # Set up default make(1) environment. + # + makeenv="${makeenv} TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS" + [ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID" + MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS}" + MAKEFLAGS="${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}" + BUILDSH=1 + export MAKEFLAGS MACHINE MACHINE_ARCH BUILDSH +} + +# sanitycheck -- +# Sanity check after parsing command line options, before rebuildmake. +# +sanitycheck() +{ + # If the PATH contains any non-absolute components (including, + # but not limited to, "." or ""), then complain. As an exception, + # allow "" or "." as the last component of the PATH. This is fatal + # if expert mode is not in effect. + # + local path="${PATH}" + path="${path%:}" # delete trailing ":" + path="${path%:.}" # delete trailing ":." + case ":${path}:/" in + *:[!/]*) + if ${do_expertmode}; then + warning "PATH contains non-absolute components" + else + bomb "PATH environment variable must not" \ + "contain non-absolute components" + fi + ;; + esac +} + +# print_tooldir_make -- +# Try to find and print a path to an existing +# ${TOOLDIR}/bin/${toolprefix}make, for use by rebuildmake() before a +# new version of ${toolprefix}make has been built. +# +# * If TOOLDIR was set in the environment or on the command line, use +# that value. +# * Otherwise try to guess what TOOLDIR would be if not overridden by +# /etc/mk.conf, and check whether the resulting directory contains +# a copy of ${toolprefix}make (this should work for everybody who +# doesn't override TOOLDIR via /etc/mk.conf); +# * Failing that, search for ${toolprefix}make, nbmake, bmake, or make, +# in the PATH (this might accidentally find a version of make that +# does not understand the syntax used by NetBSD make, and that will +# lead to failure in the next step); +# * If a copy of make was found above, try to use it with +# nobomb_getmakevar to find the correct value for TOOLDIR, and believe the +# result only if it's a directory that already exists; +# * If a value of TOOLDIR was found above, and if +# ${TOOLDIR}/bin/${toolprefix}make exists, print that value. +# +print_tooldir_make() +{ + local possible_TOP_OBJ + local possible_TOOLDIR + local possible_make + local tooldir_make + + if [ -n "${TOOLDIR}" ]; then + echo "${TOOLDIR}/bin/${toolprefix}make" + return 0 + fi + + # Set host_ostype to something like "NetBSD-4.5.6-i386". This + # is intended to match the HOST_OSTYPE variable in . + # + local host_ostype="${uname_s}-$( + echo "${uname_r}" | sed -e 's/([^)]*)//g' -e 's/ /_/g' + )-$( + echo "${uname_p}" | sed -e 's/([^)]*)//g' -e 's/ /_/g' + )" + + # Look in a few potential locations for + # ${possible_TOOLDIR}/bin/${toolprefix}make. + # If we find it, then set possible_make. + # + # In the usual case (without interference from environment + # variables or /etc/mk.conf), should set TOOLDIR to + # "${_SRC_TOP_OBJ_}/tooldir.${host_ostype}". + # + # In practice it's difficult to figure out the correct value + # for _SRC_TOP_OBJ_. In the easiest case, when the -M or -O + # options were passed to build.sh, then ${TOP_objdir} will be + # the correct value. We also try a few other possibilities, but + # we do not replicate all the logic of . + # + for possible_TOP_OBJ in \ + "${TOP_objdir}" \ + "${MAKEOBJDIRPREFIX:+${MAKEOBJDIRPREFIX}${TOP}}" \ + "${TOP}" \ + "${TOP}/obj" \ + "${TOP}/obj.${MACHINE}" + do + [ -n "${possible_TOP_OBJ}" ] || continue + possible_TOOLDIR="${possible_TOP_OBJ}/tooldir.${host_ostype}" + possible_make="${possible_TOOLDIR}/bin/${toolprefix}make" + if [ -x "${possible_make}" ]; then + break + else + unset possible_make + fi + done + + # If the above didn't work, search the PATH for a suitable + # ${toolprefix}make, nbmake, bmake, or make. + # + : ${possible_make:=$(find_in_PATH ${toolprefix}make '')} + : ${possible_make:=$(find_in_PATH nbmake '')} + : ${possible_make:=$(find_in_PATH bmake '')} + : ${possible_make:=$(find_in_PATH make '')} + + # At this point, we don't care whether possible_make is in the + # correct TOOLDIR or not; we simply want it to be usable by + # getmakevar to help us find the correct TOOLDIR. + # + # Use ${possible_make} with nobomb_getmakevar to try to find + # the value of TOOLDIR. Believe the result only if it's + # a directory that already exists and contains bin/${toolprefix}make. + # + if [ -x "${possible_make}" ]; then + possible_TOOLDIR="$( + make="${possible_make}" \ + nobomb_getmakevar TOOLDIR 2>/dev/null + )" + if [ $? = 0 ] && [ -n "${possible_TOOLDIR}" ] \ + && [ -d "${possible_TOOLDIR}" ]; + then + tooldir_make="${possible_TOOLDIR}/bin/${toolprefix}make" + if [ -x "${tooldir_make}" ]; then + echo "${tooldir_make}" + return 0 + fi + fi + fi + return 1 +} + +# rebuildmake -- +# Rebuild nbmake in a temporary directory if necessary. Sets $make +# to a path to the nbmake executable. Sets done_rebuildmake=true +# if nbmake was rebuilt. +# +# There is a cyclic dependency between building nbmake and choosing +# TOOLDIR: TOOLDIR may be affected by settings in /etc/mk.conf, so we +# would like to use getmakevar to get the value of TOOLDIR; but we can't +# use getmakevar before we have an up to date version of nbmake; we +# might already have an up to date version of nbmake in TOOLDIR, but we +# don't yet know where TOOLDIR is. +# +# The default value of TOOLDIR also depends on the location of the top +# level object directory, so $(getmakevar TOOLDIR) invoked before or +# after making the top level object directory may produce different +# results. +# +# Strictly speaking, we should do the following: +# +# 1. build a new version of nbmake in a temporary directory; +# 2. use the temporary nbmake to create the top level obj directory; +# 3. use $(getmakevar TOOLDIR) with the temporary nbmake to +# get the corect value of TOOLDIR; +# 4. move the temporary nbmake to ${TOOLDIR}/bin/nbmake. +# +# However, people don't like building nbmake unnecessarily if their +# TOOLDIR has not changed since an earlier build. We try to avoid +# rebuilding a temporary version of nbmake by taking some shortcuts to +# guess a value for TOOLDIR, looking for an existing version of nbmake +# in that TOOLDIR, and checking whether that nbmake is newer than the +# sources used to build it. +# +rebuildmake() +{ + make="$(print_tooldir_make)" + if [ -n "${make}" ] && [ -x "${make}" ]; then + for f in usr.bin/make/*.[ch] usr.bin/make/lst.lib/*.[ch]; do + if [ "${f}" -nt "${make}" ]; then + statusmsg "${make} outdated" \ + "(older than ${f}), needs building." + do_rebuildmake=true + break + fi + done + else + statusmsg "No \$TOOLDIR/bin/${toolprefix}make, needs building." + do_rebuildmake=true + fi + + # Build bootstrap ${toolprefix}make if needed. + if ${do_rebuildmake}; then + statusmsg "Bootstrapping ${toolprefix}make" + ${runcmd} cd "${tmpdir}" + ${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \ + CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \ + ${HOST_SH} "${TOP}/tools/make/configure" || + bomb "Configure of ${toolprefix}make failed" + ${runcmd} ${HOST_SH} buildmake.sh || + bomb "Build of ${toolprefix}make failed" + make="${tmpdir}/${toolprefix}make" + ${runcmd} cd "${TOP}" + ${runcmd} rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o + done_rebuildmake=true + fi +} + +# validatemakeparams -- +# Perform some late sanity checks, after rebuildmake, +# but before createmakewrapper or any real work. +# +# Also create the top-level obj directory. +# +validatemakeparams() +{ + if [ "${runcmd}" = "echo" ]; then + TOOLCHAIN_MISSING=no + EXTERNAL_TOOLCHAIN="" + else + TOOLCHAIN_MISSING=$(bomb_getmakevar TOOLCHAIN_MISSING) + EXTERNAL_TOOLCHAIN=$(bomb_getmakevar EXTERNAL_TOOLCHAIN) + fi + if [ "${TOOLCHAIN_MISSING}" = "yes" ] && \ + [ -z "${EXTERNAL_TOOLCHAIN}" ]; then + ${runcmd} echo "ERROR: build.sh (in-tree cross-toolchain) is not yet available for" + ${runcmd} echo " MACHINE: ${MACHINE}" + ${runcmd} echo " MACHINE_ARCH: ${MACHINE_ARCH}" + ${runcmd} echo "" + ${runcmd} echo "All builds for this platform should be done via a traditional make" + ${runcmd} echo "If you wish to use an external cross-toolchain, set" + ${runcmd} echo " EXTERNAL_TOOLCHAIN=" + ${runcmd} echo "in either the environment or mk.conf and rerun" + ${runcmd} echo " ${progname} $*" + exit 1 + fi + + # Normalise MKOBJDIRS, MKUNPRIVED, and MKUPDATE + # These may be set as build.sh options or in "mk.conf". + # Don't export them as they're only used for tests in build.sh. + # + MKOBJDIRS=$(getmakevar MKOBJDIRS) + MKUNPRIVED=$(getmakevar MKUNPRIVED) + MKUPDATE=$(getmakevar MKUPDATE) + + if [ "${MKOBJDIRS}" != "no" ]; then + # Create the top-level object directory. + # + # "make obj NOSUBDIR=" can handle most cases, but it + # can't handle the case where MAKEOBJDIRPREFIX is set + # while the corresponding directory does not exist + # (rules in would abort the build). We + # therefore have to handle the MAKEOBJDIRPREFIX case + # without invoking "make obj". The MAKEOBJDIR case + # could be handled either way, but we choose to handle + # it similarly to MAKEOBJDIRPREFIX. + # + if [ -n "${TOP_obj}" ]; then + # It must have been set by the "-M" or "-O" + # command line options, so there's no need to + # use getmakevar + : + elif [ -n "$MAKEOBJDIRPREFIX" ]; then + TOP_obj="$(getmakevar MAKEOBJDIRPREFIX)${TOP}" + elif [ -n "$MAKEOBJDIR" ]; then + TOP_obj="$(getmakevar MAKEOBJDIR)" + fi + if [ -n "$TOP_obj" ]; then + ${runcmd} mkdir -p "${TOP_obj}" || + bomb "Can't create top level object directory" \ + "${TOP_obj}" + else + ${runcmd} "${make}" -m ${TOP}/share/mk obj NOSUBDIR= || + bomb "Can't create top level object directory" \ + "using make obj" + fi + + # make obj in tools to ensure that the objdir for "tools" + # is available. + # + ${runcmd} cd tools + ${runcmd} "${make}" -m ${TOP}/share/mk obj NOSUBDIR= || + bomb "Failed to make obj in tools" + ${runcmd} cd "${TOP}" + fi + + # Find TOOLDIR, DESTDIR, and RELEASEDIR, according to getmakevar, + # and bomb if they have changed from the values we had from the + # command line or environment. + # + # This must be done after creating the top-level object directory. + # + for var in TOOLDIR DESTDIR RELEASEDIR + do + eval oldval=\"\$${var}\" + newval="$(getmakevar $var)" + if ! $do_expertmode; then + : ${_SRC_TOP_OBJ_:=$(getmakevar _SRC_TOP_OBJ_)} + case "$var" in + DESTDIR) + : ${newval:=${_SRC_TOP_OBJ_}/destdir.${MACHINE}} + makeenv="${makeenv} DESTDIR" + ;; + RELEASEDIR) + : ${newval:=${_SRC_TOP_OBJ_}/releasedir} + makeenv="${makeenv} RELEASEDIR" + ;; + esac + fi + if [ -n "$oldval" ] && [ "$oldval" != "$newval" ]; then + bomb "Value of ${var} has changed" \ + "(was \"${oldval}\", now \"${newval}\")" + fi + eval ${var}=\"\${newval}\" + eval export ${var} + statusmsg2 "${var} path:" "${newval}" + done + + # RELEASEMACHINEDIR is just a subdir name, e.g. "i386". + RELEASEMACHINEDIR=$(getmakevar RELEASEMACHINEDIR) + + # Check validity of TOOLDIR and DESTDIR. + # + if [ -z "${TOOLDIR}" ] || [ "${TOOLDIR}" = "/" ]; then + bomb "TOOLDIR '${TOOLDIR}' invalid" + fi + removedirs="${TOOLDIR}" + + if [ -z "${DESTDIR}" ] || [ "${DESTDIR}" = "/" ]; then + if ${do_build} || ${do_distribution} || ${do_release}; then + if ! ${do_build} || \ + [ "${uname_s}" != "NetBSD" ] || \ + [ "${uname_m}" != "${MACHINE}" ]; then + bomb "DESTDIR must != / for cross builds, or ${progname} 'distribution' or 'release'." + fi + if ! ${do_expertmode}; then + bomb "DESTDIR must != / for non -E (expert) builds" + fi + statusmsg "WARNING: Building to /, in expert mode." + statusmsg " This may cause your system to break! Reasons include:" + statusmsg " - your kernel is not up to date" + statusmsg " - the libraries or toolchain have changed" + statusmsg " YOU HAVE BEEN WARNED!" + fi + else + removedirs="${removedirs} ${DESTDIR}" + fi + if ${do_build} || ${do_distribution} || ${do_release}; then + if ! ${do_expertmode} && \ + [ "$id_u" -ne 0 ] && \ + [ "${MKUNPRIVED}" = "no" ] ; then + bomb "-U or -E must be set for build as an unprivileged user." + fi + fi + if ${do_releasekernel} && [ -z "${RELEASEDIR}" ]; then + bomb "Must set RELEASEDIR with \`releasekernel=...'" + fi + + # Install as non-root is a bad idea. + # + if ${do_install} && [ "$id_u" -ne 0 ] ; then + if ${do_expertmode}; then + warning "Will install as an unprivileged user." + else + bomb "-E must be set for install as an unprivileged user." + fi + fi + + # If a previous build.sh run used -U (and therefore created a + # METALOG file), then most subsequent build.sh runs must also + # use -U. If DESTDIR is about to be removed, then don't perform + # this check. + # + case "${do_removedirs} ${removedirs} " in + true*" ${DESTDIR} "*) + # DESTDIR is about to be removed + ;; + *) + if ( ${do_build} || ${do_distribution} || ${do_release} || \ + ${do_install} ) && \ + [ -e "${DESTDIR}/METALOG" ] && \ + [ "${MKUNPRIVED}" = "no" ] ; then + if $do_expertmode; then + warning "A previous build.sh run specified -U." + else + bomb "A previous build.sh run specified -U; you must specify it again now." + fi + fi + ;; + esac + + # live-image and install-image targets require binary sets + # (actually DESTDIR/etc/mtree/set.* files) built with MKUNPRIVED. + # If release operation is specified with live-image or install-image, + # the release op should be performed with -U for later image ops. + # + if ${do_release} && ( ${do_live_image} || ${do_install_image} ) && \ + [ "${MKUNPRIVED}" = "no" ] ; then + bomb "-U must be specified on building release to create images later." + fi +} + + +createmakewrapper() +{ + # Remove the target directories. + # + if ${do_removedirs}; then + for f in ${removedirs}; do + statusmsg "Removing ${f}" + ${runcmd} rm -r -f "${f}" + done + fi + + # Recreate $TOOLDIR. + # + ${runcmd} mkdir -p "${TOOLDIR}/bin" || + bomb "mkdir of '${TOOLDIR}/bin' failed" + + # If we did not previously rebuild ${toolprefix}make, then + # check whether $make is still valid and the same as the output + # from print_tooldir_make. If not, then rebuild make now. A + # possible reason for this being necessary is that the actual + # value of TOOLDIR might be different from the value guessed + # before the top level obj dir was created. + # + if ! ${done_rebuildmake} && \ + ( [ ! -x "$make" ] || [ "$make" != "$(print_tooldir_make)" ] ) + then + rebuildmake + fi + + # Install ${toolprefix}make if it was built. + # + if ${done_rebuildmake}; then + ${runcmd} rm -f "${TOOLDIR}/bin/${toolprefix}make" + ${runcmd} cp "${make}" "${TOOLDIR}/bin/${toolprefix}make" || + bomb "Failed to install \$TOOLDIR/bin/${toolprefix}make" + make="${TOOLDIR}/bin/${toolprefix}make" + statusmsg "Created ${make}" + fi + + # Build a ${toolprefix}make wrapper script, usable by hand as + # well as by build.sh. + # + if [ -z "${makewrapper}" ]; then + makewrapper="${TOOLDIR}/bin/${toolprefix}make-${makewrappermachine:-${MACHINE}}" + [ -z "${BUILDID}" ] || makewrapper="${makewrapper}-${BUILDID}" + fi + + ${runcmd} rm -f "${makewrapper}" + if [ "${runcmd}" = "echo" ]; then + echo 'cat <'${makewrapper} + makewrapout= + else + makewrapout=">>\${makewrapper}" + fi + + case "${KSH_VERSION:-${SH_VERSION}}" in + *PD\ KSH*|*MIRBSD\ KSH*) + set +o braceexpand + ;; + esac + + eval cat < ${releasekern}" + else + gzip -c -9 < "${builtkern}" > "${releasekern}" + fi + done +} + +buildmodules() +{ + setmakeenv MKBINUTILS no + if ! ${do_tools} && ! ${buildmoduleswarned:-false}; then + # Building tools every time we build modules is clearly + # unnecessary as well as a kernel. + # + statusmsg "Building modules without building new tools" + buildmoduleswarned=true + fi + + statusmsg "Building kernel modules for NetBSD/${MACHINE} ${DISTRIBVER}" + if [ "${MKOBJDIRS}" != "no" ]; then + make_in_dir sys/modules obj || + bomb "Failed to make obj in sys/modules" + fi + if [ "${MKUPDATE}" = "no" ]; then + make_in_dir sys/modules cleandir + fi + ${runcmd} "${makewrapper}" ${parallel} do-sys-modules || + bomb "Failed to make do-sys-modules" + + statusmsg "Successful build of kernel modules for NetBSD/${MACHINE} ${DISTRIBVER}" +} + +installmodules() +{ + dir="$1" + ${runcmd} "${makewrapper}" INSTALLMODULESDIR="${dir}" installmodules || + bomb "Failed to make installmodules to ${dir}" + statusmsg "Successful installmodules to ${dir}" +} + +installworld() +{ + dir="$1" + ${runcmd} "${makewrapper}" INSTALLWORLDDIR="${dir}" installworld || + bomb "Failed to make installworld to ${dir}" + statusmsg "Successful installworld to ${dir}" +} + +# Run rump build&link tests. +# +# To make this feasible for running without having to install includes and +# libraries into destdir (i.e. quick), we only run ld. This is possible +# since the rump kernel is a closed namespace apart from calls to rumpuser. +# Therefore, if ld complains only about rumpuser symbols, rump kernel +# linking was successful. +# +# We test that rump links with a number of component configurations. +# These attempt to mimic what is encountered in the full build. +# See list below. The list should probably be either autogenerated +# or managed elsewhere; keep it here until a better idea arises. +# +# Above all, note that THIS IS NOT A SUBSTITUTE FOR A FULL BUILD. +# + +RUMP_LIBSETS=' + -lrump, + -lrumpvfs -lrump, + -lrumpvfs -lrumpdev -lrump, + -lrumpnet -lrump, + -lrumpkern_tty -lrumpvfs -lrump, + -lrumpfs_tmpfs -lrumpvfs -lrump, + -lrumpfs_ffs -lrumpfs_msdos -lrumpvfs -lrumpdev_disk -lrumpdev -lrump, + -lrumpnet_virtif -lrumpnet_netinet -lrumpnet_net -lrumpnet -lrump, + -lrumpnet_sockin -lrumpfs_smbfs -lrumpdev_netsmb + -lrumpkern_crypto -lrumpdev -lrumpnet -lrumpvfs -lrump, + -lrumpnet_sockin -lrumpfs_nfs -lrumpnet -lrumpvfs -lrump, + -lrumpdev_cgd -lrumpdev_raidframe -lrumpdev_disk -lrumpdev_rnd + -lrumpdev_dm -lrumpdev -lrumpvfs -lrumpkern_crypto -lrump' +dorump() +{ + local doclean="" + local doobjs="" + + # we cannot link libs without building csu, and that leads to lossage + [ "${1}" != "rumptest" ] && bomb 'build.sh rump not yet functional. ' \ + 'did you mean "rumptest"?' + + # create obj and distrib dirs + if [ "${MKOBJDIRS}" != "no" ]; then + make_in_dir "${NETBSDSRCDIR}/etc/mtree" obj + make_in_dir "${NETBSDSRCDIR}/sys/rump" obj + fi + ${runcmd} "${makewrapper}" ${parallel} do-distrib-dirs \ + || bomb 'could not create distrib-dirs' + + [ "${MKUPDATE}" = "no" ] && doclean="cleandir" + targlist="${doclean} ${doobjs} dependall install" + # optimize: for test we build only static libs (3x test speedup) + if [ "${1}" = "rumptest" ] ; then + setmakeenv NOPIC 1 + setmakeenv NOPROFILE 1 + fi + for cmd in ${targlist} ; do + make_in_dir "${NETBSDSRCDIR}/sys/rump" ${cmd} + done + + # if we just wanted to build & install rump, we're done + [ "${1}" != "rumptest" ] && return + + ${runcmd} cd "${NETBSDSRCDIR}/sys/rump/librump/rumpkern" \ + || bomb "cd to rumpkern failed" + md_quirks=`${runcmd} "${makewrapper}" -V '${_SYMQUIRK}'` + # one little, two little, three little backslashes ... + md_quirks="$(echo ${md_quirks} | sed 's,\\,\\\\,g'";s/'//g" )" + ${runcmd} cd "${TOP}" || bomb "cd to ${TOP} failed" + tool_ld=`${runcmd} "${makewrapper}" -V '${LD}'` + + local oIFS="${IFS}" + IFS="," + for set in ${RUMP_LIBSETS} ; do + IFS="${oIFS}" + ${runcmd} ${tool_ld} -nostdlib -L${DESTDIR}/usr/lib \ + -static --whole-archive ${set} 2>&1 -o /tmp/rumptest.$$ | \ + awk -v quirks="${md_quirks}" ' + /undefined reference/ && + !/more undefined references.*follow/{ + if (match($NF, + "`(rumpuser_|__" quirks ")") == 0) + fails[NR] = $0 + } + /cannot find -l/{fails[NR] = $0} + /cannot open output file/{fails[NR] = $0} + END{ + for (x in fails) + print fails[x] + exit x!=0 + }' + [ $? -ne 0 ] && bomb "Testlink of rump failed: ${set}" + done + statusmsg "Rump build&link tests successful" +} + +main() +{ + initdefaults + _args=$@ + parseoptions "$@" + + sanitycheck + + build_start=$(date) + statusmsg2 "${progname} command:" "$0 $*" + statusmsg2 "${progname} started:" "${build_start}" + statusmsg2 "MINIX version:" "${DISTRIBVER}" + statusmsg2 "MACHINE:" "${MACHINE}" + statusmsg2 "MACHINE_ARCH:" "${MACHINE_ARCH}" + statusmsg2 "Build platform:" "${uname_s} ${uname_r} ${uname_m}" + statusmsg2 "HOST_SH:" "${HOST_SH}" + + rebuildmake + validatemakeparams + createmakewrapper + + # Perform the operations. + # + for op in ${operations}; do + case "${op}" in + + makewrapper) + # no-op + ;; + + tools) + buildtools + ;; + + sets) + statusmsg "Building sets from pre-populated ${DESTDIR}" + ${runcmd} "${makewrapper}" ${parallel} ${op} || + bomb "Failed to make ${op}" + setdir=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets + statusmsg "Built sets to ${setdir}" + ;; + + cleandir|obj|build|distribution|release|sourcesets|syspkgs|params) + ${runcmd} "${makewrapper}" ${parallel} ${op} || + bomb "Failed to make ${op}" + statusmsg "Successful make ${op}" + ;; + + iso-image|iso-image-source) + ${runcmd} "${makewrapper}" ${parallel} \ + CDEXTRA="$CDEXTRA" ${op} || + bomb "Failed to make ${op}" + statusmsg "Successful make ${op}" + ;; + + live-image|install-image) + # install-image and live-image require mtree spec files + # built with UNPRIVED. Assume UNPRIVED build has been + # performed if METALOG file is created in DESTDIR. + if [ ! -e "${DESTDIR}/METALOG" ] ; then + bomb "The release binaries must have been built with -U to create images." + fi + ${runcmd} "${makewrapper}" ${parallel} ${op} || + bomb "Failed to make ${op}" + statusmsg "Successful make ${op}" + ;; + kernel=*) + arg=${op#*=} + buildkernel "${arg}" + ;; + + releasekernel=*) + arg=${op#*=} + releasekernel "${arg}" + ;; + + modules) + buildmodules + ;; + + installmodules=*) + arg=${op#*=} + if [ "${arg}" = "/" ] && \ + ( [ "${uname_s}" != "NetBSD" ] || \ + [ "${uname_m}" != "${MACHINE}" ] ); then + bomb "'${op}' must != / for cross builds." + fi + installmodules "${arg}" + ;; + + install=*) + arg=${op#*=} + if [ "${arg}" = "/" ] && \ + ( [ "${uname_s}" != "NetBSD" ] || \ + [ "${uname_m}" != "${MACHINE}" ] ); then + bomb "'${op}' must != / for cross builds." + fi + installworld "${arg}" + ;; + + rump|rumptest) + dorump "${op}" + ;; + + *) + bomb "Unknown operation \`${op}'" + ;; + + esac + done + + statusmsg2 "${progname} ended:" "$(date)" + if [ -s "${results}" ]; then + echo "===> Summary of results:" + sed -e 's/^===>//;s/^/ /' "${results}" + echo "===> ." + fi +} + +main "$@" diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 000000000..a2c7d6466 --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,110 @@ +# $NetBSD: Makefile,v 1.155 2011/11/03 07:42:56 joerg Exp $ + +.include + +HAVE_GCC= 45 + +# Dependencies in SUBDIR below ordered to maximize parallel ability. +SUBDIR= host-mkdep .WAIT compat .WAIT \ + binstall .WAIT mktemp .WAIT sed .WAIT \ + genassym \ + makewhatis mkdep \ + m4 \ + .WAIT yacc \ + .WAIT awk \ + .WAIT tic \ + .WAIT lex \ + .WAIT gmake .WAIT binutils .WAIT gcc \ + cat pwd_mkdb stat zic \ + + + +.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" # { +realall realdepend install: check_MKTOOLS + +.for dir in ${SUBDIR:N.WAIT} +all-${dir} depend-${dir} dependall-${dir} install-${dir}: + @true +.endfor +.endif # } + +.include +.include + +.if !defined(PREVIOUSTOOLDIR) +. if exists(PREVIOUSTOOLDIR) +PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR +. else +PREVIOUSTOOLDIR= +. endif +.endif + +CLEANFILES+= PREVIOUSTOOLDIR + +realall realdepend: .MAKE +.if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}" + @echo "*** WARNING: TOOLDIR has moved?" + @echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'" + @echo "*** != TOOLDIR '${TOOLDIR}'" + @echo "*** Cleaning mis-matched tools" + rm -f PREVIOUSTOOLDIR + (cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir) +.endif + echo ${TOOLDIR} >PREVIOUSTOOLDIR + +# For each .WAIT point, make sure the immediately preceding target is +# installed before building anything after that point. +# (dsl: which means that with: 'a b .WAIT c' the build of 'c' waits for the +# install of 'b', but not the install of 'a'.) +# +# We use the "internal" targets and dependencies generated by +# to achieve this. These targets look like: +# subdir-all: all-dir1 [.WAIT] all-dir2 etc.. +# subdir-install: install-dir1 [.WAIT] install-dir2 etc.. +# and so on for each element in ${TARGETS}, with .WAIT sources inserted at +# places corresponding to the .WAITs in our $SUBDIR variable. +# +# Also, since we're now mixing `install' with `all' and `depend' targets +# an order relationship between those in each individual subdirectory +# must be established. +# +_deps:= +_prev:= + +.for d in ${SUBDIR} # { +_this:= ${d} + +.if ${_this} == ".WAIT" # { + +# setup dependency to apply to all/depend targets in the next group +_deps:= ${_deps} ${_prev:S/^/install-/} + +# if we're building *only* individual targets (i.e. "dependall-yacc"), +# make sure prerequisite tools build before installing +# XXX: dsl: this is likely to generate a dependency loop since there is +# a .ORDER releation between the nodes as well. +.if !make(all) && !make(dependall) && !make(install) +install-${_prev}: dependall-${_prev} +.endif + +.else # ${_this} != ".WAIT" # } { + +# order depend/all/install targets for ${d} subdir. +.ORDER: depend-${d} all-${d} dependall-${d} install-${d} + +# prevent cleandir in real{all,depend} from interfering with subdir makes +.ORDER: realdepend dependall-${d} +.ORDER: realdepend depend-${d} +.ORDER: realall all-${d} + +# make all/depend-${d} dependent on list of install targets +depend-${d} all-${d} dependall-${d}: ${_deps} + +.endif # ${_this} != ".WAIT" # } + +# stash current name in case the next entry is .WAIT +_prev:= ${d} +.endfor # } + +cleandir: + rm -f ${CLEANFILES} diff --git a/tools/Makefile.gmakehost b/tools/Makefile.gmakehost new file mode 100644 index 000000000..ba979d8c8 --- /dev/null +++ b/tools/Makefile.gmakehost @@ -0,0 +1,21 @@ +# $NetBSD: Makefile.gmakehost,v 1.7 2012/01/20 23:01:05 christos Exp $ +# +# Rules used when building a GNU host package. Expects MODULE to be set. +# This version runs ${TOOL_GMAKE} instead of ${MAKE} +# +# There's not a lot we can do to build reliably in the face of many +# available configuration options. To be as low-overhead as possible, +# we follow the following scheme: +# +# * Configuration is only re-run when an autoconf source file (such as +# "configure" or "config.sub") is changed. +# +# * "config.status" is run to rebuild Makefiles and .h files if an +# autoconf-parsed file (such as Makefile.in) is changed. +# +# * If MKUPDATE != "no", "make install" is only run if a build has happened +# since the last install in the current directory. + +.include +MAKE_PROGRAM=${TOOL_GMAKE} +.include "Makefile.gnuhost" diff --git a/tools/Makefile.gnuhost b/tools/Makefile.gnuhost new file mode 100644 index 000000000..b1598cc40 --- /dev/null +++ b/tools/Makefile.gnuhost @@ -0,0 +1,144 @@ +# $NetBSD: Makefile.gnuhost,v 1.37 2012/01/21 22:31:15 christos Exp $ +# +# Rules used when building a GNU host package. Expects MODULE to be set. +# +# There's not a lot we can do to build reliably in the face of many +# available configuration options. To be as low-overhead as possible, +# we follow the following scheme: +# +# * Configuration is only re-run when an autoconf source file (such as +# "configure" or "config.sub") is changed. +# +# * "config.status" is run to rebuild Makefiles and .h files if an +# autoconf-parsed file (such as Makefile.in) is changed. +# +# * If MKUPDATE != "no", "make install" is only run if a build has happened +# since the last install in the current directory. + +.include + +# Disable use of pre-compiled headers on Darwin. +BUILD_OSTYPE!= uname -s +.if ${BUILD_OSTYPE} == "Darwin" +HOST_CFLAGS+=-O2 -no-cpp-precomp +.endif +MAKE_PROGRAM?= ${MAKE} + +GNUHOSTDIST?= ${.CURDIR}/../../external/gpl3/gcc/dist/ + +FIND_ARGS+= \! \( -type d \( \ + -name 'CVS' -o \ + -name 'config' -o \ + -name 'doc' -o \ + -name 'po' -o \ + -name 'nbsd.mt' -o \ + -name 'tests*' \ + \) -prune \) + + +_GNU_GET_SRC!= ${HOST_SH} ${.CURDIR}/../../external/gpl3/gcc/fetch.sh && \ + ${HOST_SH} ${.CURDIR}/../../external/gpl3/binutils/fetch.sh && \ + ${HOST_SH} ${.CURDIR}/../../gnu/dist/fetch.sh + +# Do this "find" only if actually building something. +.if (${USETOOLS} == "yes") && empty(.MAKEFLAGS:M-V*) && \ + (make(all) || make(realall) || (!make(clean) && !make(cleandir) && !make(obj))) && \ + !defined(_GNU_CFGSRC) + +_GNU_CFGSRC!= find ${GNUHOSTDIST} ${FIND_ARGS} \ + -type f \( -name 'config*' -o -name '*.in' \) -print +.MAKEOVERRIDES+= _GNU_CFGSRC +.endif + +CONFIGURE_ENV+= \ + AR=${HOST_AR:Q} \ + AWK=${TOOL_AWK:Q} \ + CC=${HOST_CC:Q} \ + CFLAGS=${HOST_CFLAGS:Q} \ + CPPFLAGS=${HOST_CPPFLAGS:Q} \ + CXX=${HOST_CXX:Q} \ + CXXFLAGS=${HOST_CXXFLAGS:Q} \ + INSTALL=${HOST_INSTALL_FILE:Q} \ + LDFLAGS=${HOST_LDFLAGS:Q} \ + LEX=${LEX:Q} \ + M4=${TOOL_M4:Q} \ + MAKE=${MAKE_PROGRAM:Q} \ + PATH="${TOOLDIR}/bin:$$PATH" \ + RANLIB=${HOST_RANLIB:Q} \ + YACC=${YACC:Q} + +BUILD_ENV+= ${CONFIGURE_ENV} + +CONFIGURE_ARGS+=--prefix=${TOOLDIR} +.if ${MKPIC} == "no" +CONFIGURE_ARGS+=--disable-shared +.endif + +.if ${MAKE_PROGRAM} == ${MAKE} +.ifndef _NOWRAPPER +# Some systems have a small ARG_MAX. On such systems, prevent Make +# variables set on the command line from being exported in the +# environment (they will still be set in MAKEOVERRIDES). +.if ${BUILD_OSTYPE} == "Darwin" || ${BUILD_OSTYPE} == "FreeBSD" +__noenvexport= -X +.endif +MAKE_ARGS:= ${__noenvexport} -f ${.PARSEDIR}/Makefile.gnuwrap ${MAKE_ARGS} +.else +MAKE_ARGS+= _NOWRAPPER=1 +.endif +BUILD_COMMAND= ${BUILD_ENV} ${MAKE} ${MAKE_ARGS} +.else + +# gmake version of this puts MAKE_ARGS in the environment to be sure that +# sub-gmake's get them, otherwise tools/gcc tries to build libgcc and +# fails. it also uses "env -i" to entirely clear out MAKEFLAGS. +GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/.*(-j ?[0-9]*).*/\1/W} +BUILD_COMMAND= /usr/bin/env -i ${BUILD_ENV} ${MAKE_ARGS} ${TOOL_GMAKE} ${GMAKE_J_ARGS} -e ${MAKE_ARGS} + +.endif + +MAKE_ARGS+= BISON=true DESTDIR= INSTALL=${HOST_INSTALL_FILE:Q} + +ALL_TARGET?= all +INSTALL_TARGET?=install + +BUILD_PLATFORM!= uname -srm | tr ' ' '-' +CONFIGURE_PLATFORM!= if [ -s .configure_done ]; then cat .configure_done; else echo none; fi +.if "${BUILD_PLATFORM}" != "${CONFIGURE_PLATFORM}" +configure_cleanup: + @mkdir build 2>/dev/null || true + @(echo "Cleaning stale cache files ${BUILD_PLATFORM} != ${CONFIGURE_PLATFORM}") + @(cd build && find . -name config.cache -print0 | xargs -0 rm -f) +configure_cleanup=configure_cleanup +.endif + +.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup} + @mkdir build 2>/dev/null || true + @(cd build && ${CONFIGURE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure ${CONFIGURE_ARGS}) + @echo ${BUILD_PLATFORM} > $@ + +# The .build_done timestamp is only updated if a file actually changes +# in the build tree during "make all". This way, if nothing has changed, +# a "make install MKUPDATE=yes" will do nothing. + +.build_done: .configure_done + @(cd build && ${BUILD_COMMAND} ${ALL_TARGET}) + @if [ ! -f $@ ] || [ -n "$$(find build -type f -newer .build_done -print)" ]; \ + then touch $@; fi + +.install_done! ${BUILD:D.build_done} + @(cd ${.OBJDIR}/build && ${BUILD_COMMAND} ${INSTALL_TARGET}) + @touch $@ + +# Mapping to standard targets. + +.if ${USETOOLS} == "yes" +realall: .build_done +realinstall: .install_done +.endif + +clean: clean.gnu +clean.gnu: + -rm -r -f .*_done build + +.include diff --git a/tools/Makefile.gnuwrap b/tools/Makefile.gnuwrap new file mode 100644 index 000000000..565a75abb --- /dev/null +++ b/tools/Makefile.gnuwrap @@ -0,0 +1,33 @@ +# $NetBSD: Makefile.gnuwrap,v 1.9 2003/03/14 05:22:51 thorpej Exp $ +# +# Wrapper for GNU Makefiles. + +.ifndef _WRAPPER_INCLUDED +_WRAPPER_INCLUDED=1 + +.ifndef _NOWRAPPER +.include "${.CURDIR}/Makefile" +.endif + +# Prevent targets in source directories from being rebuilt. + +_srcdir:= ${srcdir} +.MADE: ${.ALLTARGETS:M${_srcdir}/*} Makefile + +# Don't rebuild .gmo files, or lex/yacc (which GNU puts in the source tree). +.po.gmo .l.c .y.c .y.h .x.1: + @true + +# Make sure this file gets re-loaded recursively. +.ifndef _NOWRAPPER +# Some systems have a small ARG_MAX. On such systems, prevent Make +# variables set on the command line from being exported in the +# environment (they will still be set in MAKEOVERRIDES). +BUILD_OSTYPE!= uname -s +.if ${BUILD_OSTYPE} == "Darwin" || ${BUILD_OSTYPE} == "FreeBSD" +__noenvexport= -X +.endif +_GNUWRAPPER:= ${.PARSEDIR}/${.PARSEFILE} +MAKE:= ${MAKE} ${__noenvexport} -f ${_GNUWRAPPER} +.endif +.endif diff --git a/tools/Makefile.host b/tools/Makefile.host new file mode 100644 index 000000000..9d90dc222 --- /dev/null +++ b/tools/Makefile.host @@ -0,0 +1,78 @@ +# $NetBSD: Makefile.host,v 1.28 2011/04/10 16:52:36 joerg Exp $ + +NOINFO= # defined +NOLINT= # defined +NOMAN= # defined + +.include + +.ifndef NOCOMPATLIB +COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR} +.-include "${COMPATOBJ}/defs.mk" +.endif + +# Resolve pathnames in variables. +_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD +.for var in ${_RESOLVE_VARS} +${var}:= ${${var}} +.endfor + +# Switch over to the "real" Makefile. +.PROGDIR:= ${.CURDIR}/../../${HOST_SRCDIR} +_CURDIR:= ${.CURDIR} +HOSTPROG?= ${PROG} + +.CURDIR:= ${.PROGDIR} +.PATH: ${.CURDIR} +.include "${.CURDIR}/Makefile" +.-include "${.CURDIR}/../Makefile.inc" + +# Resolve pathnames from "real" Makefile, and switch .CURDIR back. +.for var in ${_RESOLVE_VARS} +${var}:= ${${var}} +.endfor +.CURDIR:= ${_CURDIR} +.undef _CURDIR + +# Set up the environment for . +.if ${USETOOLS} != "yes" +.undef HOSTPROG +.endif + +HOSTPROGNAME?= ${HOSTPROG} +HOST_BINDIR?= ${TOOLDIR}/bin +HOST_CPPFLAGS:= ${HOST_CPPFLAGS} ${CPPFLAGS} +HOST_CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*} +.undef LINKS + +SRCS?= ${HOSTPROG}.c +SRCS+= ${HOST_SRCS} + +.PATH: ${.PROGDIR} + +# Install rule. +realinstall: install.host install.files +install.host: ${HOST_BINDIR}/${HOSTPROGNAME} +${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG} + ${_MKTARGET_INSTALL} + mkdir -p ${HOST_BINDIR} + ${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET} + +.if ${MKUPDATE} == "no" +.PHONY: ${HOST_BINDIR}/${HOSTPROGNAME} +.endif + +install.files: +.for F in ${HOSTFILES} +install.files: ${HOST_FILESDIR}/${F} +${HOST_FILESDIR}/${F}: ${F} + ${_MKTARGET_INSTALL} + mkdir -p ${HOST_FILESDIR} + ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET} + +.if ${MKUPDATE} == "no" +.PHONY: ${HOST_FILESDIR}/${F} +.endif +.endfor + +.include diff --git a/tools/awk/Makefile b/tools/awk/Makefile new file mode 100644 index 000000000..75e2d92a1 --- /dev/null +++ b/tools/awk/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.3 2010/12/12 04:06:19 christos Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}awk +HOST_SRCDIR= external/historical/nawk/bin +HOST_CPPFLAGS+= -D__EXTENSIONS__ # for isblank + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/binstall/Makefile b/tools/binstall/Makefile new file mode 100644 index 000000000..de056717d --- /dev/null +++ b/tools/binstall/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.7 2007/07/03 16:29:24 joerg Exp $ + +HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-install +HOST_SRCDIR= usr.bin/xinstall +CPPFLAGS+= -I${.CURDIR}/../compat/sys +CPPFLAGS+= -DTARGET_STRIP=\"${STRIP}\" + +.include "${.CURDIR}/../Makefile.host" + +INSTALL= ./xinstall diff --git a/tools/binutils/Makefile b/tools/binutils/Makefile new file mode 100644 index 000000000..3b204b566 --- /dev/null +++ b/tools/binutils/Makefile @@ -0,0 +1,74 @@ +# $NetBSD: Makefile,v 1.22 2012/04/15 08:37:32 mrg Exp $ + +.include + +MODULE= binutils + +GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/binutils/dist + +BRANDING?= \ + --with-pkgversion="NetBSD Binutils nb1" \ + --with-bugurl="http://www.NetBSD.org/support/send-pr.html" \ + --with-lib-path="=/usr/lib" --with-sysroot + +CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \ + --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \ + --disable-werror \ + --target=i386-elf-minix \ + ${BRANDING} + +MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} + +ALL_TARGET= all-binutils all-gas all-ld +INSTALL_TARGET= install-binutils install-gas install-ld +.if ${MKCROSSGPROF:Uno} != "no" +ALL_TARGET+= all-gprof +INSTALL_TARGET+=install-gprof +.endif + +.include "${.CURDIR}/../Makefile.gnuhost" + +CCADDFLAGS= -I${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ + +# Force avoiding possibly non-executable install-sh. +CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d" + +NEWCONFIGDIR?= ${.CURDIR}/../.. +MKNATIVE?= ${.CURDIR}/mknative-binutils + +native-binutils: .native/.configure_done + @echo 'Extracting GNU binutils configury for a native toolchain.' + MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} binutils \ + ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} + +.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile + mkdir .native 2>/dev/null || true + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native && ${CONFIGURE_ENV:NC*:NLD*} \ + CC_FOR_BUILD=${HOST_CC:Q} \ + CC=${CC:Q}' '${CCADDFLAGS:Q} \ + CXX=${CXX:Q}' '${CCADDFLAGS:Q} \ + CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \ + CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \ + MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \ + XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \ + LIBS=-lintl \ + ac_cv_prog_cc_cross=yes \ + ac_cv_func_strcoll_works=yes \ + ${HOST_SH} ${GNUHOSTDIST}/configure \ + --build=`${GNUHOSTDIST}/config.guess` \ + --host=${MACHINE_GNU_PLATFORM} \ + --target=${MACHINE_GNU_PLATFORM} \ + ${BRANDING} \ + ) + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native && ${MAKE} configure-host) + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native/bfd && ${MAKE} bfd.h bfdver.h) + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native/ld && ${MAKE} ldemul-list.h) + @touch $@ + +clean: clean.native +clean.native: + -rm -r -f .native diff --git a/tools/binutils/mknative-binutils b/tools/binutils/mknative-binutils new file mode 100755 index 000000000..32f101595 --- /dev/null +++ b/tools/binutils/mknative-binutils @@ -0,0 +1,144 @@ +#!/bin/sh +# $NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp $ +# +# Shell script for generating all the constants needed for a native +# platform build of src/external/gpl3/binutils +# + +# initialise + +_TMPDIR=$2 +_TOP=$3 +_PLATFORM=$4 +_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'` + +. $_TOP/tools/gcc/mknative.common + +##### external/gpl3/binutils/lib/libbfd ##### + +get_libbfd () { + mkdir -p $_TOP/external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH + + { + getvars bfd/Makefile \ + libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \ + INCLUDES TDEFAULTS + } | write_mk external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/defs.mk + + write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/bfd.h <$_TMPDIR/bfd/bfd.h + write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/bfdver.h <$_TMPDIR/bfd/bfdver.h + write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/bfd_stdint.h <$_TMPDIR/bfd/bfd_stdint.h + + { + cat $_TMPDIR/bfd/config.h + } | write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/config.h +} + +##### external/gpl3/binutils/lib/libopcodes ##### + +get_libopcodes () { + mkdir -p $_TOP/external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH + + { + getvars opcodes/Makefile \ + archdefs BFD_MACHINES libopcodes_la_SOURCES + } | write_mk external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH/defs.mk + + { + cat $_TMPDIR/opcodes/config.h + } | write_c external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH/config.h +} + +##### external/gpl3/binutils/lib/libiberty ##### + +get_libiberty () { + mkdir -p $_TOP/external/gpl3/binutils/lib/libiberty/arch/$MACHINE_ARCH + + getvars libiberty/Makefile \ + ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \ + | write_mk external/gpl3/binutils/lib/libiberty/arch/$MACHINE_ARCH/defs.mk + + write_c external/gpl3/binutils/lib/libiberty/arch/$MACHINE_ARCH/config.h \ + <$_TMPDIR/libiberty/config.h +} + +##### external/gpl3/binutils/usr.bin ##### + +get_binutils () { + ### common + + mkdir -p $_TOP/external/gpl3/binutils/usr.bin/common/arch/$MACHINE_ARCH + + { + getvars binutils/Makefile \ + VERSION DEFS INCLUDES PROGRAMS + getvars binutils/doc/Makefile \ + man_MANS TEXINFOS + getvars bfd/doc/Makefile \ + PKGVERSION | sed 's,\\\(.\),\1,' + getvars bfd/doc/Makefile \ + REPORT_BUGS_TEXI + + for f in `getvars binutils/Makefile PROGRAMS | sed 'y,-,_,;s,^[^=]*=,,'`; do + getvars binutils/Makefile ${f}_OBJECTS ${f}_DEPENDENCIES + done + } | write_mk external/gpl3/binutils/usr.bin/common/arch/$MACHINE_ARCH/defs.mk + + write_c external/gpl3/binutils/usr.bin/common/arch/$MACHINE_ARCH/config.h \ + <$_TMPDIR/binutils/config.h + + ### gas + + mkdir -p $_TOP/external/gpl3/binutils/usr.bin/gas/arch/$MACHINE_ARCH + + grep -v DEPDIR "$_TMPDIR/gas/Makefile" > "$_TMPDIR/gas/Makefile.nodeps" + getvars gas/Makefile.nodeps \ + DEFS INCLUDES as_new_OBJECTS as_new_LDADD | + sed -e s/G_as_new_OBJECTS/G_OBJS/ \ + -e s/G_as_new_LDADD=/G_OBJS+=/ \ + -e 's/\.\..*a//' | + write_mk external/gpl3/binutils/usr.bin/gas/arch/$MACHINE_ARCH/defs.mk + + for f in config itbl-cpu obj-format targ-cpu targ-env; do + write_c external/gpl3/binutils/usr.bin/gas/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gas/$f.h + done + + ### gprof + + mkdir -p $_TOP/external/gpl3/binutils/usr.bin/gprof/arch/$MACHINE_ARCH + + getvars gprof/Makefile \ + DEFS gprof_OBJECTS INCLUDES TEXINFOS \ + | write_mk external/gpl3/binutils/usr.bin/gprof/arch/$MACHINE_ARCH/defs.mk + + write_c external/gpl3/binutils/usr.bin/gprof/arch/$MACHINE_ARCH/gconfig.h <$_TMPDIR/gprof/gconfig.h + + ### ld + + mkdir -p $_TOP/external/gpl3/binutils/usr.bin/ld/arch/$MACHINE_ARCH + + { + getvars ld/Makefile \ + DEFS EMUL EMULATION_OFILES INCLUDES OFILES STRINGIFY TEXINFOS + getvars ld/Makefile \ + target_alias | sed 's,[\._0-9A-Z]*$,,' + } | write_mk external/gpl3/binutils/usr.bin/ld/arch/$MACHINE_ARCH/defs.mk + + for f in config ldemul-list; do + write_c external/gpl3/binutils/usr.bin/ld/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/ld/$f.h + done +} + +##### main ##### + +case $1 in +all|binutils) # everything (uses "canadian cross" temp environment) + get_binutils + get_libbfd + get_libopcodes + get_libiberty + exit 0 + ;; + +*) echo invalid arguments; exit 1;; +esac diff --git a/tools/binutils/patches/patch-aa b/tools/binutils/patches/patch-aa new file mode 100644 index 000000000..fe1696f16 --- /dev/null +++ b/tools/binutils/patches/patch-aa @@ -0,0 +1,13 @@ +$NetBSD: patch-aa,v 1.3 2006/01/07 23:59:46 wiz Exp $ + +--- configure.orig Thu Apr 6 21:49:25 2006 ++++ configure +@@ -899,7 +899,7 @@ host_libs="intl mmalloc libiberty opcodes bfd readline + # know that we are building the simulator. + # binutils, gas and ld appear in that order because it makes sense to run + # "make check" in that particular order. +-host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools" ++host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools" + + # libgcj represents the runtime libraries only used by gcj. + libgcj="target-libffi \ diff --git a/tools/binutils/patches/patch-ab b/tools/binutils/patches/patch-ab new file mode 100644 index 000000000..09f8b4f81 --- /dev/null +++ b/tools/binutils/patches/patch-ab @@ -0,0 +1,34 @@ +$NetBSD: patch-ab,v 1.1 2006/02/26 23:59:41 joerg Exp $ + +--- bfd/configure.orig Fri Jun 23 18:17:03 2006 ++++ bfd/configure +@@ -11499,7 +11499,7 @@ if test "${target}" = "${host}"; then + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386bsd.h"' + ;; +- i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) ++ i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*) + COREFILE='' + TRAD_HEADER='"hosts/i386bsd.h"' + ;; +@@ -13097,6 +13097,7 @@ do + bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; + bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;; ++ bfd_elf32_i386_dragonfly_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;; + bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;; + bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;; + bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; +@@ -13218,10 +13219,12 @@ do + i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;; + i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; + i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; ++ i386dragonfly_vec) tb="$tb i386freebsd.lo aout32.lo" ;; + i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;; + i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;; + i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;; + i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;; ++ bfd_elf32_i386_minix_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;; + i386msdos_vec) tb="$tb i386msdos.lo" ;; + i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; + i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; diff --git a/tools/binutils/patches/patch-ac b/tools/binutils/patches/patch-ac new file mode 100644 index 000000000..58eb69c63 --- /dev/null +++ b/tools/binutils/patches/patch-ac @@ -0,0 +1,23 @@ +$NetBSD: patch-ac,v 1.1 2006/02/26 23:59:41 joerg Exp $ + +--- bfd/config.bfd.orig Wed Apr 5 12:41:57 2006 ++++ bfd/config.bfd +@@ -503,7 +503,7 @@ case "${targ}" in + targ_selvecs=i386bsd_vec + targ_underscore=yes + ;; +- i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) ++ i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*) + targ_defvec=bfd_elf32_i386_freebsd_vec + targ_selvecs=i386coff_vec + # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. +@@ -611,6 +611,9 @@ case "${targ}" in + ;; + i[3-7]86-none-*) + targ_defvec=i386coff_vec ++ ;; ++ i[3-7]86-*-minix) ++ targ_defvec=bfd_elf32_i386_minix_vec + ;; + i[3-7]86-*-aout* | i[3-7]86*-*-vsta*) + targ_defvec=i386aout_vec diff --git a/tools/binutils/patches/patch-ad b/tools/binutils/patches/patch-ad new file mode 100644 index 000000000..9308a2df3 --- /dev/null +++ b/tools/binutils/patches/patch-ad @@ -0,0 +1,29 @@ +$NetBSD: patch-ad,v 1.1 2006/02/26 23:59:41 joerg Exp $ + +--- gas/configure.tgt.orig Wed Apr 5 12:41:57 2006 ++++ gas/configure.tgt +@@ -191,7 +191,7 @@ case ${generic_target} in + i386-*-freebsdaout*) fmt=aout em=386bsd ;; + i386-*-freebsd[12].*) fmt=aout em=386bsd ;; + i386-*-freebsd[12]) fmt=aout em=386bsd ;; +- i386-*-freebsd* | i386-*-kfreebsd*-gnu) ++ i386-*-freebsd* | i386-*-kfreebsd*-gnu | i386-*-dragonfly*) + fmt=elf em=freebsd ;; + i386-*-sysv*) fmt=coff ;; + i386-*-sco3.2v5*coff) fmt=coff ;; +@@ -213,6 +213,7 @@ case ${generic_target} in + i386-*-nto-qnx*) fmt=elf ;; + i386-*-*nt*) fmt=coff em=pe ;; + i386-*-chaos) fmt=elf ;; ++ i386-*-minix*) fmt=elf em=minix ;; + i386-*-rdos*) fmt=elf ;; + + i860-*-*) fmt=elf endian=little ;; +@@ -382,6 +384,7 @@ case ${generic_target} in + + *-*-aout | *-*-scout) fmt=aout ;; + *-*-freebsd* | *-*-kfreebsd*-gnu) fmt=elf em=freebsd ;; ++ *-*-dragonfly*) fmt=elf em=freebsd ;; + *-*-bsd*) fmt=aout em=sun3 ;; + *-*-generic) fmt=generic ;; + *-*-xray | *-*-hms) fmt=coff ;; diff --git a/tools/binutils/patches/patch-ae b/tools/binutils/patches/patch-ae new file mode 100644 index 000000000..85cbeabe2 --- /dev/null +++ b/tools/binutils/patches/patch-ae @@ -0,0 +1,33 @@ +$NetBSD: patch-ae,v 1.1 2006/02/26 23:59:41 joerg Exp $ + +--- ld/configure.tgt.orig Wed Apr 5 12:41:57 2006 ++++ ld/configure.tgt +@@ -145,6 +145,8 @@ i[3-7]86-*-bsd) targ_emul=i386bsd ;; + i[3-7]86-*-bsd386) targ_emul=i386bsd ;; + i[3-7]86-*-bsdi*) targ_emul=i386bsd ;; + i[3-7]86-*-aout) targ_emul=i386aout ;; ++i[3-7]86-*-minix) targ_emul=elf_i386_minix ++ targ_extra_emuls="elf_i386" ;; + i[3-7]86-*-linux*aout*) targ_emul=i386linux + targ_extra_emuls=elf_i386 + tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;; +@@ -194,7 +197,7 @@ x86_64-*-elf*) targ_emul=elf_x86_64 + i[3-7]86-*-kaos*) targ_emul=elf_i386 ;; + i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12]) + targ_emul=i386bsd ;; +-i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) ++i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*) + targ_emul=elf_i386_fbsd + targ_extra_emuls="elf_i386 i386bsd" ;; + x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) +@@ -583,6 +586,10 @@ case "${target}" in + + *-*-freebsd*) + NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib' ++ ;; ++ ++*-*-dragonfly*) ++ NATIVE_LIB_DIRS='/lib /usr/lib' + ;; + + hppa*64*-*-hpux11*) diff --git a/tools/binutils/patches/patch-af b/tools/binutils/patches/patch-af new file mode 100644 index 000000000..4868798d2 --- /dev/null +++ b/tools/binutils/patches/patch-af @@ -0,0 +1,94 @@ +$NetBSD: patch-af,v 1.1 2007/08/14 09:08:07 rillig Exp $ + +--- gas/read.c.orig 2005-11-17 07:29:28.000000000 +0000 ++++ gas/read.c +@@ -1279,7 +1279,7 @@ s_align (int arg, int bytes_p) + unsigned int align_limit = ALIGN_LIMIT; + unsigned int align; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + offsetT fill = 0; + int max; + int fill_p; +@@ -1423,7 +1423,7 @@ s_comm_internal (int param, + offsetT temp, size; + symbolS *symbolP = NULL; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; /* XXX: gcc -Wuninitialized */ + expressionS exp; + + if (flag_mri) +@@ -1538,7 +1538,7 @@ s_mri_common (int small ATTRIBUTE_UNUSED + symbolS *sym; + offsetT align; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + + if (!flag_mri) + { +@@ -1807,7 +1807,7 @@ s_fail (int ignore ATTRIBUTE_UNUSED) + { + offsetT temp; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + + if (flag_mri) + stop = mri_comment_field (&stopc); +@@ -1929,7 +1929,7 @@ s_globl (int ignore ATTRIBUTE_UNUSED) + int c; + symbolS *symbolP; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + + if (flag_mri) + stop = mri_comment_field (&stopc); +@@ -2881,7 +2881,7 @@ s_space (int mult) + expressionS val; + char *p = 0; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + int bytes; + + #ifdef md_flush_pending_output +@@ -3057,7 +3057,7 @@ s_float_space (int float_type) + int flen; + char temp[MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT]; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + + if (flag_mri) + stop = mri_comment_field (&stopc); +@@ -3134,7 +3134,7 @@ void + s_struct (int ignore ATTRIBUTE_UNUSED) + { + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + + if (flag_mri) + stop = mri_comment_field (&stopc); +@@ -3514,7 +3514,7 @@ cons_worker (register int nbytes, /* 1=. + int c; + expressionS exp; + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + + #ifdef md_flush_pending_output + md_flush_pending_output (); +@@ -5010,7 +5010,7 @@ void + equals (char *sym_name, int reassign) + { + char *stop = NULL; +- char stopc; ++ char stopc = '\0'; + + input_line_pointer++; + if (*input_line_pointer == '=') diff --git a/tools/binutils/patches/patch-ag b/tools/binutils/patches/patch-ag new file mode 100644 index 000000000..343e78a71 --- /dev/null +++ b/tools/binutils/patches/patch-ag @@ -0,0 +1,21 @@ +$NetBSD$ + +--- bfd/aoutx.h.orig Thu Mar 16 12:20:15 2006 ++++ bfd/aoutx.h +@@ -383,6 +383,7 @@ DESCRIPTION + Swap the information in an internal exec header structure + @var{execp} into the buffer @var{raw_bytes} ready for writing to disk. + */ ++#ifndef NAME_swap_exec_header_out + void + NAME (aout, swap_exec_header_out) (bfd *abfd, + struct internal_exec *execp, +@@ -398,6 +399,8 @@ NAME (aout, swap_exec_header_out) (bfd *abfd, + PUT_WORD (abfd, execp->a_trsize, bytes->e_trsize); + PUT_WORD (abfd, execp->a_drsize, bytes->e_drsize); + } ++#define NAME_swap_exec_header_out NAME(aout,swap_exec_header_out) ++#endif + + /* Make all the section for an a.out file. */ + diff --git a/tools/binutils/patches/patch-ah b/tools/binutils/patches/patch-ah new file mode 100644 index 000000000..97cbe043e --- /dev/null +++ b/tools/binutils/patches/patch-ah @@ -0,0 +1,28 @@ +$NetBSD$ + +--- bfd/elf32-i386.c.orig Sat Apr 8 22:57:22 2006 ++++ bfd/elf32-i386.c +@@ -3922,6 +3922,11 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, + #undef TARGET_LITTLE_NAME + #define TARGET_LITTLE_NAME "elf32-i386-freebsd" + ++#undef TARGET_LITTLE_SYM ++#define TARGET_LITTLE_SYM bfd_elf32_i386_minix_vec ++#undef TARGET_LITTLE_NAME ++#define TARGET_LITTLE_NAME "elf32-i386-minix" ++ + /* The kernel recognizes executables as valid only if they carry a + "FreeBSD" label in the ELF header. So we put this label on all + executables and (for simplicity) also all other object files. */ +@@ -3946,6 +3951,11 @@ elf_i386_post_process_headers (bfd *abfd, + #define elf_backend_post_process_headers elf_i386_post_process_headers + #undef elf32_bed + #define elf32_bed elf32_i386_fbsd_bed ++ ++#undef elf_backend_post_process_headers ++#define elf_backend_post_process_headers elf_i386_post_process_headers ++#undef elf32_bed ++#define elf32_bed elf32_i386_minix_bed + + #include "elf32-target.h" + diff --git a/tools/binutils/patches/patch-ai b/tools/binutils/patches/patch-ai new file mode 100644 index 000000000..a83d69804 --- /dev/null +++ b/tools/binutils/patches/patch-ai @@ -0,0 +1,330 @@ +$NetBSD$ + +--- bfd/i386minix.c.orig Sat Feb 26 00:58:30 2011 ++++ bfd/i386minix.c +@@ -0,0 +1,325 @@ ++/* BFD back-end for i386 minix a.out binaries. ++ Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003 ++ Free Software Foundation, Inc. ++ ++This file is part of BFD, the Binary File Descriptor library. ++ ++This program is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2 of the License, or ++(at your option) any later version. ++ ++This program is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with this program; if not, write to the Free Software ++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ++ ++/***************/ ++/* EXEC FORMAT */ ++/***************/ ++#include ++ ++#define external_exec exec ++#define EXEC_BYTES_SIZE sizeof( struct exec ) ++ ++#define OMAGIC 0407 /* Object file or impure executable. */ ++#define NMAGIC 0410 /* Code indicating pure executable. */ ++#define ZMAGIC 0x0301 /* Code indicating demand-paged executable. */ ++#define BMAGIC 0415 /* Used by a b.out object. */ ++ ++#ifndef QMAGIC ++#define QMAGIC 0314 ++#endif ++# ifndef N_BADMAG ++# define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \ ++ && N_MAGIC(x) != NMAGIC \ ++ && N_MAGIC(x) != ZMAGIC \ ++ && N_MAGIC(x) != QMAGIC) ++# endif /* N_BADMAG */ ++ ++#define N_HEADER_IN_TEXT(x) 0 ++ ++#define N_TXTOFF(x) EXEC_BYTES_SIZE ++#define N_TXTADDR(x) 0 ++ ++#define N_TXTSIZE(x) ((x).a_text) ++#ifdef SUPPORT_SEP ++#define MINIX_IS_SEP(x) 0 /*-> gcv.c HCLICK STUFF*/ ++#define N_DATADDR(x) (MINIX_IS_SEP(x) ? align((x).a_text,HCLICK) : (x).a_text ) ++#else ++#define N_DATADDR(x) ((x).a_text) ++#endif ++ ++/* Are these values correct? */ ++#define TARGET_PAGE_SIZE 1 ++#define SEGMENT_SIZE 1 ++ ++#define DEFAULT_STACK 5 * 1024 * 1024 /* 5 MB stack */ ++ ++#define DEFAULT_ARCH bfd_arch_i386 ++ ++/* Do not "beautify" the CONCAT* macro args. Traditional C will not ++ remove whitespace added here, and thus will fail to concatenate ++ the tokens. */ ++#define MY(OP) CONCAT2 (i386minix_,OP) ++#define NAME(a,b) i386minix_32_##b ++#define TARGETNAME "a.out-i386-minix" ++#define NO_WRITE_HEADER_KLUDGE 1 ++ ++#define ARCH_SIZE 32 ++ ++#include "bfd.h" ++#include "sysdep.h" ++/*#include "libbfd.h"*/ ++#include "aout/aout64.h" ++#include "libaout.h" ++ ++ ++#define i386minix_32_get_section_contents _bfd_generic_get_section_contents ++ ++#define SET_ARCH_MACH(abfd, exec) \ ++ bfd_set_arch_mach(abfd, DEFAULT_ARCH, 0) ++ ++static bfd_boolean i386minix_write_object_contents PARAMS ((bfd *)); ++#define MY_write_object_contents i386minix_write_object_contents ++ ++static int MY(swap_exec_header_in) PARAMS ((bfd *, struct external_exec *, struct internal_exec *)); ++static void MY(swap_exec_header_out) PARAMS ((bfd *, struct internal_exec *, struct external_exec *)); ++ ++#define NAME_swap_exec_header_in MY(swap_exec_header_in) ++#define NAME_swap_exec_header_out MY(swap_exec_header_out) ++ ++#define MY_object_p MY(object_p) ++static const bfd_target * MY(object_p) (bfd *); ++ ++ ++static bfd_boolean MY (set_sizes) PARAMS ((bfd *)); ++ ++#define MY_backend_data &MY(backend_data) ++static const struct aout_backend_data MY(backend_data) = { ++ 0, /* zmagic contiguous */ ++ 1, /* text incl header */ ++ 0, /* entry is text address */ ++ 0, /* exec_hdr_flags */ ++ 0, /* text vma? */ ++ MY(set_sizes), ++ 1, /* exec header not counted */ ++ 0, /* add_dynamic_symbols */ ++ 0, /* add_one_symbol */ ++ 0, /* link_dynamic_object */ ++ 0, /* write_dynamic_symbol */ ++ 0, /* check_dynamic_reloc */ ++ 0 /* finish_dynamic_link */ ++}; ++ ++#include "aoutx.h" ++ ++#include "aout-target.h" ++ ++/****************/ ++/* WRITE HEADER */ ++/****************/ ++static void ++MY(swap_exec_header_out) (abfd, execp, bytes) ++ bfd *abfd; ++ struct internal_exec *execp; ++ struct external_exec *bytes; ++{ ++ int total; ++ int stack; ++ ++ /* Now fill in fields in the raw data, from the fields in the exec struct. */ ++ H_PUT_16 (abfd, N_MAGIC(*execp), bytes->a_magic); ++ ++ bytes->a_flags = 0; ++ if ( bytes->a_syms ) ++ bytes->a_flags |= A_NSYM; ++ ++ bytes->a_cpu = A_I80386; ++ ++ bytes->a_hdrlen = EXEC_BYTES_SIZE; ++ ++ bytes->a_unused = 0; ++ bytes->a_version = 0; ++ ++ PUT_WORD (abfd, execp->a_text , &bytes->a_text); ++ PUT_WORD (abfd, execp->a_data , &bytes->a_data); ++ PUT_WORD (abfd, execp->a_bss , &bytes->a_bss); ++ PUT_WORD (abfd, execp->a_entry , &bytes->a_entry); ++ ++ stack = DEFAULT_STACK; ++ total = execp->a_data + execp->a_bss + stack; ++#if 0 ++ if ( MINIX_IS_SEP( abfd ) ) ++ bytes->a_flags |= A_SEP; ++ else ++#endif ++ total += execp->a_text; ++ ++ PUT_WORD (abfd, total , &bytes->a_total); ++ PUT_WORD (abfd, execp->a_syms , &bytes->a_syms); ++ PUT_WORD (abfd, execp->a_trsize, &bytes->a_trsize); ++ PUT_WORD (abfd, execp->a_drsize, &bytes->a_drsize); ++ ++ bytes->a_tbase = bytes->a_dbase = 0; ++} ++ ++#define i386minix_32_swap_exec_header_out MY(swap_exec_header_out) ++/* WRITE_HEADERS calls NAME(aout,swap_exec_header_out) ++ which I need to overwrite. Unfortunately aoutx.h doesn't have a ++ NAME_swap_exec_header_out like it does for -_in. ++ So I have to redefine the outcome of NAME(aout,swap_exec_header_out) to ++ my own function before using WRITE_HEADERS */ ++ ++/* Set the machine type correctly. */ ++static bfd_boolean ++i386minix_write_object_contents (abfd) ++ bfd *abfd; ++{ ++ struct external_exec exec_bytes; ++ struct internal_exec *execp = exec_hdr (abfd); ++ ++ N_SET_MACHTYPE (*execp, M_386); ++ ++ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; ++ ++ WRITE_HEADERS (abfd, execp); ++ ++ return TRUE; ++} ++/* undo renaming to be able to include aoutx.h */ ++#undef i386minix_32_swap_exec_header_out ++ ++/***************/ ++/* READ HEADER */ ++/***************/ ++/* define if aoutx.h is included: */ ++/* UNTRUE: but including it generates a conflict with swap_exe_header_out, so don't include it */ ++ ++/* return -1 if header is wrong ++ * otherwise return the bytes left to read */ ++static int ++MY(swap_exec_header_in) (abfd, bytes, execp) ++ bfd *abfd; ++ struct external_exec *bytes; ++ struct internal_exec *execp; ++{ ++ /* The internal_exec structure has some fields that are unused in this ++ configuration (IE for i960), so ensure that all such uninitialized ++ fields are zero'd out. There are places where two of these structs ++ are memcmp'd, and thus the contents do matter. */ ++ memset ((PTR) execp, 0, sizeof (struct internal_exec)); ++ /* Now fill in fields in the execp, from the bytes in the raw data. */ ++ ++ /*fill a_info*/ ++ N_SET_MAGIC(*execp, H_GET_16 (abfd, bytes->a_magic)); ++ N_SET_MACHTYPE(*execp, M_386); ++ N_SET_FLAGS(*execp, 0); ++ ++ /*check integrity*/ ++ if ( N_BADMAG( *execp ) ) ++ return -1; ++ ++ if ( bytes->a_cpu != A_I80386 ) ++ return -1; ++ ++ if ( bytes->a_hdrlen < A_MINHDR ) ++ return -1; ++ ++#if 0 ++ if ( bytes->a_flags & A_SEP ) ++ dosomething(); ++#endif ++ ++ /*fill the rest*/ ++ execp->a_text = GET_WORD (abfd, &bytes->a_text); ++ execp->a_data = GET_WORD (abfd, &bytes->a_data); ++ execp->a_bss = GET_WORD (abfd, &bytes->a_bss); ++ execp->a_syms = GET_WORD (abfd, &bytes->a_syms); ++ execp->a_entry = GET_WORD (abfd, &bytes->a_entry); ++ ++ if ( bytes->a_hdrlen < A_MINHDR + 2 * sizeof(long) ) ++ return bytes->a_hdrlen - A_MINHDR; ++ ++ if (bfd_bread (&bytes->a_trsize, 2 * sizeof(long), abfd) != 2 * sizeof(long)) ++ return -1; ++ ++ execp->a_trsize = GET_WORD (abfd, &bytes->a_trsize); ++ execp->a_drsize = GET_WORD (abfd, &bytes->a_drsize); ++ ++ bfd_seek (abfd, -2 * sizeof(long), SEEK_CUR); ++ ++ /*store other fields of external_exec?*/ ++ return bytes->a_hdrlen - A_MINHDR; ++} ++ ++static const bfd_target * ++MY(object_p) (abfd) ++ bfd *abfd; ++{ ++ struct external_exec exec_bytes; /* Raw exec header from file */ ++ struct internal_exec exec; /* Cleaned-up exec header */ ++ const bfd_target *target; ++ int left; ++ bfd_size_type amt = A_MINHDR; ++ ++ if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt) ++ { ++ if (bfd_get_error () != bfd_error_system_call) ++ bfd_set_error (bfd_error_wrong_format); ++ ++ return 0; ++ } ++ ++ /* let MY(swap_exec_header_in) check the header */ ++ if ( (left = MY(swap_exec_header_in) (abfd, &exec_bytes, &exec)) == -1 ) ++ { ++ /* incorrect header */ ++ return 0; ++ } ++ ++ /* skip rest of header */ ++ if ( bfd_seek( abfd, left, SEEK_CUR ) ) ++ return 0; ++ ++ target = NAME(aout,some_aout_object_p) (abfd, &exec, MY(callback)); ++ ++ int adjust = (A_MINHDR + left) - EXEC_BYTES_SIZE; ++ ++ /* adjust file positions with the bytes left to be read from the header */ ++ obj_textsec (abfd)->filepos += adjust; ++ obj_datasec (abfd)->filepos += adjust; ++ ++ obj_textsec (abfd)->rel_filepos += adjust; ++ obj_datasec (abfd)->rel_filepos += adjust; ++ ++ obj_sym_filepos (abfd) += adjust; ++ obj_str_filepos (abfd) += adjust; ++ ++ adata(abfd).exec_bytes_size = A_MINHDR + left; ++ ++#ifdef ENTRY_CAN_BE_ZERO ++ /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage) ++ * means that it isn't obvious if EXEC_P should be set. ++ * All of the following must be true for an executable: ++ * There must be no relocations, the bfd can be neither an ++ * archive nor an archive element, and the file must be executable. */ ++ ++ if (exec.a_trsize + exec.a_drsize == 0 ++ && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL) ++ { ++ struct stat buf; ++#ifndef S_IXUSR ++#define S_IXUSR 0100 /* Execute by owner. */ ++#endif ++ if (stat(abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR)) ++ abfd->flags |= EXEC_P; ++ } ++#endif /* ENTRY_CAN_BE_ZERO */ ++ ++ return target; ++} diff --git a/tools/binutils/patches/patch-aj b/tools/binutils/patches/patch-aj new file mode 100644 index 000000000..149f1c2d5 --- /dev/null +++ b/tools/binutils/patches/patch-aj @@ -0,0 +1,12 @@ +$NetBSD$ + +--- bfd/targets.c.orig Wed Apr 5 12:41:57 2006 ++++ bfd/targets.c +@@ -696,6 +696,7 @@ extern const bfd_target i386linux_vec; + extern const bfd_target i386lynx_aout_vec; + extern const bfd_target i386lynx_coff_vec; + extern const bfd_target i386mach3_vec; ++extern const bfd_target bfd_elf32_i386_minix_vec; + extern const bfd_target i386msdos_vec; + extern const bfd_target i386netbsd_vec; + extern const bfd_target i386os9k_vec; diff --git a/tools/binutils/patches/patch-am b/tools/binutils/patches/patch-am new file mode 100644 index 000000000..1dcf0977b --- /dev/null +++ b/tools/binutils/patches/patch-am @@ -0,0 +1,13 @@ +$NetBSD$ + +--- config.guess.orig Mon Jan 16 17:34:37 2006 ++++ config.guess +@@ -820,7 +820,7 @@ EOF + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) +- echo ${UNAME_MACHINE}-pc-minix ++ echo i386-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu diff --git a/tools/binutils/patches/patch-an b/tools/binutils/patches/patch-an new file mode 100644 index 000000000..90ffb419f --- /dev/null +++ b/tools/binutils/patches/patch-an @@ -0,0 +1,15 @@ +$NetBSD$ + +--- gas/config/tc-i386.h.orig Mon Feb 27 15:35:37 2006 ++++ gas/config/tc-i386.h +@@ -59,6 +59,10 @@ extern unsigned long i386_mach (void); + #define ELF_TARGET_FORMAT "elf32-i386-vxworks" + #endif + ++#ifdef TE_MINIX ++#define ELF_TARGET_FORMAT "elf32-i386-minix" ++#endif ++ + #ifndef ELF_TARGET_FORMAT + #define ELF_TARGET_FORMAT "elf32-i386" + #endif diff --git a/tools/binutils/patches/patch-ao b/tools/binutils/patches/patch-ao new file mode 100644 index 000000000..52cd31252 --- /dev/null +++ b/tools/binutils/patches/patch-ao @@ -0,0 +1,16 @@ +$NetBSD$ + +--- gas/config/te-minix.h.orig Sat Feb 26 00:58:30 2011 ++++ gas/config/te-minix.h +@@ -0,0 +1,11 @@ ++#define TE_MINIX 1 ++ ++/* Added these, because if we don't know what we're targeting we may ++ need an assembler version of libgcc, and that will use local ++ labels. */ ++#define LOCAL_LABELS_DOLLAR 1 ++#define LOCAL_LABELS_FB 1 ++ ++#define ELF_TARGET_FORMAT "elf32-i386-minix" ++ ++#include "obj-format.h" diff --git a/tools/binutils/patches/patch-ap b/tools/binutils/patches/patch-ap new file mode 100644 index 000000000..fd19e3bec --- /dev/null +++ b/tools/binutils/patches/patch-ap @@ -0,0 +1,15 @@ +$NetBSD$ + +--- gas/configure.orig Thu Apr 6 21:49:31 2006 ++++ gas/configure +@@ -3370,6 +3370,10 @@ freebsd* | kfreebsd*-gnu) + fi + ;; + ++minix*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; ++ + gnu*) + lt_cv_deplibs_check_method=pass_all + ;; diff --git a/tools/binutils/patches/patch-ar b/tools/binutils/patches/patch-ar new file mode 100644 index 000000000..5b8331faf --- /dev/null +++ b/tools/binutils/patches/patch-ar @@ -0,0 +1,23 @@ +$NetBSD$ + +--- ld/Makefile.in.orig Sat Jun 3 04:45:50 2006 ++++ ld/Makefile.in +@@ -458,6 +458,7 @@ ALL_EMULATIONS = \ + ei386linux.o \ + ei386lynx.o \ + ei386mach.o \ ++ eelf_i386_minix.o \ + ei386moss.o \ + ei386msdos.o \ + ei386nbsd.o \ +@@ -1862,6 +1864,10 @@ ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \ + ei386mach.c: $(srcdir)/emulparams/i386mach.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} + ${GENSCRIPTS} i386mach "$(tdir_i386mach)" ++eelf_i386_minix.c: $(srcdir)/emulparams/elf_i386_minix.sh \ ++ $(srcdir)/emulparams/elf_i386.sh \ ++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ++ ${GENSCRIPTS} elf_i386_minix "$(tdir_elf_i386_minix)" + ei386moss.c: $(srcdir)/emulparams/i386moss.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} i386moss "$(tdir_i386moss)" diff --git a/tools/binutils/patches/patch-as b/tools/binutils/patches/patch-as new file mode 100644 index 000000000..1c9a2a6fe --- /dev/null +++ b/tools/binutils/patches/patch-as @@ -0,0 +1,8 @@ +$NetBSD$ + +--- ld/emulparams/elf_i386_minix.sh.orig Sat Feb 26 00:58:30 2011 ++++ ld/emulparams/elf_i386_minix.sh +@@ -0,0 +1,3 @@ ++. ${srcdir}/emulparams/elf_i386.sh ++. ${srcdir}/emulparams/elf_minix.sh ++OUTPUT_FORMAT="elf32-i386-minix" diff --git a/tools/binutils/patches/patch-at b/tools/binutils/patches/patch-at new file mode 100644 index 000000000..92932f01b --- /dev/null +++ b/tools/binutils/patches/patch-at @@ -0,0 +1,6 @@ +$NetBSD$ + +--- ld/emulparams/elf_minix.sh.orig Sat Feb 26 00:58:30 2011 ++++ ld/emulparams/elf_minix.sh +@@ -0,0 +1 @@ ++ELF_INTERPRETER_NAME=\"/usr/libexec/ld-elf.so.1\" diff --git a/tools/binutils/patches/patch-au b/tools/binutils/patches/patch-au new file mode 100644 index 000000000..f2844af1c --- /dev/null +++ b/tools/binutils/patches/patch-au @@ -0,0 +1,11 @@ +$NetBSD$ + +--- ld/emulparams/i386minix.sh.orig Sat Feb 26 00:58:30 2011 ++++ ld/emulparams/i386minix.sh +@@ -0,0 +1,6 @@ ++SCRIPT_NAME=aout ++OUTPUT_FORMAT="a.out-i386-minix" ++TARGET_PAGE_SIZE=1 ++TEXT_START_ADDR=0 ++NONPAGED_TEXT_START_ADDR=0 ++ARCH=i386 diff --git a/tools/binutils/patches/patch-gas_app.c b/tools/binutils/patches/patch-gas_app.c new file mode 100644 index 000000000..d86b0964c --- /dev/null +++ b/tools/binutils/patches/patch-gas_app.c @@ -0,0 +1,16 @@ +$NetBSD$ + +Fix build with gcc-4.5. + +--- gas/app.c.orig 2006-03-10 10:57:18.000000000 +0000 ++++ gas/app.c +@@ -563,7 +563,8 @@ do_scrub_chars (int (*get) (char *, int) + { + as_warn (_("end of file in string; '%c' inserted"), quotechar); + state = old_state; +- UNGET ('\n'); ++ if (from > input_buffer) ++ UNGET ('\n'); + PUT (quotechar); + } + else if (ch == quotechar) diff --git a/tools/cat/Makefile b/tools/cat/Makefile new file mode 100644 index 000000000..b2e7de5ed --- /dev/null +++ b/tools/cat/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.2 2002/12/08 20:19:58 thorpej Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}cat +HOST_SRCDIR= bin/cat + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/compat/Makefile b/tools/compat/Makefile new file mode 100644 index 000000000..2e2635eb4 --- /dev/null +++ b/tools/compat/Makefile @@ -0,0 +1,91 @@ +# $NetBSD: Makefile,v 1.56 2012/02/18 17:51:21 njoly Exp $ + +HOSTLIB= nbcompat + +SRCS= atoll.c basename.c dirname.c fgetln.c flock.c fparseln.c \ + fpurge.c getline.c getmode.c getopt_long.c gettemp.c \ + heapsort.c \ + issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ + md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ + mi_vector_hash.c mkdtemp.c \ + mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ + pw_scan.c \ + raise_default_signal.c rmd160.c rmd160hl.c \ + setenv.c setgroupent.c \ + setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ + sha256hl.c sha384hl.c sha512hl.c snprintf.c stat_flags.c \ + strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \ + strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \ + vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c + +BUILD_OSTYPE!= uname -s + +# Disable use of pre-compiled headers on Darwin. +.if ${BUILD_OSTYPE} == "Darwin" +CPPFLAGS+= -no-cpp-precomp +.endif + +# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and +# other file ops, on many systems, without changing function names. + +CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \ + -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 + +.PATH: ${.CURDIR}/../../lib/libc/gen \ + ${.CURDIR}/../../lib/libc/hash \ + ${.CURDIR}/../../lib/libc/hash/md2 \ + ${.CURDIR}/../../lib/libc/hash/md5 \ + ${.CURDIR}/../../lib/libc/hash/rmd160 \ + ${.CURDIR}/../../lib/libc/hash/sha1 \ + ${.CURDIR}/../../lib/libc/hash/sha2 \ + ${.CURDIR}/../../lib/libc/md \ + ${.CURDIR}/../../lib/libc/stdio \ + ${.CURDIR}/../../lib/libc/stdlib \ + ${.CURDIR}/../../lib/libc/string \ + ${.CURDIR}/../../lib/libutil \ + ${.CURDIR}/../../common/lib/libc/string \ + ${.CURDIR}/../../common/lib/libc/hash/rmd160 \ + ${.CURDIR}/../../common/lib/libc/hash/sha1 \ + ${.CURDIR}/../../common/lib/libc/hash/sha2 \ + ${.CURDIR}/../../common/lib/libc/md \ + ${.CURDIR}/../../common/lib/libc/stdlib \ + ${.CURDIR}/../../external/bsd/flex/dist + +DPSRCS+= defs.mk +CLEANFILES+= config.log config.status configure.lineno *.stamp + +# Get components of Berkeley DB. +_CURDIR:= ${.CURDIR} +.CURDIR:= ${_CURDIR}/../../lib/libc +.include "${.CURDIR}/db/Makefile.inc" +.CURDIR:= ${_CURDIR} + +SRCS:= ${SRCS:M*.c} + +config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in + rm -f ${.TARGET} + CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \ + ${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache + +defs.mk: config.cache + @touch ${.TARGET} + +# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing +# configure.ac. See more detailed instructions in configure.ac. +regen: + cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf + cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader + +include/.stamp: + mkdir -p include/sys include/machine include/rpc include/arpa + @touch ${.TARGET} + +cleandir: + -rm -f nbtool_config.h confdefs.h defs.mk + -rm -r -f include + -rm -f config.cache + +HOST_CPPFLAGS:= ${CPPFLAGS} +CPPFLAGS:= # empty + +.include diff --git a/tools/compat/README b/tools/compat/README new file mode 100644 index 000000000..222482735 --- /dev/null +++ b/tools/compat/README @@ -0,0 +1,87 @@ +$NetBSD: README,v 1.12 2005/04/05 00:21:22 jmc Exp $ + +Special notes for cross-hosting a NetBSD build on certain platforms. +Only those platforms which have been tested to complete a "build.sh" run +are listed. + +All hosts must have a POSIX compatible sh. /bin/sh is assumed unless +otherwise set. This can be overridden by setting HOST_SH in the environment. + +In addition all hosts must provide the following local tools: + +gzip + +===== + +NetBSD: + +* _NETBSD_SOURCE is *not* to be defined/pulled in during compat/tools builds. + compat_defs.h will error out if it finds it defined. + +HP-UX: + +* zlib must be available. + This will be fixed in the future to include zlib in libnbcompat. + +===== + +LINUX: + +* Tested on RedHat Linux 7.1 (i386). + Tested on RedHat Linux 7.3 (i686) on 16 Sep 2002. Requires "LANG=C" + in the environment. + +* Tested on Redhat Linux 8.0 (i686) in Fall 2003. Requires no special settings. + +* Tested on Redhat ES3 and AS3 in spring of 2004. Requires no special settings. + +* The gcc (and libstdc++, if needed) package must be installed, along + with the typical system development packages (glibc-devel, etc.). + +* The ncurses-devel package must be installed (for nbinfo). + +* The zlib and zlib-devel packages must be installed. This will be + fixed in the future to include zlib in libnbcompat. + +===== + +MACOS + Requires a case sensitive filesystem such as UFS + +* Tested on 10.2.8 with Dec 2002 Developer Tools + - may require a fix to /usr/bin/join, netbsd's join should work fine +* Tested on 10.3 with xcode 1.5 + - compiles fine out of the box + +===== + +NETBSD (earlier releases): + +* Tested on NetBSD 1.5.2 (machine-independently). + +* Should need no special setup. + +===== + +SOLARIS: + +* Tested on Solaris/x86 8 (5.8) with gcc 2.95.2 and Solaris/sparc 8 (5.8) + with gcc 3.2 (not yet tested with SUNWspro). + +* $HOST_CC needs to be set properly (for gcc, it should be set to "gcc", + otherwise the improper /usr/ucb/cc may be invoked by accident). + +* The SUNWzlib package (or a built version of zlib visible to $HOST_CC, + such as SMCzlib from sunfreeware.com) must be installed. This will be + fixed in the future to include zlib in libnbcompat. + +* Needs the following paths, in this order, in $PATH: + + /usr/xpg4/bin + /usr/ccs/bin + + /usr/bin + + /usr/ucb may optionally be placed before /usr/bin, per your preference, + but /usr/ucb *MUST NOT* be before /usr/ccs/bin or before the path to + the host C and C++ compilers. diff --git a/tools/compat/compat_defs.h b/tools/compat/compat_defs.h new file mode 100644 index 000000000..1968a36d6 --- /dev/null +++ b/tools/compat/compat_defs.h @@ -0,0 +1,1196 @@ +/* $NetBSD: compat_defs.h,v 1.83 2012/01/21 20:05:27 tsutsui Exp $ */ + +#ifndef __NETBSD_COMPAT_DEFS_H__ +#define __NETBSD_COMPAT_DEFS_H__ + + +/* Work around some complete brain damage. */ +/* + * Linux: turns on _POSIX_SOURCE by default, even though the + * program (not the OS) should do that. Preload to keep any + * of this crap from being pulled in, and undefine _POSIX_SOURCE. + */ + +#if defined(__linux__) && HAVE_FEATURES_H +#include +#define __USE_ISOC99 1 +#endif + +/* So _NETBSD_SOURCE doesn't end up defined. Define enough to pull in standard + defs. Other platforms may need similiar defines. */ +#ifdef __NetBSD__ +#define _ISOC99_SOURCE +#define _POSIX_SOURCE 1 +#define _POSIX_C_SOURCE 200112L +#define _XOPEN_SOURCE 600 +#else +#undef _POSIX_SOURCE +#undef _POSIX_C_SOURCE +#endif + +/* System headers needed for (re)definitions below. */ + +#include +#include +#include +/* time.h needs to be pulled in first at least on netbsd w/o _NETBSD_SOURCE */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if HAVE_SYS_CDEFS_H +#include +#endif +#if HAVE_SYS_SYSLIMITS_H +#include +#endif +#if HAVE_SYS_SYSMACROS_H +/* major(), minor() on SVR4 */ +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDDEF_H +#include +#endif + +#ifdef _NETBSD_SOURCE +#error _NETBSD_SOURCE is *not* to be defined. +#endif + +/* Need this since we can't depend on NetBSD's version to be around */ +#ifdef __UNCONST +#undef __UNCONST +#endif +#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) + +/* We don't include here, so that "compat_pwd.h" works. */ +struct passwd; + +/* We don't include either */ +struct group; + +/* Assume an ANSI compiler for the host. */ + +#undef __P +#define __P(x) x + +#ifndef __BEGIN_DECLS +#define __BEGIN_DECLS +#endif +#ifndef __END_DECLS +#define __END_DECLS +#endif + +/* Some things usually in BSD . */ + +#ifndef __CONCAT +#define __CONCAT(x,y) x ## y +#endif +#if !defined(__attribute__) && !defined(__GNUC__) +#define __attribute__(x) +#endif +#if !defined(__packed) +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +#define __packed __attribute__((__packed__)) +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) +#define __packed __attribute__((__packed__)) +#else +#define __packed error: no __packed for this compiler +#endif +#endif /* !__packed */ +#ifndef __RENAME +#define __RENAME(x) +#endif +#undef __aconst +#define __aconst +#undef __dead +#define __dead +#undef __printflike +#define __printflike(x,y) +#undef __restrict +#define __restrict +#undef __unused +#define __unused +#undef __arraycount +#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) + +/* Dirent support. */ + +#if HAVE_DIRENT_H +# if defined(__linux__) && defined(__USE_BSD) +# undef __USE_BSD +# include +# define __USE_BSD 1 +# undef d_fileno +# else +# include +# if defined(__DARWIN_UNIX03) +# undef d_fileno +# endif +# endif +# define NAMLEN(dirent) (strlen((dirent)->d_name)) +#else +# define dirent direct +# define NAMLEN(dirent) ((dirent)->d_namlen) +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +/* Type substitutes. */ + +#if !HAVE_ID_T +typedef unsigned int id_t; +#endif + +#if !HAVE_SOCKLEN_T +typedef int socklen_t; +#endif + +#if !HAVE_U_LONG +typedef unsigned long u_long; +#endif + +#if !HAVE_U_CHAR +typedef unsigned char u_char; +#endif + +#if !HAVE_U_INT +typedef unsigned int u_int; +#endif + +#if !HAVE_U_SHORT +typedef unsigned short u_short; +#endif + +/* Prototypes for replacement functions. */ + +#if !HAVE_ATOLL +long long int atoll(const char *); +#endif + +#if !HAVE_ASPRINTF +int asprintf(char **, const char *, ...); +#endif + +#if !HAVE_ASNPRINTF +int asnprintf(char **, size_t, const char *, ...); +#endif + +#if !HAVE_BASENAME +char *basename(char *); +#endif + +#if !HAVE_DECL_OPTIND +int getopt(int, char *const *, const char *); +extern char *optarg; +extern int optind, opterr, optopt; +#endif + +#if !HAVE_DIRNAME +char *dirname(char *); +#endif + +#if !HAVE_DIRFD +#if HAVE_DIR_DD_FD +#define dirfd(dirp) ((dirp)->dd_fd) +#elif HAVE_DIR___DD_FD +#define dirfd(dirp) ((dirp)->__dd_fd) +#else +/*XXX: Very hacky but no other way to bring this into scope w/o defining + _NETBSD_SOURCE which we're avoiding. */ +#ifdef __NetBSD__ +struct _dirdesc { + int dd_fd; /* file descriptor associated with directory */ + long dd_loc; /* offset in current buffer */ + long dd_size; /* amount of data returned by getdents */ + char *dd_buf; /* data buffer */ + int dd_len; /* size of data buffer */ + off_t dd_seek; /* magic cookie returned by getdents */ + long dd_rewind; /* magic cookie for rewinding */ + int dd_flags; /* flags for readdir */ + void *dd_lock; /* lock for concurrent access */ +}; +#define dirfd(dirp) (((struct _dirdesc *)dirp)->dd_fd) +#else +#error cannot figure out how to turn a DIR * into a fd +#endif +#endif +#endif + +#if !HAVE_ERR_H +void err(int, const char *, ...); +void errx(int, const char *, ...); +void warn(const char *, ...); +void warnx(const char *, ...); +void vwarnx(const char *, va_list); +#endif + +#if !HAVE_ESETFUNC +void (*esetfunc(void (*)(int, const char *, ...)))(int, const char *, ...); +size_t estrlcpy(char *, const char *, size_t); +size_t estrlcat(char *, const char *, size_t); +char *estrdup(const char *); +char *estrndup(const char *, size_t); +void *ecalloc(size_t, size_t); +void *emalloc(size_t); +void *erealloc(void *, size_t); +FILE *efopen(const char *, const char *); +int easprintf(char **, const char *, ...); +int evasprintf(char **, const char *, va_list); +#endif + +#if !HAVE_FGETLN || defined(__NetBSD__) +char *fgetln(FILE *, size_t *); +#endif + +#if !HAVE_FLOCK +# define LOCK_SH 0x01 +# define LOCK_EX 0x02 +# define LOCK_NB 0x04 +# define LOCK_UN 0x08 +int flock(int, int); +#endif + +#if !HAVE_FPARSELN || BROKEN_FPARSELN || defined(__NetBSD__) +# define FPARSELN_UNESCESC 0x01 +# define FPARSELN_UNESCCONT 0x02 +# define FPARSELN_UNESCCOMM 0x04 +# define FPARSELN_UNESCREST 0x08 +# define FPARSELN_UNESCALL 0x0f +char *fparseln(FILE *, size_t *, size_t *, const char [3], int); +#endif + +#if !HAVE_GETLINE +ssize_t getdelim(char **, size_t *, int, FILE *); +ssize_t getline(char **, size_t *, FILE *); +#endif + +#if !HAVE_ISSETUGID +int issetugid(void); +#endif + +#if !HAVE_ISBLANK && !defined(isblank) +#define isblank(x) ((x) == ' ' || (x) == '\t') +#endif + +#define __nbcompat_bswap16(x) ((((x) << 8) & 0xff00) | (((x) >> 8) & 0x00ff)) + +#define __nbcompat_bswap32(x) ((((x) << 24) & 0xff000000) | \ + (((x) << 8) & 0x00ff0000) | \ + (((x) >> 8) & 0x0000ff00) | \ + (((x) >> 24) & 0x000000ff)) + +#define __nbcompat_bswap64(x) (((u_int64_t)bswap32((x)) << 32) | \ + ((u_int64_t)bswap32((x) >> 32))) + +#if ! HAVE_DECL_BSWAP16 +#ifdef bswap16 +#undef bswap16 +#endif +#define bswap16(x) __nbcompat_bswap16(x) +#endif +#if ! HAVE_DECL_BSWAP32 +#ifdef bswap32 +#undef bswap32 +#endif +#define bswap32(x) __nbcompat_bswap32(x) +#endif +#if ! HAVE_DECL_BSWAP64 +#ifdef bswap64 +#undef bswap64 +#endif +#define bswap64(x) __nbcompat_bswap64(x) +#endif + +#if !HAVE_MKSTEMP +int mkstemp(char *); +#endif + +#if !HAVE_MKDTEMP +char *mkdtemp(char *); +#endif + +#if !HAVE_MKSTEMP || !HAVE_MKDTEMP +/* This is a prototype for the internal function defined in + * src/lib/lib/stdio/gettemp.c */ +int __nbcompat_gettemp(char *, int *, int); +#endif + +#if !HAVE_PREAD +ssize_t pread(int, void *, size_t, off_t); +#endif + +#if !HAVE_HEAPSORT +int heapsort (void *, size_t, size_t, int (*)(const void *, const void *)); +#endif +/* Make them use our version */ +# define heapsort __nbcompat_heapsort + +char *flags_to_string(unsigned long, const char *); +int string_to_flags(char **, unsigned long *, unsigned long *); + +/* + * HAVE_X_FROM_Y and HAVE_PWCACHE_FOODB go together, because we cannot + * supply an implementation of one without the others -- some parts are + * libc internal and this varies from system to system. + * + * XXX this is dubious anyway: we assume (see HAVE_DECLs below) that if the + * XXX host system has all of these functions, all of their interfaces + * XXX and interactions are exactly the same as in our libc/libutil -- ugh. + */ +#if !HAVE_USER_FROM_UID || !HAVE_UID_FROM_USER || !HAVE_GROUP_FROM_GID || \ + !HAVE_GID_FROM_GROUP || !HAVE_PWCACHE_USERDB || !HAVE_PWCACHE_GROUDB +/* Make them use our version */ +# define user_from_uid __nbcompat_user_from_uid +# define uid_from_user __nbcompat_uid_from_user +# define pwcache_userdb __nbcompat_pwcache_userdb +# define group_from_gid __nbcompat_group_from_gid +# define gid_from_group __nbcompat_gid_from_group +# define pwcache_groupdb __nbcompat_pwcache_groupdb +#endif + +#if !HAVE_DECL_UID_FROM_USER +int uid_from_user(const char *, uid_t *); +#endif + +#if !HAVE_DECL_USER_FROM_UID +const char *user_from_uid(uid_t, int); +#endif + +#if !HAVE_DECL_PWCACHE_USERDB +int pwcache_userdb(int (*)(int), void (*)(void), + struct passwd * (*)(const char *), struct passwd * (*)(uid_t)); +#endif + +#if !HAVE_DECL_GID_FROM_GROUP +int gid_from_group(const char *, gid_t *); +#endif + +#if !HAVE_DECL_GROUP_FROM_GID +const char *group_from_gid(gid_t, int); +#endif + +#if !HAVE_DECL_PWCACHE_GROUPDB +int pwcache_groupdb(int (*)(int), void (*)(void), + struct group * (*)(const char *), struct group * (*)(gid_t)); +#endif + +#if !HAVE_DECL_STRNDUP +char *strndup(const char *, size_t); +#endif +#if !HAVE_DECL_LCHFLAGS +int lchflags(const char *, unsigned long); +#endif +#if !HAVE_DECL_LCHMOD +int lchmod(const char *, mode_t); +#endif +#if !HAVE_DECL_LCHOWN +int lchown(const char *, uid_t, gid_t); +#endif + +#if !HAVE_PWRITE +ssize_t pwrite(int, const void *, size_t, off_t); +#endif + +#if !HAVE_RAISE_DEFAULT_SIGNAL +int raise_default_signal(int); +#endif + +#if !HAVE_SETENV +int setenv(const char *, const char *, int); +#endif + +#if !HAVE_DECL_SETGROUPENT +int setgroupent(int); +#endif + +#if !HAVE_DECL_SETPASSENT +int setpassent(int); +#endif + +#if !HAVE_SETPROGNAME || defined(__NetBSD__) +const char *getprogname(void); +void setprogname(const char *); +#endif + +#if !HAVE_SNPRINTF +int snprintf(char *, size_t, const char *, ...); +#endif + +#if !HAVE_STRLCAT +size_t strlcat(char *, const char *, size_t); +#endif + +#if !HAVE_STRLCPY +size_t strlcpy(char *, const char *, size_t); +#endif + +#if !HAVE_STRMODE +void strmode(mode_t, char *); +#endif + +#if !HAVE_STRNDUP +char *strndup(const char *, size_t); +#endif + +#if !HAVE_STRSEP || defined(__NetBSD__) +char *strsep(char **, const char *); +#endif + +#if !HAVE_DECL_STRSUFTOLL +long long strsuftoll(const char *, const char *, long long, long long); +long long strsuftollx(const char *, const char *, + long long, long long, char *, size_t); +#endif + +#if !HAVE_STRTOLL +long long strtoll(const char *, char **, int); +#endif + +#if !HAVE_USER_FROM_UID +const char *user_from_uid(uid_t, int); +#endif + +#if !HAVE_GROUP_FROM_GID +const char *group_from_gid(gid_t, int); +#endif + +#if !HAVE_VASPRINTF +int vasprintf(char **, const char *, va_list); +#endif + +#if !HAVE_VASNPRINTF +int vasnprintf(char **, size_t, const char *, va_list); +#endif + +#if !HAVE_VSNPRINTF +int vsnprintf(char *, size_t, const char *, va_list); +#endif + +/* + * getmode() and setmode() are always defined, as these function names + * exist but with very different meanings on other OS's. The compat + * versions here simply accept an octal mode number; the "u+x,g-w" type + * of syntax is not accepted. + */ + +#define getmode __nbcompat_getmode +#define setmode __nbcompat_setmode + +mode_t getmode(const void *, mode_t); +void *setmode(const char *); + +/* Eliminate assertions embedded in binaries. */ + +#undef _DIAGASSERT +#define _DIAGASSERT(x) + +/* Various sources use this */ +#undef __RCSID +#define __RCSID(x) struct XXXNETBSD_RCSID +#undef __SCCSID +#define __SCCSID(x) +#undef __COPYRIGHT +#define __COPYRIGHT(x) struct XXXNETBSD_COPYRIGHT +#undef __KERNEL_RCSID +#define __KERNEL_RCSID(x,y) + +/* Heimdal expects this one. */ + +#undef RCSID +#define RCSID(x) + +/* Some definitions not available on all systems. */ + +#ifndef __inline +#define __inline inline +#endif + +/* */ + +#ifndef EFTYPE +#define EFTYPE EIO +#endif + +/* */ + +#ifndef O_EXLOCK +#define O_EXLOCK 0 +#endif +#ifndef O_SHLOCK +#define O_SHLOCK 0 +#endif + +/* */ + +#if UCHAR_MAX == 0xffU /* char is an 8-bit type */ +#ifndef PRId8 +#define PRId8 "hhd" +#endif +#ifndef PRIi8 +#define PRIi8 "hhi" +#endif +#ifndef PRIo8 +#define PRIo8 "hho" +#endif +#ifndef PRIu8 +#define PRIu8 "hhu" +#endif +#ifndef PRIx8 +#define PRIx8 "hhx" +#endif +#ifndef PRIX8 +#define PRIX8 "hhX" +#endif +#ifndef SCNd8 +#define SCNd8 "hhd" +#endif +#ifndef SCNi8 +#define SCNi8 "hhi" +#endif +#ifndef SCNo8 +#define SCNo8 "hho" +#endif +#ifndef SCNu8 +#define SCNu8 "hhu" +#endif +#ifndef SCNx8 +#define SCNx8 "hhx" +#endif +#ifndef SCNX8 +#define SCNX8 "hhX" +#endif +#endif /* char is an 8-bit type */ +#if ! (defined(PRId8) && defined(PRIi8) && defined(PRIo8) && \ + defined(PRIu8) && defined(PRIx8) && defined(PRIX8)) +#error "Don't know how to define PRI[diouxX]8" +#endif +#if ! (defined(SCNd8) && defined(SCNi8) && defined(SCNo8) && \ + defined(SCNu8) && defined(SCNx8) && defined(SCNX8)) +#error "Don't know how to define SCN[diouxX]8" +#endif + +#if USHRT_MAX == 0xffffU /* short is a 16-bit type */ +#ifndef PRId16 +#define PRId16 "hd" +#endif +#ifndef PRIi16 +#define PRIi16 "hi" +#endif +#ifndef PRIo16 +#define PRIo16 "ho" +#endif +#ifndef PRIu16 +#define PRIu16 "hu" +#endif +#ifndef PRIx16 +#define PRIx16 "hx" +#endif +#ifndef PRIX16 +#define PRIX16 "hX" +#endif +#ifndef SCNd16 +#define SCNd16 "hd" +#endif +#ifndef SCNi16 +#define SCNi16 "hi" +#endif +#ifndef SCNo16 +#define SCNo16 "ho" +#endif +#ifndef SCNu16 +#define SCNu16 "hu" +#endif +#ifndef SCNx16 +#define SCNx16 "hx" +#endif +#ifndef SCNX16 +#define SCNX16 "hX" +#endif +#endif /* short is a 16-bit type */ +#if ! (defined(PRId16) && defined(PRIi16) && defined(PRIo16) && \ + defined(PRIu16) && defined(PRIx16) && defined(PRIX16)) +#error "Don't know how to define PRI[diouxX]16" +#endif +#if ! (defined(SCNd16) && defined(SCNi16) && defined(SCNo16) && \ + defined(SCNu16) && defined(SCNx16) && defined(SCNX16)) +#error "Don't know how to define SCN[diouxX]16" +#endif + +#if UINT_MAX == 0xffffffffU /* int is a 32-bit type */ +#ifndef PRId32 +#define PRId32 "d" +#endif +#ifndef PRIi32 +#define PRIi32 "i" +#endif +#ifndef PRIo32 +#define PRIo32 "o" +#endif +#ifndef PRIu32 +#define PRIu32 "u" +#endif +#ifndef PRIx32 +#define PRIx32 "x" +#endif +#ifndef PRIX32 +#define PRIX32 "X" +#endif +#ifndef SCNd32 +#define SCNd32 "d" +#endif +#ifndef SCNi32 +#define SCNi32 "i" +#endif +#ifndef SCNo32 +#define SCNo32 "o" +#endif +#ifndef SCNu32 +#define SCNu32 "u" +#endif +#ifndef SCNx32 +#define SCNx32 "x" +#endif +#ifndef SCNX32 +#define SCNX32 "X" +#endif +#endif /* int is a 32-bit type */ +#if ULONG_MAX == 0xffffffffU /* long is a 32-bit type */ +#ifndef PRId32 +#define PRId32 "ld" +#endif +#ifndef PRIi32 +#define PRIi32 "li" +#endif +#ifndef PRIo32 +#define PRIo32 "lo" +#endif +#ifndef PRIu32 +#define PRIu32 "lu" +#endif +#ifndef PRIx32 +#define PRIx32 "lx" +#endif +#ifndef PRIX32 +#define PRIX32 "lX" +#endif +#ifndef SCNd32 +#define SCNd32 "ld" +#endif +#ifndef SCNi32 +#define SCNi32 "li" +#endif +#ifndef SCNo32 +#define SCNo32 "lo" +#endif +#ifndef SCNu32 +#define SCNu32 "lu" +#endif +#ifndef SCNx32 +#define SCNx32 "lx" +#endif +#ifndef SCNX32 +#define SCNX32 "lX" +#endif +#endif /* long is a 32-bit type */ +#if ! (defined(PRId32) && defined(PRIi32) && defined(PRIo32) && \ + defined(PRIu32) && defined(PRIx32) && defined(PRIX32)) +#error "Don't know how to define PRI[diouxX]32" +#endif +#if ! (defined(SCNd32) && defined(SCNi32) && defined(SCNo32) && \ + defined(SCNu32) && defined(SCNx32) && defined(SCNX32)) +#error "Don't know how to define SCN[diouxX]32" +#endif + +#if ULONG_MAX == 0xffffffffffffffffU /* long is a 64-bit type */ +#ifndef PRId64 +#define PRId64 "ld" +#endif +#ifndef PRIi64 +#define PRIi64 "li" +#endif +#ifndef PRIo64 +#define PRIo64 "lo" +#endif +#ifndef PRIu64 +#define PRIu64 "lu" +#endif +#ifndef PRIx64 +#define PRIx64 "lx" +#endif +#ifndef PRIX64 +#define PRIX64 "lX" +#endif +#ifndef SCNd64 +#define SCNd64 "ld" +#endif +#ifndef SCNi64 +#define SCNi64 "li" +#endif +#ifndef SCNo64 +#define SCNo64 "lo" +#endif +#ifndef SCNu64 +#define SCNu64 "lu" +#endif +#ifndef SCNx64 +#define SCNx64 "lx" +#endif +#ifndef SCNX64 +#define SCNX64 "lX" +#endif +#endif /* long is a 64-bit type */ +#if ULLONG_MAX == 0xffffffffffffffffU /* long long is a 64-bit type */ +#ifndef PRId64 +#define PRId64 "lld" +#endif +#ifndef PRIi64 +#define PRIi64 "lli" +#endif +#ifndef PRIo64 +#define PRIo64 "llo" +#endif +#ifndef PRIu64 +#define PRIu64 "llu" +#endif +#ifndef PRIx64 +#define PRIx64 "llx" +#endif +#ifndef PRIX64 +#define PRIX64 "llX" +#endif +#ifndef SCNd64 +#define SCNd64 "lld" +#endif +#ifndef SCNi64 +#define SCNi64 "lli" +#endif +#ifndef SCNo64 +#define SCNo64 "llo" +#endif +#ifndef SCNu64 +#define SCNu64 "llu" +#endif +#ifndef SCNx64 +#define SCNx64 "llx" +#endif +#ifndef SCNX64 +#define SCNX64 "llX" +#endif +#endif /* long long is a 64-bit type */ +#if ! (defined(PRId64) && defined(PRIi64) && defined(PRIo64) && \ + defined(PRIu64) && defined(PRIx64) && defined(PRIX64)) +#error "Don't know how to define PRI[diouxX]64" +#endif +#if ! (defined(SCNd64) && defined(SCNi64) && defined(SCNo64) && \ + defined(SCNu64) && defined(SCNx64) && defined(SCNX64)) +#error "Don't know how to define SCN[diouxX]64" +#endif + +/* */ + +#ifndef UID_MAX +#define UID_MAX 32767 +#endif +#ifndef GID_MAX +#define GID_MAX UID_MAX +#endif + +#ifndef UQUAD_MAX +#define UQUAD_MAX ((u_quad_t)-1) +#endif +#ifndef QUAD_MAX +#define QUAD_MAX ((quad_t)(UQUAD_MAX >> 1)) +#endif +#ifndef QUAD_MIN +#define QUAD_MIN ((quad_t)(~QUAD_MAX)) +#endif +#ifndef ULLONG_MAX +#define ULLONG_MAX ((unsigned long long)-1) +#endif +#ifndef LLONG_MAX +#define LLONG_MAX ((long long)(ULLONG_MAX >> 1)) +#endif +#ifndef LLONG_MIN +#define LLONG_MIN ((long long)(~LLONG_MAX)) +#endif + +/* */ + +/* The host's _PATH_BSHELL might be broken, so override it. */ +#undef _PATH_BSHELL +#define _PATH_BSHELL PATH_BSHELL +#ifndef _PATH_DEFPATH +#define _PATH_DEFPATH "/usr/bin:/bin:/usr/local/bin" +#endif +#ifndef _PATH_DEV +#define _PATH_DEV "/dev/" +#endif +#ifndef _PATH_DEVNULL +#define _PATH_DEVNULL _PATH_DEV "null" +#endif +#ifndef _PATH_TMP +#define _PATH_TMP "/tmp/" +#endif +#ifndef _PATH_DEFTAPE +#define _PATH_DEFTAPE "/dev/nrst0" +#endif +#ifndef _PATH_VI +#define _PATH_VI "/usr/bin/vi" +#endif + +/* */ + +#if !defined(SIZE_MAX) && defined(SIZE_T_MAX) +#define SIZE_MAX SIZE_T_MAX +#endif + +#ifndef UINT8_MAX +#define UINT8_MAX 0xffU +#endif + +#ifndef UINT16_MAX +#define UINT16_MAX 0xffffU +#endif + +#ifndef UINT32_MAX +#define UINT32_MAX 0xffffffffU +#endif + +/* */ + +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +#endif + +/* avoid prototype conflicts with host */ +#define cgetcap __nbcompat_cgetcap +#define cgetclose __nbcompat_cgetclose +#define cgetent __nbcompat_cgetent +#define cgetfirst __nbcompat_cgetfirst +#define cgetmatch __nbcompat_cgetmatch +#define cgetnext __nbcompat_cgetnext +#define cgetnum __nbcompat_cgetnum +#define cgetset __nbcompat_cgetset +#define cgetstr __nbcompat_cgetstr +#define cgetustr __nbcompat_cgetustr + +char *cgetcap(char *, const char *, int); +int cgetclose(void); +int cgetent(char **, const char * const *, const char *); +int cgetfirst(char **, const char * const *); +int cgetmatch(const char *, const char *); +int cgetnext(char **, const char * const *); +int cgetnum(char *, const char *, long *); +int cgetset(const char *); +int cgetstr(char *, const char *, char **); +int cgetustr(char *, const char *, char **); + +/* */ + +#if WORDS_BIGENDIAN +#if !HAVE_DECL_HTOBE16 +#define htobe16(x) (x) +#endif +#if !HAVE_DECL_HTOBE32 +#define htobe32(x) (x) +#endif +#if !HAVE_DECL_HTOBE64 +#define htobe64(x) (x) +#endif +#if !HAVE_DECL_HTOLE16 +#define htole16(x) bswap16((u_int16_t)(x)) +#endif +#if !HAVE_DECL_HTOLE32 +#define htole32(x) bswap32((u_int32_t)(x)) +#endif +#if !HAVE_DECL_HTOLE64 +#define htole64(x) bswap64((u_int64_t)(x)) +#endif +#else +#if !HAVE_DECL_HTOBE16 +#define htobe16(x) bswap16((u_int16_t)(x)) +#endif +#if !HAVE_DECL_HTOBE32 +#define htobe32(x) bswap32((u_int32_t)(x)) +#endif +#if !HAVE_DECL_HTOBE64 +#define htobe64(x) bswap64((u_int64_t)(x)) +#endif +#if !HAVE_DECL_HTOLE16 +#define htole16(x) (x) +#endif +#if !HAVE_DECL_HTOLE32 +#define htole32(x) (x) +#endif +#if !HAVE_DECL_HTOLE64 +#define htole64(x) (x) +#endif +#endif +#if !HAVE_DECL_BE16TOH +#define be16toh(x) htobe16(x) +#endif +#if !HAVE_DECL_BE32TOH +#define be32toh(x) htobe32(x) +#endif +#if !HAVE_DECL_BE64TOH +#define be64toh(x) htobe64(x) +#endif +#if !HAVE_DECL_LE16TOH +#define le16toh(x) htole16(x) +#endif +#if !HAVE_DECL_LE32TOH +#define le32toh(x) htole32(x) +#endif +#if !HAVE_DECL_LE64TOH +#define le64toh(x) htole64(x) +#endif + +#define __GEN_ENDIAN_ENC(bits, endian) \ +static void \ +endian ## bits ## enc(void *dst, uint ## bits ## _t u) \ +{ \ + u = hto ## endian ## bits (u); \ + memcpy(dst, &u, sizeof(u)); \ +} +#if !HAVE_DECL_BE16ENC +__GEN_ENDIAN_ENC(16, be) +#endif +#if !HAVE_DECL_BE32ENC +__GEN_ENDIAN_ENC(32, be) +#endif +#if !HAVE_DECL_BE64ENC +__GEN_ENDIAN_ENC(64, be) +#endif +#if !HAVE_DECL_LE16ENC +__GEN_ENDIAN_ENC(16, le) +#endif +#if !HAVE_DECL_LE32ENC +__GEN_ENDIAN_ENC(32, le) +#endif +#if !HAVE_DECL_LE64ENC +__GEN_ENDIAN_ENC(64, le) +#endif +#undef __GEN_ENDIAN_ENC + +#define __GEN_ENDIAN_DEC(bits, endian) \ +static uint ## bits ## _t \ +endian ## bits ## dec(const void *buf) \ +{ \ + uint ## bits ## _t u; \ + memcpy(&u, buf, sizeof(u)); \ + return endian ## bits ## toh (u); \ +} +#if !HAVE_DECL_BE16DEC +__GEN_ENDIAN_DEC(16, be) +#endif +#if !HAVE_DECL_BE32DEC +__GEN_ENDIAN_DEC(32, be) +#endif +#if !HAVE_DECL_BE64DEC +__GEN_ENDIAN_DEC(64, be) +#endif +#if !HAVE_DECL_LE16DEC +__GEN_ENDIAN_DEC(16, le) +#endif +#if !HAVE_DECL_LE32DEC +__GEN_ENDIAN_DEC(32, le) +#endif +#if !HAVE_DECL_LE64DEC +__GEN_ENDIAN_DEC(64, le) +#endif +#undef __GEN_ENDIAN_DEC + +/* */ + +#ifndef MAP_FILE +#define MAP_FILE 0 +#endif + +/* HP-UX has MAP_ANONYMOUS but not MAP_ANON */ +#ifndef MAP_ANON +#ifdef MAP_ANONYMOUS +#define MAP_ANON MAP_ANONYMOUS +#endif +#endif + +/* */ + +#undef BIG_ENDIAN +#undef LITTLE_ENDIAN +#undef PDP_ENDIAN +#define BIG_ENDIAN 4321 +#define LITTLE_ENDIAN 1234 +#define PDP_ENDIAN 3412 + +#undef BYTE_ORDER +#if WORDS_BIGENDIAN +#define BYTE_ORDER BIG_ENDIAN +#else +#define BYTE_ORDER LITTLE_ENDIAN +#endif + +/* all references of DEV_BSIZE in tools are for NetBSD's file images */ +#undef DEV_BSIZE +#define DEV_BSIZE (1 << 9) + +#undef MIN +#undef MAX +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define MAX(a,b) ((a) > (b) ? (a) : (b)) + +#ifndef MAXBSIZE +#define MAXBSIZE (64 * 1024) +#endif +#ifndef MAXFRAG +#define MAXFRAG 8 +#endif +#ifndef MAXPHYS +#define MAXPHYS (64 * 1024) +#endif + +/* XXX needed by makefs; this should be done in a better way */ +#undef btodb +#define btodb(x) ((x) << 9) + +#undef setbit +#undef clrbit +#undef isset +#undef isclr +#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) +#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) +#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) +#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) + +#ifndef powerof2 +#define powerof2(x) ((((x)-1)&(x))==0) +#endif + +#undef roundup +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) + +/* */ + +#ifndef ALLPERMS +#define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) +#endif +#ifndef DEFFILEMODE +#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) +#endif +#ifndef S_ISTXT +#ifdef S_ISVTX +#define S_ISTXT S_ISVTX +#else +#define S_ISTXT 0 +#endif +#endif + +/* Protected by _NETBSD_SOURCE otherwise. */ +#if HAVE_STRUCT_STAT_ST_FLAGS && defined(__NetBSD__) +#define UF_SETTABLE 0x0000ffff +#define UF_NODUMP 0x00000001 +#define UF_IMMUTABLE 0x00000002 +#define UF_APPEND 0x00000004 +#define UF_OPAQUE 0x00000008 +#define SF_SETTABLE 0xffff0000 +#define SF_ARCHIVED 0x00010000 +#define SF_IMMUTABLE 0x00020000 +#define SF_APPEND 0x00040000 +#endif + +/* */ + +#ifndef LINE_MAX +#define LINE_MAX 2048 +#endif + +/* */ + +#ifndef timercmp +#define timercmp(tvp, uvp, cmp) \ + (((tvp)->tv_sec == (uvp)->tv_sec) ? \ + ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ + ((tvp)->tv_sec cmp (uvp)->tv_sec)) +#endif +#ifndef timeradd +#define timeradd(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ + if ((vvp)->tv_usec >= 1000000) { \ + (vvp)->tv_sec++; \ + (vvp)->tv_usec -= 1000000; \ + } \ + } while (/* CONSTCOND */ 0) +#endif +#ifndef timersub +#define timersub(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (/* CONSTCOND */ 0) +#endif + +/* */ + +#ifdef major +#undef major +#endif +#define major(x) ((int32_t)((((x) & 0x000fff00) >> 8))) + +#ifdef minor +#undef minor +#endif +#define minor(x) ((int32_t)((((x) & 0xfff00000) >> 12) | \ + (((x) & 0x000000ff) >> 0))) +#ifdef makedev +#undef makedev +#endif +#define makedev(x,y) ((dev_t)((((x) << 8) & 0x000fff00) | \ + (((y) << 12) & 0xfff00000) | \ + (((y) << 0) & 0x000000ff))) +#ifndef NBBY +#define NBBY 8 +#endif + +#if !HAVE_U_QUAD_T +/* #define, not typedef, as quad_t exists as a struct on some systems */ +#define quad_t long long +#define u_quad_t unsigned long long +#define strtoq strtoll +#define strtouq strtoull +#endif + +/* Has quad_t but these prototypes don't get pulled into scope. w/o we lose */ +#ifdef __NetBSD__ +quad_t strtoq __P((const char *, char **, int)); +u_quad_t strtouq __P((const char *, char **, int)); +#endif + +#endif /* !__NETBSD_COMPAT_DEFS_H__ */ diff --git a/tools/compat/compat_getopt.h b/tools/compat/compat_getopt.h new file mode 100644 index 000000000..86599bf3f --- /dev/null +++ b/tools/compat/compat_getopt.h @@ -0,0 +1,17 @@ +/* $NetBSD: compat_getopt.h,v 1.2 2007/11/08 20:30:59 christos Exp $ */ + +/* We unconditionally use the NetBSD getopt.h in libnbcompat. */ + +#if HAVE_GETOPT_H +#include +#endif + +#define option __nbcompat_option +#define getopt_long __nbcompat_getopt_long + +#undef no_argument +#undef required_argument +#undef optional_argument +#undef _GETOPT_H_ + +#include "../../include/getopt.h" diff --git a/tools/compat/compat_pwd.h b/tools/compat/compat_pwd.h new file mode 100644 index 000000000..00dd2e274 --- /dev/null +++ b/tools/compat/compat_pwd.h @@ -0,0 +1,63 @@ +/* $NetBSD: compat_pwd.h,v 1.6 2009/01/18 01:44:09 christos Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _COMPAT_PWD_H_ +#define _COMPAT_PWD_H_ + +/* A very special version of for pwd_mkdb(8) and __nbcompat_pwscan(3). */ + +#include "../../include/pwd.h" + +#define passwd __nbcompat_passwd +#define pw_scan __nbcompat_pw_scan +#ifdef LOGIN_NAME_MAX +#undef LOGIN_NAME_MAX +#endif +/* Taken from syslimits.h. Need the NetBSD def, not the local system def */ +#define LOGIN_NAME_MAX 17 + +/* All elements exactly sized: */ +struct passwd { + char *pw_name; + char *pw_passwd; + int32_t pw_uid; + int32_t pw_gid; + int64_t pw_change; + char *pw_class; + char *pw_gecos; + char *pw_dir; + char *pw_shell; + int64_t pw_expire; +}; + +int pw_scan(char *, struct passwd *, int *); + +#endif /* !_PWD_H_ */ diff --git a/tools/compat/configure b/tools/compat/configure new file mode 100755 index 000000000..57c24ac18 --- /dev/null +++ b/tools/compat/configure @@ -0,0 +1,8442 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52 for libnbcompat noversion. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME='libnbcompat' +PACKAGE_TARNAME='libnbcompat' +PACKAGE_VERSION='noversion' +PACKAGE_STRING='libnbcompat noversion' +PACKAGE_BUGREPORT='lib-bug-people@NetBSD.org' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF +libnbcompat configure noversion +generated by GNU Autoconf 2.52 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:861: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:872: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:880: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:896: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:900: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:906: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:908: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:910: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:929: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:931: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:951: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:954: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +ac_config_headers="$ac_config_headers nbtool_config.h" + +ac_config_files="$ac_config_files defs.mk" + +# Autoheader header and footer + +# AC_NETBSD + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:979: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:994: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1002: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1005: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:1014: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1029: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1037: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1040: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:1053: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1068: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1076: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1079: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1088: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1103: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1111: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1114: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1127: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1147: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1169: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1172: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:1183: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:1198: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1206: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1209: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1222: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:1237: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1245: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1248: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1260: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:1265:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1268: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1271: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1273: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1276: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1278: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1281: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1285 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:1301: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:1304: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1307: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1330: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:1336: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1341: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:1347: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1350: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1357: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1365: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1372: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1374: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1377: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1379: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1382: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1398: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:1404: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:1410: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1416 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1428: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1431: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1443: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:1450: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1454: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1460 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1475: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1478: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1481: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1484: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1496: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:1502: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1508 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1520: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1523: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1526: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1529: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1539: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1566: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1569: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1572: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1575: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1587 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1600: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1603: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1606: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1609: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1619 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1631: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1634: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1637: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1640: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:1672: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1693 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1698: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1704: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1727 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1731: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1737: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:1774: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1784 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1789: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1795: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1818 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1822: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1828: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:1856: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + echo "$as_me:1867: checking for NetBSD" >&5 +echo $ECHO_N "checking for NetBSD... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line 1870 "configure" +#include "confdefs.h" +#ifdef __NetBSD__ + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + echo "$as_me:1879: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + +cat >>confdefs.h <<\EOF +#define _POSIX_C_SOURCE 200112L +EOF + +cat >>confdefs.h <<\EOF +#define _XOPEN_SOURCE 600 +EOF + +else + echo "$as_me:1895: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest* + +# Extract the first word of "sh", so it can be a program name with args. +set dummy sh; ac_word=$2 +echo "$as_me:1902: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_BSHELL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $BSHELL in + [\\/]* | ?:[\\/]*) + ac_cv_path_BSHELL="$BSHELL" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_BSHELL="$ac_dir/$ac_word" + echo "$as_me:1919: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +BSHELL=$ac_cv_path_BSHELL + +if test -n "$BSHELL"; then + echo "$as_me:1930: result: $BSHELL" >&5 +echo "${ECHO_T}$BSHELL" >&6 +else + echo "$as_me:1933: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test x"$BSHELL" = x; then + { { echo "$as_me:1938: error: sh must be somewhere on \$PATH" >&5 +echo "$as_me: error: sh must be somewhere on \$PATH" >&2;} + { (exit 1); exit 1; }; } +fi + +cat >>confdefs.h <&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +#line 1955 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1972: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1975: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1978: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1981: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +#line 1985 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2002: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2005: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2008: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2011: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_bigendian=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { { echo "$as_me:2027: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 2032 "configure" +#include "confdefs.h" +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:2048: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2051: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:2053: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2056: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_bigendian=yes +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:2069: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +if test $ac_cv_c_bigendian = yes; then + +cat >>confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + +echo "$as_me:2079: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2085 "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:2093: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2099: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line 2121 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line 2139 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line 2160 "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:2186: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2189: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:2191: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2194: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:2207: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +# Confirm existence of zlib. (This is available as a default install +# option on many OS's; this could be added as a reachover build in the +# future.) +echo "$as_me:2220: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2226 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2230: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2236: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_zlib_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_zlib_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2255: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +if test $ac_cv_header_zlib_h = yes; then + : +else + { { echo "$as_me:2260: error: zlib must be installed in a compiler-visible path" >&5 +echo "$as_me: error: zlib must be installed in a compiler-visible path" >&2;} + { (exit 1); exit 1; }; } +fi + +echo "$as_me:2265: checking for gzdopen in -lz" >&5 +echo $ECHO_N "checking for gzdopen in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_gzdopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2273 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gzdopen (); +int +main () +{ +gzdopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2292: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2295: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2298: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2301: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_z_gzdopen=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_z_gzdopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2312: result: $ac_cv_lib_z_gzdopen" >&5 +echo "${ECHO_T}$ac_cv_lib_z_gzdopen" >&6 +if test $ac_cv_lib_z_gzdopen = yes; then + cat >>confdefs.h <&5 +echo "$as_me: error: zlib must be installed in a compiler-visible path" >&2;} + { (exit 1); exit 1; }; } +fi + +# Make sure certain required headers are available. +# These are not necessarily required by the code, but they are not +# currently conditionalized. + +for ac_header in sys/ioctl.h sys/mman.h sys/param.h \ + sys/socket.h sys/stat.h sys/time.h sys/types.h sys/utsname.h \ + sys/wait.h assert.h ctype.h errno.h fcntl.h grp.h limits.h locale.h \ + netdb.h pwd.h signal.h stdarg.h stdio.h stdlib.h string.h \ + termios.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:2338: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2344 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:2348: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2354: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2373: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo "$as_me: error: standard system header file not found" >&2;} + { (exit 1); exit 1; }; } +fi +done + +# Find headers that may not be available. + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +echo "$as_me:2392: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2398 "configure" +#include "confdefs.h" +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2413: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2416: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2419: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2422: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2432: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 +if test "${ac_cv_lib_dir_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldir $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2453 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2472: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2475: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2478: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2481: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dir_opendir=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dir_opendir=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2492: result: $ac_cv_lib_dir_opendir" >&5 +echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 +if test $ac_cv_lib_dir_opendir = yes; then + LIBS="$LIBS -ldir" +fi + +else + echo "$as_me:2499: checking for opendir in -lx" >&5 +echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 +if test "${ac_cv_lib_x_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lx $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2507 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2526: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2529: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2532: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2535: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_x_opendir=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_x_opendir=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2546: result: $ac_cv_lib_x_opendir" >&5 +echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 +if test $ac_cv_lib_x_opendir = yes; then + LIBS="$LIBS -lx" +fi + +fi + +for ac_header in sys/mtio.h sys/sysmacros.h sys/syslimits.h \ + getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:2558: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2564 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:2568: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2574: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2593: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2614 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:2618: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2624: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2643: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2664 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:2668: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2674: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2693: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <include/$ac_header.new + echo '#include "'$srcdir/../../include/$ac_header'"' \ + >>include/$ac_header.new + if cmp include/$ac_header.new include/$ac_header >/dev/null 2>&1; then + rm -f include/$ac_header.new + else + mv -f include/$ac_header.new include/$ac_header + fi +fi +done + +# Typedefs. +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:2719: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2725 "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2731: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2734: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2737: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2740: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2750: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2766 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2781: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2784: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2787: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2790: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_size_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2800: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for id_t... $ECHO_C" >&6 +if test "${ac_cv_type_id_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2818 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((id_t *) 0) + return 0; +if (sizeof (id_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2833: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2836: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2839: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2842: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_id_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_id_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2852: result: $ac_cv_type_id_t" >&5 +echo "${ECHO_T}$ac_cv_type_id_t" >&6 +if test $ac_cv_type_id_t = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2867 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2882: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2885: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2888: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2891: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_long_long=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2901: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 +if test $ac_cv_type_long_long = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for u_long... $ECHO_C" >&6 +if test "${ac_cv_type_u_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2916 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_long *) 0) + return 0; +if (sizeof (u_long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2931: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2934: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2937: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2940: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_long=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2950: result: $ac_cv_type_u_long" >&5 +echo "${ECHO_T}$ac_cv_type_u_long" >&6 +if test $ac_cv_type_u_long = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for u_char... $ECHO_C" >&6 +if test "${ac_cv_type_u_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2965 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_char *) 0) + return 0; +if (sizeof (u_char)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2980: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2983: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2986: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2989: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_char=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_char=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2999: result: $ac_cv_type_u_char" >&5 +echo "${ECHO_T}$ac_cv_type_u_char" >&6 +if test $ac_cv_type_u_char = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for u_short... $ECHO_C" >&6 +if test "${ac_cv_type_u_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3014 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_short *) 0) + return 0; +if (sizeof (u_short)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3029: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3032: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3035: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3038: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_short=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_short=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3048: result: $ac_cv_type_u_short" >&5 +echo "${ECHO_T}$ac_cv_type_u_short" >&6 +if test $ac_cv_type_u_short = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for u_int... $ECHO_C" >&6 +if test "${ac_cv_type_u_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3063 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int *) 0) + return 0; +if (sizeof (u_int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3078: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3081: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3084: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3087: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3097: result: $ac_cv_type_u_int" >&5 +echo "${ECHO_T}$ac_cv_type_u_int" >&6 +if test $ac_cv_type_u_int = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for u_quad_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_quad_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3112 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_quad_t *) 0) + return 0; +if (sizeof (u_quad_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3127: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3130: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3133: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3136: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_quad_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_quad_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3146: result: $ac_cv_type_u_quad_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_quad_t" >&6 +if test $ac_cv_type_u_quad_t = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 +if test "${ac_cv_type_socklen_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3162 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +if ((socklen_t *) 0) + return 0; +if (sizeof (socklen_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3179: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3182: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3185: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3188: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_socklen_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_socklen_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3198: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 +if test $ac_cv_type_socklen_t = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_SOCKLEN_T 1 +EOF + +fi + + echo "$as_me:3208: checking for uint8_t" >&5 +echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3214 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint8_t *) 0) + return 0; +if (sizeof (uint8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3229: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3232: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3235: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3238: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint8_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint8_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3248: result: $ac_cv_type_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 +if test $ac_cv_type_uint8_t = yes; then + : +else + + echo "$as_me:3254: checking for u_int8_t" >&5 +echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3260 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int8_t *) 0) + return 0; +if (sizeof (u_int8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3275: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3278: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3281: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3284: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int8_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int8_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3294: result: $ac_cv_type_u_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6 +if test $ac_cv_type_u_int8_t = yes; then + +cat >>confdefs.h <<\EOF +#define uint8_t u_int8_t +EOF + +else + { { echo "$as_me:3303: error: cannot find a suitable type for uint8_t" >&5 +echo "$as_me: error: cannot find a suitable type for uint8_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + echo "$as_me:3310: checking for u_int8_t" >&5 +echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3316 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int8_t *) 0) + return 0; +if (sizeof (u_int8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3331: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3334: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3337: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3340: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int8_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int8_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3350: result: $ac_cv_type_u_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6 +if test $ac_cv_type_u_int8_t = yes; then + : +else + + echo "$as_me:3356: checking for uint8_t" >&5 +echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3362 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint8_t *) 0) + return 0; +if (sizeof (uint8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3377: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3380: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3383: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3386: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint8_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint8_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3396: result: $ac_cv_type_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 +if test $ac_cv_type_uint8_t = yes; then + +cat >>confdefs.h <<\EOF +#define u_int8_t uint8_t +EOF + +else + { { echo "$as_me:3405: error: cannot find a suitable type for u_int8_t" >&5 +echo "$as_me: error: cannot find a suitable type for u_int8_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + echo "$as_me:3412: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3418 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3433: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3436: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3439: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3442: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint16_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3452: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 +if test $ac_cv_type_uint16_t = yes; then + : +else + + echo "$as_me:3458: checking for u_int16_t" >&5 +echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3464 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int16_t *) 0) + return 0; +if (sizeof (u_int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3479: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3482: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3485: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3488: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int16_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3498: result: $ac_cv_type_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 +if test $ac_cv_type_u_int16_t = yes; then + +cat >>confdefs.h <<\EOF +#define uint16_t u_int16_t +EOF + +else + { { echo "$as_me:3507: error: cannot find a suitable type for uint16_t" >&5 +echo "$as_me: error: cannot find a suitable type for uint16_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + echo "$as_me:3514: checking for u_int16_t" >&5 +echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3520 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int16_t *) 0) + return 0; +if (sizeof (u_int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3535: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3538: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3541: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3544: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int16_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3554: result: $ac_cv_type_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 +if test $ac_cv_type_u_int16_t = yes; then + : +else + + echo "$as_me:3560: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3566 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3581: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3584: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3587: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3590: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint16_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3600: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 +if test $ac_cv_type_uint16_t = yes; then + +cat >>confdefs.h <<\EOF +#define u_int16_t uint16_t +EOF + +else + { { echo "$as_me:3609: error: cannot find a suitable type for u_int16_t" >&5 +echo "$as_me: error: cannot find a suitable type for u_int16_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + echo "$as_me:3616: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3622 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3637: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3640: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3643: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3646: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3656: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + : +else + + echo "$as_me:3662: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3668 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3683: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3686: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3689: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3692: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3702: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + +cat >>confdefs.h <<\EOF +#define uint32_t u_int32_t +EOF + +else + { { echo "$as_me:3711: error: cannot find a suitable type for uint32_t" >&5 +echo "$as_me: error: cannot find a suitable type for uint32_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + echo "$as_me:3718: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3724 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3739: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3742: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3745: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3748: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3758: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + : +else + + echo "$as_me:3764: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3770 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3785: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3788: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3791: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3794: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3804: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + +cat >>confdefs.h <<\EOF +#define u_int32_t uint32_t +EOF + +else + { { echo "$as_me:3813: error: cannot find a suitable type for u_int32_t" >&5 +echo "$as_me: error: cannot find a suitable type for u_int32_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + echo "$as_me:3820: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3826 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3841: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3844: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3847: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3850: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3860: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else + + echo "$as_me:3866: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3872 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3887: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3890: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3893: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3896: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3906: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +if test $ac_cv_type_u_int64_t = yes; then + +cat >>confdefs.h <<\EOF +#define uint64_t u_int64_t +EOF + +else + { { echo "$as_me:3915: error: cannot find a suitable type for uint64_t" >&5 +echo "$as_me: error: cannot find a suitable type for uint64_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + echo "$as_me:3922: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3928 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3943: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3946: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3949: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3952: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3962: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +if test $ac_cv_type_u_int64_t = yes; then + : +else + + echo "$as_me:3968: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3974 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3989: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3992: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3995: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3998: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4008: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + +cat >>confdefs.h <<\EOF +#define u_int64_t uint64_t +EOF + +else + { { echo "$as_me:4017: error: cannot find a suitable type for u_int64_t" >&5 +echo "$as_me: error: cannot find a suitable type for u_int64_t" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +# Struct members. +echo "$as_me:4025: checking for DIR.dd_fd" >&5 +echo $ECHO_N "checking for DIR.dd_fd... $ECHO_C" >&6 +if test "${ac_cv_member_DIR_dd_fd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4031 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +static DIR ac_aggr; +if (ac_aggr.dd_fd) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4047: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4050: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4053: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4056: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_DIR_dd_fd=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_DIR_dd_fd=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4066: result: $ac_cv_member_DIR_dd_fd" >&5 +echo "${ECHO_T}$ac_cv_member_DIR_dd_fd" >&6 +if test $ac_cv_member_DIR_dd_fd = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for DIR.__dd_fd... $ECHO_C" >&6 +if test "${ac_cv_member_DIR___dd_fd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4081 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +static DIR ac_aggr; +if (ac_aggr.__dd_fd) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4097: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4100: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4103: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4106: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_DIR___dd_fd=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_DIR___dd_fd=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4116: result: $ac_cv_member_DIR___dd_fd" >&5 +echo "${ECHO_T}$ac_cv_member_DIR___dd_fd" >&6 +if test $ac_cv_member_DIR___dd_fd = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct dirent.d_namlen... $ECHO_C" >&6 +if test "${ac_cv_member_struct_dirent_d_namlen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4131 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +static struct dirent ac_aggr; +if (ac_aggr.d_namlen) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4147: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4150: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4153: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4156: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_dirent_d_namlen=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_dirent_d_namlen=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4166: result: $ac_cv_member_struct_dirent_d_namlen" >&5 +echo "${ECHO_T}$ac_cv_member_struct_dirent_d_namlen" >&6 +if test $ac_cv_member_struct_dirent_d_namlen = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4182 "configure" +#include "confdefs.h" +#include + +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_flags) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4197: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4200: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4203: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4206: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_flags=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_stat_st_flags=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4216: result: $ac_cv_member_struct_stat_st_flags" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6 +if test $ac_cv_member_struct_stat_st_flags = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4231 "configure" +#include "confdefs.h" +#include + +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_gen) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4246: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4249: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4252: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4255: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_gen=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_stat_st_gen=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4265: result: $ac_cv_member_struct_stat_st_gen" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6 +if test $ac_cv_member_struct_stat_st_gen = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4280 "configure" +#include "confdefs.h" +#include + +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_birthtime) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4295: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4298: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4301: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4304: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_birthtime=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_stat_st_birthtime=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4314: result: $ac_cv_member_struct_stat_st_birthtime" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6 +if test $ac_cv_member_struct_stat_st_birthtime = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct stat.st_birthtimensec... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_birthtimensec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4329 "configure" +#include "confdefs.h" +#include + +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_birthtimensec) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4344: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4347: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4350: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4353: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_birthtimensec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_stat_st_birthtimensec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4363: result: $ac_cv_member_struct_stat_st_birthtimensec" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtimensec" >&6 +if test $ac_cv_member_struct_stat_st_birthtimensec = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct stat.st_atim... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_atim+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4378 "configure" +#include "confdefs.h" +#include + +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_atim) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4393: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4396: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4399: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4402: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_atim=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_stat_st_atim=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4412: result: $ac_cv_member_struct_stat_st_atim" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_atim" >&6 +if test $ac_cv_member_struct_stat_st_atim = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct stat.st_mtimensec... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_mtimensec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4427 "configure" +#include "confdefs.h" +#include + +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_mtimensec) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4442: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4445: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4448: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4451: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_mtimensec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_stat_st_mtimensec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4461: result: $ac_cv_member_struct_stat_st_mtimensec" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_mtimensec" >&6 +if test $ac_cv_member_struct_stat_st_mtimensec = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for struct statvfs.f_iosize... $ECHO_C" >&6 +if test "${ac_cv_member_struct_statvfs_f_iosize+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4477 "configure" +#include "confdefs.h" +#include + +int +main () +{ +static struct statvfs ac_aggr; +if (ac_aggr.f_iosize) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4492: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4495: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4498: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4501: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_statvfs_f_iosize=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_member_struct_statvfs_f_iosize=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4511: result: $ac_cv_member_struct_statvfs_f_iosize" >&5 +echo "${ECHO_T}$ac_cv_member_struct_statvfs_f_iosize" >&6 +if test $ac_cv_member_struct_statvfs_f_iosize = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking whether optind is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_optind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4528 "configure" +#include "confdefs.h" + +#include +#include +#include + +int +main () +{ +#ifndef optind + char *p = (char *) optind; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4547: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4550: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4553: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4556: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_optind=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_optind=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4566: result: $ac_cv_have_decl_optind" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optind" >&6 +if test $ac_cv_have_decl_optind = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_optreset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4586 "configure" +#include "confdefs.h" + +#include +#include +#include + +int +main () +{ +#ifndef optreset + char *p = (char *) optreset; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4605: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4608: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4611: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4614: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_optreset=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_optreset=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4624: result: $ac_cv_have_decl_optreset" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6 +if test $ac_cv_have_decl_optreset = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether sys_signame is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_sys_signame+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4645 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef sys_signame + char *p = (char *) sys_signame; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4661: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4664: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4667: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4670: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_sys_signame=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_sys_signame=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4680: result: $ac_cv_have_decl_sys_signame" >&5 +echo "${ECHO_T}$ac_cv_have_decl_sys_signame" >&6 +if test $ac_cv_have_decl_sys_signame = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4704 "configure" +#include "confdefs.h" +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4716: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4719: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4722: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4725: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_working_alloca_h=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:4735: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_ALLOCA_H 1 +EOF + +fi + +echo "$as_me:4745: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4751 "configure" +#include "confdefs.h" +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4783: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4786: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4789: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4792: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_alloca_works=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_alloca_works=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:4802: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 + +if test $ac_cv_func_alloca_works = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_ALLOCA 1 +EOF + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\EOF +#define C_ALLOCA 1 +EOF + +echo "$as_me:4823: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4829 "configure" +#include "confdefs.h" +#if defined(CRAY) && ! defined(CRAY2) +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "webecray" >/dev/null 2>&1; then + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +echo "$as_me:4847: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6 +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:4852: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4858 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* 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 +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4889: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4892: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4895: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4898: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:4908: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4931 "configure" +#include "confdefs.h" +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +main () +{ + exit (find_stack_direction () < 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4954: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4957: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4959: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4962: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_stack_direction=1 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_stack_direction=-1 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:4974: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5000 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* 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 +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5031: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5034: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5037: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5040: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:5050: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking whether user_from_uid is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_user_from_uid+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5066 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +#ifndef user_from_uid + char *p = (char *) user_from_uid; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5083: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5086: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5089: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5092: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_user_from_uid=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_user_from_uid=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5102: result: $ac_cv_have_decl_user_from_uid" >&5 +echo "${ECHO_T}$ac_cv_have_decl_user_from_uid" >&6 +if test $ac_cv_have_decl_user_from_uid = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether uid_from_user is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_uid_from_user+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5122 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +#ifndef uid_from_user + char *p = (char *) uid_from_user; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5139: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5142: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5145: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5148: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_uid_from_user=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_uid_from_user=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5158: result: $ac_cv_have_decl_uid_from_user" >&5 +echo "${ECHO_T}$ac_cv_have_decl_uid_from_user" >&6 +if test $ac_cv_have_decl_uid_from_user = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether pwcache_userdb is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_pwcache_userdb+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5178 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +#ifndef pwcache_userdb + char *p = (char *) pwcache_userdb; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5195: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5198: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5201: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5204: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_pwcache_userdb=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_pwcache_userdb=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5214: result: $ac_cv_have_decl_pwcache_userdb" >&5 +echo "${ECHO_T}$ac_cv_have_decl_pwcache_userdb" >&6 +if test $ac_cv_have_decl_pwcache_userdb = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether group_from_gid is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_group_from_gid+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5235 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +#ifndef group_from_gid + char *p = (char *) group_from_gid; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5252: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5255: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5258: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5261: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_group_from_gid=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_group_from_gid=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5271: result: $ac_cv_have_decl_group_from_gid" >&5 +echo "${ECHO_T}$ac_cv_have_decl_group_from_gid" >&6 +if test $ac_cv_have_decl_group_from_gid = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether gid_from_group is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_gid_from_group+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5291 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +#ifndef gid_from_group + char *p = (char *) gid_from_group; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5308: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5311: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5314: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5317: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_gid_from_group=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_gid_from_group=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5327: result: $ac_cv_have_decl_gid_from_group" >&5 +echo "${ECHO_T}$ac_cv_have_decl_gid_from_group" >&6 +if test $ac_cv_have_decl_gid_from_group = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether pwcache_groupdb is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_pwcache_groupdb+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5347 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +#ifndef pwcache_groupdb + char *p = (char *) pwcache_groupdb; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5364: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5367: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5370: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5373: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_pwcache_groupdb=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_pwcache_groupdb=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5383: result: $ac_cv_have_decl_pwcache_groupdb" >&5 +echo "${ECHO_T}$ac_cv_have_decl_pwcache_groupdb" >&6 +if test $ac_cv_have_decl_pwcache_groupdb = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether strndup is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strndup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5404 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef strndup + char *p = (char *) strndup; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5420: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5423: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5426: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5429: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strndup=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_strndup=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5439: result: $ac_cv_have_decl_strndup" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strndup" >&6 +if test $ac_cv_have_decl_strndup = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether strsuftoll is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strsuftoll+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5460 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef strsuftoll + char *p = (char *) strsuftoll; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5476: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5479: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5482: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5485: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strsuftoll=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_strsuftoll=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5495: result: $ac_cv_have_decl_strsuftoll" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strsuftoll" >&6 +if test $ac_cv_have_decl_strsuftoll = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether lchflags is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_lchflags+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5516 "configure" +#include "confdefs.h" + +#include +#include + +int +main () +{ +#ifndef lchflags + char *p = (char *) lchflags; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5534: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5537: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5540: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5543: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_lchflags=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_lchflags=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5553: result: $ac_cv_have_decl_lchflags" >&5 +echo "${ECHO_T}$ac_cv_have_decl_lchflags" >&6 +if test $ac_cv_have_decl_lchflags = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether lchmod is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_lchmod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5573 "configure" +#include "confdefs.h" + +#include +#include + +int +main () +{ +#ifndef lchmod + char *p = (char *) lchmod; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5591: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5594: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5597: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5600: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_lchmod=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_lchmod=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5610: result: $ac_cv_have_decl_lchmod" >&5 +echo "${ECHO_T}$ac_cv_have_decl_lchmod" >&6 +if test $ac_cv_have_decl_lchmod = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether lchown is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_lchown+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5630 "configure" +#include "confdefs.h" + +#include +#include + +int +main () +{ +#ifndef lchown + char *p = (char *) lchown; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5648: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5651: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5654: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5657: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_lchown=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_lchown=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5667: result: $ac_cv_have_decl_lchown" >&5 +echo "${ECHO_T}$ac_cv_have_decl_lchown" >&6 +if test $ac_cv_have_decl_lchown = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether htobe16 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_htobe16+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5688 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef htobe16 + char *p = (char *) htobe16; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5704: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5707: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5710: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5713: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_htobe16=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_htobe16=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5723: result: $ac_cv_have_decl_htobe16" >&5 +echo "${ECHO_T}$ac_cv_have_decl_htobe16" >&6 +if test $ac_cv_have_decl_htobe16 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether htobe32 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_htobe32+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5743 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef htobe32 + char *p = (char *) htobe32; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5759: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5762: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5765: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5768: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_htobe32=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_htobe32=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5778: result: $ac_cv_have_decl_htobe32" >&5 +echo "${ECHO_T}$ac_cv_have_decl_htobe32" >&6 +if test $ac_cv_have_decl_htobe32 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether htobe64 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_htobe64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5798 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef htobe64 + char *p = (char *) htobe64; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5814: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5817: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5820: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5823: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_htobe64=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_htobe64=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5833: result: $ac_cv_have_decl_htobe64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_htobe64" >&6 +if test $ac_cv_have_decl_htobe64 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether htole16 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_htole16+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5853 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef htole16 + char *p = (char *) htole16; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5869: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5872: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5875: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5878: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_htole16=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_htole16=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5888: result: $ac_cv_have_decl_htole16" >&5 +echo "${ECHO_T}$ac_cv_have_decl_htole16" >&6 +if test $ac_cv_have_decl_htole16 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether htole32 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_htole32+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5908 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef htole32 + char *p = (char *) htole32; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5924: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5927: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5930: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5933: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_htole32=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_htole32=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5943: result: $ac_cv_have_decl_htole32" >&5 +echo "${ECHO_T}$ac_cv_have_decl_htole32" >&6 +if test $ac_cv_have_decl_htole32 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether htole64 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_htole64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5963 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef htole64 + char *p = (char *) htole64; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5979: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5982: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5985: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5988: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_htole64=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_htole64=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5998: result: $ac_cv_have_decl_htole64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_htole64" >&6 +if test $ac_cv_have_decl_htole64 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be16toh is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be16toh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6018 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be16toh + char *p = (char *) be16toh; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6034: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6037: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6040: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6043: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be16toh=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be16toh=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6053: result: $ac_cv_have_decl_be16toh" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be16toh" >&6 +if test $ac_cv_have_decl_be16toh = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be32toh is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be32toh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6073 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be32toh + char *p = (char *) be32toh; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6089: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6092: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6095: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6098: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be32toh=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be32toh=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6108: result: $ac_cv_have_decl_be32toh" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be32toh" >&6 +if test $ac_cv_have_decl_be32toh = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be64toh is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be64toh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6128 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be64toh + char *p = (char *) be64toh; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6144: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6147: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6150: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6153: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be64toh=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be64toh=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6163: result: $ac_cv_have_decl_be64toh" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be64toh" >&6 +if test $ac_cv_have_decl_be64toh = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le16toh is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le16toh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6183 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le16toh + char *p = (char *) le16toh; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6199: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6202: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6205: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6208: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le16toh=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le16toh=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6218: result: $ac_cv_have_decl_le16toh" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le16toh" >&6 +if test $ac_cv_have_decl_le16toh = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le32toh is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le32toh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6238 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le32toh + char *p = (char *) le32toh; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6254: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6257: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6260: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6263: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le32toh=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le32toh=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6273: result: $ac_cv_have_decl_le32toh" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le32toh" >&6 +if test $ac_cv_have_decl_le32toh = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le64toh is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le64toh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6293 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le64toh + char *p = (char *) le64toh; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6309: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6312: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6315: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6318: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le64toh=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le64toh=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6328: result: $ac_cv_have_decl_le64toh" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le64toh" >&6 +if test $ac_cv_have_decl_le64toh = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether bswap16 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_bswap16+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6349 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef bswap16 + char *p = (char *) bswap16; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6365: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6368: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6371: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6374: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_bswap16=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_bswap16=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6384: result: $ac_cv_have_decl_bswap16" >&5 +echo "${ECHO_T}$ac_cv_have_decl_bswap16" >&6 +if test $ac_cv_have_decl_bswap16 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether bswap32 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_bswap32+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6404 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef bswap32 + char *p = (char *) bswap32; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6420: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6423: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6426: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6429: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_bswap32=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_bswap32=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6439: result: $ac_cv_have_decl_bswap32" >&5 +echo "${ECHO_T}$ac_cv_have_decl_bswap32" >&6 +if test $ac_cv_have_decl_bswap32 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether bswap64 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_bswap64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6459 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef bswap64 + char *p = (char *) bswap64; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6475: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6478: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6481: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6484: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_bswap64=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_bswap64=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6494: result: $ac_cv_have_decl_bswap64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_bswap64" >&6 +if test $ac_cv_have_decl_bswap64 = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be16enc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be16enc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6515 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be16enc + char *p = (char *) be16enc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6531: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6534: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6537: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6540: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be16enc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be16enc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6550: result: $ac_cv_have_decl_be16enc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be16enc" >&6 +if test $ac_cv_have_decl_be16enc = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le16enc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le16enc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6570 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le16enc + char *p = (char *) le16enc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6586: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6589: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6592: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6595: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le16enc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le16enc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6605: result: $ac_cv_have_decl_le16enc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le16enc" >&6 +if test $ac_cv_have_decl_le16enc = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be16dec is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be16dec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6625 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be16dec + char *p = (char *) be16dec; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6641: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6644: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6647: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6650: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be16dec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be16dec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6660: result: $ac_cv_have_decl_be16dec" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be16dec" >&6 +if test $ac_cv_have_decl_be16dec = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le16dec is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le16dec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6680 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le16dec + char *p = (char *) le16dec; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6696: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6699: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6702: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6705: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le16dec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le16dec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6715: result: $ac_cv_have_decl_le16dec" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le16dec" >&6 +if test $ac_cv_have_decl_le16dec = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be32enc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be32enc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6735 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be32enc + char *p = (char *) be32enc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6751: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6754: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6757: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6760: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be32enc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be32enc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6770: result: $ac_cv_have_decl_be32enc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be32enc" >&6 +if test $ac_cv_have_decl_be32enc = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le32enc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le32enc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6790 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le32enc + char *p = (char *) le32enc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6806: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6809: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6812: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6815: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le32enc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le32enc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6825: result: $ac_cv_have_decl_le32enc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le32enc" >&6 +if test $ac_cv_have_decl_le32enc = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be32dec is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be32dec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6845 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be32dec + char *p = (char *) be32dec; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6861: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6864: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6867: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6870: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be32dec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be32dec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6880: result: $ac_cv_have_decl_be32dec" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be32dec" >&6 +if test $ac_cv_have_decl_be32dec = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le32dec is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le32dec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6900 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le32dec + char *p = (char *) le32dec; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6916: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6919: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6922: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6925: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le32dec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le32dec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6935: result: $ac_cv_have_decl_le32dec" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le32dec" >&6 +if test $ac_cv_have_decl_le32dec = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be64enc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be64enc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6955 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be64enc + char *p = (char *) be64enc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6971: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6974: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6977: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6980: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be64enc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be64enc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6990: result: $ac_cv_have_decl_be64enc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be64enc" >&6 +if test $ac_cv_have_decl_be64enc = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le64enc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le64enc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7010 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le64enc + char *p = (char *) le64enc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7026: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7029: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7032: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7035: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le64enc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le64enc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:7045: result: $ac_cv_have_decl_le64enc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le64enc" >&6 +if test $ac_cv_have_decl_le64enc = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether be64dec is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_be64dec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7065 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef be64dec + char *p = (char *) be64dec; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7081: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7084: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7087: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7090: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_be64dec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_be64dec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:7100: result: $ac_cv_have_decl_be64dec" >&5 +echo "${ECHO_T}$ac_cv_have_decl_be64dec" >&6 +if test $ac_cv_have_decl_be64dec = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether le64dec is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_le64dec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7120 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef le64dec + char *p = (char *) le64dec; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7136: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7139: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7142: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7145: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_le64dec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_le64dec=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:7155: result: $ac_cv_have_decl_le64dec" >&5 +echo "${ECHO_T}$ac_cv_have_decl_le64dec" >&6 +if test $ac_cv_have_decl_le64dec = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether fstatvfs is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fstatvfs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7176 "configure" +#include "confdefs.h" +#include + +int +main () +{ +#ifndef fstatvfs + char *p = (char *) fstatvfs; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7192: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7195: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7198: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7201: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fstatvfs=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_fstatvfs=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:7211: result: $ac_cv_have_decl_fstatvfs" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fstatvfs" >&6 +if test $ac_cv_have_decl_fstatvfs = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether setgroupent is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_setgroupent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7232 "configure" +#include "confdefs.h" + +#include +#include +#include + +int +main () +{ +#ifndef setgroupent + char *p = (char *) setgroupent; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7251: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7254: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7257: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7260: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_setgroupent=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_setgroupent=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:7270: result: $ac_cv_have_decl_setgroupent" >&5 +echo "${ECHO_T}$ac_cv_have_decl_setgroupent" >&6 +if test $ac_cv_have_decl_setgroupent = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking whether setpassent is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_setpassent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7290 "configure" +#include "confdefs.h" + +#include +#include +#include + +int +main () +{ +#ifndef setpassent + char *p = (char *) setpassent; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7309: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7312: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7315: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7318: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_setpassent=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_have_decl_setpassent=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:7328: result: $ac_cv_have_decl_setpassent" >&5 +echo "${ECHO_T}$ac_cv_have_decl_setpassent" >&6 +if test $ac_cv_have_decl_setpassent = yes; then + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking for regfree in -lregex... $ECHO_C" >&6 +if test "${ac_cv_lib_regex_regfree+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lregex $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 7354 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regfree (); +int +main () +{ +regfree (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7373: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7376: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7379: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7382: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_regex_regfree=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_regex_regfree=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:7393: result: $ac_cv_lib_regex_regfree" >&5 +echo "${ECHO_T}$ac_cv_lib_regex_regfree" >&6 +if test $ac_cv_lib_regex_regfree = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for library containing regfree... $ECHO_C" >&6 +if test "${ac_cv_search_regfree+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_regfree=no +cat >conftest.$ac_ext <<_ACEOF +#line 7412 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regfree (); +int +main () +{ +regfree (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7431: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7434: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7437: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7440: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_regfree="none required" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_regfree" = no; then + for ac_lib in rx posix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 7452 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regfree (); +int +main () +{ +regfree (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7471: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7474: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7477: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7480: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_regfree="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:7493: result: $ac_cv_search_regfree" >&5 +echo "${ECHO_T}$ac_cv_search_regfree" >&6 +if test "$ac_cv_search_regfree" != no; then + test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS" + +fi + +for ac_func in fparseln +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:7503: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7509 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* 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 +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7540: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7543: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7546: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7549: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:7559: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking if fparseln seems to work... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { echo "$as_me:7569: WARNING: cross compiling: not checking farseln" >&5 +echo "$as_me: WARNING: cross compiling: not checking farseln" >&2;} + +else + cat >conftest.$ac_ext <<_ACEOF +#line 7574 "configure" +#include "confdefs.h" + +#define _NETBSD_SOURCE +#include +#include +#define CONFTEST "conftest.fparseln" +#define COMMENT '#' +int +main(void) +{ + static const char delim[3] = { '\0', '\0', COMMENT }; + FILE *fp; + char *ptr; + fp = fopen(CONFTEST, "w+"); + if (fp != NULL) { + unlink(CONFTEST); + ungetc(COMMENT, fp); + ptr = fparseln(fp, NULL, NULL, delim, + FPARSELN_UNESCALL); + fclose(fp); + if (ptr == NULL) + exit(0); + } + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:7603: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7606: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:7608: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7611: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:7613: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:7619: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\EOF +#define BROKEN_FPARSELN 1 +EOF + +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +done + +# Variables substituted via @VARNAME@ in defs.mk.in +HAVE_PTHREAD_H=$ac_cv_header_pthread_h + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:7715: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:7887: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:7906: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me (libnbcompat noversion) 2.52, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "defs.mk" ) CONFIG_FILES="$CONFIG_FILES defs.mk" ;; + "nbtool_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS nbtool_config.h" ;; + *) { { echo "$as_me:7943: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@BSHELL@,$BSHELL,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@HAVE_PTHREAD_H@,$HAVE_PTHREAD_H,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:8144: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:8162: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:8175: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:8235: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:8246: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:8259: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +EOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\EOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +EOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\EOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +EOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:8376: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/tools/compat/configure.ac b/tools/compat/configure.ac new file mode 100644 index 000000000..10d0429b5 --- /dev/null +++ b/tools/compat/configure.ac @@ -0,0 +1,236 @@ +# $NetBSD: configure.ac,v 1.74 2011/11/03 14:13:53 joerg Exp $ +# +# Autoconf definition file for libnbcompat. +# +# When you edit configure.ac: +# 0. Create the tools versions of autoconf and autoheader: +# cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools +# (This might not work if you try it after editing configure.ac.) +# 1. edit configure.ac +# 2. Regenerate "configure" and "nbtool_config.h.in" from "configure.ac": +# cd ${SRCDIR}/tools/compat && ${TOOLDIR}/bin/nbmake-${MACHINE} regen +# (Please don't use a non-tools version of autoconf or autoheader.) +# 3. Test that the tools still build: +# mv ${TOOLDIR} ${TOOLDIR}.bak +# cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools +# 4. cvs commit files that you edited. +# 5. Regen again, to pick up changed RCS IDs from the above commit: +# cd ${SRCDIR}/tools/compat && ${TOOLDIR}/bin/nbmake-${MACHINE} regen +# 6. cvs commit files that were generated. +# + +AC_INIT([libnbcompat], [noversion], [lib-bug-people@NetBSD.org]) +AC_CONFIG_HEADERS(nbtool_config.h) +AC_CONFIG_FILES(defs.mk) + +# Autoheader header and footer +AH_TOP([/* $][NetBSD$ */ + +#ifndef __NETBSD_NBTOOL_CONFIG_H__ +#define __NETBSD_NBTOOL_CONFIG_H__]) + +AH_BOTTOM([#include "compat_defs.h" +#endif /* !__NETBSD_NBTOOL_CONFIG_H__ */]) + +AC_DEFUN([AC_NETBSD], +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl + AC_BEFORE([$0], [AC_RUN_IFELSE])dnl + AC_MSG_CHECKING([for NetBSD]) + AC_EGREP_CPP(yes, + [#ifdef __NetBSD__ + yes + #endif + ], + [AC_MSG_RESULT([yes]) + AC_DEFINE([_POSIX_SOURCE], 1, [Define for NetBSD headers.]) + AC_DEFINE([_POSIX_C_SOURCE], 200112L, [Define for NetBSD headers.]) + AC_DEFINE([_XOPEN_SOURCE], 600, [Define for NetBSD headers.])], + [AC_MSG_RESULT([no])]) +])# AC_NETBSD + +AC_NETBSD +AC_PATH_PROG(BSHELL, sh, ) +if test x"$BSHELL" = x; then + AC_MSG_ERROR([sh must be somewhere on \$PATH]) +fi +AC_DEFINE_UNQUOTED([PATH_BSHELL], "$BSHELL", [Path to sh(1).]) + +AC_C_BIGENDIAN +AC_HEADER_STDC + +# Confirm existence of zlib. (This is available as a default install +# option on many OS's; this could be added as a reachover build in the +# future.) +AC_CHECK_HEADER(zlib.h,, + AC_MSG_ERROR([zlib must be installed in a compiler-visible path])) +AC_CHECK_LIB(z, gzdopen,, + AC_MSG_ERROR([zlib must be installed in a compiler-visible path])) + +# Make sure certain required headers are available. +# These are not necessarily required by the code, but they are not +# currently conditionalized. +AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h sys/param.h \ + sys/socket.h sys/stat.h sys/time.h sys/types.h sys/utsname.h \ + sys/wait.h assert.h ctype.h errno.h fcntl.h grp.h limits.h locale.h \ + netdb.h pwd.h signal.h stdarg.h stdio.h stdlib.h string.h \ + termios.h unistd.h,, + AC_MSG_ERROR([standard system header file not found])) + +# Find headers that may not be available. +AC_HEADER_DIRENT +AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h \ + getopt.h features.h malloc.h sys/poll.h pthread.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,, + [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 + echo '#include "'$srcdir/../../include/$ac_header'"' \ + >>include/$ac_header.new + if cmp include/$ac_header.new include/$ac_header >/dev/null 2>&1; then + rm -f include/$ac_header.new + else + mv -f include/$ac_header.new include/$ac_header + fi]) + +# Typedefs. +AC_TYPE_SIZE_T +AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t]) +AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1, + [Define if you have the socklen_t type.])],, +[#include +#include ]) + +dnl XXX - This is UGLY. Need a better way to homogenize the bitsized types, +dnl including use of compiler primitive types via AC_CHECK_SIZEOF. +dnl +define([NB_CHECK_INTTYPE], [ + AC_CHECK_TYPE(uint][$1][_t,, [ + AC_CHECK_TYPE(u_int][$1][_t, + AC_DEFINE(uint][$1][_t, u_int][$1][_t, \ + [Define if you have u_int][$1][_t, but not uint][$1][_t.]), + AC_MSG_ERROR([cannot find a suitable type for uint][$1][_t])) + ]) + AC_CHECK_TYPE(u_int][$1][_t,, [ + AC_CHECK_TYPE(uint][$1][_t, + AC_DEFINE(u_int][$1][_t, uint][$1][_t, \ + [Define if you have uint][$1][_t, but not u_int][$1][_t.]), + AC_MSG_ERROR([cannot find a suitable type for u_int][$1][_t])) + ]) +]) + +NB_CHECK_INTTYPE(8) +NB_CHECK_INTTYPE(16) +NB_CHECK_INTTYPE(32) +NB_CHECK_INTTYPE(64) + +# Struct members. +AC_CHECK_MEMBERS([DIR.dd_fd, DIR.__dd_fd, struct dirent.d_namlen],,, +[#include +#include ]) +AC_CHECK_MEMBERS([struct stat.st_flags, struct stat.st_gen, + struct stat.st_birthtime, struct stat.st_birthtimensec, + struct stat.st_atim, struct stat.st_mtimensec],,, + [#include ]) +AC_CHECK_MEMBERS(struct statvfs.f_iosize,,, [#include ]) + +# Global variable decls. +AC_CHECK_DECLS([optind, optreset],,, [ +#include +#include +#include +]) +AC_CHECK_DECLS(sys_signame,,, [#include ]) + +# Library functions (where a .h check isn't enough). +AC_FUNC_ALLOCA +AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \ + esetfunc fgetln flock fpurge __fpurge futimes getline \ + getopt getopt_long group_from_gid gid_from_group \ + heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ + mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ + pwrite raise_default_signal random setenv \ + setgroupent setprogname setpassent snprintf strlcat strlcpy strmode \ + strndup strsep strsuftoll strtoll \ + user_from_uid uid_from_user vasprintf vasnprintf vsnprintf) + +AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[ +#include +]) +AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[ +#include +]) +AC_CHECK_DECLS([strndup],,,[#include ]) +AC_CHECK_DECLS([strsuftoll],,,[#include ]) +AC_CHECK_DECLS([lchflags, lchmod, lchown],,,[ +#include +#include +]) + +AC_CHECK_DECLS([htobe16, htobe32, htobe64, htole16, htole32, htole64, + be16toh, be32toh, be64toh, le16toh, le32toh, le64toh],,, + [#include ]) + +AC_CHECK_DECLS([bswap16, bswap32, bswap64],,, [#include ]) + +AC_CHECK_DECLS([be16enc, le16enc, be16dec, le16dec, be32enc, le32enc, + be32dec, le32dec, be64enc, le64enc, be64dec, le64dec],,, + [#include ]) + +AC_CHECK_DECLS([fstatvfs],,, [#include ]) + +AC_CHECK_DECLS([setgroupent, setpassent],,, [ +#include +#include +#include +]) + +# regcomp() and regexec() are also names of functions in the old V8 +# regexp package. To avoid them, we need to find out who has regfree(). + +dnl # Cygwin: We *MUST* look at -lregex *before* the "no libs" condition. +dnl # Thus AC_CHECK_LIB(regex...) comes first, and AC_SEARCHLIBS next. +AC_CHECK_LIB(regex, regfree) +AC_SEARCH_LIBS(regfree, rx posix) + +AC_CHECK_FUNCS(fparseln, [ + AC_MSG_CHECKING(if fparseln seems to work) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#define _NETBSD_SOURCE +#include +#include +#define CONFTEST "conftest.fparseln" +#define COMMENT '#' +int +main(void) +{ + static const char delim[3] = { '\0', '\0', COMMENT }; + FILE *fp; + char *ptr; + fp = fopen(CONFTEST, "w+"); + if (fp != NULL) { + unlink(CONFTEST); + ungetc(COMMENT, fp); + ptr = fparseln(fp, NULL, NULL, delim, + FPARSELN_UNESCALL); + fclose(fp); + if (ptr == NULL) + exit(0); + } + exit(1); +} + ]])], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE(BROKEN_FPARSELN, 1, + [Define to 1 if your `fparseln' function is broken.])], + [AC_MSG_WARN([cross compiling: not checking farseln])] + ) +]) + +# Variables substituted via @VARNAME@ in defs.mk.in +AC_SUBST(HAVE_PTHREAD_H, $ac_cv_header_pthread_h) + +AC_OUTPUT diff --git a/tools/compat/crypto/rmd160.h b/tools/compat/crypto/rmd160.h new file mode 100644 index 000000000..72a3d2101 --- /dev/null +++ b/tools/compat/crypto/rmd160.h @@ -0,0 +1,5 @@ +/* $NetBSD: rmd160.h,v 1.2 2006/10/27 22:32:45 mrg Exp $ */ + +/* We unconditionally use the NetBSD RMD160 in libnbcompat. */ +#include "nbtool_config.h" +#include "../../sys/sys/rmd160.h" diff --git a/tools/compat/crypto/sha2.h b/tools/compat/crypto/sha2.h new file mode 100644 index 000000000..e1bc07c8e --- /dev/null +++ b/tools/compat/crypto/sha2.h @@ -0,0 +1,5 @@ +/* $NetBSD: sha2.h,v 1.2 2006/10/27 22:32:45 mrg Exp $ */ + +/* We unconditionally use the NetBSD SHA2 in libnbcompat. */ +#include "nbtool_config.h" +#include "../../../sys/sys/sha2.h" diff --git a/tools/compat/db.h b/tools/compat/db.h new file mode 100644 index 000000000..fdd5d2851 --- /dev/null +++ b/tools/compat/db.h @@ -0,0 +1,7 @@ +/* $NetBSD: db.h,v 1.4 2006/10/16 19:44:23 apb Exp $ */ + +#include "nbtool_config.h" +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ +#endif +#include "../../include/db.h" diff --git a/tools/compat/defs.mk.in b/tools/compat/defs.mk.in new file mode 100644 index 000000000..39312fc20 --- /dev/null +++ b/tools/compat/defs.mk.in @@ -0,0 +1,22 @@ +# $NetBSD: defs.mk.in,v 1.10 2011/08/14 20:22:42 apb Exp $ + +COMPATOBJ:= ${.PARSEDIR} +HOSTEXEEXT= @EXEEXT@ + +HOST_BSHELL= @BSHELL@ + +BUILD_OSTYPE!= uname -s + +# Disable use of pre-compiled headers on Darwin. +.if ${BUILD_OSTYPE} == "Darwin" +HOST_CPPFLAGS+= -no-cpp-precomp +.endif + +HOST_CPPFLAGS+= -I${COMPATOBJ} -I${COMPATOBJ}/include \ + -I${.CURDIR}/../compat -DHAVE_NBTOOL_CONFIG_H=1 \ + -D_FILE_OFFSET_BITS=64 + +DPADD+= ${COMPATOBJ}/libnbcompat.a +LDADD+= -L${COMPATOBJ} -lnbcompat @LIBS@ + +HAVE_PTHREAD_H= @HAVE_PTHREAD_H@ diff --git a/tools/compat/fgetln.c b/tools/compat/fgetln.c new file mode 100644 index 000000000..0856072fc --- /dev/null +++ b/tools/compat/fgetln.c @@ -0,0 +1,106 @@ +/* $NetBSD: fgetln.c,v 1.9 2008/04/29 06:53:03 martin Exp $ */ + +/*- + * Copyright (c) 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#if !HAVE_FGETLN +#include +#ifndef HAVE_NBTOOL_CONFIG_H +/* These headers are required, but included from nbtool_config.h */ +#include +#include +#include +#include +#endif + +char * +fgetln(FILE *fp, size_t *len) +{ + static char *buf = NULL; + static size_t bufsiz = 0; + char *ptr; + + + if (buf == NULL) { + bufsiz = BUFSIZ; + if ((buf = malloc(bufsiz)) == NULL) + return NULL; + } + + if (fgets(buf, bufsiz, fp) == NULL) + return NULL; + + *len = 0; + while ((ptr = strchr(&buf[*len], '\n')) == NULL) { + size_t nbufsiz = bufsiz + BUFSIZ; + char *nbuf = realloc(buf, nbufsiz); + + if (nbuf == NULL) { + int oerrno = errno; + free(buf); + errno = oerrno; + buf = NULL; + return NULL; + } else + buf = nbuf; + + if (fgets(&buf[bufsiz], BUFSIZ, fp) == NULL) { + buf[bufsiz] = '\0'; + *len = strlen(buf); + return buf; + } + + *len = bufsiz; + bufsiz = nbufsiz; + } + + *len = (ptr - buf) + 1; + return buf; +} + +#endif + +#ifdef TEST +int +main(int argc, char *argv[]) +{ + char *p; + size_t len; + + while ((p = fgetln(stdin, &len)) != NULL) { + (void)printf("%zu %s", len, p); + free(p); + } + return 0; +} +#endif diff --git a/tools/compat/flock.c b/tools/compat/flock.c new file mode 100644 index 000000000..4a51ebe13 --- /dev/null +++ b/tools/compat/flock.c @@ -0,0 +1,76 @@ +/* $NetBSD: flock.c,v 1.6 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Emulate flock() with fcntl(), where available. + * Otherwise, don't do locking; just pretend success. + */ + +#include "nbtool_config.h" + +#if !HAVE_FLOCK +#include +#include + +int flock(int fd, int op) { + int rc = 0; + +#if defined(F_SETLK) && defined(F_SETLKW) + struct flock fl = {0}; + + switch (op & (LOCK_EX|LOCK_SH|LOCK_UN)) { + case LOCK_EX: + fl.l_type = F_WRLCK; + break; + + case LOCK_SH: + fl.l_type = F_RDLCK; + break; + + case LOCK_UN: + fl.l_type = F_UNLCK; + break; + + default: + errno = EINVAL; + return -1; + } + + fl.l_whence = SEEK_SET; + rc = fcntl(fd, op & LOCK_NB ? F_SETLK : F_SETLKW, &fl); + + if (rc && (errno == EAGAIN)) + errno = EWOULDBLOCK; +#endif + + return rc; +} +#endif diff --git a/tools/compat/fpurge.c b/tools/compat/fpurge.c new file mode 100644 index 000000000..0c859ce73 --- /dev/null +++ b/tools/compat/fpurge.c @@ -0,0 +1,49 @@ +/* $NetBSD: fpurge.c,v 1.1 2009/06/16 22:35:34 christos Exp $ */ + +/*- + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Pretend... + */ + +#include "nbtool_config.h" + +#if !HAVE_FPURGE +#include +#include + +void +fpurge(FILE *fp) +{ +#if HAVE___FPURGE + __fpurge(fp); +#endif +} +#endif diff --git a/tools/compat/fts.h b/tools/compat/fts.h new file mode 100644 index 000000000..b5f582637 --- /dev/null +++ b/tools/compat/fts.h @@ -0,0 +1,5 @@ +/* $NetBSD: fts.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */ + +/* We unconditionally use the NetBSD fts(3) in libnbcompat. */ +#include "nbtool_config.h" +#include "../../include/fts.h" diff --git a/tools/compat/getline.c b/tools/compat/getline.c new file mode 100644 index 000000000..e214c779b --- /dev/null +++ b/tools/compat/getline.c @@ -0,0 +1,107 @@ +/* $NetBSD: getline.c,v 1.1 2011/03/20 20:48:57 christos Exp $ */ + +/*- + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#if !HAVE_GETLINE +#include + +#ifndef HAVE_NBTOOL_CONFIG_H +/* These headers are required, but included from nbtool_config.h */ +#include +#include +#include +#include +#endif + +ssize_t +getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp) +{ + char *ptr, *eptr; + + + if (*buf == NULL || *bufsiz == 0) { + *bufsiz = BUFSIZ; + if ((*buf = malloc(*bufsiz)) == NULL) + return -1; + } + + for (ptr = *buf, eptr = *buf + *bufsiz;;) { + int c = fgetc(fp); + if (c == -1) { + if (feof(fp)) + return ptr == *buf ? -1 : ptr - *buf; + else + return -1; + } + *ptr++ = c; + if (c == delimiter) { + *ptr = '\0'; + return ptr - *buf; + } + if (ptr + 2 >= eptr) { + char *nbuf; + size_t nbufsiz = *bufsiz * 2; + ssize_t d = ptr - *buf; + if ((nbuf = realloc(*buf, nbufsiz)) == NULL) + return -1; + *buf = nbuf; + *bufsiz = nbufsiz; + eptr = nbuf + nbufsiz; + ptr = nbuf + d; + } + } +} + +ssize_t +getline(char **buf, size_t *bufsiz, FILE *fp) +{ + return getdelim(buf, bufsiz, '\n', fp); +} + +#endif + +#ifdef TEST +int +main(int argc, char *argv[]) +{ + char *p = NULL; + ssize_t len; + size_t n = 0; + + while ((len = getline(&p, &n, stdin)) != -1) + (void)printf("%zd %s", len, p); + free(p); + return 0; +} +#endif diff --git a/tools/compat/getmode.c b/tools/compat/getmode.c new file mode 100644 index 000000000..fdafbbe2c --- /dev/null +++ b/tools/compat/getmode.c @@ -0,0 +1,57 @@ +/* $NetBSD: getmode.c,v 1.8 2008/11/04 23:31:32 dbj Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "nbtool_config.h" +#include +#include + +void * +setmode(const char *str) +{ + mode_t *mp = malloc(sizeof(mode_t)); + + *mp = strtoul(str, NULL, 8); + + return mp; +} + +mode_t +getmode(const void *mp, mode_t mode) +{ + mode_t m; + + m = *((const mode_t *)mp); + + mode &= ~ALLPERMS; /* input mode less RWX permissions */ + m &= ALLPERMS; /* new RWX permissions */ + + return m | mode; +} diff --git a/tools/compat/glob.h b/tools/compat/glob.h new file mode 100644 index 000000000..0d4ad95df --- /dev/null +++ b/tools/compat/glob.h @@ -0,0 +1,5 @@ +/* $NetBSD: glob.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */ + +/* We unconditionally use the NetBSD glob(3) in libnbcompat. */ +#include "nbtool_config.h" +#include "../../include/glob.h" diff --git a/tools/compat/issetugid.c b/tools/compat/issetugid.c new file mode 100644 index 000000000..8e65f2a41 --- /dev/null +++ b/tools/compat/issetugid.c @@ -0,0 +1,21 @@ +/* $NetBSD: issetugid.c,v 1.2 2003/10/27 00:12:43 lukem Exp $ */ + +/* + * Written by Ben Harris, 2002 + * This file is in the Public Domain + */ + +#include "nbtool_config.h" + +#if !HAVE_ISSETUGID +int +issetugid(void) +{ + + /* + * Assume that anything linked against libnbcompat will be installed + * without special privileges. + */ + return 0; +} +#endif diff --git a/tools/compat/lchflags.c b/tools/compat/lchflags.c new file mode 100644 index 000000000..bb27b7627 --- /dev/null +++ b/tools/compat/lchflags.c @@ -0,0 +1,54 @@ +/* $NetBSD: lchflags.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Emulate lchflags(2), checking path with lstat(2) first to ensure that + * it's not a symlink, and then call chflags(2) */ + +#include "nbtool_config.h" + +#if !HAVE_LCHFLAGS && HAVE_STRUCT_STAT_ST_FLAGS +#include +#include +#include + +int +lchflags(const char *path, u_long flags) +{ + struct stat psb; + + if (lstat(path, &psb) == -1) + return -1; + if (S_ISLNK(psb.st_mode)) { + return 0; + } + return (chflags(path, flags)); +} +#endif diff --git a/tools/compat/lchmod.c b/tools/compat/lchmod.c new file mode 100644 index 000000000..459f77ae4 --- /dev/null +++ b/tools/compat/lchmod.c @@ -0,0 +1,54 @@ +/* $NetBSD: lchmod.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Emulate lchmod(2), checking path with lstat(2) first to ensure that + * it's not a symlink, and then call chmod(2) */ + +#include "nbtool_config.h" + +#if !HAVE_LCHMOD +#include +#include +#include + +int +lchmod(const char *path, mode_t mode) +{ + struct stat psb; + + if (lstat(path, &psb) == -1) + return -1; + if (S_ISLNK(psb.st_mode)) { + return 0; + } + return (chmod(path, mode)); +} +#endif diff --git a/tools/compat/lchown.c b/tools/compat/lchown.c new file mode 100644 index 000000000..c99148dc5 --- /dev/null +++ b/tools/compat/lchown.c @@ -0,0 +1,54 @@ +/* $NetBSD: lchown.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Emulate lchown(2), checking path with lstat(2) first to ensure that + * it's not a symlink, and then call chown(2) */ + +#include "nbtool_config.h" + +#if !HAVE_LCHOWN +#include +#include +#include + +int +lchown(const char *path, uid_t owner, gid_t group) +{ + struct stat psb; + + if (lstat(path, &psb) == -1) + return -1; + if (S_ISLNK(psb.st_mode)) { + return 0; + } + return (chown(path, owner, group)); +} +#endif diff --git a/tools/compat/md2.h b/tools/compat/md2.h new file mode 100644 index 000000000..10b7c1aa6 --- /dev/null +++ b/tools/compat/md2.h @@ -0,0 +1,5 @@ +/* $NetBSD: md2.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */ + +/* We unconditionally use the NetBSD MD2 in libnbcompat. */ +#include "nbtool_config.h" +#include "../../include/md2.h" diff --git a/tools/compat/md4.h b/tools/compat/md4.h new file mode 100644 index 000000000..42ff5731a --- /dev/null +++ b/tools/compat/md4.h @@ -0,0 +1,5 @@ +/* $NetBSD: md4.h,v 1.3 2003/10/27 00:12:43 lukem Exp $ */ + +/* We unconditionally use the NetBSD MD4 in libnbcompat. */ +#include "nbtool_config.h" +#include "../../sys/sys/md4.h" diff --git a/tools/compat/md5.h b/tools/compat/md5.h new file mode 100644 index 000000000..fcc1b607e --- /dev/null +++ b/tools/compat/md5.h @@ -0,0 +1,5 @@ +/* $NetBSD: md5.h,v 1.3 2003/10/27 00:12:43 lukem Exp $ */ + +/* We unconditionally use the NetBSD MD5 in libnbcompat. */ +#include "nbtool_config.h" +#include "../../sys/sys/md5.h" diff --git a/tools/compat/mpool.h b/tools/compat/mpool.h new file mode 100644 index 000000000..e594c8546 --- /dev/null +++ b/tools/compat/mpool.h @@ -0,0 +1,3 @@ +/* $NetBSD: mpool.h,v 1.1 2002/01/21 20:04:37 tv Exp $ */ + +#include "../../include/mpool.h" diff --git a/tools/compat/namespace.h b/tools/compat/namespace.h new file mode 100644 index 000000000..0e6a6f257 --- /dev/null +++ b/tools/compat/namespace.h @@ -0,0 +1,14 @@ +/* $NetBSD: namespace.h,v 1.3 2003/10/27 00:12:43 lukem Exp $ */ + +/* + * Mainly empty header to make reachover bits of libc happy. + * + * Since all reachover bits will include this, it's a good place to pull + * in nbtool_config.h. + */ +#include "nbtool_config.h" + +/* No aliases in reachover-based libc sources. */ +#undef __indr_reference +#undef __weak_alias +#undef __warn_references diff --git a/tools/compat/nbtool_config.h.in b/tools/compat/nbtool_config.h.in new file mode 100644 index 000000000..2b87fd977 --- /dev/null +++ b/tools/compat/nbtool_config.h.in @@ -0,0 +1,643 @@ +/* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ + +/* $NetBSD: nbtool_config.h.in,v 1.27 2011/11/03 14:13:53 joerg Exp $ */ + +#ifndef __NETBSD_NBTOOL_CONFIG_H__ +#define __NETBSD_NBTOOL_CONFIG_H__ + +/* Define to 1 if your `fparseln' function is broken. */ +#undef BROKEN_FPARSELN + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have the header file. */ +#undef HAVE_ARPA_NAMESER_H + +/* Define if you have the `asnprintf' function. */ +#undef HAVE_ASNPRINTF + +/* Define if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + +/* Define if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define if you have the `atoll' function. */ +#undef HAVE_ATOLL + +/* Define if you have the `basename' function. */ +#undef HAVE_BASENAME + +/* Define if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the declaration of `be16dec', and to 0 if you + don't. */ +#undef HAVE_DECL_BE16DEC + +/* Define to 1 if you have the declaration of `be16enc', and to 0 if you + don't. */ +#undef HAVE_DECL_BE16ENC + +/* Define to 1 if you have the declaration of `be16toh', and to 0 if you + don't. */ +#undef HAVE_DECL_BE16TOH + +/* Define to 1 if you have the declaration of `be32dec', and to 0 if you + don't. */ +#undef HAVE_DECL_BE32DEC + +/* Define to 1 if you have the declaration of `be32enc', and to 0 if you + don't. */ +#undef HAVE_DECL_BE32ENC + +/* Define to 1 if you have the declaration of `be32toh', and to 0 if you + don't. */ +#undef HAVE_DECL_BE32TOH + +/* Define to 1 if you have the declaration of `be64dec', and to 0 if you + don't. */ +#undef HAVE_DECL_BE64DEC + +/* Define to 1 if you have the declaration of `be64enc', and to 0 if you + don't. */ +#undef HAVE_DECL_BE64ENC + +/* Define to 1 if you have the declaration of `be64toh', and to 0 if you + don't. */ +#undef HAVE_DECL_BE64TOH + +/* Define to 1 if you have the declaration of `bswap16', and to 0 if you + don't. */ +#undef HAVE_DECL_BSWAP16 + +/* Define to 1 if you have the declaration of `bswap32', and to 0 if you + don't. */ +#undef HAVE_DECL_BSWAP32 + +/* Define to 1 if you have the declaration of `bswap64', and to 0 if you + don't. */ +#undef HAVE_DECL_BSWAP64 + +/* Define to 1 if you have the declaration of `fstatvfs', and to 0 if you + don't. */ +#undef HAVE_DECL_FSTATVFS + +/* Define to 1 if you have the declaration of `gid_from_group', and to 0 if + you don't. */ +#undef HAVE_DECL_GID_FROM_GROUP + +/* Define to 1 if you have the declaration of `group_from_gid', and to 0 if + you don't. */ +#undef HAVE_DECL_GROUP_FROM_GID + +/* Define to 1 if you have the declaration of `htobe16', and to 0 if you + don't. */ +#undef HAVE_DECL_HTOBE16 + +/* Define to 1 if you have the declaration of `htobe32', and to 0 if you + don't. */ +#undef HAVE_DECL_HTOBE32 + +/* Define to 1 if you have the declaration of `htobe64', and to 0 if you + don't. */ +#undef HAVE_DECL_HTOBE64 + +/* Define to 1 if you have the declaration of `htole16', and to 0 if you + don't. */ +#undef HAVE_DECL_HTOLE16 + +/* Define to 1 if you have the declaration of `htole32', and to 0 if you + don't. */ +#undef HAVE_DECL_HTOLE32 + +/* Define to 1 if you have the declaration of `htole64', and to 0 if you + don't. */ +#undef HAVE_DECL_HTOLE64 + +/* Define to 1 if you have the declaration of `lchflags', and to 0 if you + don't. */ +#undef HAVE_DECL_LCHFLAGS + +/* Define to 1 if you have the declaration of `lchmod', and to 0 if you don't. + */ +#undef HAVE_DECL_LCHMOD + +/* Define to 1 if you have the declaration of `lchown', and to 0 if you don't. + */ +#undef HAVE_DECL_LCHOWN + +/* Define to 1 if you have the declaration of `le16dec', and to 0 if you + don't. */ +#undef HAVE_DECL_LE16DEC + +/* Define to 1 if you have the declaration of `le16enc', and to 0 if you + don't. */ +#undef HAVE_DECL_LE16ENC + +/* Define to 1 if you have the declaration of `le16toh', and to 0 if you + don't. */ +#undef HAVE_DECL_LE16TOH + +/* Define to 1 if you have the declaration of `le32dec', and to 0 if you + don't. */ +#undef HAVE_DECL_LE32DEC + +/* Define to 1 if you have the declaration of `le32enc', and to 0 if you + don't. */ +#undef HAVE_DECL_LE32ENC + +/* Define to 1 if you have the declaration of `le32toh', and to 0 if you + don't. */ +#undef HAVE_DECL_LE32TOH + +/* Define to 1 if you have the declaration of `le64dec', and to 0 if you + don't. */ +#undef HAVE_DECL_LE64DEC + +/* Define to 1 if you have the declaration of `le64enc', and to 0 if you + don't. */ +#undef HAVE_DECL_LE64ENC + +/* Define to 1 if you have the declaration of `le64toh', and to 0 if you + don't. */ +#undef HAVE_DECL_LE64TOH + +/* Define to 1 if you have the declaration of `optind', and to 0 if you don't. + */ +#undef HAVE_DECL_OPTIND + +/* Define to 1 if you have the declaration of `optreset', and to 0 if you + don't. */ +#undef HAVE_DECL_OPTRESET + +/* Define to 1 if you have the declaration of `pwcache_groupdb', and to 0 if + you don't. */ +#undef HAVE_DECL_PWCACHE_GROUPDB + +/* Define to 1 if you have the declaration of `pwcache_userdb', and to 0 if + you don't. */ +#undef HAVE_DECL_PWCACHE_USERDB + +/* Define to 1 if you have the declaration of `setgroupent', and to 0 if you + don't. */ +#undef HAVE_DECL_SETGROUPENT + +/* Define to 1 if you have the declaration of `setpassent', and to 0 if you + don't. */ +#undef HAVE_DECL_SETPASSENT + +/* Define to 1 if you have the declaration of `strndup', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNDUP + +/* Define to 1 if you have the declaration of `strsuftoll', and to 0 if you + don't. */ +#undef HAVE_DECL_STRSUFTOLL + +/* Define to 1 if you have the declaration of `sys_signame', and to 0 if you + don't. */ +#undef HAVE_DECL_SYS_SIGNAME + +/* Define to 1 if you have the declaration of `uid_from_user', and to 0 if you + don't. */ +#undef HAVE_DECL_UID_FROM_USER + +/* Define to 1 if you have the declaration of `user_from_uid', and to 0 if you + don't. */ +#undef HAVE_DECL_USER_FROM_UID + +/* Define if you have the `devname' function. */ +#undef HAVE_DEVNAME + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_DIRENT_H + +/* Define if you have the `dirfd' function. */ +#undef HAVE_DIRFD + +/* Define if you have the `dirname' function. */ +#undef HAVE_DIRNAME + +/* Define if `dd_fd' is member of `DIR'. */ +#undef HAVE_DIR_DD_FD + +/* Define if `__dd_fd' is member of `DIR'. */ +#undef HAVE_DIR___DD_FD + +/* Define if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_ERR_H + +/* Define if you have the `esetfunc' function. */ +#undef HAVE_ESETFUNC + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_FEATURES_H + +/* Define if you have the `fgetln' function. */ +#undef HAVE_FGETLN + +/* Define if you have the `flock' function. */ +#undef HAVE_FLOCK + +/* Define if you have the `fparseln' function. */ +#undef HAVE_FPARSELN + +/* Define if you have the `fpurge' function. */ +#undef HAVE_FPURGE + +/* Define if you have the `futimes' function. */ +#undef HAVE_FUTIMES + +/* Define if you have the `getline' function. */ +#undef HAVE_GETLINE + +/* Define if you have the `getopt' function. */ +#undef HAVE_GETOPT + +/* Define if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + +/* Define if you have the `gid_from_group' function. */ +#undef HAVE_GID_FROM_GROUP + +/* Define if you have the `group_from_gid' function. */ +#undef HAVE_GROUP_FROM_GID + +/* Define if you have the header file. */ +#undef HAVE_GRP_H + +/* Define if you have the `heapsort' function. */ +#undef HAVE_HEAPSORT + +/* Define if the system has the type `id_t'. */ +#undef HAVE_ID_T + +/* Define if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have the `isblank' function. */ +#undef HAVE_ISBLANK + +/* Define if you have the `issetugid' function. */ +#undef HAVE_ISSETUGID + +/* Define if you have the `lchflags' function. */ +#undef HAVE_LCHFLAGS + +/* Define if you have the `lchmod' function. */ +#undef HAVE_LCHMOD + +/* Define if you have the `lchown' function. */ +#undef HAVE_LCHOWN + +/* Define if you have the header file. */ +#undef HAVE_LIBGEN_H + +/* Define if you have the `regex' library (-lregex). */ +#undef HAVE_LIBREGEX + +/* Define if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if the system has the type `long long'. */ +#undef HAVE_LONG_LONG + +/* Define if you have the `lutimes' function. */ +#undef HAVE_LUTIMES + +/* Define if you have the header file. */ +#undef HAVE_MACHINE_BSWAP_H + +/* Define if you have the header file. */ +#undef HAVE_MACHINE_ENDIAN_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the `mkdtemp' function. */ +#undef HAVE_MKDTEMP + +/* Define if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_NETCONFIG_H + +/* Define if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define if you have the header file. */ +#undef HAVE_PATHS_H + +/* Define if you have the `poll' function. */ +#undef HAVE_POLL + +/* Define if you have the `pread' function. */ +#undef HAVE_PREAD + +/* Define if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define if you have the `putc_unlocked' function. */ +#undef HAVE_PUTC_UNLOCKED + +/* Define if you have the `pwcache_groupdb' function. */ +#undef HAVE_PWCACHE_GROUPDB + +/* Define if you have the `pwcache_userdb' function. */ +#undef HAVE_PWCACHE_USERDB + +/* Define if you have the header file. */ +#undef HAVE_PWD_H + +/* Define if you have the `pwrite' function. */ +#undef HAVE_PWRITE + +/* Define if you have the `raise_default_signal' function. */ +#undef HAVE_RAISE_DEFAULT_SIGNAL + +/* Define if you have the `random' function. */ +#undef HAVE_RANDOM + +/* Define if you have the header file. */ +#undef HAVE_RESOLV_H + +/* Define if you have the header file. */ +#undef HAVE_RPC_TYPES_H + +/* Define if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define if you have the `setgroupent' function. */ +#undef HAVE_SETGROUPENT + +/* Define if you have the `setpassent' function. */ +#undef HAVE_SETPASSENT + +/* Define if you have the `setprogname' function. */ +#undef HAVE_SETPROGNAME + +/* Define if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define if you have the socklen_t type. */ +#undef HAVE_SOCKLEN_T + +/* Define if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the `strlcat' function. */ +#undef HAVE_STRLCAT + +/* Define if you have the `strlcpy' function. */ +#undef HAVE_STRLCPY + +/* Define if you have the `strmode' function. */ +#undef HAVE_STRMODE + +/* Define if you have the `strndup' function. */ +#undef HAVE_STRNDUP + +/* Define if you have the `strsep' function. */ +#undef HAVE_STRSEP + +/* Define if you have the `strsuftoll' function. */ +#undef HAVE_STRSUFTOLL + +/* Define if you have the `strtoll' function. */ +#undef HAVE_STRTOLL + +/* Define if `d_namlen' is member of `struct dirent'. */ +#undef HAVE_STRUCT_DIRENT_D_NAMLEN + +/* Define if `f_iosize' is member of `struct statvfs'. */ +#undef HAVE_STRUCT_STATVFS_F_IOSIZE + +/* Define if `st_atim' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM + +/* Define if `st_birthtime' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIME + +/* Define if `st_birthtimensec' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + +/* Define if `st_flags' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_FLAGS + +/* Define if `st_gen' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_GEN + +/* Define if `st_mtimensec' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_MTIMENSEC + +/* Define if you have the header file. */ +#undef HAVE_SYS_BSWAP_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_CDEFS_H + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_ENDIAN_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FEATURETEST_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_MTIO_H + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_POLL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSLIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSMACROS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_UTSNAME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the `uid_from_user' function. */ +#undef HAVE_UID_FROM_USER + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the `user_from_uid' function. */ +#undef HAVE_USER_FROM_UID + +/* Define if you have the header file. */ +#undef HAVE_UTIL_H + +/* Define if the system has the type `u_char'. */ +#undef HAVE_U_CHAR + +/* Define if the system has the type `u_int'. */ +#undef HAVE_U_INT + +/* Define if the system has the type `u_long'. */ +#undef HAVE_U_LONG + +/* Define if the system has the type `u_quad_t'. */ +#undef HAVE_U_QUAD_T + +/* Define if the system has the type `u_short'. */ +#undef HAVE_U_SHORT + +/* Define if you have the `vasnprintf' function. */ +#undef HAVE_VASNPRINTF + +/* Define if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + +/* Define if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define if you have the `__fpurge' function. */ +#undef HAVE___FPURGE + +/* Path to sh(1). */ +#undef PATH_BSHELL + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if your processor stores words with the most significant byte first + (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define for NetBSD headers. */ +#undef _POSIX_C_SOURCE + +/* Define for NetBSD headers. */ +#undef _POSIX_SOURCE + +/* Define for NetBSD headers. */ +#undef _XOPEN_SOURCE + +/* Define to `unsigned' if does not define. */ +#undef size_t + +/* Define if you have uint16_t, but not u_int16_t. */ +#undef u_int16_t + +/* Define if you have uint32_t, but not u_int32_t. */ +#undef u_int32_t + +/* Define if you have uint64_t, but not u_int64_t. */ +#undef u_int64_t + +/* Define if you have uint8_t, but not u_int8_t. */ +#undef u_int8_t + +/* Define if you have u_int16_t, but not uint16_t. */ +#undef uint16_t + +/* Define if you have u_int32_t, but not uint32_t. */ +#undef uint32_t + +/* Define if you have u_int64_t, but not uint64_t. */ +#undef uint64_t + +/* Define if you have u_int8_t, but not uint8_t. */ +#undef uint8_t + +#include "compat_defs.h" +#endif /* !__NETBSD_NBTOOL_CONFIG_H__ */ diff --git a/tools/compat/ndbm.h b/tools/compat/ndbm.h new file mode 100644 index 000000000..d2922bdc7 --- /dev/null +++ b/tools/compat/ndbm.h @@ -0,0 +1,7 @@ +/* $NetBSD: ndbm.h,v 1.1 2010/02/03 15:34:44 roy Exp $ */ + +#include "nbtool_config.h" +#ifndef DBM_SUFFIX +#define DBM_SUFFIX ".db" +#endif +#include "../../include/ndbm.h" diff --git a/tools/compat/nl_types.h b/tools/compat/nl_types.h new file mode 100644 index 000000000..1c114eb8a --- /dev/null +++ b/tools/compat/nl_types.h @@ -0,0 +1,5 @@ +/* $NetBSD: nl_types.h,v 1.1 2002/01/29 10:20:32 tv Exp $ */ + +#ifdef _NLS_PRIVATE +#include "../../include/nl_types.h" +#endif diff --git a/tools/compat/pread.c b/tools/compat/pread.c new file mode 100644 index 000000000..9266cf1fc --- /dev/null +++ b/tools/compat/pread.c @@ -0,0 +1,55 @@ +/* $NetBSD: pread.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Emulate pread() with lseek()/read()/lseek(). Not thread-safe, of course. */ + +#include "nbtool_config.h" + +#if !HAVE_PREAD +#include + +ssize_t pread(int d, void *buf, size_t nbytes, off_t offset) { + off_t oldoff = lseek(d, offset, SEEK_SET); + int olderrno; + ssize_t nr; + + if (oldoff < 0) + return -1; + + nr = read(d, buf, nbytes); + + olderrno = errno; + lseek(d, oldoff, SEEK_SET); + errno = olderrno; + + return nr; +} +#endif diff --git a/tools/compat/putc_unlocked.c b/tools/compat/putc_unlocked.c new file mode 100644 index 000000000..b158025b8 --- /dev/null +++ b/tools/compat/putc_unlocked.c @@ -0,0 +1,47 @@ +/* $NetBSD: putc_unlocked.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2003 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Emulate putc_unlocked(). */ + +#include "nbtool_config.h" + +#if !HAVE_PUTC_UNLOCKED +#include + +#ifndef putc_unlocked +int +putc_unlocked(int c, FILE *stream) +{ + + putc(c, stream); +} +#endif /* putc_unlocked */ +#endif diff --git a/tools/compat/pwrite.c b/tools/compat/pwrite.c new file mode 100644 index 000000000..0aa2cb0a9 --- /dev/null +++ b/tools/compat/pwrite.c @@ -0,0 +1,55 @@ +/* $NetBSD: pwrite.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Emulate pwrite() with lseek()/write()/lseek(). Not thread-safe, of course. */ + +#include "nbtool_config.h" + +#if !HAVE_PWRITE +#include + +ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset) { + off_t oldoff = lseek(d, offset, SEEK_SET); + int olderrno; + ssize_t nw; + + if (oldoff < 0) + return -1; + + nw = write(d, buf, nbytes); + + olderrno = errno; + lseek(d, oldoff, SEEK_SET); + errno = olderrno; + + return nw; +} +#endif diff --git a/tools/compat/setenv.c b/tools/compat/setenv.c new file mode 100644 index 000000000..2b3acdc93 --- /dev/null +++ b/tools/compat/setenv.c @@ -0,0 +1,50 @@ +/* $NetBSD: setenv.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Emulate setenv() with getenv()/malloc()/putenv(). */ + +#include "nbtool_config.h" + +#if !HAVE_SETENV +int setenv(const char *name, const char *value, int overwrite) { + char *buf; + + if (!overwrite && getenv(name)) + return 0; + + /* Include sizes plus '=' and trailing null. */ + if (!(buf = malloc(strlen(name) + strlen(value) + 2))) + return -1; + + sprintf(buf, "%s=%s", name, value); + putenv(buf); +} +#endif diff --git a/tools/compat/setgroupent.c b/tools/compat/setgroupent.c new file mode 100644 index 000000000..dbbb2eff6 --- /dev/null +++ b/tools/compat/setgroupent.c @@ -0,0 +1,12 @@ +/* $NetBSD: setgroupent.c,v 1.4 2003/10/27 00:12:43 lukem Exp $ */ + +#include "nbtool_config.h" + +#if !HAVE_SETGROUPENT || !HAVE_DECL_SETGROUPENT +#include + +int setgroupent(int stayopen) { + setgrent(); + return 1; +} +#endif diff --git a/tools/compat/setpassent.c b/tools/compat/setpassent.c new file mode 100644 index 000000000..d7c548354 --- /dev/null +++ b/tools/compat/setpassent.c @@ -0,0 +1,12 @@ +/* $NetBSD: setpassent.c,v 1.4 2003/10/27 00:12:43 lukem Exp $ */ + +#include "nbtool_config.h" + +#if !HAVE_SETPASSENT || !HAVE_DECL_SETPASSENT +#include + +int setpassent(int stayopen) { + setpwent(); + return 1; +} +#endif diff --git a/tools/compat/setprogname.c b/tools/compat/setprogname.c new file mode 100644 index 000000000..1fc29eb42 --- /dev/null +++ b/tools/compat/setprogname.c @@ -0,0 +1,54 @@ +/* $NetBSD: setprogname.c,v 1.5 2008/04/28 20:24:12 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "nbtool_config.h" + +#if !HAVE_SETPROGNAME +#include + +static const char *__progname = "command line"; + +void +setprogname(const char *progname) +{ + __progname = strrchr(progname, '/'); + if (__progname == NULL) + __progname = progname; + else + __progname++; +} + +const char * +getprogname(void) +{ + return __progname; +} +#endif diff --git a/tools/compat/snprintf.c b/tools/compat/snprintf.c new file mode 100644 index 000000000..f9c9e4307 --- /dev/null +++ b/tools/compat/snprintf.c @@ -0,0 +1,663 @@ +/* + * Copyright (c) 1995-2001 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. + */ + +/* From heimdal lib/roken/snprintf.c. */ + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#if 0 +RCSID("$Id: snprintf.c,v 1.3 2003/10/27 00:12:43 lukem Exp $"); +#endif +#include +#include +#include +#include +#include +#if 0 +#include +#endif + +#undef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#undef max +#define max(a,b) ((a) > (b) ? (a) : (b)) + +enum format_flags { + minus_flag = 1, + plus_flag = 2, + space_flag = 4, + alternate_flag = 8, + zero_flag = 16 +}; + +/* + * Common state + */ + +struct state { + unsigned char *str; + unsigned char *s; + unsigned char *theend; + size_t sz; + size_t max_sz; + void (*append_char)(struct state *, unsigned char); + /* XXX - methods */ +}; + +#if TEST_SNPRINTF +#include "snprintf-test.h" +#endif /* TEST_SNPRINTF */ + +#if !defined(HAVE_VSNPRINTF) || defined(TEST_SNPRINTF) +static int +sn_reserve (struct state *state, size_t n) +{ + return state->s + n > state->theend; +} + +static void +sn_append_char (struct state *state, unsigned char c) +{ + if (!sn_reserve (state, 1)) + *state->s++ = c; +} +#endif + +static int +as_reserve (struct state *state, size_t n) +{ + if (state->s + n > state->theend) { + int off = state->s - state->str; + unsigned char *tmp; + + if (state->max_sz && state->sz >= state->max_sz) + return 1; + + state->sz = max(state->sz * 2, state->sz + n); + if (state->max_sz) + state->sz = min(state->sz, state->max_sz); + tmp = realloc (state->str, state->sz); + if (tmp == NULL) + return 1; + state->str = tmp; + state->s = state->str + off; + state->theend = state->str + state->sz - 1; + } + return 0; +} + +static void +as_append_char (struct state *state, unsigned char c) +{ + if(!as_reserve (state, 1)) + *state->s++ = c; +} + +/* longest integer types */ + +#ifdef HAVE_LONG_LONG +typedef unsigned long long u_longest; +typedef long long longest; +#else +typedef unsigned long u_longest; +typedef long longest; +#endif + +/* + * is # supposed to do anything? + */ + +static int +use_alternative (int flags, u_longest num, unsigned base) +{ + return flags & alternate_flag && (base == 16 || base == 8) && num != 0; +} + +static int +append_number(struct state *state, + u_longest num, unsigned base, char *rep, + int width, int prec, int flags, int minusp) +{ + int len = 0; + int i; + u_longest n = num; + + /* given precision, ignore zero flag */ + if(prec != -1) + flags &= ~zero_flag; + else + prec = 1; + /* zero value with zero precision -> "" */ + if(prec == 0 && n == 0) + return 0; + do{ + (*state->append_char)(state, rep[n % base]); + ++len; + n /= base; + } while(n); + prec -= len; + /* pad with prec zeros */ + while(prec-- > 0){ + (*state->append_char)(state, '0'); + ++len; + } + /* add length of alternate prefix (added later) to len */ + if(use_alternative(flags, num, base)) + len += base / 8; + /* pad with zeros */ + if(flags & zero_flag){ + width -= len; + if(minusp || (flags & space_flag) || (flags & plus_flag)) + width--; + while(width-- > 0){ + (*state->append_char)(state, '0'); + len++; + } + } + /* add alternate prefix */ + if(use_alternative(flags, num, base)){ + if(base == 16) + (*state->append_char)(state, rep[10] + 23); /* XXX */ + (*state->append_char)(state, '0'); + } + /* add sign */ + if(minusp){ + (*state->append_char)(state, '-'); + ++len; + } else if(flags & plus_flag) { + (*state->append_char)(state, '+'); + ++len; + } else if(flags & space_flag) { + (*state->append_char)(state, ' '); + ++len; + } + if(flags & minus_flag) + /* swap before padding with spaces */ + for(i = 0; i < len / 2; i++){ + char c = state->s[-i-1]; + state->s[-i-1] = state->s[-len+i]; + state->s[-len+i] = c; + } + width -= len; + while(width-- > 0){ + (*state->append_char)(state, ' '); + ++len; + } + if(!(flags & minus_flag)) + /* swap after padding with spaces */ + for(i = 0; i < len / 2; i++){ + char c = state->s[-i-1]; + state->s[-i-1] = state->s[-len+i]; + state->s[-len+i] = c; + } + return len; +} + +/* + * return length + */ + +static int +append_string (struct state *state, + const unsigned char *arg, + int width, + int prec, + int flags) +{ + int len = 0; + + if(arg == NULL) + arg = (const unsigned char*)"(null)"; + + if(prec != -1) + width -= prec; + else + width -= strlen((const char *)arg); + if(!(flags & minus_flag)) + while(width-- > 0) { + (*state->append_char) (state, ' '); + ++len; + } + if (prec != -1) { + while (*arg && prec--) { + (*state->append_char) (state, *arg++); + ++len; + } + } else { + while (*arg) { + (*state->append_char) (state, *arg++); + ++len; + } + } + if(flags & minus_flag) + while(width-- > 0) { + (*state->append_char) (state, ' '); + ++len; + } + return len; +} + +static int +append_char(struct state *state, + unsigned char arg, + int width, + int flags) +{ + int len = 0; + + while(!(flags & minus_flag) && --width > 0) { + (*state->append_char) (state, ' ') ; + ++len; + } + (*state->append_char) (state, arg); + ++len; + while((flags & minus_flag) && --width > 0) { + (*state->append_char) (state, ' '); + ++len; + } + return 0; +} + +/* + * This can't be made into a function... + */ + +#ifdef HAVE_LONG_LONG + +#define PARSE_INT_FORMAT(res, arg, unsig) \ +if (long_long_flag) \ + res = (unsig long long)va_arg(arg, unsig long long); \ +else if (long_flag) \ + res = (unsig long)va_arg(arg, unsig long); \ +else if (short_flag) \ + res = (unsig short)va_arg(arg, unsig int); \ +else \ + res = (unsig int)va_arg(arg, unsig int) + +#else + +#define PARSE_INT_FORMAT(res, arg, unsig) \ +if (long_flag) \ + res = (unsig long)va_arg(arg, unsig long); \ +else if (short_flag) \ + res = (unsig short)va_arg(arg, unsig int); \ +else \ + res = (unsig int)va_arg(arg, unsig int) + +#endif + +/* + * zyxprintf - return length, as snprintf + */ + +static int +xyzprintf (struct state *state, const char *char_format, va_list ap) +{ + const unsigned char *format = (const unsigned char *)char_format; + unsigned char c; + int len = 0; + + while((c = *format++)) { + if (c == '%') { + int flags = 0; + int width = 0; + int prec = -1; + int long_long_flag = 0; + int long_flag = 0; + int short_flag = 0; + + /* flags */ + while((c = *format++)){ + if(c == '-') + flags |= minus_flag; + else if(c == '+') + flags |= plus_flag; + else if(c == ' ') + flags |= space_flag; + else if(c == '#') + flags |= alternate_flag; + else if(c == '0') + flags |= zero_flag; + else + break; + } + + if((flags & space_flag) && (flags & plus_flag)) + flags ^= space_flag; + + if((flags & minus_flag) && (flags & zero_flag)) + flags ^= zero_flag; + + /* width */ + if (isdigit(c)) + do { + width = width * 10 + c - '0'; + c = *format++; + } while(isdigit(c)); + else if(c == '*') { + width = va_arg(ap, int); + c = *format++; + } + + /* precision */ + if (c == '.') { + prec = 0; + c = *format++; + if (isdigit(c)) + do { + prec = prec * 10 + c - '0'; + c = *format++; + } while(isdigit(c)); + else if (c == '*') { + prec = va_arg(ap, int); + c = *format++; + } + } + + /* size */ + + if (c == 'h') { + short_flag = 1; + c = *format++; + } else if (c == 'l') { + long_flag = 1; + c = *format++; + if (c == 'l') { + long_long_flag = 1; + c = *format++; + } + } + + switch (c) { + case 'c' : + append_char(state, va_arg(ap, int), width, flags); + ++len; + break; + case 's' : + len += append_string(state, + va_arg(ap, unsigned char*), + width, + prec, + flags); + break; + case 'd' : + case 'i' : { + longest arg; + u_longest num; + int minusp = 0; + + PARSE_INT_FORMAT(arg, ap, signed); + + if (arg < 0) { + minusp = 1; + num = -arg; + } else + num = arg; + + len += append_number (state, num, 10, "0123456789", + width, prec, flags, minusp); + break; + } + case 'u' : { + u_longest arg; + + PARSE_INT_FORMAT(arg, ap, unsigned); + + len += append_number (state, arg, 10, "0123456789", + width, prec, flags, 0); + break; + } + case 'o' : { + u_longest arg; + + PARSE_INT_FORMAT(arg, ap, unsigned); + + len += append_number (state, arg, 010, "01234567", + width, prec, flags, 0); + break; + } + case 'x' : { + u_longest arg; + + PARSE_INT_FORMAT(arg, ap, unsigned); + + len += append_number (state, arg, 0x10, "0123456789abcdef", + width, prec, flags, 0); + break; + } + case 'X' :{ + u_longest arg; + + PARSE_INT_FORMAT(arg, ap, unsigned); + + len += append_number (state, arg, 0x10, "0123456789ABCDEF", + width, prec, flags, 0); + break; + } + case 'p' : { + unsigned long arg = (unsigned long)va_arg(ap, void*); + + len += append_number (state, arg, 0x10, "0123456789ABCDEF", + width, prec, flags, 0); + break; + } + case 'n' : { + int *arg = va_arg(ap, int*); + *arg = state->s - state->str; + break; + } + case '\0' : + --format; + /* FALLTHROUGH */ + case '%' : + (*state->append_char)(state, c); + ++len; + break; + default : + (*state->append_char)(state, '%'); + (*state->append_char)(state, c); + len += 2; + break; + } + } else { + (*state->append_char) (state, c); + ++len; + } + } + return len; +} + +#if !defined(HAVE_SNPRINTF) || defined(TEST_SNPRINTF) +int +snprintf (char *str, size_t sz, const char *format, ...) +{ + va_list args; + int ret; + + va_start(args, format); + ret = vsnprintf (str, sz, format, args); + va_end(args); + +#ifdef PARANOIA + { + int ret2; + char *tmp; + + tmp = malloc (sz); + if (tmp == NULL) + abort (); + + va_start(args, format); + ret2 = vsprintf (tmp, format, args); + va_end(args); + if (ret != ret2 || strcmp(str, tmp)) + abort (); + free (tmp); + } +#endif + + return ret; +} +#endif + +#if !defined(HAVE_ASPRINTF) || defined(TEST_SNPRINTF) +int +asprintf (char **ret, const char *format, ...) +{ + va_list args; + int val; + + va_start(args, format); + val = vasprintf (ret, format, args); + +#ifdef PARANOIA + { + int ret2; + char *tmp; + tmp = malloc (val + 1); + if (tmp == NULL) + abort (); + + ret2 = vsprintf (tmp, format, args); + if (val != ret2 || strcmp(*ret, tmp)) + abort (); + free (tmp); + } +#endif + + va_end(args); + return val; +} +#endif + +#if !defined(HAVE_ASNPRINTF) || defined(TEST_SNPRINTF) +int +asnprintf (char **ret, size_t max_sz, const char *format, ...) +{ + va_list args; + int val; + + va_start(args, format); + val = vasnprintf (ret, max_sz, format, args); + +#ifdef PARANOIA + { + int ret2; + char *tmp; + tmp = malloc (val + 1); + if (tmp == NULL) + abort (); + + ret2 = vsprintf (tmp, format, args); + if (val != ret2 || strcmp(*ret, tmp)) + abort (); + free (tmp); + } +#endif + + va_end(args); + return val; +} +#endif + +#if !defined(HAVE_VASPRINTF) || defined(TEST_SNPRINTF) +int +vasprintf (char **ret, const char *format, va_list args) +{ + return vasnprintf (ret, 0, format, args); +} +#endif + + +#if !defined(HAVE_VASNPRINTF) || defined(TEST_SNPRINTF) +int +vasnprintf (char **ret, size_t max_sz, const char *format, va_list args) +{ + int st; + struct state state; + + state.max_sz = max_sz; + state.sz = 1; + state.str = malloc(state.sz); + if (state.str == NULL) { + *ret = NULL; + return -1; + } + state.s = state.str; + state.theend = state.s + state.sz - 1; + state.append_char = as_append_char; + + st = xyzprintf (&state, format, args); + if (st > state.sz) { + free (state.str); + *ret = NULL; + return -1; + } else { + char *tmp; + + *state.s = '\0'; + tmp = realloc (state.str, st+1); + if (tmp == NULL) { + free (state.str); + *ret = NULL; + return -1; + } + *ret = tmp; + return st; + } +} +#endif + +#if !defined(HAVE_VSNPRINTF) || defined(TEST_SNPRINTF) +int +vsnprintf (char *str, size_t sz, const char *format, va_list args) +{ + struct state state; + int ret; + unsigned char *ustr = (unsigned char *)str; + + state.max_sz = 0; + state.sz = sz; + state.str = ustr; + state.s = ustr; + state.theend = ustr + sz - (sz > 0); + state.append_char = sn_append_char; + + ret = xyzprintf (&state, format, args); + if (state.s != NULL) + *state.s = '\0'; + return ret; +} +#endif diff --git a/tools/compat/sys/null.h b/tools/compat/sys/null.h new file mode 100644 index 000000000..b73ea73c5 --- /dev/null +++ b/tools/compat/sys/null.h @@ -0,0 +1,3 @@ +/* $NetBSD: null.h,v 1.1 2007/07/19 13:49:12 jmmv Exp $ */ + +#include "../../../sys/sys/null.h" diff --git a/tools/compat/sys/queue.h b/tools/compat/sys/queue.h new file mode 100644 index 000000000..e605deb6f --- /dev/null +++ b/tools/compat/sys/queue.h @@ -0,0 +1,3 @@ +/* $NetBSD: queue.h,v 1.1 2002/01/21 20:04:37 tv Exp $ */ + +#include "../../../sys/sys/queue.h" diff --git a/tools/compat/sys/rmd160.h b/tools/compat/sys/rmd160.h new file mode 100644 index 000000000..1e2f17329 --- /dev/null +++ b/tools/compat/sys/rmd160.h @@ -0,0 +1,3 @@ +/* $NetBSD: rmd160.h,v 1.1 2006/10/27 22:32:45 mrg Exp $ */ + +#include "../../../sys/sys/rmd160.h" diff --git a/tools/compat/sys/sha1.h b/tools/compat/sys/sha1.h new file mode 100644 index 000000000..38847ec10 --- /dev/null +++ b/tools/compat/sys/sha1.h @@ -0,0 +1,5 @@ +/* $NetBSD: sha1.h,v 1.1 2006/10/29 06:17:08 dogcow Exp $ */ + +/* We unconditionally use the NetBSD SHA1 in libnbcompat. */ +#include "nbtool_config.h" +#include "../../sys/sys/sha1.h" diff --git a/tools/compat/sys/sha2.h b/tools/compat/sys/sha2.h new file mode 100644 index 000000000..3162eca67 --- /dev/null +++ b/tools/compat/sys/sha2.h @@ -0,0 +1,3 @@ +/* $NetBSD: sha2.h,v 1.1 2006/10/27 22:32:45 mrg Exp $ */ + +#include "../../../sys/sys/sha2.h" diff --git a/tools/compat/sys/verified_exec.h b/tools/compat/sys/verified_exec.h new file mode 100644 index 000000000..b8045a7f6 --- /dev/null +++ b/tools/compat/sys/verified_exec.h @@ -0,0 +1,3 @@ +/* $NetBSD: verified_exec.h,v 1.1 2006/12/20 22:03:20 agc Exp $ */ + +#include "../../sys/sys/verified_exec.h" diff --git a/tools/compat/tzfile.h b/tools/compat/tzfile.h new file mode 100644 index 000000000..1db872e1a --- /dev/null +++ b/tools/compat/tzfile.h @@ -0,0 +1,3 @@ +/* $NetBSD: tzfile.h,v 1.1 2002/01/31 22:43:49 tv Exp $ */ + +#include "../../include/tzfile.h" diff --git a/tools/compat/ufs/ffs/ffs_extern.h b/tools/compat/ufs/ffs/ffs_extern.h new file mode 100644 index 000000000..c2ef087f6 --- /dev/null +++ b/tools/compat/ufs/ffs/ffs_extern.h @@ -0,0 +1,3 @@ +/* $NetBSD: ffs_extern.h,v 1.1 2003/05/14 00:30:26 dbj Exp $ */ + +#include "../../../../sys/ufs/ffs/ffs_extern.h" diff --git a/tools/compat/ufs/ffs/fs.h b/tools/compat/ufs/ffs/fs.h new file mode 100644 index 000000000..03b5a333d --- /dev/null +++ b/tools/compat/ufs/ffs/fs.h @@ -0,0 +1,3 @@ +/* $NetBSD: fs.h,v 1.1 2003/05/14 00:30:26 dbj Exp $ */ + +#include "../../../../sys/ufs/ffs/fs.h" diff --git a/tools/compat/ufs/ufs/dinode.h b/tools/compat/ufs/ufs/dinode.h new file mode 100644 index 000000000..a42290459 --- /dev/null +++ b/tools/compat/ufs/ufs/dinode.h @@ -0,0 +1,3 @@ +/* $NetBSD: dinode.h,v 1.1 2003/05/14 00:30:26 dbj Exp $ */ + +#include "../../../../sys/ufs/ufs/dinode.h" diff --git a/tools/compat/ufs/ufs/dir.h b/tools/compat/ufs/ufs/dir.h new file mode 100644 index 000000000..07228c295 --- /dev/null +++ b/tools/compat/ufs/ufs/dir.h @@ -0,0 +1,3 @@ +/* $NetBSD: dir.h,v 1.1 2003/05/14 00:30:27 dbj Exp $ */ + +#include "../../../../sys/ufs/ufs/dir.h" diff --git a/tools/compat/ufs/ufs/quota.h b/tools/compat/ufs/ufs/quota.h new file mode 100644 index 000000000..cc1d1ea15 --- /dev/null +++ b/tools/compat/ufs/ufs/quota.h @@ -0,0 +1,3 @@ +/* $NetBSD: quota.h,v 1.1 2011/03/07 02:02:36 joerg Exp $ */ + +#include "../../../../sys/ufs/ufs/quota.h" diff --git a/tools/compat/ufs/ufs/ufs_bswap.h b/tools/compat/ufs/ufs/ufs_bswap.h new file mode 100644 index 000000000..c1546e9a6 --- /dev/null +++ b/tools/compat/ufs/ufs/ufs_bswap.h @@ -0,0 +1,3 @@ +/* $NetBSD: ufs_bswap.h,v 1.1 2003/05/14 00:30:27 dbj Exp $ */ + +#include "../../../../sys/ufs/ufs/ufs_bswap.h" diff --git a/tools/compat/vis.h b/tools/compat/vis.h new file mode 100644 index 000000000..4b6a0187f --- /dev/null +++ b/tools/compat/vis.h @@ -0,0 +1,5 @@ +/* $NetBSD: vis.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */ + +/* We unconditionally use the NetBSD vis(3) in libnbcompat. */ +#include "nbtool_config.h" +#include "../../include/vis.h" diff --git a/tools/gcc/Makefile b/tools/gcc/Makefile new file mode 100644 index 000000000..3b0df9196 --- /dev/null +++ b/tools/gcc/Makefile @@ -0,0 +1,208 @@ +# $NetBSD: Makefile,v 1.50 2012/01/10 12:27:54 skrll Exp $ + +.include + +GCC_LANGUAGES=c c++ objc +MODULE= gcc4 + +MKNATIVE_CONFIG_TARGET_LIBS= \ + configure-target-libiberty \ + configure-target-libstdc++-v3 \ + configure-target-libobjc \ + configure-target-libgcc + +.if ${HAVE_GCC} == 45 +MKNATIVE_TARGET= gcc45 +GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/gcc/dist +MKNATIVE_CONFIG_TARGET_LIBS+= \ + configure-target-libgomp +.else +MKNATIVE_TARGET= gcc4 +.endif + +BINENV= /usr/bin/env -i + +VAX_CONFIGURE_ARGS= + +.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" +MULTILIB_ARGS= --enable-multilib +.else +MULTILIB_ARGS= --disable-multilib +.endif + +.if ${MKSOFTFLOAT} != "no" +SOFTFLOAT_ARGS= -with-float=soft +.endif + +COMMON_CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} \ + --enable-long-long \ + --enable-threads \ + --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html \ + --with-pkgversion="NetBSD nb2 20111202" \ + ${VAX_CONFIGURE_ARGS} \ + --enable-__cxa_atexit \ + --target=i386-elf-minix \ + --with-as="${TOOLDIR}/i386-elf-minix/bin/as" \ + --with-ld="${TOOLDIR}/i386-elf-minix/bin/ld" \ + --disable-threads \ + --disable-visibility \ + --enable-__cxa_atexit \ + --disable-libunwind +# --with-headers="/home/thomas/Documents/minix/cc3/obj/destdir.i386/usr/include" + +.if defined(GCC_CONFIG_ARCH.${MACHINE_ARCH}) +COMMON_CONFIGURE_ARGS+= --with-arch=${GCC_CONFIG_ARCH.${MACHINE_ARCH}} +.endif +.if defined(GCC_CONFIG_TUNE.${MACHINE_ARCH}) +COMMON_CONFIGURE_ARGS+= --with-tune=${GCC_CONFIG_TUNE.${MACHINE_ARCH}} +.endif + +CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS} +.if ${HAVE_GCC} >= 45 +CONFIGURE_ARGS+= \ + --with-mpc=${TOOLDIR} \ + --with-mpfr=${TOOLDIR} \ + --with-gmp=${TOOLDIR} +.endif +CONFIGURE_ARGS+= \ + --disable-nls \ + ${MULTILIB_ARGS} \ + ${SOFTFLOAT_ARGS} \ + --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \ + --enable-languages=c + +GCC_CPPFLAGS= -DNETBSD_TOOLS -DTARGET_SYSTEM_ROOT=0 \ + -DTARGET_SYSTEM_ROOT_RELOCATABLE + +MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \ + LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \ + EXTRA_PARTS= CPPFLAGS=${GCC_CPPFLAGS:Q} \ + AR=${HOST_AR:Q} RANLIB=${HOST_RANLIB:Q} + +CONFIGURE_ENV+= gcc_cv_libc_provides_ssp=yes \ + gcc_cv_as_sparc_gotdata_op=no + +MKNATIVE_ENV= ${BINENV} ${CONFIGURE_ENV:NC*:NLD*} \ + CC_FOR_BUILD=${HOST_CC:Q} \ + CC=${CC:Q}' '${CCADDFLAGS:Q} \ + CXX=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \ + CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \ + CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \ + AS=${AS:Q} AWK=${TOOL_AWK:Q} LD=${LD:Q} \ + MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \ + NM=${NM:Q} OBJDUMP=${OBJDUMP:Q} \ + XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \ + LIBS=-lintl \ + ac_cv_prog_cc_cross=yes \ + ac_cv_func_strcoll_works=yes \ + ac_cv_func_elf_getshstrndx=no \ + gcc_cv_func_printf_ptr=yes \ + gcc_cv_libc_provides_ssp=yes \ + gdb_cv_printf_has_long_double=yes \ + gdb_cv_printf_has_long_long=yes \ + gdb_cv_scanf_has_long_double=yes \ + gcc_cv_as_sparc_gotdata_op=no + +ALL_TARGET= all-gcc +INSTALL_TARGET= install-gcc + +.include "${.CURDIR}/../Makefile.gmakehost" +BUILD_MAKE=${TOOL_GMAKE} + +# +# mknative-gcc specific stuff +# + +.if ${HAVE_GCC} < 45 +GCCSRCDIR=${.CURDIR}/../../gnu/dist/gcc4 +.else +GCCSRCDIR=${.CURDIR}/../../external/gpl3/gcc/dist +.endif + +CXXADDFLAGS= --sysroot=${DESTDIR} +CCADDFLAGS= --sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include + +NEWCONFIGDIR?= ${.CURDIR}/../.. +MKNATIVE?= ${.CURDIR}/mknative-gcc + +bootstrap-libgcc: .configure_done + @echo 'Creating files needed for libgcc by a native bootstrap build.' + @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} lib${MKNATIVE_TARGET} \ + ${.OBJDIR}/build ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \ + ${DESTDIR} + +native-gcc: .native/.configure_done + @echo 'Extracting GNU GCC configury for a native toolchain.' + @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} ${MKNATIVE_TARGET} \ + ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \ + ${DESTDIR} + +NATIVE_CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS} +.if ${HAVE_GCC} >= 45 +NATIVE_CONFIGURE_ARGS+= \ + --with-mpc=${DESTDIR}/usr \ + --with-mpfr=${DESTDIR}/usr \ + --with-gmp=${DESTDIR}/usr + +. if ${MACHINE_ARCH} != "vax" +NATIVE_CONFIGURE_ARGS+= --enable-tls +. endif +.endif +NATIVE_CONFIGURE_ARGS+= \ + --disable-multilib \ + --disable-symvers \ + --disable-libstdcxx-pch \ + --build=`${GCCSRCDIR}/config.guess` \ + --host=${MACHINE_GNU_PLATFORM} + +.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile + mkdir .native 2>/dev/null || true + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native && ${MKNATIVE_ENV} \ + ${HOST_SH} ${GNUHOSTDIST}/configure \ + ${NATIVE_CONFIGURE_ARGS}) && \ + (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} all-build-libiberty) + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} configure-gcc configure-libcpp) && \ + (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} configure-libiberty) && \ + (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} configure-libdecnumber) + # edit Makefile so that maybe-all-gcc does not depend on all-gcc any more. + (cd .native && mv Makefile Makefile.config && \ + ${TOOL_SED} -e 's/\(maybe-all-gcc:\) all-gcc/\1/' \ + -e 's/\(maybe-all-target-libgcc:\) all-target-libgcc/\1/' \ + < Makefile.config > Makefile) + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native/gcc && ${MKNATIVE_ENV} ${BUILD_MAKE} -e tree-check.h config.h multilib.h gcov-iov.h) + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native/gcc && ${MKNATIVE_ENV} ${BUILD_MAKE} -e libgcc.mvars tconfig.h unwind.h) + (cd .native && touch gcc/cc1obj gcc/cc1plus gcc/f771 gcc/libgcc.a gcc/libgcc_s.so) +.for _lib in ${MKNATIVE_CONFIG_TARGET_LIBS} + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} \ + ${_lib} \ + ALL_GCC_C= ALL_GCC_CXX= \ + CC_FOR_TARGET=${CC:Q}' '${CCADDFLAGS:Q} \ + CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \ + RAW_CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \ + CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \ + ac_cv_prog_cc_cross=yes) && \ + true +.endfor + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native/${MACHINE_GNU_PLATFORM}/libstdc++-v3/include && \ + ${MKNATIVE_ENV} ${BUILD_MAKE} \ + CC_FOR_TARGET=${CC:Q}' '${CCADDFLAGS:Q} \ + CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \ + CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \ + all-local) && \ + true +.if 0 + PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ + (cd .native/${MACHINE_GNU_PLATFORM}/libiberty && \ + ${MKNATIVE_ENV} ${BUILD_MAKE} needed-list) +.endif + @touch $@ + +clean: clean.native +clean.native: + -rm -r -f .native diff --git a/tools/gcc/README.mknative b/tools/gcc/README.mknative new file mode 100644 index 000000000..032a7f630 --- /dev/null +++ b/tools/gcc/README.mknative @@ -0,0 +1,69 @@ +$NetBSD: README.mknative,v 1.9 2011/09/21 02:15:18 mrg Exp $ + +XXX THIS FILE DOES NOT DESCRIBE GCC 4.5 METHODS PROPERLY XXX + +This file describes how to bootstrap the native toolchain on a new NetBSD +platform (and how to update the new toolchain files, if needed). These +files may be generated on a cross-compile host without problems. + +NOTE: DO NOT RUN "mknative" BY HAND! It requires the Makefile in this +directory to set up certain environments first. + +Since libc's features change over time, the config.h files can change as a +result; thus the instructions below are the same no matter whether +bootstrapping on a cross or native host. This is important: even on a +"native" host, you should bootstrap the toolchain by building from an +up-to-date source tree to a $DESTDIR using the exact same instructions. + +In these notes, MACHINE is the $MACHINE of the target. These files can be +cross-generated. Though a $MACHINE_ARCH all uses the same config files, you +must pick a specific $MACHINE so that building the requisite bits below will +work. + +1. Set MKMAINTAINERTOOLS=yes in mk.conf. (Needed so that src/tools/gettext + gets built, eliciting proper HAVE_*GETTEXT* defns in config.h files.) + +2. Build and install a cross toolchain (via "build.sh -m MACHINE tools"). + +3. In src/tools/gcc, do "nbmake-MACHINE bootstrap-libgcc". + + This will create just enough glue in src/gnu/lib/libgcc4/arch to make it + possible to build, based on the toolchain built in ${.OBJDIR}/build. + Because the files generated in this step contain things like + -DCROSS_COMPILE, they are not suitable for committing. Step 8 below + will regenerate the "proper" libgcc config files. + +4. At top level, do + "nbmake-MACHINE do-distrib-dirs obj includes MKGCC=no MKBINUTILS=no". + +5. In src/gnu/lib/libgcc4, do "nbmake-MACHINE obj includes". + +6. If the platform sets USE_COMPILERCRTSTUFF=yes, then in src/gnu/lib/crtstuff4 + do "nbmake-MACHINE dependall install" + +7. In each of src/lib/csu, src/gnu/lib/libgcc4, and src/lib, + do "nbmake-MACHINE dependall install". + + Optionally, all of the following may be set in the environment to reduce + the amount of code needed to build at this step. Basically, it must be + possible for static binaries to build and base system libs to exist so + that "configure" can do its job for the target--these MK* options omit + the rest for this stage of the build. + + MKCRYPTO=no + MKLINT=no + MKPROFILE=no + MKSHARE=no + +8. In src/tools/gcc, do "nbmake-MACHINE native-gcc". + + This will do a full configury in ${.OBJDIR}/.native that is a "Canadian" + cross toolchain (--build reflects the host platform, but --host and + --target are the target). The result is a tree that would build a + native-to-NetBSD compiler on a cross host, and mknative pulls glue data + from this. + +9. Try out a full build using "nbmake-MACHINE"; the result should include + a native compiler. + +10. If all is well, commit the glue files added to src/gnu/{lib,usr.bin}/*. diff --git a/tools/gcc/files/dragonfly-spec.h b/tools/gcc/files/dragonfly-spec.h new file mode 100644 index 000000000..ace9e19c4 --- /dev/null +++ b/tools/gcc/files/dragonfly-spec.h @@ -0,0 +1,215 @@ +/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/dragonfly-spec.h,v 1.5 2008/07/24 21:45:10 corecode Exp $ */ + +/* Base configuration file for all DragonFly targets. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Common DragonFly configuration. + All DragonFly architectures should include this file, which will specify + their commonalities. + + Adapted from gcc/config/freebsd-spec.h by + Joerg Sonnenberger + + Adapted from gcc/config/freebsd.h by + David O'Brien + Loren J. Rittle . */ + + +/* This defines which switch letters take arguments. On DragonFly, most of + the normal cases (defined in gcc.c) apply, and we also have -h* and + -z* options (for the linker) (coming from SVR4). + We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ + +#define DFBSD_SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ + || (CHAR) == 'h' \ + || (CHAR) == 'z' /* ignored by ld */ \ + || (CHAR) == 'R') + +/* This defines which multi-letter switches take arguments. */ + +#define DFBSD_WORD_SWITCH_TAKES_ARG(STR) \ + (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ + || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ + || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ + || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) + +#define DFBSD_TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + if (DFBSD_MAJOR == 3) \ + builtin_define ("__DragonFly__=3"); \ + else if (DFBSD_MAJOR == 2) \ + builtin_define ("__DragonFly__=2"); \ + else if (DFBSD_MAJOR == 1) \ + builtin_define ("__DragonFly__=1"); \ + else \ + builtin_define ("__DragonFly__"); \ + builtin_define ("__DragonFly_cc_version=100001"); \ + builtin_define_std ("unix"); \ + builtin_define ("__KPRINTF_ATTRIBUTE__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=bsd"); \ + builtin_assert ("system=DragonFly"); \ + DFBSD_TARGET_CPU_CPP_BUILTINS(); \ + } \ + while (0) + +/* Define the default DragonFly-specific per-CPU hook code. */ +#define DFBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0) + +/* Provide a CPP_SPEC appropriate for DragonFly. We just deal with the GCC + option `-posix', and PIC issues. */ + +#define DFBSD_CPP_SPEC " \ + %(cpp_cpu) \ + %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \ + %{posix:-D_POSIX_SOURCE}" + +/* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add + the magical crtbegin.o file (see crtstuff.c) which provides part + of the support for getting C++ file-scope static object constructed + before entering `main'. */ + +#define DFBSD_STARTFILE_SPEC \ + "%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ + crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" + +/* Provide a ENDFILE_SPEC appropriate for DragonFly. Here we tack on + the magical crtend.o file (see crtstuff.c) which provides part of + the support for getting C++ file-scope static object constructed + before entering `main', followed by a normal "finalizer" file, + `crtn.o'. */ + +#define DFBSD_ENDFILE_SPEC \ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + +/* Provide a LIB_SPEC appropriate for DragonFly as configured and as + required by the user-land thread model. Select the appropriate libc, + depending on whether we're doing profiling or need threads support. + Make it a hard error if -pthread is provided on the command line and gcc + was configured with --disable-threads (this will help avoid bug + reports from users complaining about threading when they + misconfigured the gcc bootstrap but are later consulting DragonFly + manual pages that refer to the mythical -pthread option). */ + +/* Provide a LIB_SPEC appropriate for DragonFly. Just select the appropriate + libc, depending on whether we're doing profiling or need threads support. + (simular to the default, except no -lg, and no -p). */ + +#ifdef DFBSD_NO_THREADS +#define DFBSD_LIB_SPEC " \ + %{pthread: %eThe -pthread option is only supported on DragonFly when gcc \ +is built with the --enable-threads configure-time option.} \ + %{!nostdlib{!nostartfiles{!nolibc: -lc}}} \ + }" +#else +#define DFBSD_LIB_SPEC " \ + %{pthread:-lpthread} \ + %{!nostdlib: %{!nostartfiles: %{!nolibc: -lc}}} \ + " +#endif + +#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2" + +#if 0 +#define LINK_LIBGCC_SPEC "" +#define LIBGCC_SPEC "%{shared: -lgcc_pic} %{!shared: -lgcc}" + +#define PRE_LIB_SPEC " \ + %{pg: -L"PREFIX2"/lib/gcc41/profiling \ + %{!static: -rpath /usr/lib/gcc41/profiling \ + -rpath-link "PREFIX2"/lib/gcc41/profiling}} \ + %{g: -L"PREFIX2"/lib/gcc41/debug \ + %{!static: -rpath /usr/lib/gcc41/debug \ + -rpath-link "PREFIX2"/lib/gcc41/debug}} \ + -L"PREFIX2"/lib/gcc41 \ + %{!static: -rpath /usr/lib/gcc41 -rpath-link "PREFIX2"/lib/gcc41} \ + %{pg: -L"PREFIX2"/lib/profiling \ + %{!static: -rpath /usr/lib/profiling \ + -rpath-link "PREFIX2"/lib/profiling}} \ + %{g: -L"PREFIX2"/lib/debug \ + %{!static: -rpath /usr/lib/debug -rpath-link "PREFIX2"/lib/debug}} \ + %{!static: -rpath /usr/lib -rpath-link "PREFIX2"/lib} \ + " + +#define DFBSD_LINK_COMMAND_SPEC "\ +%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ + %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ + %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ + %{static:} %{L*} %(link_libgcc) %o \ + %{fprofile-arcs|fprofile-generate: -lgcov}\ + %{!nostdlib:%{!nodefaultlibs:%(pre_lib)}}\ + %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\ + %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}" + +#ifndef PREFIX2 +#define PREFIX2 "/usr" +#endif + +#ifndef STANDARD_STARTFILE_PREFIX_1 +#define STANDARD_STARTFILE_PREFIX_1 PREFIX2"/lib/gcc41/" +#endif +#ifndef STANDARD_EXEC_PREFIX +#define STANDARD_EXEC_PREFIX PREFIX2"/libexec/gcc41/" +#endif +#ifndef STANDARD_STARTFILE_PREFIX +#define STANDARD_STARTFILE_PREFIX PREFIX2"/lib/" +#endif +#ifndef TOOLDIR_BASE_PREFIX +#define TOOLDIR_BASE_PREFIX PREFIX2"/libexec/gcc41" +#endif +#ifndef STANDARD_BINDIR_PREFIX +#define STANDARD_BINDIR_PREFIX PREFIX2"/libexec/gcc41" +#endif +#ifndef STANDARD_LIBEXEC_PREFIX +#define STANDARD_LIBEXEC_PREFIX PREFIX2"/libexec/gcc41" +#endif + +#ifndef GPLUSPLUS_INCLUDE_DIR +#define GPLUSPLUS_INCLUDE_DIR PREFIX2"/include/c++" +#endif +#ifndef GPLUSPLUS_TOOL_INCLUDE_DIR +#define GPLUSPLUS_TOOL_INCLUDE_DIR PREFIX2"/include/c++/4.1" +#endif +#ifndef GPLUSPLUS_BACKWARD_INCLUDE_DIR +#define GPLUSPLUS_BACKWARD_INCLUDE_DIR PREFIX2"/include/c++/4.1/backward" +#endif +#ifndef GCC_LOCAL_INCLUDE_DIR +#define GCC_LOCAL_INCLUDE_DIR PREFIX2"/libdata/gcc41" +#endif +#ifndef GCC_INCLUDE_DIR +#define GCC_INCLUDE_DIR PREFIX2"/include" +#endif + +#undef INCLUDE_DEFAULTS +#define INCLUDE_DEFAULTS \ + { \ + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \ + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0 }, \ + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0 }, \ + { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \ + { GCC_LOCAL_INCLUDE_DIR, "GCC", 0, 0 }, \ + { NULL, NULL, 0, 0 } \ + } +#endif diff --git a/tools/gcc/files/dragonfly.h b/tools/gcc/files/dragonfly.h new file mode 100644 index 000000000..6274620d9 --- /dev/null +++ b/tools/gcc/files/dragonfly.h @@ -0,0 +1,97 @@ +/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/dragonfly.h,v 1.2 2008/05/19 10:46:39 corecode Exp $ */ + +/* Base configuration file for all DragonFly targets. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Common DragonFly configuration. + All DragonFly architectures should include this file, which will specify + their commonalities. + + Adapted from gcc/config/freebsd.h by + Joerg Sonnenberger + + Adapted from gcc/config/i386/freebsd-elf.h by + David O'Brien . + Further work by David O'Brien and + Loren J. Rittle . */ + + +/* This defines which switch letters take arguments. On DragonFly, most of + the normal cases (defined in gcc.c) apply, and we also have -h* and + -z* options (for the linker) (coming from SVR4). + We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ + +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) (DFBSD_SWITCH_TAKES_ARG(CHAR)) + +#undef WORD_SWITCH_TAKES_ARG +#define WORD_SWITCH_TAKES_ARG(STR) (DFBSD_WORD_SWITCH_TAKES_ARG(STR)) + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() DFBSD_TARGET_OS_CPP_BUILTINS() + +#undef CPP_SPEC +#define CPP_SPEC DFBSD_CPP_SPEC + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC DFBSD_STARTFILE_SPEC + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC DFBSD_ENDFILE_SPEC + +#undef LIB_SPEC +#define LIB_SPEC DFBSD_LIB_SPEC + +#if 0 +#undef LINK_COMMAND_SPEC +#define LINK_COMMAND_SPEC DFBSD_LINK_COMMAND_SPEC +#endif + +/************************[ Target stuff ]***********************************/ + +/* All DragonFly Architectures support the ELF object file format. */ +#undef OBJECT_FORMAT_ELF +#define OBJECT_FORMAT_ELF + +/* Don't assume anything about the header files. */ +#undef NO_IMPLICIT_EXTERN_C +#define NO_IMPLICIT_EXTERN_C 1 + +/* Make gcc agree with DragonFly's standard headers (, etc...) */ + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#define MATH_LIBRARY_PROFILE "-lm_p" + +/* Code generation parameters. */ + +/* Use periods rather than dollar signs in special g++ assembler names. + This ensures the configuration knows our system correctly so we can link + with libraries compiled with the native cc. */ +#undef NO_DOLLAR_IN_LABEL + +/* Define this so we can compile MS code for use with WINE. */ +#define HANDLE_PRAGMA_PACK_PUSH_POP + +/* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW. + This enables the test coverage code to use file locking when exiting a + program, which avoids race conditions if the program has forked. */ +#define TARGET_POSIX_IO diff --git a/tools/gcc/files/gcov-minix-fs-wrapper.h b/tools/gcc/files/gcov-minix-fs-wrapper.h new file mode 100644 index 000000000..182f3ce6d --- /dev/null +++ b/tools/gcc/files/gcov-minix-fs-wrapper.h @@ -0,0 +1,39 @@ +/* This header makes it possible to redefine system calls to the + * file system. This way, minix servers can re-route the data + * that libgcov tries to send to the file system. This is + * necessary, because the servers can't access the file system + * directly. Instead, they will copy the data to a helping user + * space process, which will call the file system for them. + * For more information, see the header file. + */ + +#include +#include +#include + + +/* These function pointers initially point to the standard system library + * functions (fopen, etc). All calls to these system library functions are + * then redefined to calls to these function pointers. Because the pointers + * still point to the original functions, all functionality is unchanged. + * Therefore, libgcov won't act differently when linked to applications. + * But, when these pointers are redefined by code within the minix servers, + * the file system calls get replaced by other functionality. + */ + +#define fopen(...) _gcov_fopen(__VA_ARGS__) +#define fread(...) _gcov_fread(__VA_ARGS__) +#define fwrite(...) _gcov_fwrite(__VA_ARGS__) +#define fclose(...) _gcov_fclose(__VA_ARGS__) +#define fseek(...) _gcov_fseek(__VA_ARGS__) +#define getenv(...) _gcov_getenv(__VA_ARGS__) + + +/* wrapper to make it possible to disable gcov_exit on a process exit (for mfs) */ + +int do_gcov_exit = 1; + +void gcov_exit_wrapper(void){ + if(do_gcov_exit) + gcov_exit(); +} diff --git a/tools/gcc/files/hello.f b/tools/gcc/files/hello.f new file mode 100644 index 000000000..4b34eeda6 --- /dev/null +++ b/tools/gcc/files/hello.f @@ -0,0 +1,5 @@ + + PROGRAM hello + print*, 'Hello, World!' + END + diff --git a/tools/gcc/files/hello.m b/tools/gcc/files/hello.m new file mode 100644 index 000000000..c25ba5ad4 --- /dev/null +++ b/tools/gcc/files/hello.m @@ -0,0 +1,6 @@ +#import + +int main( int argc, const char *argv[] ) { + printf( "hello world\n" ); + return 0; +} diff --git a/tools/gcc/files/i386-dragonfly.h b/tools/gcc/files/i386-dragonfly.h new file mode 100644 index 000000000..78b7e0c1d --- /dev/null +++ b/tools/gcc/files/i386-dragonfly.h @@ -0,0 +1,148 @@ +/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/i386/dragonfly.h,v 1.1 2006/09/27 12:10:34 corecode Exp $ */ + +/* Definitions for Intel 386 running DragonFly with ELF format + + Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc. + Contributed by Eric Youngdale. + Modified for stabs-in-ELF by H.J. Lu. + Adapted from GNU/Linux version by John Polstra. + Continued development by David O'Brien + Adapted from the FreeBSD version. + + Changes: + - remove support for changing the dynamic linker + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +#define TARGET_VERSION fprintf (stderr, " (i386 DragonFly/ELF)"); + +/* Override the default comment-starter of "/". */ +#undef ASM_COMMENT_START +#define ASM_COMMENT_START "#" + +#undef ASM_APP_ON +#define ASM_APP_ON "#APP\n" + +#undef ASM_APP_OFF +#define ASM_APP_OFF "#NO_APP\n" + +#undef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(n) \ + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) + +#undef NO_PROFILE_COUNTERS +#define NO_PROFILE_COUNTERS 1 + +/* Tell final.c that we don't need a label passed to mcount. */ + +#undef MCOUNT_NAME +#define MCOUNT_NAME ".mcount" + +/* Make gcc agree with . */ + +#undef SIZE_TYPE +#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD) + +#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */ +#define SUBTARGET_EXTRA_SPECS \ + { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER } + +/* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add + the magical crtbegin.o file (see crtstuff.c) which provides part + of the support for getting C++ file-scope static object constructed + before entering `main'. */ + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC \ + "%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ + crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" + +/* Provide a ENDFILE_SPEC appropriate for DragonFly. Here we tack on + the magical crtend.o file (see crtstuff.c) which provides part of + the support for getting C++ file-scope static object constructed + before entering `main', followed by a normal "finalizer" file, + `crtn.o'. */ + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + +/* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support + for the special GCC options -static and -shared, which allow us to + link things in one of these three modes by applying the appropriate + combinations of options at link-time. We like to support here for + as many of the other GNU linker options as possible. But I don't + have the time to search for those flags. I am sure how to add + support for -soname shared_object_name. H.J. + + I took out %{v:%{!V:-V}}. It is too much :-(. They can use + -Wl,-V. + + When the -shared link option is used a final link is not being + done. */ + +#undef LINK_SPEC +#define LINK_SPEC "\ + %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ + %{v:-V} \ + %{assert*} %{R*} %{rpath*} %{defsym*} \ + %{shared:-Bshareable %{h*} %{soname*}} \ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \ + %{static:-Bstatic}} \ + %{symbolic:-Bsymbolic}" + +/* A C statement to output to the stdio stream FILE an assembler + command to advance the location counter to a multiple of 1< and std::numeric_limits correct. */ +#undef TARGET_96_ROUND_53_LONG_DOUBLE +#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT) diff --git a/tools/gcc/files/i386-dragonfly64.h b/tools/gcc/files/i386-dragonfly64.h new file mode 100644 index 000000000..f42365398 --- /dev/null +++ b/tools/gcc/files/i386-dragonfly64.h @@ -0,0 +1,54 @@ +/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/i386/dragonfly64.h,v 1.1 2007/01/15 17:53:16 corecode Exp $ */ + +/* Definitions for AMD x86-64 running DragonFly with ELF format + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by David O'Brien + Adapted from the FreeBSD version. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* $FreeBSD: src/contrib/gcc/config/i386/freebsd64.h,v 1.9 2004/07/28 04:44:23 kan Exp $ */ + + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (x86-64 DragonFly/ELF)"); + +/* Tell final.c that we don't need a label passed to mcount. */ + +#define SUBTARGET_EXTRA_SPECS \ + { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER } + +#undef MCOUNT_NAME +#define MCOUNT_NAME ".mcount" + +/* Provide a LINK_SPEC appropriate for the DragonFly/x86-64 ELF target. + This is a copy of LINK_SPEC from tweaked for + the x86-64 target. + XXX We don't support two arch userland yet */ + +#undef LINK_SPEC +#define LINK_SPEC "\ + %{v:-V} \ + %{assert*} %{R*} %{rpath*} %{defsym*} \ + %{shared:-Bshareable %{h*} %{soname*}} \ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \ + %{static:-Bstatic}} \ + %{symbolic:-Bsymbolic}" diff --git a/tools/gcc/files/i386-minix.h b/tools/gcc/files/i386-minix.h new file mode 100644 index 000000000..0caea817c --- /dev/null +++ b/tools/gcc/files/i386-minix.h @@ -0,0 +1,148 @@ +/* Definitions for Intel 386 running MINIX with ELF format + Copyright (C) 1996, 2000, 2002, 2004 Free Software Foundation, Inc. + Contributed by Eric Youngdale. + Modified for stabs-in-ELF by H.J. Lu. + Adapted from GNU/Linux version by John Polstra. + Continued development by David O'Brien + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef MINIX_TARGET_CPU_CPP_BUILTINS +#define MINIX_TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_define_with_int_value ("_EM_WSIZE", 4); \ + builtin_define_with_int_value ("_EM_PSIZE", 4); \ + builtin_define_with_int_value ("_EM_SSIZE", 2); \ + builtin_define_with_int_value ("_EM_LSIZE", 4); \ + builtin_define_with_int_value ("_EM_FSIZE", 4); \ + builtin_define_with_int_value ("_EM_DSIZE", 8); \ + } \ + while (0) + +#define TARGET_VERSION fprintf (stderr, " (i386 MINIX/ELF)"); + +/* Override the default comment-starter of "/". */ +#undef ASM_COMMENT_START +#define ASM_COMMENT_START "#" + +#undef ASM_APP_ON +#define ASM_APP_ON "#APP\n" + +#undef ASM_APP_OFF +#define ASM_APP_OFF "#NO_APP\n" + +#undef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(n) \ + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) + +#undef NO_PROFILE_COUNTERS +#define NO_PROFILE_COUNTERS 1 + +/* Tell final.c that we don't need a label passed to mcount. */ + +#undef MCOUNT_NAME +#define MCOUNT_NAME ".mcount" + +/* Make gcc agree with . */ + +#undef SIZE_TYPE +#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD) + +#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */ +#define SUBTARGET_EXTRA_SPECS \ + { "minix_dynamic_linker", MINIX_DYNAMIC_LINKER } + +/* Provide a STARTFILE_SPEC appropriate for MINIX. Here we add + the magical crtbegin.o file (see crtstuff.c) which provides part + of the support for getting C++ file-scope static object constructed + before entering `main'. */ + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC \ + "%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ + crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" + +/* Provide a ENDFILE_SPEC appropriate for MINIX. Here we tack on + the magical crtend.o file (see crtstuff.c) which provides part of + the support for getting C++ file-scope static object constructed + before entering `main', followed by a normal "finalizer" file, + `crtn.o'. */ + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + +/* Provide a LINK_SPEC appropriate for MINIX. Here we provide support + for the special GCC options -static and -shared, which allow us to + link things in one of these three modes by applying the appropriate + combinations of options at link-time. We like to support here for + as many of the other GNU linker options as possible. But I don't + have the time to search for those flags. I am sure how to add + support for -soname shared_object_name. H.J. + + I took out %{v:%{!V:-V}}. It is too much :-(. They can use + -Wl,-V. + + When the -shared link option is used a final link is not being + done. */ + +#undef LINK_SPEC +#define LINK_SPEC "\ + %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ + %{v:-V} \ + %{assert*} %{R*} %{rpath*} %{defsym*} \ + %{shared:-Bshareable %{h*} %{soname*}} \ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker %(minix_dynamic_linker) }} \ + %{static:-Bstatic}} \ + %{symbolic:-Bsymbolic}" + +/* A C statement to output to the stdio stream FILE an assembler + command to advance the location counter to a multiple of 1< +set -e +gcc=gcc +if [[ "x$1" = x*gcc ]]; then + gcc=$1; shift +fi +gcc_dir=`${gcc} "$@" -print-libgcc-file-name` +gcc_dir=${gcc_dir%/*} #*/ +set -x +${gcc} "$@" -c -o $gcc_dir/values-Xa.o -DXa $0 +${gcc} "$@" -c -o $gcc_dir/values-Xc.o -DXc $0 +${gcc} "$@" -c -o $gcc_dir/values-Xt.o -DXt $0 +exit +#endif + +#include + +#if defined(Xa) +const enum version _lib_version = ansi_1; +#elif defined(Xc) +const enum version _lib_version = strict_ansi; +#elif defined(Xt) +const enum version _lib_version = c_issue_4; +#else +#error "compile by issuing 'ksh -f values.c [gcc] [-m64]'" +#endif + +#if defined(__x86_64__) +asm("\n" +".section .init\n" +".align 1\n" +" leaq 1f(%rip),%rax\n" +"1: cmpl $0,2f-1b(%rax)\n" +" jne 2f\n" +" jmp 2f+5\n" +" .skip 9\n" /* pad up to 0x1b bytes */ +"2:\n" +); +#else +asm("\n" +".section .init\n" +".align 1\n" +" call 1f\n" +"1: popl %eax\n" +" cmpl $0,2f-1b(%eax)\n" +" jne 2f\n" +" jmp 2f+5\n" +" .skip 10\n" /* pad up to 0x1b bytes */ +"2:\n" +); +#endif diff --git a/tools/gcc/mknative-gcc b/tools/gcc/mknative-gcc new file mode 100755 index 000000000..79d2c87b4 --- /dev/null +++ b/tools/gcc/mknative-gcc @@ -0,0 +1,732 @@ +#!/bin/sh +# $NetBSD: mknative-gcc,v 1.66 2012/01/10 12:27:54 skrll Exp $ +# +# Shell script for generating all the constants needed for a native +# platform build of src/gnu/dist/gcc. +# + +# initialise + +_TMPDIR=$2 +_TOP=$3 +_PLATFORM=$4 +_DESTDIR=$5 +_ABI=$6 +_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'` +_GNU_DIST=`cd ${_VPATH}; pwd` + +if [ -z "$_DESTDIR" ]; then + echo "\$_DESTDIR is empty" 2>&1 + exit 1 +fi + +. $_TOP/tools/gcc/mknative.common + +# default to GCC 4.1 for now +_OUTDIR="$_TOP/gnu" +_OUTDIRBASE="gnu" + +##### gnu/lib/crtstuff ##### + +get_crtstuff () { + _subdir="$1" + mkdir -p $_OUTDIR/lib/$_subdir/arch + + getvars gcc/Makefile \ + INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS \ + tm_defines xm_file xm_defines \ + | sed "s,-I$_DESTDIR/usr/include,,g" \ + | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH.mk +} + +##### gnu/lib/libg2c ##### + +get_libg2c () { + mkdir -p $_OUTDIR/lib/libg2c3/arch/$MACHINE_ARCH + + write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h + write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h + + { + getvars $_PLATFORM/libf2c/Makefile \ + F2CEXT + getvars $_PLATFORM/libf2c/libF77/Makefile \ + ALL_CFLAGS OBJS + getvars $_PLATFORM/libf2c/libI77/Makefile \ + ALL_CFLAGS OBJS | sed 's,=,+=,' + getvars $_PLATFORM/libf2c/libU77/Makefile \ + ALL_CFLAGS OBJS | sed 's,=,+=,' + } | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/defs.mk +} + +##### gnu/lib/libgcc ##### + +get_libgcc_list_funcs_asm () { + { + getvars gcc/Makefile LIB1ASMFUNCS | { + # print newline separated list + sed -e ' + s,^.*=,, + s, *$,, + s, *, ,g + s, ,\ +,g' + } + getvars gcc/Makefile LIB2FUNCS_EXTRA | { + # print newline separated list + sed -e ' + s,^.*=,, + s, *$,, + s, *, ,g + s, ,\ +,g' | \ + sed -ne ' + /\.S$/ { s,^.*/,,; s,\.S$,,; p; } + /\.asm$/ { s,^.*/,,; s,\.asm$,,; p; } + ' + } + } | { + # print foo and foo_s + sed -ne ' + /./ { + p + s,$,_s, + p + } + ' + } | sort +} + +get_libgcc_list_funcs_lib () { + local _lib=$1 + local _lib_prefix=${_lib%.*} + local _lib_suffix=${_lib#*.} + local _abi=${2:-'\.'} + + cat build/gcc/libgcc.mk | \ + grep '/'${_abi}'/' | \ + sed -ne ' + /^'${_abi}'\/'${_lib_prefix}'\.'${_lib_suffix}': .*\.o$/ { + s,^.*/,, + s,\.o$,, + p + } + ' | sort +} + +get_libgcc_list_objs_libs () { + local _abi=${1:-'\.'} + + cat build/gcc/libgcc.mk | \ + grep '/'${_abi}'/' | \ + egrep '^'${_abi}'\/(libgcc_s\.so|libgcc\.a|libgcc_eh\.a|libgcov\.a): (libgcc_s|libgcc|libgcc_eh|libgcov)\/.*\.o$' | \ + sed -e ' + s,^'${_abi}'\/,, + s,: .*/, , + s,^\(.*\) \(.*\)$,\2 \1, + ' | sort +} + +get_libgcc_list_objs_srcs () { + local _abi=${1:-'\.'} # XXX not used + + if [ -e $_TOP/${libgcc_db_funcs}.S ]; then + cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \ + comm -23 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \ + sed -e 's,\(.*\),\1.o \1.c,' + + cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \ + comm -12 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \ + sed -e 's,\(.*\),\1.o \1.S,' + else + cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \ + sed -e 's,\(.*\),\1.o \1.c,' + fi | sort +} + +get_libgcc_list_objs_tmplsrcs () { + local _abi=${1:-'\.'} + + grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \ + grep '/'${_abi}'/' | \ + sed -ne ' + s,^.* -c \([^ ]*\).* -o .*/\([^ ]*\.o\)$,\2 \1, + # basename + /\$/ { s,\$.*/,,; } + /\// { s,\/.*/,,; } + p + ' | sort -u +} + +get_libgcc_list_objs_xflags () { + local _flags=$1 + local _abi=${2:-'\.'} + + grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \ + grep '/'${_abi}'/' | \ + sed -n ' + x + :loop + g + s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\5 \2/p + g + s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\1 \3 \4\/\5/ + h + t loop + ' | sort +} + +get_libgcc_list_objs_cppflags () { + get_libgcc_list_objs_xflags D $1 +} + +get_libgcc_list_objs_copts () { + get_libgcc_list_objs_xflags fmx $1 +} + +get_libgcc_list_tmplsrcs () { + local _lib=$1 + local _abi=$2 # XXX not used + local _tmplallsrcs=$( mktemp /tmp/mknative-gcc._tmplallsrcs.XXXXXX ) + + touch $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*} + touch $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*} + touch $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} + + # all files + local _lib_prefix=${_lib%.*} + local _lib_suffix=${_lib#*.} + join $_TOP/$libgcc_db_objs_libs $_TOP/$libgcc_db_objs_tmplsrcs | \ + grep ${_lib_prefix}'\.'${_lib_suffix} | cut -d' ' -f 3 | sort -u > \ + $_tmplallsrcs + + # TMPLFPSRCS = [fdp]p-bit.c + grep '[fdt]p-bit\.c' <$_tmplallsrcs | sort -u | \ + writefile ${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*} + + # TMPLASMSRCS = $(LIB1ASMSRC) + grep '\$(LIB1ASMSRC)' <$_tmplallsrcs | sort -u | \ + writefile ${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} + + # TMPLSRCS is anything else; exclude TMPLFPSRCS and TMPLASMSRCS + cat $_tmplallsrcs | \ + comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*} | \ + comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} | \ + writefile ${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*} + + rm -f $_tmplallsrcs +} + +get_libgcc_new_analyze () { + local _abi=$1 + + mkdir -p $_TOP/${_machine_arch_subdir} + + touch $_TOP/${libgcc_db_funcs}.S + get_libgcc_list_funcs_asm | \ + writefile ${libgcc_db_funcs}.S + + for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do + touch $_TOP/${libgcc_db_funcs}.${_lib%.*} + get_libgcc_list_funcs_lib $_lib $_abi | \ + writefile ${libgcc_db_funcs}.${_lib%.*} + done + + get_libgcc_list_objs_libs $_abi | writefile ${libgcc_db_objs_libs} + get_libgcc_list_objs_srcs $_abi | writefile ${libgcc_db_objs_srcs} + get_libgcc_list_objs_tmplsrcs $_abi | writefile ${libgcc_db_objs_tmplsrcs} + get_libgcc_list_objs_cppflags $_abi | writefile ${libgcc_db_objs_cppflags} + get_libgcc_list_objs_copts $_abi | writefile ${libgcc_db_objs_copts} + + for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do + get_libgcc_list_tmplsrcs $_lib $_abi + done +} + +##### + +get_libgcc_gen_tmplsrcs_tmplsrcs () { + local _lib=$1 + + printf '\n' + printf 'TMPLSRCS.%s = \\\n' $_lib + sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*} +} + +get_libgcc_gen_tmplsrcs_tmplfpsrcs () { + local _lib=$1 + + printf '\n' + printf 'TMPLFPSRCS.%s = \\\n' $_lib + sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*} +} + +get_libgcc_gen_tmplsrcs_tmplasmsrcs () { + local _lib=$1 + + printf '\n' + printf 'TMPLASMSRCS.%s = \\\n' $_lib + sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} | \ + sed -e 's,LIB1ASMSRC,G_&,' +} + +get_libgcc_gen_srcs () { + local _lib=$1 + + printf '\n' + printf 'SRCS.%s = \\\n' $_lib + if [ -e $_TOP/${libgcc_db_funcs}.S ]; then + comm -23 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \ + sed -e 's,$,.c,; s,^,tmp_,' + comm -12 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \ + sed -e 's,$,.S,; s,^,tmp_,' + else + cat $_TOP/${libgcc_db_funcs}.${_lib%.*} | \ + sed -e 's,$,.c,; s,^,tmp_,' + fi | sort | \ + sed -e 's,^, ,; s,$, \\,' +} + +_lookup_objs () { + local _obj=$1; local _key=$2 + + eval grep \^$_obj\\\ \$_TOP/\${libgcc_db_objs_${_key}} | cut -f2 +} + +get_libgcc_gen_srcs_tmplsrcs () { + cut -f1 $_TOP/${libgcc_db_objs_libs} | \ + while read _obj; do + printf 'SRCS.tmp_%s=%s\n' \ + "$( _lookup_objs $_obj srcs )" \ + "$( _lookup_objs $_obj tmplsrcs )" + done | \ + sed -e 's,\$(\(.*\)),${G_\1},' +} + +get_libgcc_gen_srcs_cppflags () { + cut -f1 $_TOP/${libgcc_db_objs_libs} | \ + while read _obj; do + printf '_CPPFLAGS.tmp_%s=%s\n' \ + "$( _lookup_objs $_obj srcs )" \ + "$( _lookup_objs $_obj cppflags | xargs )" + done +} + +get_libgcc_gen_srcs_copts () { + cut -f1 $_TOP/${libgcc_db_objs_libs} | \ + while read _obj; do + printf 'COPTS.tmp_%s=%s\n' \ + "$( _lookup_objs $_obj srcs )" \ + "$( _lookup_objs $_obj copts | xargs )" + done +} + +get_libgcc_new_generate () { + local _abi=$1 + + for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do + for _tmpl in tmplsrcs tmplfpsrcs tmplasmsrcs; do + eval get_libgcc_gen_tmplsrcs_${_tmpl} $_lib | \ + write_mk ${libgcc_libs_mk}.${_lib%.*}.tmplsrcs.${_tmpl}.mk + done + + get_libgcc_gen_srcs $_lib | \ + write_mk ${libgcc_libs_mk}.${_lib%.*}.srcs.mk + done + + for _arg in tmplsrcs cppflags copts; do + eval get_libgcc_gen_srcs_${_arg} | \ + eval writefile \$libgcc_srcs_mk_${_arg} + done +} + +##### + +get_libgcc_new () { + _subdir="$1" + _abi="$2" + + # List of generated files. + + _machine_arch_subdir=$_OUTDIRBASE/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH/$_abi + + libgcc_db_funcs=${_machine_arch_subdir}/funcs + libgcc_db_tmplsrcs=${_machine_arch_subdir}/tmplsrcs + libgcc_db_objs_libs=${_machine_arch_subdir}/objs.libs + libgcc_db_objs_srcs=${_machine_arch_subdir}/objs.srcs + libgcc_db_objs_tmplsrcs=${_machine_arch_subdir}/objs.tmplsrcs + libgcc_db_objs_cppflags=${_machine_arch_subdir}/objs.cppflags + libgcc_db_objs_copts=${_machine_arch_subdir}/objs.copts + + get_libgcc_new_analyze $_abi + + libgcc_libs_mk=${_machine_arch_subdir}/libs + libgcc_srcs_mk=${_machine_arch_subdir}/srcs.mk + libgcc_srcs_mk_tmplsrcs=${_machine_arch_subdir}/srcs.tmplsrcs.mk + libgcc_srcs_mk_cppflags=${_machine_arch_subdir}/srcs.cppflags.mk + libgcc_srcs_mk_copts=${_machine_arch_subdir}/srcs.copts.mk + + get_libgcc_new_generate $_abi +} + +get_libgcc () { + _subdir="$1" + mkdir -p $_OUTDIR/lib/lib$_subdir/arch + + case "$_subdir" in + gcc4|gcc) + _extravars="COLLECT2 UNWIND_H xm_include_list" + _archsubdir="" + ;; + esac + + # DPBIT, FPBIT only used on mn10[23]00, we don't need them. + # XXX we should probably grab everything Just In Case for + # the future. + { + getvars gcc/Makefile \ + INCLUDES LIB2ADD LIB2ADDEH LIB2ADD_ST \ + LIB1ASMFUNCS LIB1ASMSRC \ + LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \ + LIB2FUNCS_EXTRA \ + LIBGCC2_CFLAGS \ + SHLIB_MKMAP SHLIB_MKMAP_OPTS \ + SHLIB_MAPFILES SHLIB_NM_FLAGS \ + EXTRA_HEADERS xm_defines \ + tm_defines ${_extravars} + } | sed "s,-I$_DESTDIR/usr/include,,g" \ + | write_mk $_OUTDIRBASE/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH.mk + + # Generate new style files. + if [ -n "${MKNATIVE_LIBGCC_NEW}" ]; then + get_libgcc_new $_subdir $_ABI + fi +} + +##### gnu/lib/libgcov ##### + +get_libgcov () { + _subdir="$1" + + mkdir -p $_OUTDIR/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH + + { + getvars gcc/Makefile \ + LIBGCOV + } | write_mk $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/defs.mk + + write_c $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/gcov-iov.h \ + <$_TMPDIR/gcc/gcov-iov.h + +} + +##### gnu/usr.bin/gcc[34]/libiberty ##### + +get_gcc_libiberty () { + _subdir="$1" + case "$_subdir" in + gcc4) + _libibertydir="usr.bin/$_subdir/libiberty" + ;; + gcc) + _libibertydir="lib/libiberty" + ;; + esac + mkdir -p $_OUTDIR/$_libibertydir/arch/$MACHINE_ARCH + + getvars libiberty/Makefile \ + ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \ + | write_mk $_OUTDIRBASE/$_libibertydir/defs.mk + + write_c $_OUTDIRBASE/$_libibertydir/arch/$MACHINE_ARCH/config.h \ + <$_TMPDIR/libiberty/config.h +} + +##### lib/libdecnumber ##### + +get_libdecnumber () { + _subdir="$1" + + mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH + write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/config.h \ + <$_TMPDIR/libdecnumber/config.h +} + +##### lib/libgomp ##### + +get_libgomp () { + _subdir="$1" + + mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH + write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \ + <$_TMPDIR/$_PLATFORM/libgomp/config.h + write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp_f.h \ + <$_TMPDIR/$_PLATFORM/libgomp/libgomp_f.h + write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp.spec \ + <$_TMPDIR/$_PLATFORM/libgomp/libgomp.spec + write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/omp.h \ + <$_TMPDIR/$_PLATFORM/libgomp/omp.h +} + +##### gnu/lib/libobjc ##### + +get_libobjc () { + _subdir="$1/arch/$MACHINE_ARCH" + _options="ALL_OPT_FILES" + _unwind="UNWIND_H" + + mkdir -p $_OUTDIR/lib/$_subdir + + { + if [ -n "$_options" ]; then + getvars gcc/Makefile $_options + fi + getvars $_PLATFORM/libobjc/Makefile \ + ALL_CFLAGS INCLUDES OBJS OBJC_H \ + | sed "s,$_GNU_DIST,\${GNUHOSTDIST},g" + if [ -n "$_unwind" ]; then + getvars gcc/Makefile $_unwind + fi + } | write_mk $_OUTDIRBASE/lib/$_subdir/defs.mk + + write_c $_OUTDIRBASE/lib/$_subdir/config.h \ + <$_TMPDIR/$_PLATFORM/libobjc/config.h +} + +##### gnu/lib/libstdc++-v3 ##### + +get_libstdcxx_v3 () { + _subdir="$1" + mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH + + case ${_subdir} in + *) + _src_CC_files="atomicity_file CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_CC CLOCALE_CC BASIC_FILE_CC" + _headers1="host_headers debug_headers tr1_headers c_compatibility_headers_extra tr1_impl_headers parallel_headers decimal_headers" + _headers2="thread_host_headers host_headers_extra" + _build_headers="c++allocator.h c++config.h cxxabi_tweaks.h gthr-default.h gthr-posix.h gthr-single.h gthr-tpf.h gthr.h" + _unwind="UNWIND_H" + ;; + esac + + # build files + for h in $_build_headers; do + write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/$h \ + <$_TMPDIR/$_PLATFORM/libstdc++-v3/include/$_PLATFORM/bits/$h + done + + write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \ + <$_TMPDIR/$_PLATFORM/libstdc++-v3/config.h + write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/gstdint.h \ + <$_TMPDIR/$_PLATFORM/libstdc++-v3/include/gstdint.h + + { + # libsupc++ + getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \ + sources | sed 's/^G_sources=/G_LIBSUPCXX_SOURCES=/' + getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \ + c_sources | sed 's/^G_c_sources=/G_LIBSUPCXX_C_SOURCES=/' + + # src + getvars $_PLATFORM/libstdc++-v3/src/Makefile \ + sources $_src_CC_files SECTION_FLAGS | sed 's/^G_sources=/G_SRC_SOURCES=/' + + # include + getvars $_PLATFORM/libstdc++-v3/include/Makefile \ + c_base_headers std_headers | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g' + getvars $_PLATFORM/libstdc++-v3/include/Makefile \ + bits_headers backward_headers ext_headers c_base_headers_extra \ + $_headers1 | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g' + getvars $_PLATFORM/libstdc++-v3/include/Makefile \ + $_headers2 | sed -e 's#\./[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g' + + if [ -n "$_unwind" ]; then + getvars gcc/Makefile $_unwind + fi + } | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/defs.mk +} + +##### gnu/usr.bin/gcc3 ##### + +get_gcc () { + _subdir="$1" + mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH + mkdir -p $_OUTDIR/usr.bin/libcpp/arch/$MACHINE_ARCH + case ${_subdir} in + gcc4) + _buildname="BUILD_" + _libcppsubdir="" + _extravars="TM_H ALL_OPT_FILES" + _hconfig_h="" + _extravars2="tm_file_list build_xm_include_list" + _extravars3="tm_p_include_list" + ;; + + gcc) + _buildname="BUILD_" + _libcppsubdir="" + _extravars="TM_H ALL_OPT_FILES" + _hconfig_h="" + _extravars2="tm_file_list build_xm_include_list" + _extravars3="tm_p_include_list" + ;; + esac + + { + getvars gcc/Makefile \ + ${_buildname}EARLY_SUPPORT ${_buildname}ERRORS ${_buildname}PRINT \ + ${_buildname}RTL ${_buildname}SUPPORT ${_buildname}VARRAY | \ + sed -e 's#build/errors.o#build-errors.o#g' \ + -e 's#build/print-rtl.o#build-print-rtl.o#g' \ + -e 's#build/rtl.o#build-rtl.o#g' \ + -e 's#build/varray.o#build-varray.o#g' \ + -e 's#build/ggc-none.o#build-ggc-none.o#g' \ + -e 's#build/##g' + getvars gcc/Makefile \ + ALL_CFLAGS ALL_CPPFLAGS C_AND_OBJC_OBJS C_OBJS CCCP_OBJS \ + GCOV_OBJS PROTO_OBJS ${_extravars1} \ + INCLUDES md_file OBJC_OBJS OBJS out_file version \ + BUILD_PREFIX RTL_H TREE_H ${_hconfig_h} BASIC_BLOCK_H GCC_H \ + GTFILES_SRCDIR GTFILES_FILES_FILES GTFILES_FILES_LANGS \ + GTFILES GTFILES_LANG_DIR_NAMES \ + tm_defines host_xm_file host_xm_defines tm_p_file \ + target_cpu_default ${_extravars} ${_extravars2} \ + lang_specs_files ${_extravars3} \ + | sed "s,-I$_DESTDIR/usr/include,,g" + getvars gcc/Makefile \ + LIB2ADDEHDEP | sed 's/unwind.inc//' + getvars gcc/Makefile \ + CXX_OBJS CXX_C_OBJS | sed 's/cp\///g' + getvars gcc/Makefile \ + F77_OBJS | sed 's/f\///g' + case ${_subdir} in + gcc4 | gcc) + getvars libcpp/Makefile \ + libcpp_a_OBJS + ;; + gcc3) + getvars gcc/Makefile \ + LIBCPP_OBJS LIBCPP_H + ;; + esac + getvars gcc/Makefile \ + ENABLE_SHARED + case ${_subdir} in + gcc4 | gcc) + echo G_SHLIB_LINK="$CC -shared" + echo G_SHLIB_MULTILIB=. + ;; + esac + } | write_mk $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/defs.mk + + case "$_subdir" in + gcc4) + write_c $_OUTDIRBASE/usr.bin/$_subdir/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h + hfiles='auto-host gencheck configargs gthr-default tm bconfig config multilib' + ;; + gcc) + write_c $_OUTDIRBASE/usr.bin/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h + hfiles='auto-host configargs gthr-default tm bconfig config multilib bversion plugin-version' + ;; + esac + for f in $hfiles; do + write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h + if [ "${MACHINE_ARCH}" = "powerpc" -a "${f}" = "configargs" ] + then + ex <<__EOF__ $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h +/configuration_arguments/ s/$// +ya +i +#ifdef _SOFT_FLOAT +. +pu +s/";$/ -with-float=soft";/ +a +#else +#endif +. +. m +1 +/configure_default_options/ s/{ NULL.*$// +a +#ifdef _SOFT_FLOAT + { "float", "soft" }, +#endif + { NULL, NULL } +}; +. +wq +__EOF__ + fi + done + + # keep identical + for f in all-tree.def; do + cp $_TMPDIR/gcc/$f $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f + done + + # special transforms + for f in gtyp-input.list; do + sed -e 's/^.*external\/gpl3\/gcc\/dist/SRCDIR/' < $_TMPDIR/gcc/$f > $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f + done + + # special platforms + if [ "${MACHINE_ARCH}" = "sh3el" -o "${MACHINE_ARCH}" = "sh3eb" ]; then + write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/sysroot-suffix.h <$_TMPDIR/gcc/sysroot-suffix.h + fi +} + +##### main ##### + +case "$1" in +# .mk and .h files for libgcc bootstrap (from host build) +libgcc) + get_libgcc gcc3 + get_crtstuff crtstuff3 + exit 0 + ;; + +libgcc4) + get_libgcc gcc4 + get_crtstuff crtstuff4 + exit 0 + ;; + +libgcc45) + _OUTDIR="$_TOP/external/gpl3/gcc" + _OUTDIRBASE="external/gpl3/gcc" + get_libgcc gcc + get_crtstuff crtstuff + get_libgcov gcc + exit 0 + ;; + +# gcc files +gcc4) + get_gcc gcc4 + get_libgcc gcc4 + get_libgcov gcc4 + get_crtstuff crtstuff4 + get_gcc_libiberty gcc4 + get_libobjc libobjc4 + get_libstdcxx_v3 libstdc++-v3_4 + exit 0 + ;; + +gcc45) + _OUTDIR="$_TOP/external/gpl3/gcc" + _OUTDIRBASE="external/gpl3/gcc" + get_gcc gcc + get_libgcc gcc + get_libgcov gcc + get_crtstuff crtstuff + get_gcc_libiberty gcc + get_libobjc libobjc + get_libstdcxx_v3 libstdc++-v3 + get_libdecnumber libdecnumber + get_libgomp libgomp + exit 0 + ;; + + +*) echo invalid arguments; exit 1;; +esac diff --git a/tools/gcc/mknative.common b/tools/gcc/mknative.common new file mode 100644 index 000000000..8fd7553e7 --- /dev/null +++ b/tools/gcc/mknative.common @@ -0,0 +1,91 @@ +# $NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp $ +# +# from: NetBSD: mknative,v 1.12 2003/03/05 06:17:17 mrg Exp +# +# shell-fragment common to all "mknative" scripts + +bomb() +{ + echo >&2 "ABORT: $*" + exit 1 +} + +# Make sure we can run OK. +if [ -x "$MAKE" ]; then + : +else + bomb "MAKE not set" +fi + +# usage: getvars MAKEFILE VARNAME [VARNAME...] +# +getvars() +{ + _mf="$1"; shift + case "$MAKE" in + *gmake) + env MAKEFLAGS= $MAKE -f - -f "$_TMPDIR/$_mf" _x_ <$_TOP/$1.tmp || \ + bomb "cannot create $1" + grep '$''NetBSD' $0 | sed 's,[#$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp + echo '$NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp $' | sed 's,[#$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp + echo '' >>$_TOP/$1.tmp + writefile $1 +} + +# usage: write_mk FILENAME +# +write_mk() +{ + echo '# This file is automatically generated. DO NOT EDIT!' >$_TOP/$1.tmp || \ + bomb "cannot create $1" + grep '$''NetBSD' $0 | sed 's,[#$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp + echo '$NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp $' | sed 's,[#$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp + echo '#' >>$_TOP/$1.tmp + writefile $1 +} + +writefile() +{ + sed -e 's,netbsd\(elf\)*1[0-9\.]*\(_\)*[A-Z]*,netbsd\1,' \ + -e 's,^/\* #undef HAVE_MMAP \*/$,#define HAVE_MMAP 1,' \ + >>$_TOP/$1.tmp + + # Compare new file, sans "generated from" comments and RCS Id, + # to old file. If they match, don't change anything. + rm -f $_TMPDIR/.1 $_TMPDIR/.2 + grep -v 'Generated from:' $_TOP/$1 >$_TMPDIR/.1 2>/dev/null + grep -v 'Generated from:' $_TOP/$1.tmp >$_TMPDIR/.2 + + # will not overwrite a file that has the same content + if cmp $_TMPDIR/.1 $_TMPDIR/.2 >/dev/null 2>&1; then + rm -f $_TOP/$1.tmp + else + echo >&2 "$1 changed" + mv -f $_TOP/$1.tmp $_TOP/$1 + fi +} diff --git a/tools/gcc/patches/patch-aa b/tools/gcc/patches/patch-aa new file mode 100644 index 000000000..0f8c0583f --- /dev/null +++ b/tools/gcc/patches/patch-aa @@ -0,0 +1,62 @@ +$NetBSD: patch-aa,v 1.1.1.1 2009/09/18 11:24:50 dmcmahill Exp $ + +--- configure.orig Sat Apr 25 04:10:29 2009 ++++ configure +@@ -4532,7 +4532,7 @@ if test "${with_mpfr_lib+set}" = set; then + fi; + + if test "x$with_mpfr" != x; then +- gmplibs="-L$with_mpfr/lib $gmplibs" ++ gmplibs="-L$with_mpfr/lib -Wl,-R${PREFIX}/lib $gmplibs" + gmpinc="-I$with_mpfr/include" + fi + if test "x$with_mpfr_include" != x; then +--- gcc/config.gcc.orig 2009-04-17 13:58:41 +0200 ++++ gcc/config.gcc +@@ -488,6 +488,33 @@ case ${target} in + default_use_cxa_atexit=yes;; + esac + ;; ++*-*-dragonfly*) ++ gas=yes ++ gnu_ld=yes ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" ++ case ${target} in ++ *-*-dragonfly1 | *-*-dragonfly[1].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=1" ;; ++ *-*-dragonfly2 | *-*-dragonfly[2].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=2" ;; ++ *-*-dragonfly3 | *-*-dragonfly[3].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=3" ;; ++ *-*-dragonfly4 | *-*-dragonfly[4].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=4" ;; ++ *) ++ echo 'Please update *-*-dragonfly* in gcc/config.gcc' ++ exit 1 ++ ;; ++ esac ++ tmake_file="t-slibgcc-elf-ver t-dragonfly" ++ case ${enable_threads} in ++ "" | yes | posix) ++ thread_file='posix' ++ tmake_file="${tmake_file} t-dragonfly-thread" ++ ;; ++ esac ++ dfbsd_tm_file="${dfbsd_tm_file} dragonfly-spec.h dragonfly.h" ++ ;; + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) + extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" + gas=yes +@@ -1053,6 +1080,12 @@ x86_64-*-freebsd*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" + tmake_file="${tmake_file} i386/t-crtstuff" + ;; ++i[34567]86-*-dragonfly*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/dragonfly.h" ++ ;; ++x86_64-*-dragonfly*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h" ++ ;; + i[34567]86-*-netbsdelf*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" + ;; diff --git a/tools/gcc/patches/patch-ab b/tools/gcc/patches/patch-ab new file mode 100644 index 000000000..6ee550946 --- /dev/null +++ b/tools/gcc/patches/patch-ab @@ -0,0 +1,10 @@ +--- gcc/Makefile.in.orig Fri Jun 3 14:13:51 2011 ++++ gcc/Makefile.in Fri Jun 3 14:16:25 2011 +@@ -310,7 +310,6 @@ + $(srcdir)/ginclude/iso646.h \ + $(srcdir)/ginclude/stdarg.h \ + $(srcdir)/ginclude/stdbool.h \ +- $(srcdir)/ginclude/stddef.h \ + $(srcdir)/ginclude/varargs.h \ + $(srcdir)/ginclude/stdfix.h \ + $(EXTRA_HEADERS) diff --git a/tools/gcc/patches/patch-ac b/tools/gcc/patches/patch-ac new file mode 100644 index 000000000..1c921f069 --- /dev/null +++ b/tools/gcc/patches/patch-ac @@ -0,0 +1,82 @@ +--- gcc/config.gcc.orig Fri Jun 3 14:42:47 2011 ++++ gcc/config.gcc Fri Jun 3 14:42:58 2011 +@@ -251,7 +251,7 @@ + | *-*-sysv* \ + | vax-*-vms* \ + ) +- echo "*** Configuration ${target} not supported" 1>&2 ++ echo "*** Configuration ${target} recognized but not supported" 1>&2 + exit 1 + ;; + esac +@@ -515,6 +515,33 @@ + esac + dfbsd_tm_file="${dfbsd_tm_file} dragonfly-spec.h dragonfly.h" + ;; ++*-*-dragonfly*) ++ gas=yes ++ gnu_ld=yes ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" ++ case ${target} in ++ *-*-dragonfly1 | *-*-dragonfly[1].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=1" ;; ++ *-*-dragonfly2 | *-*-dragonfly[2].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=2" ;; ++ *-*-dragonfly3 | *-*-dragonfly[3].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=3" ;; ++ *-*-dragonfly4 | *-*-dragonfly[4].*) ++ tm_defines="${tm_defines} DFBSD_MAJOR=4" ;; ++ *) ++ echo 'Please update *-*-dragonfly* in gcc/config.gcc' ++ exit 1 ++ ;; ++ esac ++ tmake_file="t-slibgcc-elf-ver t-dragonfly" ++ case ${enable_threads} in ++ "" | yes | posix) ++ thread_file='posix' ++ tmake_file="${tmake_file} t-dragonfly-thread" ++ ;; ++ esac ++ dfbsd_tm_file="${dfbsd_tm_file} dragonfly-spec.h dragonfly.h" ++ ;; + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) + extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" + gas=yes +@@ -1070,6 +1097,14 @@ + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/x86-64.h" + tmake_file="${tmake_file} i386/t-i386elf t-svr4" + ;; ++i[34567]86-*-minix) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h minix-spec.h minix.h i386/minix.h" ++# tmake_file="t-slibgcc-elf-ver t-minix i386/t-minix" ++# use_fixproto=yes ++ gas=yes ++ gnu_ld=yes ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" ++ ;; + i[34567]86-*-aout*) + tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/i386-aout.h" + ;; +@@ -1086,6 +1121,12 @@ + x86_64-*-dragonfly*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h" + ;; ++i[34567]86-*-dragonfly*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/dragonfly.h" ++ ;; ++x86_64-*-dragonfly*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h" ++ ;; + i[34567]86-*-netbsdelf*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" + ;; +@@ -2466,7 +2507,7 @@ + cxx_target_objs="m32c-pragma.o" + ;; + *) +- echo "*** Configuration ${target} not supported" 1>&2 ++ echo "*** Configuration ${target} not recognized, not supported" 1>&2 + exit 1 + ;; + esac diff --git a/tools/gcc/patches/patch-ad b/tools/gcc/patches/patch-ad new file mode 100644 index 000000000..7a7091b90 --- /dev/null +++ b/tools/gcc/patches/patch-ad @@ -0,0 +1,15 @@ +$NetBSD$ + +--- gcc/gcov.c.orig Sat Jan 9 00:05:06 2010 ++++ gcc/gcov.c +@@ -58,6 +58,10 @@ along with Gcov; see the file COPYING3. If not see + + #define STRING_SIZE 200 + ++#ifdef _MINIX ++#define block_t gcc_block_t ++#endif ++ + struct function_info; + struct block_info; + struct source_info; diff --git a/tools/gcc/patches/patch-ae b/tools/gcc/patches/patch-ae new file mode 100644 index 000000000..184e15b41 --- /dev/null +++ b/tools/gcc/patches/patch-ae @@ -0,0 +1,34 @@ +$NetBSD$ + +--- gcc/libgcov.c.orig Thu Apr 9 23:23:07 2009 ++++ gcc/libgcov.c +@@ -40,6 +40,11 @@ see the files COPYING3 and COPYING.RUNTIME respectivel + #define GCOV_LINKAGE /* nothing */ + #endif + #endif ++ ++#ifndef L_gcov_merge_add ++#include "gcov-minix-fs-wrapper.h" ++#endif ++ + #include "gcov-io.h" + + #if defined(inhibit_libc) +@@ -152,7 +157,7 @@ gcov_version (struct gcov_info *ptr, gcov_unsigned_t v + in two separate programs, and we must keep the two program + summaries separate. */ + +-static void ++void + gcov_exit (void) + { + struct gcov_info *gi_ptr; +@@ -564,7 +569,7 @@ __gcov_init (struct gcov_info *info) + gcov_crc32 = crc32; + + if (!gcov_list) +- atexit (gcov_exit); ++ atexit (gcov_exit_wrapper); + + info->next = gcov_list; + gcov_list = info; diff --git a/tools/gcc/patches/patch-af b/tools/gcc/patches/patch-af new file mode 100644 index 000000000..cb34371d8 --- /dev/null +++ b/tools/gcc/patches/patch-af @@ -0,0 +1,40 @@ +$NetBSD: patch-af,v 1.1 2009/09/24 11:50:57 dmcmahill Exp $ + +--- libgcc/config.host.orig Fri Apr 17 11:58:41 2009 ++++ libgcc/config.host +@@ -149,6 +149,8 @@ case ${host} in + # machine-specific sections may refine and add to this + # configuration. + ;; ++*-*-dragonfly*) ++ ;; + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*) + extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" + ;; +@@ -277,9 +279,15 @@ x86_64-*-elf*) + ;; + i[34567]86-*-aout*) + ;; ++i[34567]86-*-minix*) ++ ;; + i[34567]86-*-freebsd*) + ;; + x86_64-*-freebsd*) ++ ;; ++i[34567]86-*-dragonfly*) ++ ;; ++x86_64-*-dragonfly*) + ;; + i[34567]86-*-netbsdelf*) + ;; +--- libjava/configure.orig 2009-07-22 07:43:59.000000000 +0000 ++++ libjava/configure 2009-09-23 12:51:11.000000000 +0000 +@@ -28129,7 +28129,7 @@ echo "${ECHO_T}Python modules dir: ${pyt + + + # needed for aot-compile-rpm +-MAKE=`which make` ++MAKE=${PKGSRC_MAKE} + + + # Check whether --enable-aot-compile-rpm or --disable-aot-compile-rpm was given. diff --git a/tools/gcc/patches/patch-ag b/tools/gcc/patches/patch-ag new file mode 100644 index 000000000..0f3bdc04c --- /dev/null +++ b/tools/gcc/patches/patch-ag @@ -0,0 +1,23 @@ +--- libjava/contrib/rebuild-gcj-db.in.orig Wed Jul 2 13:17:54 2008 ++++ libjava/contrib/rebuild-gcj-db.in Fri Jun 3 14:16:43 2011 +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # rebuild-gcj-db + + ## Copyright (C) 2000, 2002, 2003, 2008 Free Software Foundation +@@ -16,12 +16,12 @@ + base=@prefix@/lib/$dirname + dbLocation=`@prefix@/bin/gcj-dbtool -p $base` + libdir=$base/gcj +- if ! test -d $libdir; then ++ if test ! -d $libdir; then + # No shared libraries here. + continue + fi + dirname $dbLocation | xargs mkdir -p + @prefix@/bin/gcj-dbtool -n $dbLocation 64 +- find $libdir -follow -name '*.db' -print0 | \ ++ find $libdir -follow -name '*.db' -print | @AWK@ '{printf("%s%c", $1, 0);}' | \ + @prefix@/bin/gcj-dbtool -0 -m $dbLocation $dbLocation + done diff --git a/tools/gcc/patches/patch-ai b/tools/gcc/patches/patch-ai new file mode 100644 index 000000000..95530e963 --- /dev/null +++ b/tools/gcc/patches/patch-ai @@ -0,0 +1,20 @@ +--- gcc/fortran/f95-lang.c.orig Tue Jun 15 12:27:01 2010 ++++ gcc/fortran/f95-lang.c Fri Jun 3 14:51:32 2011 +@@ -873,10 +873,17 @@ + + gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, + BUILT_IN_CABSL, "cabsl", true); ++#if defined (__NetBSD__) + gfc_define_builtin ("__builtin_cabs", func_cdouble_double, ++ BUILT_IN_CABS, "__c99_cabs", true); ++ gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, ++ BUILT_IN_CABSF, "__c99_cabsf", true); ++#else ++ gfc_define_builtin ("__builtin_cabs", func_cdouble_double, + BUILT_IN_CABS, "cabs", true); + gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, + BUILT_IN_CABSF, "cabsf", true); ++#endif + + gfc_define_builtin ("__builtin_copysignl", mfunc_longdouble[1], + BUILT_IN_COPYSIGNL, "copysignl", true); diff --git a/tools/gcc/patches/patch-aj b/tools/gcc/patches/patch-aj new file mode 100644 index 000000000..4f37f72d7 --- /dev/null +++ b/tools/gcc/patches/patch-aj @@ -0,0 +1,54 @@ +$NetBSD$ + +--- libstdc++-v3/config/io/basic_file_stdio.cc.orig Thu Apr 9 23:23:07 2009 ++++ libstdc++-v3/config/io/basic_file_stdio.cc +@@ -27,6 +27,10 @@ + // ISO C++ 14882: 27.8 File-based streams + // + ++#ifndef _POSIX_SOURCE ++#define _POSIX_SOURCE 1 ++#endif ++ + #include + #include + #include +--- libstdc++-v3/config/os/bsd/netbsd/ctype_base.h.orig 2009-04-09 23:23:07.000000000 +0000 ++++ libstdc++-v3/config/os/bsd/netbsd/ctype_base.h +@@ -30,6 +30,8 @@ + // Full details can be found from the CVS files at: + // anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h + // See www.netbsd.org for details of access. ++ ++#include + + _GLIBCXX_BEGIN_NAMESPACE(std) + +@@ -42,6 +44,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + // NB: Offsets into ctype::_M_table force a particular size + // on the mask type. Because of this, we don't use an enum. + typedef unsigned char mask; ++#if __NetBSD_Version__ >= 599004100 ++ static const mask upper = _CTYPE_U; ++ static const mask lower = _CTYPE_L; ++ static const mask alpha = _CTYPE_U | _CTYPE_L; ++ static const mask digit = _CTYPE_N; ++ static const mask xdigit = _CTYPE_N | _CTYPE_X; ++ static const mask space = _CTYPE_S; ++ static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B; ++ static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N; ++ static const mask cntrl = _CTYPE_C; ++ static const mask punct = _CTYPE_P; ++ static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N; ++#else + static const mask upper = _U; + static const mask lower = _L; + static const mask alpha = _U | _L; +@@ -53,6 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + static const mask cntrl = _C; + static const mask punct = _P; + static const mask alnum = _U | _L | _N; ++#endif + }; + + _GLIBCXX_END_NAMESPACE diff --git a/tools/gcc/patches/patch-ak b/tools/gcc/patches/patch-ak new file mode 100644 index 000000000..37e669c5c --- /dev/null +++ b/tools/gcc/patches/patch-ak @@ -0,0 +1,54 @@ +$NetBSD$ + +--- libstdc++-v3/config/os/generic/error_constants.h.orig Thu Apr 9 23:23:07 2009 ++++ libstdc++-v3/config/os/generic/error_constants.h +@@ -51,12 +51,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + #endif + + broken_pipe = EPIPE, ++#ifdef _GLIBCXX_HAVE_ECONNABORTED + connection_aborted = ECONNABORTED, ++#endif + connection_already_in_progress = EALREADY, + connection_refused = ECONNREFUSED, + connection_reset = ECONNRESET, + cross_device_link = EXDEV, ++#ifdef _GLIBCXX_HAVE_EDESTADDRREQ + destination_address_required = EDESTADDRREQ, ++#endif + device_or_resource_busy = EBUSY, + directory_not_empty = ENOTEMPTY, + executable_format_error = ENOEXEC, +@@ -79,7 +83,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + is_a_directory = EISDIR, + message_size = EMSGSIZE, + network_down = ENETDOWN, ++#ifdef _GLIBCXX_HAVE_ENETRESET + network_reset = ENETRESET, ++#endif + network_unreachable = ENETUNREACH, + no_buffer_space = ENOBUFS, + no_child_process = ECHILD, +@@ -94,7 +100,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + no_message_available = ENODATA, + #endif + ++#ifdef _GLIBCXX_HAVE_ENOMSG + no_message = ENOMSG, ++#endif + no_protocol_option = ENOPROTOOPT, + no_space_on_device = ENOSPC, + +--- libjava/configure.host.orig 2011-02-25 16:07:42.000000000 +0100 ++++ libjava/configure.host +@@ -310,6 +310,9 @@ + *-*-freebsd*) + slow_pthread_self= + ;; ++ *-*-netbsd*) ++ slow_pthread_self= ++ ;; + *-mingw*) + libgcj_flags="${libgcj_flags} -fno-omit-frame-pointer" + # FIXME: win32_exception_handler( ) in win32.cc does not do the + diff --git a/tools/gcc/patches/patch-al b/tools/gcc/patches/patch-al new file mode 100644 index 000000000..5f8246419 --- /dev/null +++ b/tools/gcc/patches/patch-al @@ -0,0 +1,36 @@ +$NetBSD$ + +--- libgfortran/intrinsics/c99_functions.c.orig Thu Apr 9 23:23:07 2009 ++++ libgfortran/intrinsics/c99_functions.c +@@ -1412,7 +1412,7 @@ ctanl (long double complex a) + #endif + + +-#if !defined(HAVE_TGAMMA) ++#if !defined(HAVE_TGAMMA) && defined(HAVE_NEXTAFTER) + #define HAVE_TGAMMA 1 + + extern double tgamma (double); +@@ -1551,7 +1551,7 @@ tgamma (double x) + + + +-#if !defined(HAVE_LGAMMA) ++#if !defined(HAVE_LGAMMA) && defined(HAVE_NEXTAFTER) + #define HAVE_LGAMMA 1 + + extern double lgamma (double); +--- libjava/configure.ac.orig 2011-02-25 16:08:27.000000000 +0100 ++++ libjava/configure.ac +@@ -1011,6 +1011,11 @@ + THREADLDFLAGS=-pthread + THREADSPEC=-lpthread + ;; ++ *-*-netbsd*) ++ # NetBSD should work with pthread. ++ THREADLDFLAGS=-pthread ++ THREADSPEC=-lpthread ++ ;; + alpha*-dec-osf* | hppa*-hp-hpux*) + THREADCXXFLAGS=-pthread + # boehm-gc needs some functions from librt, so link that too. diff --git a/tools/gcc/patches/patch-am b/tools/gcc/patches/patch-am new file mode 100644 index 000000000..a5e50dc26 --- /dev/null +++ b/tools/gcc/patches/patch-am @@ -0,0 +1,36 @@ +$NetBSD$ + +--- gcc/ginclude/stddef.h.orig Thu Apr 9 23:23:07 2009 ++++ gcc/ginclude/stddef.h +@@ -58,6 +58,9 @@ see the files COPYING3 and COPYING.RUNTIME respectivel + #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) + #include + #endif ++#if defined (__minix) ++#include ++#endif + + /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are + defined if the corresponding type is *not* defined. +--- libjava/boehm.cc.orig 2011-03-05 18:09:36.000000000 +0000 ++++ libjava/boehm.cc +@@ -747,7 +747,8 @@ _Jv_GCAttachThread () + // The registration interface is only defined on posixy systems and + // only actually works if pthread_getattr_np is defined. + // FIXME: until gc7 it is simpler to disable this on solaris. +-#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) ++#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) \ ++ && !defined(__NetBSD__) + GC_register_my_thread (); + #endif + } +@@ -755,7 +756,8 @@ _Jv_GCAttachThread () + void + _Jv_GCDetachThread () + { +-#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) ++#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) \ ++ && !defined(__NetBSD__) + GC_unregister_my_thread (); + #endif + } diff --git a/tools/gcc/patches/patch-ao b/tools/gcc/patches/patch-ao new file mode 100644 index 000000000..d191121ec --- /dev/null +++ b/tools/gcc/patches/patch-ao @@ -0,0 +1,14 @@ +$NetBSD$ + +--- gcc/toplev.h.orig Fri Feb 20 15:20:38 2009 ++++ gcc/toplev.h +@@ -174,7 +174,8 @@ extern int exact_log2 (unsigned HOST_ + extern int floor_log2 (unsigned HOST_WIDE_INT); + + /* Inline versions of the above for speed. */ +-#if GCC_VERSION >= 3004 ++/* #if GCC_VERSION >= 3004 */ ++#if 0 + # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG + # define CLZ_HWI __builtin_clzl + # define CTZ_HWI __builtin_ctzl diff --git a/tools/gcc/patches/patch-gcc_ginclude_stddef.h b/tools/gcc/patches/patch-gcc_ginclude_stddef.h new file mode 100644 index 000000000..82dd34e4b --- /dev/null +++ b/tools/gcc/patches/patch-gcc_ginclude_stddef.h @@ -0,0 +1,19 @@ +$NetBSD$ + +Fix build on NetBSD i386/amd64 after the ansi.h header include protection +name change. + +--- gcc/ginclude/stddef.h.orig 2009-04-09 23:23:07.000000000 +0000 ++++ gcc/ginclude/stddef.h +@@ -53,6 +53,11 @@ see the files COPYING3 and COPYING.RUNTI + one less case to deal with in the following. */ + #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) + #include ++#if !defined(_MACHINE_ANSI_H_) ++#if defined(_I386_ANSI_H_) || defined(_X86_64_ANSI_H_) ++#define _MACHINE_ANSI_H_ ++#endif ++#endif + #endif + /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ + #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) diff --git a/tools/genassym/Makefile b/tools/genassym/Makefile new file mode 100644 index 000000000..76d890912 --- /dev/null +++ b/tools/genassym/Makefile @@ -0,0 +1,26 @@ +# $NetBSD: Makefile,v 1.5 2008/10/25 22:15:28 apb Exp $ + +.include + +.PATH.sh: ${.CURDIR}/../../usr.bin/genassym + +COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR} +.-include "${COMPATOBJ}/defs.mk" + + +TIMESTAMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym + +CLEANFILES+= genassym + +.include + +install: ${TIMESTAMP} +${TIMESTAMP}: genassym + ${HOST_INSTALL_FILE} -m ${BINMODE} ${.ALLSRC} ${.TARGET} + +genassym: genassym.sh + ${TOOL_SED} -e "s,/bin/sh,${HOST_BSHELL},g" \ + -e "s,{AWK:=.*},{AWK:="${TOOL_AWK:Q}"}," \ + < ${.ALLSRC} > ${.TARGET} + +realall: genassym diff --git a/tools/gmake/Makefile b/tools/gmake/Makefile new file mode 100644 index 000000000..797b4269a --- /dev/null +++ b/tools/gmake/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.2 2006/10/27 22:36:23 uwe Exp $ +# + +GNUHOSTDIST= ${.CURDIR}/../../gnu/dist/gmake + +CONFIGURE_ENV+= CC=${HOST_CC:Q} \ + CFLAGS=${HOST_CFLAGS:Q} \ + CPPFLAGS=${HOST_CPPFLAGS:Q} \ + CXX=${HOST_CXX:Q} + +CONFIGURE_ARGS= --program-prefix=${_TOOL_PREFIX}g +CONFIGURE_ARGS+=--disable-nls + +.NOTPARALLEL: + +.include "${.CURDIR}/../Makefile.gnuhost" diff --git a/tools/host-mkdep/Makefile b/tools/host-mkdep/Makefile new file mode 100644 index 000000000..73ce6ec8c --- /dev/null +++ b/tools/host-mkdep/Makefile @@ -0,0 +1,28 @@ +# $NetBSD: Makefile,v 1.10 2008/10/19 22:05:23 apb Exp $ + +TIMESTAMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep + +CLEANFILES+= config.cache config.log config.status host-mkdep + +.include + +# When host-mkdep is built, TOOL_AWK is not yet available, so we do not +# pass AWK=${TOOL_AWK:Q} to configure; we allow configure to find awk +# for itself (or complain if it can't find awk). + +realall: host-mkdep +host-mkdep: configure host-mkdep.in + -rm -f $@ + CC=${HOST_CC:Q} ${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache + chmod +x $@ + +# This is the only program that comes before binstall. +install: ${TIMESTAMP} +${TIMESTAMP}: host-mkdep + mkdir -p ${TOOLDIR}/bin + cp host-mkdep $@ + chmod +x $@ + +# Run by hand, then "configure" script committed: +regen: + cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf diff --git a/tools/host-mkdep/configure b/tools/host-mkdep/configure new file mode 100755 index 000000000..4306f9b33 --- /dev/null +++ b/tools/host-mkdep/configure @@ -0,0 +1,2518 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52 for mkdep noversion. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME='mkdep' +PACKAGE_TARNAME='mkdep' +PACKAGE_VERSION='noversion' +PACKAGE_STRING='mkdep noversion' +PACKAGE_BUGREPORT='tech-toolchain@NetBSD.org' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF +mkdep configure noversion +generated by GNU Autoconf 2.52 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:824: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:835: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:843: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:859: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:863: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:869: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:871: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:873: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:892: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:894: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:914: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:917: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +# Extract the first word of "sh", so it can be a program name with args. +set dummy sh; ac_word=$2 +echo "$as_me:928: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_BSHELL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $BSHELL in + [\\/]* | ?:[\\/]*) + ac_cv_path_BSHELL="$BSHELL" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_BSHELL="$ac_dir/$ac_word" + echo "$as_me:945: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +BSHELL=$ac_cv_path_BSHELL + +if test -n "$BSHELL"; then + echo "$as_me:956: result: $BSHELL" >&5 +echo "${ECHO_T}$BSHELL" >&6 +else + echo "$as_me:959: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test x"$BSHELL" = x; then + { { echo "$as_me:964: error: sh must be somewhere on \$PATH" >&5 +echo "$as_me: error: sh must be somewhere on \$PATH" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_config_files="$ac_config_files host-mkdep" + +for ac_prog in mawk gawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:975: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AWK="$ac_prog" +echo "$as_me:990: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:998: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:1001: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1016: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:1031: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1039: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1042: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:1051: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1066: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1074: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1077: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:1090: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1105: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1113: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1116: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1125: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1140: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1148: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1151: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1164: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1184: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1206: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1209: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:1220: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:1235: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1243: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1246: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1259: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:1274: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1282: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1285: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1297: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:1302:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1305: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1308: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1310: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1313: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1315: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1318: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1322 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:1338: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:1341: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1344: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1367: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:1373: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1378: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:1384: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1387: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1394: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1402: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1409: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1411: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1414: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1416: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1419: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1435: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:1441: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:1447: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1453 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1465: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1468: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1480: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:1487: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1491: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1497 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1512: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1515: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1518: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1521: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1533: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:1539: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1545 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1557: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1560: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1563: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1566: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1576: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1603: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1606: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1609: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1612: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1624 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1637: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1640: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1643: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1646: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1656 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1668: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1671: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1674: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1677: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:1709: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1730 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1735: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1741: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1764 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1768: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1774: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:1811: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1821 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1826: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1832: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1855 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1859: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1865: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:1893: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\EOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +EOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:2013: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:2180: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:2199: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me (mkdep noversion) 2.52, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "host-mkdep" ) CONFIG_FILES="$CONFIG_FILES host-mkdep" ;; + *) { { echo "$as_me:2235: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@BSHELL@,$BSHELL,;t t +s,@AWK@,$AWK,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:2434: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:2452: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:2465: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/tools/host-mkdep/configure.ac b/tools/host-mkdep/configure.ac new file mode 100644 index 000000000..418862bfd --- /dev/null +++ b/tools/host-mkdep/configure.ac @@ -0,0 +1,18 @@ +# $NetBSD: configure.ac,v 1.3 2003/07/26 20:24:00 salo Exp $ +# +# Autoconf definition file for mkdep. +# + +AC_INIT([mkdep], [noversion], [tech-toolchain@NetBSD.org]) + +AC_PATH_PROG(BSHELL, sh, ) +if test x"$BSHELL" = x; then + AC_MSG_ERROR([sh must be somewhere on \$PATH]) +fi + +AC_CONFIG_FILES(host-mkdep) + +AC_PROG_AWK +AC_PROG_CPP + +AC_OUTPUT diff --git a/tools/host-mkdep/host-mkdep.in b/tools/host-mkdep/host-mkdep.in new file mode 100644 index 000000000..8512480d2 --- /dev/null +++ b/tools/host-mkdep/host-mkdep.in @@ -0,0 +1,253 @@ +#!@BSHELL@ - +# +# $NetBSD: host-mkdep.in,v 1.20 2011/06/30 20:09:41 wiz Exp $ +# +# Copyright (c) 1991, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. +# +# @(#)mkdep.old.compiler 8.1 (Berkeley) 6/6/93 +# + +APPEND=false +MERGE=false +OPTIONAL=false +AWK_OPTIONAL= +QUIET=false +CPPFLAGS= +NEWEXT=.o +OUTFILE=.depend +SRCS= + +usage() +{ + echo "Usage: $0 [-adopq] [-s .suffixes] [-f .depend] -- [flags] file ..." >&2 + exit 1 +} + +set_objlist() +{ + if [ -n "$NEWEXT" ]; then + oifs="$IFS" + IFS=" ," + set -- $NEWEXT + IFS="$oifs" + objlist= + for suf in "$@"; do + objlist="$objlist${objlist:+ }$file$suf" + done + else + objlist="$file" + fi +} + +# A getopt compatible command line parser in shell comands. +# (don't trust the shell builtin getopts to be in a known state on error) +while [ $# -gt 0 ]; do + option="${1#-}" + [ "$option" = "$1" -o -z "$option" ] && break + while + optarg="${option#?}" + option="${option%$optarg}" + + case "-$option" in + -a) APPEND=true;; + -d) MERGE=true;; + -o) OPTIONAL=true; AWK_OPTIONAL='print ".OPTIONAL:" $0';; + -p) NEWEXT=;; + -q) QUIET=true;; + + -[fs]) # Options with arguments + [ -z "$optarg" ] && { + [ $# = 1 ] && usage + shift + optarg="$1" + } + case "-$option" in + -f) OUTFILE="$optarg";; + -s) NEWEXT="$optarg";; + esac + optarg= + ;; + + --) [ -z "$optarg" ] && shift + break 2 + ;; + + *) $MERGE && usage + break 2; + ;; + esac + [ -n "$optarg" ] + do + option="$optarg" + done + shift +done + +[ $# = 0 ] && usage + +if $MERGE; then + SRCS="$*" +else + # + # Process argument list. + # This is tricky, because arguments may contain spaces and other + # escapes characters. The argument list is used like a tail queue. + # $cppargs has one x for each unprocessed argument, so when an + # argument is processed, it is shifted and the corresponding number + # of x's is removed. The advantage to counting is that suffix removal + # works without fork. + # + cppargs= + for arg; do + cppargs="x$cppargs" + done + while [ -n "$cppargs" ]; do + case "$1" in + -L) # takes an arg, but ignored + shift 2 + cppargs=${cppargs%xx} + ;; + + -c|-[lLMOW]*) # takes no extra args + shift + cppargs=${cppargs%x} + ;; + + -[IDU]*) + set -- "$@" "$1" + shift + cppargs=${cppargs%x} + ;; + + -[IDU]|-include|-isystem|-isysroot) + set -- "$@" "$1" "$2" + shift 2 + cppargs=${cppargs%xx} + ;; + + -isystem-cxx|-cxx-isystem) + set -- "$@" "-isystem" "$2" + shift 2 + cppargs=${cppargs%xx} + ;; + + -no-cpp-precomp) # This is a Darwin-specific option. + set -- "$@" "$1" + shift + cppargs=${cppargs%x} + ;; + + -nostdinc*) # This is a gcc/g++ ism; ignore if not gcc/g++ + case "@CFLAGS@" in + *-O2*) # Autoconf puts -O2 when gcc only + set -- "$@" "$1" + ;; + esac + shift + cppargs=${cppargs%x} + ;; + + -*) + echo "$0: Unknown option: $1" 1>&2 # all other -options + exit 1 + ;; + + *) + SRCS="$SRCS $1" # source file + shift + cppargs=${cppargs%x} + ;; + esac + done +fi + +[ -z "$SRCS" ] && usage + +TMP=/tmp/mkdep$$ +rm -f $TMP + +trap 'rm -f $TMP; exit 1' 1 2 3 13 15 + +if $MERGE; then + for f in $SRCS; do + if [ ! -f "$f" ]; then + if ! $QUIET; then echo "$0: Ignoring $f" >&2; fi + continue + fi + while IFS=':'; read target dependents; do + IFS= + t1="${target#* }" + file="${target%.o}" + if [ "$t1" = "$target" -a "$file" != "$target" ]; then + set_objlist $file + target="$objlist" + fi + echo "$target:$dependents" + if "$OPTIONAL"; then + echo ".OPTIONAL:$dependents" + fi + done <$f + done >$TMP +else + for f in $SRCS; do + file=${f##*/} + file=${file%.*} + set_objlist $file + + @CPP@ "$@" $f | @AWK@ ' + /^#/ { + # Be as tolerant as possible. + sub(/^#(line)? [ 0-9]*\"?/, "") + sub(/^#(pragma).*/, "") + sub(/^<.*/, "") + sub(/\".*$/, "") + sub(/ [ 0-9]*$/, "") + + if ($0 in seenfiles) next + if ($0 ~ /y.tab.c/) next + + seenfiles[$0] = 1 + print "'"$objlist"'" ": " $0 + '"$AWK_OPTIONAL"' + } + ' >> $TMP + done +fi + +if $APPEND; then + cat $TMP >> $OUTFILE +else + cat $TMP > $OUTFILE +fi + +rm -f $TMP +exit 0 diff --git a/tools/installboot/Makefile b/tools/installboot/Makefile new file mode 100644 index 000000000..dd0e97ca3 --- /dev/null +++ b/tools/installboot/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.11 2011/03/06 18:15:30 bouyer Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}installboot +HOST_SRCDIR= usr.sbin/installboot + +HOST_CPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../mips-elf2ecoff +HOST_CPPFLAGS+= -I${TOOLDIR}/include/nbinclude + +.include "${.CURDIR}/../Makefile.nbincludes" +.include "${.CURDIR}/../Makefile.host" + diff --git a/tools/lex/Makefile b/tools/lex/Makefile new file mode 100644 index 000000000..e0e9f27ba --- /dev/null +++ b/tools/lex/Makefile @@ -0,0 +1,21 @@ +# $NetBSD: Makefile,v 1.9 2009/10/30 00:30:20 christos Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}lex +HOST_SRCDIR= external/bsd/flex/bin + +.include "${.CURDIR}/../Makefile.host" +HOST_CPPFLAGS+= -DM4=\"${TOOL_M4}\" + +.y.c .l.c .y.h: + @true + +scan.c: + echo '#include ' >$@ +parse.c: + echo '#include ' >$@ +parse.h: + echo '#include ' >$@ + +scan.c: parse.h + +CLEANFILES+=scan.c parse.c parse.h diff --git a/tools/m4/Makefile b/tools/m4/Makefile new file mode 100644 index 000000000..54837a867 --- /dev/null +++ b/tools/m4/Makefile @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.5 2009/11/06 15:14:37 joerg Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}m4 +HOST_SRCDIR= usr.bin/m4 +HOST_CPPFLAGS+= -I. + +.include "${.CURDIR}/../Makefile.host" + +# Don't build any of those; we don't have lex and yacc available yet +.y.c .y.h .l.c: + @true + +parser.c: ${.CURDIR}/bootstrap/parser.c + @ln -sf ${.ALLSRC:M*.c} $@ +parser.h: ${.CURDIR}/bootstrap/parser.h + @ln -sf ${.ALLSRC:M*.h} $@ +tokenizer.c: ${.CURDIR}/bootstrap/tokenizer.c + @ln -sf ${.ALLSRC:M*.c} $@ diff --git a/tools/m4/bootstrap/Makefile b/tools/m4/bootstrap/Makefile new file mode 100644 index 000000000..2775d8893 --- /dev/null +++ b/tools/m4/bootstrap/Makefile @@ -0,0 +1,24 @@ +# $NetBSD: Makefile,v 1.2 2009/11/03 22:52:59 christos Exp $ + +FILES=parser.h parser.c tokenizer.c + +all: ${FILES} + +.include + +DIST=${NETBSDSRCDIR}/usr.bin/m4 + +parser.c parser.h: ${DIST}/parser.y + ${YACC} -d ${DIST}/parser.y + sed -e 's/\$$''NetBSD:\([^$$]*\)\ \$$/NetBSD:\1/' < y.tab.c > parser.c + rm -f y.tab.c + mv y.tab.h parser.h + +tokenizer.c: ${DIST}/tokenizer.l + ${LEX} ${DIST}/tokenizer.l + sed -e 's/\$$''NetBSD:\([^$$]*\)\ \$$/NetBSD:\1/' < lex.yy.c > ${.TARGET} + rm -f lex.yy.c + +clean:: + rm -f ${FILES} + diff --git a/tools/m4/bootstrap/parser.c b/tools/m4/bootstrap/parser.c new file mode 100644 index 000000000..e6890a76e --- /dev/null +++ b/tools/m4/bootstrap/parser.c @@ -0,0 +1,649 @@ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif +#include +#ifndef lint +#if 0 +static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#else +#if defined(__NetBSD__) && defined(__IDSTRING) +__IDSTRING(yyrcsid, "NetBSD: skeleton.c,v 1.29 2008/07/18 14:25:37 drochner Exp "); +#endif /* __NetBSD__ && __IDSTRING */ +#endif /* 0 */ +#endif /* lint */ +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYLEX yylex() +#define YYEMPTY -1 +#define yyclearin (yychar=(YYEMPTY)) +#define yyerrok (yyerrflag=0) +#define YYRECOVERING (yyerrflag!=0) +#define YYPREFIX "yy" +#line 2 "../../../usr.bin/m4/parser.y" +/* NetBSD: parser.y,v 1.2 2009/10/26 21:11:28 christos Exp */ +/* $OpenBSD: parser.y,v 1.6 2008/08/21 21:00:14 espie Exp $ */ +/* + * Copyright (c) 2004 Marc Espie + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif +__RCSID("NetBSD: parser.y,v 1.2 2009/10/26 21:11:28 christos Exp "); +#include +#define YYSTYPE int32_t +extern int32_t end_result; +extern int yylex(void); +extern int yyerror(const char *); +#line 48 "parser.c" +#define NUMBER 257 +#define ERROR 258 +#define LOR 259 +#define LAND 260 +#define EQ 261 +#define NE 262 +#define LE 263 +#define GE 264 +#define LSHIFT 265 +#define RSHIFT 266 +#define UMINUS 267 +#define UPLUS 268 +#define YYERRCODE 256 +const short yylhs[] = { -1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, +}; +const short yylen[] = { 2, + 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 1, +}; +const short yydefred[] = { 0, + 25, 0, 0, 0, 0, 0, 0, 0, 22, 21, + 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, +}; +const short yydgoto[] = { 7, + 8, +}; +const short yysindex[] = { -13, + 0, -13, -13, -13, -13, -13, 0, 190, 0, 0, + 0, 0, 114, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, 0, 321, 347, 159, 397, 354, -24, -24, -35, + -35, -35, -35, 136, 136, -31, -31, 0, 0, 0, +}; +const short yyrindex[] = { 0, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 65, 56, 51, 48, 74, 60, 66, 34, + 40, 76, 83, 17, 26, 1, 9, 0, 0, 0, +}; +const short yygindex[] = { 0, + 458, +}; +#define YYTABLESIZE 663 +const short yytable[] = { 0, + 2, 31, 1, 0, 0, 31, 29, 27, 3, 28, + 29, 30, 31, 0, 0, 30, 7, 29, 27, 4, + 28, 0, 30, 0, 0, 8, 6, 0, 0, 2, + 0, 3, 0, 9, 0, 21, 0, 23, 2, 11, + 0, 2, 0, 2, 0, 2, 3, 16, 0, 3, + 17, 3, 0, 3, 7, 18, 0, 7, 0, 13, + 2, 0, 2, 8, 19, 14, 8, 0, 3, 0, + 3, 9, 0, 15, 9, 10, 7, 11, 7, 0, + 11, 0, 12, 0, 0, 8, 0, 8, 16, 0, + 0, 17, 0, 9, 2, 9, 18, 13, 0, 11, + 13, 11, 3, 14, 0, 19, 14, 0, 0, 0, + 7, 15, 5, 10, 15, 0, 10, 0, 0, 8, + 12, 0, 0, 12, 2, 0, 0, 9, 0, 0, + 0, 0, 3, 11, 0, 10, 0, 10, 0, 0, + 7, 16, 12, 0, 12, 0, 0, 0, 0, 8, + 31, 18, 0, 13, 32, 29, 27, 9, 28, 14, + 30, 0, 0, 11, 0, 0, 0, 15, 0, 10, + 0, 16, 31, 21, 17, 23, 12, 29, 27, 0, + 28, 0, 30, 13, 0, 0, 0, 0, 0, 14, + 0, 0, 0, 0, 0, 31, 18, 15, 0, 10, + 29, 27, 0, 28, 0, 30, 12, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, + 23, 0, 0, 0, 0, 0, 31, 18, 0, 25, + 26, 29, 27, 0, 28, 0, 30, 16, 22, 24, + 25, 26, 0, 1, 0, 0, 0, 0, 0, 21, + 0, 23, 17, 0, 0, 0, 0, 0, 0, 2, + 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, + 7, 7, 7, 17, 8, 8, 8, 8, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 9, 11, 11, + 11, 11, 11, 11, 0, 0, 16, 16, 0, 17, + 17, 0, 0, 16, 18, 18, 0, 0, 13, 13, + 13, 13, 0, 19, 14, 14, 14, 14, 0, 0, + 0, 0, 15, 15, 10, 10, 10, 10, 10, 10, + 0, 12, 12, 12, 12, 12, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 31, 18, 0, + 0, 0, 29, 27, 0, 28, 0, 30, 0, 0, + 0, 0, 14, 15, 19, 20, 22, 24, 25, 26, + 21, 0, 23, 31, 18, 0, 0, 0, 29, 27, + 31, 28, 0, 30, 0, 29, 27, 0, 28, 0, + 30, 0, 0, 0, 0, 0, 21, 0, 23, 0, + 0, 0, 0, 21, 17, 23, 0, 0, 0, 19, + 20, 22, 24, 25, 26, 0, 0, 0, 0, 0, + 0, 0, 0, 31, 18, 0, 0, 0, 29, 27, + 17, 28, 0, 30, 16, 0, 0, 0, 14, 15, + 19, 20, 22, 24, 25, 26, 21, 0, 23, 9, + 10, 11, 12, 13, 0, 0, 0, 0, 0, 0, + 16, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 19, 20, 22, 24, 25, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 19, 20, 22, + 24, 25, 26, 0, 19, 20, 22, 24, 25, 26, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 19, 20, 22, + 24, 25, 26, +}; +const short yycheck[] = { -1, + 0, 37, 0, -1, -1, 37, 42, 43, 0, 45, + 42, 47, 37, -1, -1, 47, 0, 42, 43, 33, + 45, -1, 47, -1, -1, 0, 40, -1, -1, 43, + -1, 45, -1, 0, -1, 60, -1, 62, 38, 0, + -1, 41, -1, 43, -1, 45, 38, 0, -1, 41, + 0, 43, -1, 45, 38, 0, -1, 41, -1, 0, + 60, -1, 62, 38, 0, 0, 41, -1, 60, -1, + 62, 38, -1, 0, 41, 0, 60, 38, 62, -1, + 41, -1, 0, -1, -1, 60, -1, 62, 41, -1, + -1, 41, -1, 60, 94, 62, 41, 38, -1, 60, + 41, 62, 94, 38, -1, 41, 41, -1, -1, -1, + 94, 38, 126, 38, 41, -1, 41, -1, -1, 94, + 38, -1, -1, 41, 124, -1, -1, 94, -1, -1, + -1, -1, 124, 94, -1, 60, -1, 62, -1, -1, + 124, 94, 60, -1, 62, -1, -1, -1, -1, 124, + 37, 38, -1, 94, 41, 42, 43, 124, 45, 94, + 47, -1, -1, 124, -1, -1, -1, 94, -1, 94, + -1, 124, 37, 60, 124, 62, 94, 42, 43, -1, + 45, -1, 47, 124, -1, -1, -1, -1, -1, 124, + -1, -1, -1, -1, -1, 37, 38, 124, -1, 124, + 42, 43, -1, 45, -1, 47, 124, 94, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, + 62, -1, -1, -1, -1, -1, 37, 38, -1, 265, + 266, 42, 43, -1, 45, -1, 47, 124, 263, 264, + 265, 266, -1, 257, -1, -1, -1, -1, -1, 60, + -1, 62, 94, -1, -1, -1, -1, -1, -1, 259, + 260, 261, 262, 263, 264, 265, 266, 259, 260, 261, + 262, 263, 264, 265, 266, 259, 260, 261, 262, 263, + 264, 265, 266, 94, 259, 260, 261, 262, 263, 264, + 265, 266, 259, 260, 261, 262, 263, 264, 259, 260, + 261, 262, 263, 264, -1, -1, 259, 260, -1, 259, + 260, -1, -1, 124, 259, 260, -1, -1, 259, 260, + 261, 262, -1, 259, 259, 260, 261, 262, -1, -1, + -1, -1, 259, 260, 259, 260, 261, 262, 263, 264, + -1, 259, 260, 261, 262, 263, 264, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, + -1, -1, 42, 43, -1, 45, -1, 47, -1, -1, + -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, + 60, -1, 62, 37, 38, -1, -1, -1, 42, 43, + 37, 45, -1, 47, -1, 42, 43, -1, 45, -1, + 47, -1, -1, -1, -1, -1, 60, -1, 62, -1, + -1, -1, -1, 60, 94, 62, -1, -1, -1, 261, + 262, 263, 264, 265, 266, -1, -1, -1, -1, -1, + -1, -1, -1, 37, 38, -1, -1, -1, 42, 43, + 94, 45, -1, 47, 124, -1, -1, -1, 259, 260, + 261, 262, 263, 264, 265, 266, 60, -1, 62, 2, + 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, + 124, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 260, 261, 262, 263, 264, 265, 266, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 261, 262, 263, + 264, 265, 266, -1, 261, 262, 263, 264, 265, 266, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 261, 262, 263, + 264, 265, 266, +}; +#define YYFINAL 7 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 268 +#if YYDEBUG +const char * const yyname[] = { +"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +"'!'",0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, +0,0,0,0,0,"'<'",0,"'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,"'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0, +"'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,"NUMBER","ERROR","LOR","LAND","EQ","NE","LE","GE", +"LSHIFT","RSHIFT","UMINUS","UPLUS", +}; +const char * const yyrule[] = { +"$accept : top", +"top : expr", +"expr : expr '+' expr", +"expr : expr '-' expr", +"expr : expr '*' expr", +"expr : expr '/' expr", +"expr : expr '%' expr", +"expr : expr LSHIFT expr", +"expr : expr RSHIFT expr", +"expr : expr '<' expr", +"expr : expr '>' expr", +"expr : expr LE expr", +"expr : expr GE expr", +"expr : expr EQ expr", +"expr : expr NE expr", +"expr : expr '&' expr", +"expr : expr '^' expr", +"expr : expr '|' expr", +"expr : expr LAND expr", +"expr : expr LOR expr", +"expr : '(' expr ')'", +"expr : '-' expr", +"expr : '+' expr", +"expr : '!' expr", +"expr : '~' expr", +"expr : NUMBER", +}; +#endif +#ifndef YYSTYPE +typedef int YYSTYPE; +#endif +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 +#endif +#endif +#define YYINITSTACKSIZE 200 +int yydebug; +int yynerrs; +int yyerrflag; +int yychar; +short *yyssp; +YYSTYPE *yyvsp; +YYSTYPE yyval; +static YYSTYPE yyvalzero; +YYSTYPE yylval; +short *yyss; +short *yysslim; +YYSTYPE *yyvs; +int yystacksize; +int yyparse(void); +#line 85 "../../../usr.bin/m4/parser.y" + +#line 315 "parser.c" +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(void); +static int yygrowstack(void) +{ + int newsize, i; + short *newss; + YYSTYPE *newvs; + + if ((newsize = yystacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return -1; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + i = yyssp - yyss; + if ((newss = (short *)realloc(yyss, newsize * sizeof *newss)) == NULL) + return -1; + yyss = newss; + yyssp = newss + i; + if ((newvs = (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs)) == NULL) + return -1; + yyvs = newvs; + yyvsp = newvs + i; + yystacksize = newsize; + yysslim = yyss + newsize - 1; + return 0; +} + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +int +yyparse(void) +{ + int yym, yyn, yystate; +#if YYDEBUG + const char *yys; + + if ((yys = getenv("YYDEBUG")) != NULL) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif + + yynerrs = 0; + yyerrflag = 0; + yychar = (-1); + + if (yyss == NULL && yygrowstack()) goto yyoverflow; + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + } + if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, shifting to state %d\n", + YYPREFIX, yystate, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = (-1); + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag) goto yyinrecovery; + goto yynewerror; +yynewerror: + yyerror("syntax error"); + goto yyerrlab; +yyerrlab: + ++yynerrs; +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, error recovery shifting\ + to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: error recovery discarding state %d\n", + YYPREFIX, *yyssp); +#endif + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, error recovery discards token %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + yychar = (-1); + goto yyloop; + } +yyreduce: +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, reducing by rule %d (%s)\n", + YYPREFIX, yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + if (yym) + yyval = yyvsp[1-yym]; + else + yyval = yyvalzero; + switch (yyn) + { +case 1: +#line 45 "../../../usr.bin/m4/parser.y" +{ end_result = yyvsp[0]; } +break; +case 2: +#line 47 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] + yyvsp[0]; } +break; +case 3: +#line 48 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] - yyvsp[0]; } +break; +case 4: +#line 49 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] * yyvsp[0]; } +break; +case 5: +#line 50 "../../../usr.bin/m4/parser.y" +{ + if (yyvsp[0] == 0) { + yyerror("division by zero"); + exit(1); + } + yyval = yyvsp[-2] / yyvsp[0]; + } +break; +case 6: +#line 57 "../../../usr.bin/m4/parser.y" +{ + if (yyvsp[0] == 0) { + yyerror("modulo zero"); + exit(1); + } + yyval = yyvsp[-2] % yyvsp[0]; + } +break; +case 7: +#line 64 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] << yyvsp[0]; } +break; +case 8: +#line 65 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] >> yyvsp[0]; } +break; +case 9: +#line 66 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] < yyvsp[0]; } +break; +case 10: +#line 67 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] > yyvsp[0]; } +break; +case 11: +#line 68 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] <= yyvsp[0]; } +break; +case 12: +#line 69 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] >= yyvsp[0]; } +break; +case 13: +#line 70 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] == yyvsp[0]; } +break; +case 14: +#line 71 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] != yyvsp[0]; } +break; +case 15: +#line 72 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] & yyvsp[0]; } +break; +case 16: +#line 73 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] ^ yyvsp[0]; } +break; +case 17: +#line 74 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] | yyvsp[0]; } +break; +case 18: +#line 75 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] && yyvsp[0]; } +break; +case 19: +#line 76 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-2] || yyvsp[0]; } +break; +case 20: +#line 77 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[-1]; } +break; +case 21: +#line 78 "../../../usr.bin/m4/parser.y" +{ yyval = -yyvsp[0]; } +break; +case 22: +#line 79 "../../../usr.bin/m4/parser.y" +{ yyval = yyvsp[0]; } +break; +case 23: +#line 80 "../../../usr.bin/m4/parser.y" +{ yyval = !yyvsp[0]; } +break; +case 24: +#line 81 "../../../usr.bin/m4/parser.y" +{ yyval = ~yyvsp[0]; } +break; +#line 591 "parser.c" + } + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state 0 to\ + state %d\n", YYPREFIX, YYFINAL); +#endif + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, YYFINAL, yychar, yys); + } +#endif + } + if (yychar == 0) goto yyaccept; + goto yyloop; + } + if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state %d \ +to state %d\n", YYPREFIX, *yyssp, yystate); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; +yyoverflow: + yyerror("yacc stack overflow"); +yyabort: + return (1); +yyaccept: + return (0); +} diff --git a/tools/m4/bootstrap/parser.h b/tools/m4/bootstrap/parser.h new file mode 100644 index 000000000..fc848d6ca --- /dev/null +++ b/tools/m4/bootstrap/parser.h @@ -0,0 +1,12 @@ +#define NUMBER 257 +#define ERROR 258 +#define LOR 259 +#define LAND 260 +#define EQ 261 +#define NE 262 +#define LE 263 +#define GE 264 +#define LSHIFT 265 +#define RSHIFT 266 +#define UMINUS 267 +#define UPLUS 268 diff --git a/tools/m4/bootstrap/tokenizer.c b/tools/m4/bootstrap/tokenizer.c new file mode 100644 index 000000000..80d0bc176 --- /dev/null +++ b/tools/m4/bootstrap/tokenizer.c @@ -0,0 +1,1899 @@ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif +#line 2 "tokenizer.c" + +#line 4 "tokenizer.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* NetBSD: flexint.h,v 1.1.1.1 2009/10/26 00:26:19 christos Exp */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart(yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); + +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +typedef unsigned char YY_CHAR; + +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + +typedef int yy_state_type; + +extern int yylineno; + +int yylineno = 1; + +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 13 +#define YY_END_OF_BUFFER 14 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[33] = + { 0, + 0, 0, 14, 12, 1, 1, 12, 12, 2, 2, + 12, 12, 12, 12, 1, 9, 10, 2, 0, 0, + 2, 6, 4, 8, 5, 7, 11, 0, 2, 0, + 3, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 1, 1, 1, 1, 5, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 6, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 9, 1, 10, + 11, 12, 1, 1, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 15, 14, 14, 14, 14, 14, 16, 14, 14, + 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, + + 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 15, 14, 14, 14, 14, 14, 16, + 14, 14, 1, 17, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[18] = + { 0, + 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, + 1, 1, 3, 4, 4, 4, 1 + } ; + +static yyconst flex_int16_t yy_base[37] = + { 0, + 0, 0, 46, 47, 16, 18, 34, 39, 16, 0, + 14, 32, 15, 25, 26, 47, 47, 27, 0, 0, + 0, 47, 47, 47, 47, 47, 47, 32, 0, 0, + 0, 47, 38, 28, 33, 35 + } ; + +static yyconst flex_int16_t yy_def[37] = + { 0, + 32, 1, 32, 32, 32, 32, 32, 32, 32, 33, + 32, 32, 32, 32, 32, 32, 32, 32, 34, 35, + 33, 32, 32, 32, 32, 32, 32, 34, 35, 36, + 36, 0, 32, 32, 32, 32 + } ; + +static yyconst flex_int16_t yy_nxt[65] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 10, 4, 11, + 12, 13, 4, 4, 4, 4, 14, 15, 15, 15, + 15, 18, 18, 22, 23, 25, 26, 15, 15, 28, + 19, 20, 18, 18, 29, 29, 31, 31, 31, 21, + 30, 27, 24, 17, 16, 32, 3, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32 + } ; + +static yyconst flex_int16_t yy_chk[65] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 5, 5, 6, + 6, 9, 9, 11, 11, 13, 13, 15, 15, 34, + 9, 9, 18, 18, 35, 35, 36, 36, 36, 33, + 28, 14, 12, 8, 7, 3, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "../../../usr.bin/m4/tokenizer.l" +#line 2 "../../../usr.bin/m4/tokenizer.l" +/* NetBSD: tokenizer.l,v 1.2 2009/10/26 21:11:28 christos Exp */ +/* $OpenBSD: tokenizer.l,v 1.6 2008/08/21 21:00:14 espie Exp $ */ +/* + * Copyright (c) 2004 Marc Espie + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif +#include "parser.h" +__RCSID("NetBSD: tokenizer.l,v 1.2 2009/10/26 21:11:28 christos Exp "); +#include +#include +#include +#include + +extern int mimic_gnu; +extern int32_t yylval; +extern int yylex(void); +extern int yywrap(void); + +int32_t number(void); +int32_t parse_radix(void); +#line 509 "tokenizer.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +int yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap (void ); +#else +extern int yywrap (void ); +#endif +#endif + +#ifndef YY_NO_UNPUT + + static void yyunput (int c,char *buf_ptr ); + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 45 "../../../usr.bin/m4/tokenizer.l" + +#line 697 "tokenizer.c" + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 33 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 47 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP +#line 46 "../../../usr.bin/m4/tokenizer.l" +{/* just skip it */} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 47 "../../../usr.bin/m4/tokenizer.l" +{ yylval = number(); return(NUMBER); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 48 "../../../usr.bin/m4/tokenizer.l" +{ if (mimic_gnu) { + yylval = parse_radix(); return(NUMBER); + } else { + return(ERROR); + } + } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 54 "../../../usr.bin/m4/tokenizer.l" +{ return(LE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 55 "../../../usr.bin/m4/tokenizer.l" +{ return(GE); } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 56 "../../../usr.bin/m4/tokenizer.l" +{ return(LSHIFT); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 57 "../../../usr.bin/m4/tokenizer.l" +{ return(RSHIFT); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 58 "../../../usr.bin/m4/tokenizer.l" +{ return(EQ); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 59 "../../../usr.bin/m4/tokenizer.l" +{ return(NE); } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 60 "../../../usr.bin/m4/tokenizer.l" +{ return(LAND); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 61 "../../../usr.bin/m4/tokenizer.l" +{ return(LOR); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 62 "../../../usr.bin/m4/tokenizer.l" +{ return yytext[0]; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 63 "../../../usr.bin/m4/tokenizer.l" +ECHO; + YY_BREAK +#line 851 "tokenizer.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 33 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 33 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 32); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); + + yyfree((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + yy_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param line_number + * + */ +void yyset_lineno (int line_number ) +{ + + yylineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} + +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 63 "../../../usr.bin/m4/tokenizer.l" + + + +int32_t +number() +{ + long l; + + errno = 0; + l = strtol(yytext, NULL, 0); + if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || + l > INT32_MAX || l < INT32_MIN) { + fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext); + } + return l; +} + +int32_t +parse_radix() +{ + long base; + char *next; + long l; + + l = 0; + base = strtol(yytext+2, &next, 0); + if (base > 36 || next == NULL) { + fprintf(stderr, "m4: error in number %s\n", yytext); + } else { + next++; + while (*next != 0) { + if (*next >= '0' && *next <= '9') + l = base * l + *next - '0'; + else if (*next >= 'a' && *next <= 'z') + l = base * l + *next - 'a' + 10; + else if (*next >= 'A' && *next <= 'Z') + l = base * l + *next - 'A' + 10; + next++; + } + } + return l; +} + + diff --git a/tools/make/Makefile.regen b/tools/make/Makefile.regen new file mode 100644 index 000000000..f55958d34 --- /dev/null +++ b/tools/make/Makefile.regen @@ -0,0 +1,8 @@ +# $NetBSD: Makefile.regen,v 1.1 2007/10/14 20:25:35 apb Exp $ + +.include "bsd.own.mk" + +# Run "${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen" by hand after +# editing configure.ac. See more detailed instructions in configure.ac. +regen: + cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf diff --git a/tools/make/buildmake.sh.in b/tools/make/buildmake.sh.in new file mode 100755 index 000000000..59e3bfbbf --- /dev/null +++ b/tools/make/buildmake.sh.in @@ -0,0 +1,23 @@ +#! /bin/sh +# $NetBSD: buildmake.sh.in,v 1.8 2006/08/26 22:17:48 christos Exp $ +# +# buildmake.sh.in - Autoconf-processed shell script for building make(1). +# + +: ${HOST_CC="@CC@"} +: ${HOST_CFLAGS="@CPPFLAGS@ @CFLAGS@"} +: ${HOST_LDFLAGS="@LDFLAGS@ @LIBS@"} +: ${runcmd=""} + +docmd () { + echo "$1" + $1 || exit 1 +} + +MKSRCDIR=@srcdir@/../../usr.bin/make + +for f in $MKSRCDIR/*.c $MKSRCDIR/lst.lib/*.c; do + docmd "${HOST_CC} ${HOST_CFLAGS} @DEFS@ -c $f" +done + +docmd "${HOST_CC} ${HOST_CFLAGS} -o ${_TOOL_PREFIX:-nb}make *.o ${HOST_LDFLAGS}" diff --git a/tools/make/configure b/tools/make/configure new file mode 100755 index 000000000..92810e3fc --- /dev/null +++ b/tools/make/configure @@ -0,0 +1,2802 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52 for make noversion. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME='make' +PACKAGE_TARNAME='make' +PACKAGE_VERSION='noversion' +PACKAGE_STRING='make noversion' +PACKAGE_BUGREPORT='bin-bug-people@NetBSD.org' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF +make configure noversion +generated by GNU Autoconf 2.52 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:824: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:835: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:843: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:859: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:863: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:869: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:871: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:873: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:892: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:894: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:914: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:917: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +ac_config_files="$ac_config_files buildmake.sh" + +# Extract the first word of "sh", so it can be a program name with args. +set dummy sh; ac_word=$2 +echo "$as_me:930: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_BSHELL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $BSHELL in + [\\/]* | ?:[\\/]*) + ac_cv_path_BSHELL="$BSHELL" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_BSHELL="$ac_dir/$ac_word" + echo "$as_me:947: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +BSHELL=$ac_cv_path_BSHELL + +if test -n "$BSHELL"; then + echo "$as_me:958: result: $BSHELL" >&5 +echo "${ECHO_T}$BSHELL" >&6 +else + echo "$as_me:961: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test x"$BSHELL" = x; then + { { echo "$as_me:966: error: sh must be somewhere on \$PATH, or BSHELL must be defined" >&5 +echo "$as_me: error: sh must be somewhere on \$PATH, or BSHELL must be defined" >&2;} + { (exit 1); exit 1; }; } +fi +cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:998: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1006: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1009: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:1018: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1033: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1041: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1044: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:1057: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1072: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1080: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1083: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1092: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1107: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1115: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1118: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1131: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1151: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1173: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1176: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:1187: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:1202: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1210: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1213: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1226: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:1241: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1249: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1252: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1264: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:1269:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1272: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1275: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1277: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1280: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1282: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1285: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1289 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:1305: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:1308: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1311: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1334: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:1340: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1345: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:1351: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1354: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1361: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1369: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1376: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1378: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1381: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1383: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1386: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1402: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:1408: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:1414: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1420 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1432: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1435: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1447: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:1454: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1458: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1464 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1479: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1482: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1485: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1488: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1500: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:1506: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1512 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1524: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1527: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1530: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1533: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1543: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1570: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1573: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1576: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1579: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1591 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1604: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1607: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1610: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1613: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1623 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1635: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1638: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1641: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1644: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:1676: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1697 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1702: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1708: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1731 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1735: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1741: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:1778: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1788 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1793: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1799: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1822 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1826: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1832: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:1860: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +echo "$as_me:1871: checking for regex.h" >&5 +echo $ECHO_N "checking for regex.h... $ECHO_C" >&6 +if test "${ac_cv_header_regex_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1877 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1881: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1887: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_regex_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_regex_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:1906: result: $ac_cv_header_regex_h" >&5 +echo "${ECHO_T}$ac_cv_header_regex_h" >&6 +if test $ac_cv_header_regex_h = yes; then + : +else + { { echo "$as_me:1911: error: POSIX regex.h is required" >&5 +echo "$as_me: error: POSIX regex.h is required" >&2;} + { (exit 1); exit 1; }; } +fi + +# If we don't have , we need to use select(2). +echo "$as_me:1917: checking for poll.h" >&5 +echo $ECHO_N "checking for poll.h... $ECHO_C" >&6 +if test "${ac_cv_header_poll_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1923 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1927: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1933: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_poll_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_poll_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:1952: result: $ac_cv_header_poll_h" >&5 +echo "${ECHO_T}$ac_cv_header_poll_h" >&6 +if test $ac_cv_header_poll_h = yes; then + : +else + cat >>confdefs.h <<\EOF +#define USE_SELECT 1 +EOF + +fi + +# regcomp() and regexec() are also names of functions in the old V8 +# regexp package. To avoid them, we need to find out who has regfree(). + +echo "$as_me:1966: checking for regfree in -lregex" >&5 +echo $ECHO_N "checking for regfree in -lregex... $ECHO_C" >&6 +if test "${ac_cv_lib_regex_regfree+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lregex $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 1974 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regfree (); +int +main () +{ +regfree (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:1993: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1996: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:1999: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2002: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_regex_regfree=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_regex_regfree=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2013: result: $ac_cv_lib_regex_regfree" >&5 +echo "${ECHO_T}$ac_cv_lib_regex_regfree" >&6 +if test $ac_cv_lib_regex_regfree = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for library containing regfree... $ECHO_C" >&6 +if test "${ac_cv_search_regfree+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_regfree=no +cat >conftest.$ac_ext <<_ACEOF +#line 2032 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regfree (); +int +main () +{ +regfree (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2051: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2054: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2057: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2060: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_regfree="none required" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_regfree" = no; then + for ac_lib in rx posix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 2072 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regfree (); +int +main () +{ +regfree (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2091: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2094: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2097: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2100: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_regfree="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:2113: result: $ac_cv_search_regfree" >&5 +echo "${ECHO_T}$ac_cv_search_regfree" >&6 +if test "$ac_cv_search_regfree" != no; then + test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS" + +fi + +for ac_func in setenv strdup strerror strftime vsnprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:2123: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2129 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* 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 +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2160: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2163: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2166: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2169: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:2179: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\EOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +EOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:2298: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:2465: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:2484: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me (make noversion) 2.52, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "buildmake.sh" ) CONFIG_FILES="$CONFIG_FILES buildmake.sh" ;; + *) { { echo "$as_me:2520: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@BSHELL@,$BSHELL,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:2718: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:2736: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:2749: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/tools/make/configure.ac b/tools/make/configure.ac new file mode 100644 index 000000000..368e8a704 --- /dev/null +++ b/tools/make/configure.ac @@ -0,0 +1,50 @@ +# $NetBSD: configure.ac,v 1.9 2007/10/14 20:26:47 apb Exp $ +# +# Autoconf definition file for make. +# +# When you edit configure.ac: +# 0. Create the tools version of autoconf: +# cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools +# (This might not work if you try it after editing configure.ac.) +# 1. edit configure.ac +# 2. Regenerate "configure" from "configure.ac": +# cd ${SRCDIR}/tools/make && \ +# ${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen +# (Please don't use a non-tools version of autoconf). +# 3. Test that nbmake still builds +# mv ${TOOLDIR}/nbmake ${TOOLDIR}/bin/nbmake.bak +# cd ${SRCDIR} && build.sh makewrapper +# 4. cvs commit files that you edited. +# 5. Regen again, to pick up changed RCS IDs from the above commit: +# cd ${SRCDIR}/tools/make && \ +# ${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen +# 6. cvs commit files that were generated. +# +# + +AC_INIT([make], [noversion], [bin-bug-people@NetBSD.org]) +AC_CONFIG_FILES(buildmake.sh) + +AC_PATH_PROG(BSHELL, sh) +if test x"$BSHELL" = x; then + AC_MSG_ERROR([sh must be somewhere on \$PATH, or BSHELL must be defined]) +fi +AC_DEFINE_UNQUOTED(DEFSHELL_CUSTOM, "${BSHELL}") + +# Make sure we have POSIX regex ability. +AC_CHECK_HEADER(regex.h,, AC_MSG_ERROR([POSIX regex.h is required])) + +# If we don't have , we need to use select(2). +AC_CHECK_HEADER(poll.h,, AC_DEFINE(USE_SELECT)) + +# regcomp() and regexec() are also names of functions in the old V8 +# regexp package. To avoid them, we need to find out who has regfree(). + +dnl # Cygwin: We *MUST* look at -lregex *before* the "no libs" condition. +dnl # Thus AC_CHECK_LIB(regex...) comes first, and AC_SEARCHLIBS next. +AC_CHECK_LIB(regex, regfree) +AC_SEARCH_LIBS(regfree, rx posix) + +AC_CHECK_FUNCS(setenv strdup strerror strftime vsnprintf) + +AC_OUTPUT diff --git a/tools/makewhatis/Makefile b/tools/makewhatis/Makefile new file mode 100644 index 000000000..0cef6bcf5 --- /dev/null +++ b/tools/makewhatis/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.3 2003/06/14 17:57:26 wiz Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}makewhatis +HOST_SRCDIR= libexec/makewhatis + +CPPFLAGS+= -DNROFF="\"nbnroff\"" + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/mkdep/Makefile b/tools/mkdep/Makefile new file mode 100644 index 000000000..3885ec5f1 --- /dev/null +++ b/tools/mkdep/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.8 2002/12/08 20:20:03 thorpej Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}mkdep +HOST_SRCDIR= usr.bin/mkdep + +SRCS= mkdep.c + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/mknod/Makefile b/tools/mknod/Makefile new file mode 100644 index 000000000..1179585e7 --- /dev/null +++ b/tools/mknod/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2003/10/27 00:35:37 lukem Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}mknod +HOST_SRCDIR= sbin/mknod + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/mktemp/Makefile b/tools/mktemp/Makefile new file mode 100644 index 000000000..8ea418469 --- /dev/null +++ b/tools/mktemp/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.4 2002/12/08 20:20:03 thorpej Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}mktemp +HOST_SRCDIR= usr.bin/mktemp + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/pwd_mkdb/Makefile b/tools/pwd_mkdb/Makefile new file mode 100644 index 000000000..239f381ae --- /dev/null +++ b/tools/pwd_mkdb/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.2 2002/12/08 20:20:04 thorpej Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}pwd_mkdb +HOST_SRCDIR= usr.sbin/pwd_mkdb + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/sed/Makefile b/tools/sed/Makefile new file mode 100644 index 000000000..c523f33e6 --- /dev/null +++ b/tools/sed/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2006/06/18 05:16:41 gdamore Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}sed +HOST_SRCDIR= usr.bin/sed + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/stat/Makefile b/tools/stat/Makefile new file mode 100644 index 000000000..c702ffbdd --- /dev/null +++ b/tools/stat/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2003/07/20 14:06:33 lukem Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}stat +HOST_SRCDIR= usr.bin/stat + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/tic/Makefile b/tools/tic/Makefile new file mode 100644 index 000000000..a26168d83 --- /dev/null +++ b/tools/tic/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.5 2011/11/02 17:49:20 christos Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}tic +HOST_SRCDIR= usr.bin/tic +HOST_SRCS= compile.c hash.c + +TERMINFODIR= ${NETBSDSRCDIR}/lib/libterminfo + +.include "${.CURDIR}/../Makefile.host" + +.PATH: ${TERMINFODIR} diff --git a/tools/yacc/Makefile b/tools/yacc/Makefile new file mode 100644 index 000000000..c53b279fc --- /dev/null +++ b/tools/yacc/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.5 2009/10/29 01:01:27 christos Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}yacc +HOST_SRCDIR= external/bsd/byacc/bin + +.include "${.CURDIR}/../Makefile.host" diff --git a/tools/zic/Makefile b/tools/zic/Makefile new file mode 100644 index 000000000..5927879a0 --- /dev/null +++ b/tools/zic/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.6 2011/03/03 14:53:01 nakayama Exp $ + +HOSTPROGNAME= ${_TOOL_PREFIX}zic +HOST_SRCDIR= usr.sbin/zic + +.if !empty(HOST_OSTYPE:MSunOS-5.1[01]-*) +HOST_CPPFLAGS= -D_POSIX_PTHREAD_SEMANTICS +.endif + +.include "${.CURDIR}/../Makefile.host" -- 2.44.0