cproto-4.7m/ 0000755 0001751 0000144 00000000000 12546350510 011567 5 ustar tom users cproto-4.7m/config_h.in 0000644 0001751 0000144 00000000136 05701601743 013675 0 ustar tom users /* @configure_input@ */
/* $Id: config_h.in,v 4.2 1995/01/01 19:34:59 cthuang Exp $ */
@DEFS@
cproto-4.7m/config.guess 0000755 0001751 0000144 00000124637 12521135173 014123 0 ustar tom users #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2015 Free Software Foundation, Inc.
timestamp='2015-03-04'
# This file 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 3 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, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches to .
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_SYSTEM}" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval $set_cc_for_build
cat <<-EOF > $dummy.c
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || \
echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
machine=${arch}${endian}-unknown
;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# Determine ABI tags.
case "${UNAME_MACHINE_ARCH}" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}${abi}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
e2k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-${LIBC}
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-${LIBC}
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval $set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
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`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
cproto-4.7m/dump.h 0000644 0001751 0000144 00000000532 11510147077 012707 0 ustar tom users /* $Id: dump.h,v 4.6 2011/01/02 19:13:03 tom Exp $ */
#ifndef DUMP_H
#define DUMP_H
#include
extern void dump_parameter(Parameter *p, int level);
extern void dump_param_list(ParameterList *p, int level);
extern void dump_declarator(Declarator *d, int level);
extern void dump_decl_spec(DeclSpec *d, int level);
#endif /* DUMP_H */
cproto-4.7m/README 0000644 0001751 0000144 00000001314 07643576142 012463 0 ustar tom users Cproto is a program that generates function prototypes and variable
declarations from C source code. It can also convert function definitions
between the old style and the ANSI C style. This conversion overwrites the
original files, so make a backup copy of your files in case something goes
wrong.
The program isn't confused by complex function definitions as much as other
prototype generators because it uses a yacc generated parser. By ignoring all
the input between braces, I avoided implementing the entire C language grammar.
Cproto is in the public domain, except for the configure script which is
copyrighted by the Free Software Foundation, Inc.
Chin Huang
Thomas Dickey
dickey@invisible-island.net
cproto-4.7m/os2/ 0000755 0001751 0000144 00000000000 06461721323 012275 5 ustar tom users cproto-4.7m/os2/watcom.mak 0000644 0001751 0000144 00000001424 06461721323 014262 0 ustar tom users # $Id: watcom.mak,v 4.3 1998/01/22 19:49:39 cthuang Exp $
#
# Watcom makefile for C prototype generator
# To use this file, do
#
# wmake /u /f watcom.mak
PROGRAM = cproto
DEFINES =
INCLUDES = -I.. -I..\porting
LEX = lex
YACC = yacc
CC = wcl386
CFLAGS = $(DEFINES) $(INCLUDES)
LIBS =
.c: ..
.c.obj: .AUTODEPEND
$(CC) $(CFLAGS) /c $<
O = .obj
OBJECTS = \
cproto$(O) \
getopt$(O) \
lintlibs$(O) \
semantic$(O) \
strkey$(O) \
symbol$(O) \
y_tab$(O)
all: $(PROGRAM).exe
$(PROGRAM).exe: $(OBJECTS)
$(CC) $(CFLAGS) /fe=$@ $(OBJECTS) $(LIBS)
getopt$(O): ..\porting\getopt.c
$(CC) $(CFLAGS) /c ..\porting\getopt.c
cproto.man: cproto.1
cawf -man $*.1 | bsfilt - >$*.man
clean:
-del $(PROGRAM).exe
-del *$(O)
-del *.err
-del *.log
-del *.out
-del case*.c
test:
run_test
cproto-4.7m/os2/README 0000644 0001751 0000144 00000000234 06461035676 013165 0 ustar tom users The files in this directory are used to build and test on OS/2.
watcom.mak makefile for Watcom C/C++
run_test.cmd REXX script to run the regression tests
cproto-4.7m/os2/run_test.cmd 0000644 0001751 0000144 00000001365 06461721322 014631 0 ustar tom users /* REXX script to run cproto tests. */
/* $Id: run_test.cmd,v 4.2 1998/01/22 19:49:38 cthuang Exp $ */
"@echo off"
testDir = "..\testing"
casesFile = testDir||"\run_test.txt"
sourceFile = testDir||"\syntax.c"
logFile = "run_test.out"
echo "Test log" ">" logFile
linein(casesFile,1,0);
do while lines(casesFile) > 0
parse value linein(casesFile) with caseID '=' platforms '=' options
if left(caseID, 4) = "CASE" & pos("os2", platforms) > 0 then do
say caseID
baseName = "case"||substr(caseID, 6, 2)
inputFile = baseName||".c"
outputFile = baseName||".out"
refFile = testDir||"\"||baseName||".ref"
copy sourceFile inputFile ">nul"
cproto options inputFile ">" outputFile
echo n "|" comp outputFile refFile ">>" logFile
end
end
cproto-4.7m/grammar.y 0000644 0001751 0000144 00000051170 11510151212 013377 0 ustar tom users /* $Id: grammar.y,v 4.21 2011/01/02 19:31:22 tom Exp $
*
* yacc grammar for C function prototype generator
* This was derived from the grammar in Appendix A of
* "The C Programming Language" by Kernighan and Ritchie.
*/
%token '(' '*' '&'
/* identifiers that are not reserved words */
T_IDENTIFIER T_TYPEDEF_NAME T_DEFINE_NAME
/* storage class */
T_AUTO T_EXTERN T_REGISTER T_STATIC T_TYPEDEF
/* This keyword included for compatibility with C++. */
T_INLINE
/* This keyword included for compatibility with GCC */
T_EXTENSION
/* type specifiers */
T_CHAR T_DOUBLE T_FLOAT T_INT T_VOID
T_LONG T_SHORT T_SIGNED T_UNSIGNED
T_ENUM T_STRUCT T_UNION
/* C9X new types */
T_Bool T_Complex T_Imaginary
/* type qualifiers */
T_TYPE_QUALIFIER
/* paired square brackets and everything between them: [ ... ] */
T_BRACKETS
%token
/* left brace */
T_LBRACE
/* all input to the matching right brace */
T_MATCHRBRACE
/* three periods */
T_ELLIPSIS
/* constant expression or paired braces following an equal sign */
T_INITIALIZER
/* string literal */
T_STRING_LITERAL
/* asm */
T_ASM
/* ( "string literal" ) following asm keyword */
T_ASMARG
/* va_dcl from */
T_VA_DCL
%type decl_specifiers decl_specifier
%type storage_class type_specifier type_qualifier
%type struct_or_union_specifier enum_specifier
%type init_declarator_list
%type init_declarator declarator direct_declarator
%type abs_declarator direct_abs_declarator
%type parameter_type_list parameter_list
%type parameter_declaration
%type opt_identifier_list identifier_list
%type struct_or_union pointer opt_type_qualifiers type_qualifier_list
any_id identifier_or_ref
%type enumeration
%{
#include
#include
#define YYMAXDEPTH 150
extern int yylex(void);
/* declaration specifier attributes for the typedef statement currently being
* scanned
*/
static int cur_decl_spec_flags;
/* pointer to parameter list for the current function definition */
static ParameterList *func_params;
/* A parser semantic action sets this pointer to the current declarator in
* a function parameter declaration in order to catch any comments following
* the parameter declaration on the same line. If the lexer scans a comment
* and is not NULL, then the comment is attached to the
* declarator. To ignore subsequent comments, the lexer sets this to NULL
* after scanning a comment or end of line.
*/
static Declarator *cur_declarator;
/* temporary string buffer */
static char *temp_buf = 0;
static size_t temp_len = 0;
/* table of typedef names */
static SymbolTable *typedef_names;
/* table of define names */
static SymbolTable *define_names;
/* table of type qualifiers */
static SymbolTable *type_qualifiers;
/* information about the current input file */
typedef struct {
char *base_name; /* base input file name */
char *file_name; /* current file name */
size_t len_file_name; /* ...its allocated size */
FILE *file; /* input file */
unsigned line_num; /* current line number in input file */
FILE *tmp_file; /* temporary file */
long begin_comment; /* tmp file offset after last written ) or ; */
long end_comment; /* tmp file offset after last comment */
boolean convert; /* if TRUE, convert function definitions */
boolean changed; /* TRUE if conversion done in this file */
} IncludeStack;
static IncludeStack *cur_file; /* current input file */
#include "yyerror.c"
static int haveAnsiParam(void);
/* Flags to enable us to find if a procedure returns a value.
*/
static int return_val, /* nonzero on BRACES iff return-expression found */
returned_at; /* marker for token-number to set 'return_val' */
#if OPT_LINTLIBRARY
static const char *
dft_decl_spec(void)
{
return (lintLibrary() && !return_val) ? "void" : "int";
}
#else
#define dft_decl_spec() "int"
#endif
static int
haveAnsiParam(void)
{
Parameter *p;
if (func_params != 0) {
for (p = func_params->first; p != 0; p = p->next) {
if (p->declarator->func_def == FUNC_ANSI) {
return TRUE;
}
}
}
return FALSE;
}
static void
need_temp(size_t need)
{
if (need > temp_len) {
if (need < MAX_TEXT_SIZE)
need = MAX_TEXT_SIZE;
if (need < temp_len * 2)
need = temp_len * 2;
temp_buf = type_realloc(char, temp_buf, need);
temp_len = need;
}
}
%}
%%
program
: /* empty */
| translation_unit
;
translation_unit
: external_declaration
| translation_unit external_declaration
;
external_declaration
: declaration
| function_definition
| ';'
| linkage_specification
| asm_specifier
| error T_MATCHRBRACE
{
yyerrok;
}
| error ';'
{
yyerrok;
}
;
braces
: T_LBRACE T_MATCHRBRACE
;
linkage_specification
: T_EXTERN T_STRING_LITERAL braces
{
/* Provide an empty action here so bison will not complain about
* incompatible types in the default action it normally would
* have generated.
*/
}
| T_EXTERN T_STRING_LITERAL declaration
{
/* empty */
}
;
declaration
: decl_specifiers ';'
{
#if OPT_LINTLIBRARY
if (types_out && want_typedef()) {
gen_declarations(&$1, (DeclaratorList *)0);
flush_varargs();
}
#endif
free_decl_spec(&$1);
end_typedef();
}
| decl_specifiers init_declarator_list ';'
{
if (func_params != NULL) {
set_param_types(func_params, &$1, &$2);
} else {
gen_declarations(&$1, &$2);
#if OPT_LINTLIBRARY
flush_varargs();
#endif
free_decl_list(&$2);
}
free_decl_spec(&$1);
end_typedef();
}
| any_typedef decl_specifiers
{
cur_decl_spec_flags = $2.flags;
free_decl_spec(&$2);
}
opt_declarator_list ';'
{
end_typedef();
}
;
any_typedef
: T_EXTENSION T_TYPEDEF
{
begin_typedef();
}
| T_TYPEDEF
{
begin_typedef();
}
;
opt_declarator_list
: /* empty */
| declarator_list
;
declarator_list
: declarator
{
int flags = cur_decl_spec_flags;
/* If the typedef is a pointer type, then reset the short type
* flags so it does not get promoted.
*/
if (strcmp($1->text, $1->name) != 0)
flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
new_symbol(typedef_names, $1->name, NULL, flags);
free_declarator($1);
}
| declarator_list ',' declarator
{
int flags = cur_decl_spec_flags;
if (strcmp($3->text, $3->name) != 0)
flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
new_symbol(typedef_names, $3->name, NULL, flags);
free_declarator($3);
}
;
function_definition
: decl_specifiers declarator
{
check_untagged(&$1);
if ($2->func_def == FUNC_NONE) {
yyerror("syntax error");
YYERROR;
}
func_params = &($2->head->params);
func_params->begin_comment = cur_file->begin_comment;
func_params->end_comment = cur_file->end_comment;
}
opt_declaration_list T_LBRACE
{
/* If we're converting to K&R and we've got a nominally K&R
* function which has a parameter which is ANSI (i.e., a prototyped
* function pointer), then we must override the deciphered value of
* 'func_def' so that the parameter will be converted.
*/
if (func_style == FUNC_TRADITIONAL
&& haveAnsiParam()
&& $2->head->func_def == func_style) {
$2->head->func_def = FUNC_BOTH;
}
func_params = NULL;
if (cur_file->convert)
gen_func_definition(&$1, $2);
gen_prototype(&$1, $2);
#if OPT_LINTLIBRARY
flush_varargs();
#endif
free_decl_spec(&$1);
free_declarator($2);
}
T_MATCHRBRACE
| declarator
{
if ($1->func_def == FUNC_NONE) {
yyerror("syntax error");
YYERROR;
}
func_params = &($1->head->params);
func_params->begin_comment = cur_file->begin_comment;
func_params->end_comment = cur_file->end_comment;
}
opt_declaration_list T_LBRACE T_MATCHRBRACE
{
DeclSpec decl_spec;
func_params = NULL;
new_decl_spec(&decl_spec, dft_decl_spec(), $1->begin, DS_NONE);
if (cur_file->convert)
gen_func_definition(&decl_spec, $1);
gen_prototype(&decl_spec, $1);
#if OPT_LINTLIBRARY
flush_varargs();
#endif
free_decl_spec(&decl_spec);
free_declarator($1);
}
;
opt_declaration_list
: /* empty */
| T_VA_DCL
| declaration_list
;
declaration_list
: declaration
| declaration_list declaration
;
decl_specifiers
: decl_specifier
| decl_specifiers decl_specifier
{
join_decl_specs(&$$, &$1, &$2);
free_decl_spec(&$1);
free_decl_spec(&$2);
}
;
decl_specifier
: storage_class
| type_specifier
| type_qualifier
;
storage_class
: T_AUTO
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_EXTERN
{
new_decl_spec(&$$, $1.text, $1.begin, DS_EXTERN);
}
| T_REGISTER
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_STATIC
{
new_decl_spec(&$$, $1.text, $1.begin, DS_STATIC);
}
| T_INLINE
{
new_decl_spec(&$$, $1.text, $1.begin, DS_INLINE);
}
| T_EXTENSION
{
new_decl_spec(&$$, $1.text, $1.begin, DS_JUNK);
}
;
type_specifier
: T_CHAR
{
new_decl_spec(&$$, $1.text, $1.begin, DS_CHAR);
}
| T_DOUBLE
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_FLOAT
{
new_decl_spec(&$$, $1.text, $1.begin, DS_FLOAT);
}
| T_INT
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_LONG
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_SHORT
{
new_decl_spec(&$$, $1.text, $1.begin, DS_SHORT);
}
| T_SIGNED
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_UNSIGNED
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_VOID
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_Bool
{
new_decl_spec(&$$, $1.text, $1.begin, DS_CHAR);
}
| T_Complex
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_Imaginary
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_TYPEDEF_NAME
{
Symbol *s;
s = find_symbol(typedef_names, $1.text);
if (s != NULL)
new_decl_spec(&$$, $1.text, $1.begin, s->flags);
}
| struct_or_union_specifier
| enum_specifier
;
type_qualifier
: T_TYPE_QUALIFIER
{
new_decl_spec(&$$, $1.text, $1.begin, DS_NONE);
}
| T_DEFINE_NAME
{
/* This rule allows the nonterminal to scan #define
* names as if they were type modifiers.
*/
Symbol *s;
s = find_symbol(define_names, $1.text);
if (s != NULL)
new_decl_spec(&$$, $1.text, $1.begin, s->flags);
}
;
struct_or_union_specifier
: struct_or_union any_id braces
{
char *s;
if ((s = implied_typedef()) == 0) {
need_temp(2 + strlen($1.text) + strlen($2.text));
(void)sprintf(s = temp_buf, "%s %s", $1.text, $2.text);
}
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| struct_or_union braces
{
char *s;
if ((s = implied_typedef()) == 0) {
need_temp(4 + strlen($1.text));
(void)sprintf(s = temp_buf, "%s {}", $1.text);
}
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| struct_or_union any_id
{
need_temp(2 + strlen($1.text) + strlen($2.text));
(void)sprintf(temp_buf, "%s %s", $1.text, $2.text);
new_decl_spec(&$$, temp_buf, $1.begin, DS_NONE);
}
;
struct_or_union
: T_STRUCT
{
imply_typedef($$.text);
}
| T_UNION
{
imply_typedef($$.text);
}
;
init_declarator_list
: init_declarator
{
new_decl_list(&$$, $1);
}
| init_declarator_list ',' init_declarator
{
add_decl_list(&$$, &$1, $3);
}
;
init_declarator
: declarator
{
if ($1->func_def != FUNC_NONE && func_params == NULL &&
func_style == FUNC_TRADITIONAL && cur_file->convert) {
gen_func_declarator($1);
fputs(cur_text(), cur_file->tmp_file);
}
cur_declarator = $$;
}
| declarator '='
{
if ($1->func_def != FUNC_NONE && func_params == NULL &&
func_style == FUNC_TRADITIONAL && cur_file->convert) {
gen_func_declarator($1);
fputs(" =", cur_file->tmp_file);
}
}
T_INITIALIZER
;
asm_specifier
: T_ASM T_ASMARG
| parameter_declaration T_ASM T_ASMARG
{
free_parameter($1);
}
;
enum_specifier
: enumeration any_id braces
{
char *s;
if ((s = implied_typedef()) == 0) {
need_temp(6 + strlen($2.text));
(void)sprintf(s = temp_buf, "enum %s", $2.text);
}
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| enumeration braces
{
char *s;
if ((s = implied_typedef()) == 0) {
need_temp(4 + strlen($1.text));
(void)sprintf(s = temp_buf, "%s {}", $1.text);
}
new_decl_spec(&$$, s, $1.begin, DS_NONE);
}
| enumeration any_id
{
need_temp(6 + strlen($2.text));
(void)sprintf(temp_buf, "enum %s", $2.text);
new_decl_spec(&$$, temp_buf, $1.begin, DS_NONE);
}
;
enumeration
: T_ENUM
{
imply_typedef("enum");
$$ = $1;
}
;
any_id
: T_IDENTIFIER
| T_TYPEDEF_NAME
;
declarator
: pointer direct_declarator
{
$$ = $2;
need_temp(1 + strlen($1.text) + strlen($2->text));
(void)sprintf(temp_buf, "%s%s", $1.text, $$->text);
free($$->text);
$$->text = xstrdup(temp_buf);
$$->begin = $1.begin;
$$->pointer = TRUE;
}
| direct_declarator
;
direct_declarator
: identifier_or_ref
{
$$ = new_declarator($1.text, $1.text, $1.begin);
}
| '(' declarator ')'
{
$$ = $2;
need_temp(2 + strlen($2->text));
(void)sprintf(temp_buf, "(%s)", $$->text);
free($$->text);
$$->text = xstrdup(temp_buf);
$$->begin = $1.begin;
}
| direct_declarator T_BRACKETS
{
$$ = $1;
need_temp(1 + strlen($1->text) + strlen($2.text));
(void)sprintf(temp_buf, "%s%s", $$->text, $2.text);
free($$->text);
$$->text = xstrdup(temp_buf);
}
| direct_declarator '(' parameter_type_list ')'
{
$$ = new_declarator("%s()", $1->name, $1->begin);
$$->params = $3;
$$->func_stack = $1;
$$->head = ($1->func_stack == NULL) ? $$ : $1->head;
$$->func_def = FUNC_ANSI;
}
| direct_declarator '(' opt_identifier_list ')'
{
$$ = new_declarator("%s()", $1->name, $1->begin);
$$->params = $3;
$$->func_stack = $1;
$$->head = ($1->func_stack == NULL) ? $$ : $1->head;
$$->func_def = FUNC_TRADITIONAL;
}
;
pointer
: '*' opt_type_qualifiers
{
need_temp(2 + strlen($2.text));
(void)sprintf($$.text, "*%s", $2.text);
$$.begin = $1.begin;
}
| '*' opt_type_qualifiers pointer
{
need_temp(2 + strlen($2.text) + strlen($3.text));
(void)sprintf($$.text, "*%s%s", $2.text, $3.text);
$$.begin = $1.begin;
}
;
opt_type_qualifiers
: /* empty */
{
strcpy($$.text, "");
$$.begin = 0L;
}
| type_qualifier_list
;
type_qualifier_list
: type_qualifier
{
need_temp(2 + strlen($1.text));
(void)sprintf($$.text, "%s ", $1.text);
$$.begin = $1.begin;
free($1.text);
}
| type_qualifier_list type_qualifier
{
need_temp(1 + strlen($1.text) + strlen($2.text));
(void)sprintf($$.text, "%s%s ", $1.text, $2.text);
$$.begin = $1.begin;
free($2.text);
}
;
parameter_type_list
: parameter_list
| parameter_list ',' T_ELLIPSIS
{
add_ident_list(&$$, &$1, "...");
}
;
parameter_list
: parameter_declaration
{
new_param_list(&$$, $1);
}
| parameter_list ',' parameter_declaration
{
add_param_list(&$$, &$1, $3);
}
;
parameter_declaration
: decl_specifiers declarator
{
check_untagged(&$1);
$$ = new_parameter(&$1, $2);
}
| decl_specifiers abs_declarator
{
check_untagged(&$1);
$$ = new_parameter(&$1, $2);
}
| decl_specifiers
{
check_untagged(&$1);
$$ = new_parameter(&$1, (Declarator *)0);
}
;
opt_identifier_list
: /* empty */
{
new_ident_list(&$$);
}
| identifier_list
;
identifier_list
: any_id
{
new_ident_list(&$$);
add_ident_list(&$$, &$$, $1.text);
}
| identifier_list ',' any_id
{
add_ident_list(&$$, &$1, $3.text);
}
;
identifier_or_ref
: any_id
{
$$ = $1;
}
| '&' any_id
{
need_temp(2 + strlen($2.text));
#if OPT_LINTLIBRARY
if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */
$$ = $2;
} else
#endif
(void)sprintf($$.text, "&%s", $2.text);
$$.begin = $1.begin;
}
;
abs_declarator
: pointer
{
$$ = new_declarator($1.text, "", $1.begin);
}
| pointer direct_abs_declarator
{
$$ = $2;
need_temp(1 + strlen($1.text) + strlen($2->text));
(void)sprintf(temp_buf, "%s%s", $1.text, $$->text);
free($$->text);
$$->text = xstrdup(temp_buf);
$$->begin = $1.begin;
}
| direct_abs_declarator
;
direct_abs_declarator
: '(' abs_declarator ')'
{
$$ = $2;
need_temp(3 + strlen($2->text));
(void)sprintf(temp_buf, "(%s)", $$->text);
free($$->text);
$$->text = xstrdup(temp_buf);
$$->begin = $1.begin;
}
| direct_abs_declarator T_BRACKETS
{
$$ = $1;
need_temp(1 + strlen($1->text) + strlen($2.text));
(void)sprintf(temp_buf, "%s%s", $$->text, $2.text);
free($$->text);
$$->text = xstrdup(temp_buf);
}
| T_BRACKETS
{
$$ = new_declarator($1.text, "", $1.begin);
}
| direct_abs_declarator '(' parameter_type_list ')'
{
$$ = new_declarator("%s()", "", $1->begin);
$$->params = $3;
$$->func_stack = $1;
$$->head = ($1->func_stack == NULL) ? $$ : $1->head;
$$->func_def = FUNC_ANSI;
}
| direct_abs_declarator '(' ')'
{
$$ = new_declarator("%s()", "", $1->begin);
$$->func_stack = $1;
$$->head = ($1->func_stack == NULL) ? $$ : $1->head;
$$->func_def = FUNC_ANSI;
}
| '(' parameter_type_list ')'
{
Declarator *d;
d = new_declarator("", "", $1.begin);
$$ = new_declarator("%s()", "", $1.begin);
$$->params = $2;
$$->func_stack = d;
$$->head = $$;
$$->func_def = FUNC_ANSI;
}
| '(' ')'
{
Declarator *d;
d = new_declarator("", "", $1.begin);
$$ = new_declarator("%s()", "", $1.begin);
$$->func_stack = d;
$$->head = $$;
$$->func_def = FUNC_ANSI;
}
;
%%
#if defined(HAVE_CONFIG_H)
# include "lex.yy.c"
#else
#if defined(__EMX__) || defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(vms)
# ifdef USE_flex
# include "lexyy.c"
# else
# include "lex_yy.c"
# endif
#else
# include "lex.yy.c"
#endif
#endif
static void
yaccError(const char *msg)
{
func_params = NULL;
put_error(); /* tell what line we're on, and what file */
fprintf(stderr, "%s at token '%s'\n", msg, yytext);
}
/* Initialize the table of type qualifier keywords recognized by the lexical
* analyzer.
*/
void
init_parser(void)
{
static const char *keywords[] =
{
"const",
"restrict",
"volatile",
"interrupt",
#ifdef vms
"noshare",
"readonly",
#endif
#if defined(MSDOS) || defined(OS2)
"__cdecl",
"__export",
"__far",
"__fastcall",
"__fortran",
"__huge",
"__inline",
"__interrupt",
"__loadds",
"__near",
"__pascal",
"__saveregs",
"__segment",
"__stdcall",
"__syscall",
"_cdecl",
"_cs",
"_ds",
"_es",
"_export",
"_far",
"_fastcall",
"_fortran",
"_huge",
"_interrupt",
"_loadds",
"_near",
"_pascal",
"_saveregs",
"_seg",
"_segment",
"_ss",
"cdecl",
"far",
"huge",
"near",
"pascal",
#ifdef OS2
"__far16",
#endif
#endif
#ifdef __GNUC__
/* gcc aliases */
"__builtin_va_arg",
"__builtin_va_list",
"__const",
"__const__",
"__gnuc_va_list",
"__inline",
"__inline__",
"__restrict",
"__restrict__",
"__volatile",
"__volatile__",
#endif
};
unsigned i;
/* Initialize type qualifier table. */
type_qualifiers = new_symbol_table();
for (i = 0; i < sizeof(keywords) / sizeof(keywords[0]); ++i) {
new_symbol(type_qualifiers, keywords[i], NULL, DS_NONE);
}
}
/* Process the C source file. Write function prototypes to the standard
* output. Convert function definitions and write the converted source
* code to a temporary file.
*/
void
process_file(FILE *infile, const char *name)
{
const char *s;
if (strlen(name) > 2) {
s = name + strlen(name) - 2;
if (*s == '.') {
++s;
if (*s == 'l' || *s == 'y')
BEGIN LEXYACC;
#if defined(MSDOS) || defined(OS2)
if (*s == 'L' || *s == 'Y')
BEGIN LEXYACC;
#endif
}
}
included_files = new_symbol_table();
typedef_names = new_symbol_table();
define_names = new_symbol_table();
inc_depth = -1;
curly = 0;
ly_count = 0;
func_params = NULL;
yyin = infile;
include_file(strcpy(base_file, name), func_style != FUNC_NONE);
if (file_comments) {
#if OPT_LINTLIBRARY
if (lintLibrary()) {
put_blankline(stdout);
begin_tracking();
}
#endif
put_string(stdout, "/* ");
put_string(stdout, cur_file_name());
put_string(stdout, " */\n");
}
yyparse();
free_symbol_table(define_names);
free_symbol_table(typedef_names);
free_symbol_table(included_files);
}
#ifdef NO_LEAKS
void
free_parser(void)
{
free_symbol_table(type_qualifiers);
#ifdef FLEX_SCANNER
if (yy_current_buffer != 0)
yy_delete_buffer(yy_current_buffer);
#endif
if (temp_buf != 0) {
temp_buf = 0;
temp_len = 0;
}
}
#endif
cproto-4.7m/AUTHORS 0000644 0001751 0000144 00000000137 11416372254 012644 0 ustar tom users -- $Id: AUTHORS,v 4.1 2010/07/11 16:43:24 tom Exp $
cthuang Chin Huang
dickey Thomas E. Dickey
cproto-4.7m/trace.h 0000644 0001751 0000144 00000001042 11510145371 013030 0 ustar tom users /* $Id: trace.h,v 4.4 2011/01/02 18:59:05 tom Exp $ */
#ifndef TRACE_H
#define TRACE_H
#include
extern void Where(char *f, int n);
extern void Trace(char *f, ...) GCC_PRINTFLIKE(1,2);
extern void show_alloc(void);
extern void Elapsed(char *msg);
extern void WalkBack(void);
extern void fail_alloc(char *msg, char *ptr);
#ifdef DOALLOC
extern void *doalloc(void *,unsigned);
extern void dofree(void *);
#define malloc(n) doalloc(0,n)
#define realloc(p,n) doalloc(p,n)
#define free(n) dofree(n)
#endif
#endif /* TRACE_H */
cproto-4.7m/lex.l 0000644 0001751 0000144 00000061603 12261035752 012544 0 ustar tom users %p 3000
%{
/* $Id: lex.l,v 4.23 2014/01/01 16:01:46 tom Exp $
*
* Lexical analyzer for C function prototype generator
*
* This is designed to parse lexically at the top level (e.g., of extern
* objects such as procedures). The corresponding yacc-grammar expects
* that curly-braces (for function bodies) are recognized as a single
* token, BRACES. Similarly, square-brackets and their contents are
* passed back as BRACKETS.
*
* Assignments at the top level are data-initialization statements.
* These are returned as INITIALIZER.
*
* The logic here recognizes tokens inside curly-braces, but does not
* pass them back to the grammar.
*
* Apollo extensions:
* "&" is ignored when creating lint-libraries, because we ignore
* expressions of all kinds. Note that function-prototypes may use "&" to
* denote reference-parameters. By ignoring that as well, we make the
* output compatible with lint (kludge).
*
* Similarly, ignore "std_$call", since it is not compatible with lint.
*
* CPP_INLINE handles a special case of the Apollo CC 6.7 compiler that
* uses inline attribute declarations, e.g.
*
* int foo #attribute[aligned(1)];
*
* In CC 6.8 this behavior is hidden by a macro.
*
* VAX/VMS extensions:
* Treat the keywords 'globalref', etc., as 'extern'.
*
* The keywords 'noshare' and 'readonly' are type-qualifiers.
*
* GCC extensions:
* The keywords '__attribute__', '__inline', '__inline__', '__signed',
* '__signed__'. and '__extension__'
*/
#define result(nn) count(); if (!brackets && unnested()) return(nn)
#define is_IDENTIFIER save_text_offset();\
return type_of_name(yytext);
#if !OPT_LINTLIBRARY
#define gcc_attribute absorb_special /* otherwise, we don't care */
#endif
#ifdef apollo
#define apollo_keyword
#define apollo_special absorb_special()
#else
#define apollo_keyword is_IDENTIFIER
#define apollo_special is_IDENTIFIER
#endif
#ifdef vms
#define vms_extern save_text_offset(); return(T_EXTERN);
#define vms_keyword save_text_offset();
#else /* unix */
#define vms_extern is_IDENTIFIER
#define vms_keyword is_IDENTIFIER
#endif /* vms/unix */
char *varargs_str; /* save printflike/scanflike text */
int varargs_num; /* code to save "VARARGS" */
int debug_trace; /* true if we trace token-level stuff */
char base_file[BUFSIZ]; /* top-level file name */
static int asm_level; /* parenthesis level for "asm" parsing */
static int save_cpp; /* true if cpp-text within curly braces */
static int in_cpp; /* true while we are within cpp-text */
static int curly; /* number of curly brace nesting levels */
static int ly_count; /* number of occurances of %% */
#ifdef FLEX_SCANNER
/* flex scanner state */
static YY_BUFFER_STATE *buffer_stack;
#ifdef __cplusplus
#define LexInput() yyinput()
#endif
#endif /* FLEX_SCANNER */
#ifndef LexInput
#define LexInput() input()
#endif
static unsigned inc_limit; /* stack size */
static int inc_depth; /* include nesting level */
static IncludeStack *inc_stack; /* stack of included files */
static SymbolTable *included_files; /* files already included */
static int type_of_name(char *name);
static void startCpp(int level);
static void finishCpp(void);
#if defined(apollo) || !OPT_LINTLIBRARY
static void absorb_special(void);
#endif
#if OPT_LINTLIBRARY
static void gcc_attribute(void);
#endif
static void update_line_num(void);
static void save_text(void);
static void save_text_offset(void);
static void get_quoted(void);
static void get_comment(void);
static void get_cpp_directive(int copy);
static void parsing_file_name(unsigned need);
static void do_include(char *f);
static void include_file(char *name, int convert);
static void put_file(FILE *outf);
static void put_quoted(int c);
#if OPT_LINTLIBRARY
static int decipher_comment(char *keyword, int len);
#endif
%}
WS [ \t]
LETTER [A-Za-z$_]
DIGIT [0-9]
ID {LETTER}({LETTER}|{DIGIT})*
QUOTE [\"\']
%s CPP1 INIT1 INIT2 CURLY LEXYACC ASM CPP_INLINE
%%
\n { save_text(); cur_file->line_num++;
cur_declarator = NULL; }
"/*" { save_text(); get_comment(); }
"//".*$ save_text();
"&" { save_text(); return '&'; /* C++ ref-variable? */ }
^"%%" { save_text(); if (++ly_count >= 2) BEGIN INITIAL; }
^"%{" { save_text(); BEGIN INITIAL; }
{QUOTE} get_quoted();
. save_text();
^"%}" { save_text(); BEGIN LEXYACC; }
#{WS}* { save_text(); startCpp(0); }
"??="{WS}* { save_text(); startCpp(0); }
attribute { BEGIN CPP_INLINE; /* apollo */}
options { BEGIN CPP_INLINE; /* apollo */}
[^;]* finishCpp();
define{WS}+{ID} {
char *name;
char *value;
save_text();
*(name = (char *) xmalloc((size_t) (yyleng + 1))) = '\0';
sscanf(yytext, "define %s", name);
get_cpp_directive(1);
*(value = (char *) xmalloc(1 + strlen(temp_buf))) = '\0';
sscanf(temp_buf, "%s", value);
new_symbol(define_names, name, value, DS_NONE);
free(name);
free(value);
}
include{WS}* {
save_text();
get_cpp_directive(1);
if (temp_buf[0] != '"' && temp_buf[0] != '<') {
Symbol *sym = find_symbol(define_names, temp_buf);
if (sym != NULL && sym->value != NULL) {
need_temp(strlen(sym->value));
strcpy(temp_buf, sym->value);
} else {
temp_buf[0] = '\0';
}
}
if (temp_buf[0] != '\0')
do_include(temp_buf);
}
line{WS}+[0-9]+{WS}+\".*$ {
save_text();
parsing_file_name((unsigned) yyleng);
sscanf(yytext, "line %u \"%[^\"]\"",
&cur_file->line_num,
cur_file->file_name);
cur_file->line_num--;
track_in();
finishCpp();
}
[0-9]+{WS}+\".*$ {
save_text();
parsing_file_name((unsigned) yyleng);
sscanf(yytext, "%u \"%[^\"]\"",
&cur_file->line_num,
cur_file->file_name);
cur_file->line_num--;
track_in();
finishCpp();
}
[0-9]+.*$ {
save_text();
sscanf(yytext, "%u ", &cur_file->line_num);
cur_file->line_num--;
track_in();
finishCpp();
}
. { save_text(); get_cpp_directive(0); }
"(" { save_text_offset(); return '('; }
")" {
save_text();
if (cur_file->convert)
cur_file->begin_comment =
ftell(cur_file->tmp_file);
return ')';
}
"*" { save_text_offset(); return '*'; }
[,;] {
save_text();
if (cur_file->convert)
cur_file->begin_comment =
ftell(cur_file->tmp_file);
return yytext[0];
}
"..." { save_text(); return T_ELLIPSIS; }
\" {
get_quoted();
return T_STRING_LITERAL;
}
"__asm__" { save_text(); BEGIN ASM; return T_ASM; }
asm { save_text(); BEGIN ASM; return T_ASM; }
"(" { ++asm_level; save_text(); }
")" { --asm_level; save_text(); if (asm_level <= 0) { asm_level = 0; BEGIN INITIAL; return T_ASMARG; } }
{QUOTE} get_quoted();
. save_text();
__?based[^(]*\([^)]*\) { save_text_offset(); return T_TYPE_QUALIFIER; }
auto { save_text_offset(); return T_AUTO; }
extern { save_text_offset(); return T_EXTERN; }
register { save_text_offset(); return T_REGISTER; }
static { save_text_offset(); return T_STATIC; }
typedef { save_text_offset(); return T_TYPEDEF; }
inline { save_text_offset(); return T_INLINE; }
_Bool { save_text_offset(); return T_Bool; }
_Complex { save_text_offset(); return T_Complex; }
_Imaginary { save_text_offset(); return T_Imaginary; }
char { save_text_offset(); return T_CHAR; }
double { save_text_offset(); return T_DOUBLE; }
float { save_text_offset(); return T_FLOAT; }
int { save_text_offset(); return T_INT; }
void { save_text_offset(); return T_VOID; }
long { save_text_offset(); return T_LONG; }
short { save_text_offset(); return T_SHORT; }
signed { save_text_offset(); return T_SIGNED; }
unsigned { save_text_offset(); return T_UNSIGNED; }
enum { save_text_offset(); return T_ENUM; }
struct { save_text_offset(); return T_STRUCT; }
union { save_text_offset(); return T_UNION; }
va_dcl { save_text_offset(); return T_VA_DCL; }
__signed { save_text_offset(); return T_SIGNED; }
__signed__ { save_text_offset(); return T_SIGNED; }
__inline { save_text_offset(); return T_INLINE; }
__inline__ { save_text_offset(); return T_INLINE; }
__extension__ { save_text_offset(); return T_EXTENSION; }
__attribute__ { gcc_attribute(); }
globalvalue { vms_extern; }
globalref { vms_extern; }
globaldef { vms_extern; }
"std_$call" { apollo_keyword; }
"__attribute" { apollo_special; }
{ID} { is_IDENTIFIER }
\[[^\]]*\] {
/* This can't handle the case where a comment
* containing a ] appears between the brackets.
*/
save_text_offset();
update_line_num();
return T_BRACKETS;
}
"??("[^?]*"??)" {
save_text_offset();
update_line_num();
return T_BRACKETS;
}
"=" { save_text(); BEGIN INIT1; return '='; }
"{" { save_text(); curly = 1; BEGIN INIT2; }
[,;] {
unput(yytext[yyleng-1]);
BEGIN INITIAL;
return T_INITIALIZER;
}
{QUOTE} get_quoted();
. save_text();
"{" { save_text(); ++curly; }
"}" {
save_text();
if (--curly == 0) {
BEGIN INITIAL;
return T_INITIALIZER;
}
}
{QUOTE} get_quoted();
. save_text();
"{" {
save_text();
curly = 1;
return_val =
returned_at = FALSE;
BEGIN CURLY;
return T_LBRACE;
}
"{" { save_text(); ++curly; }
"}" {
save_text();
if (--curly == 0) {
BEGIN INITIAL;
return T_MATCHRBRACE;
}
}
{QUOTE} get_quoted();
"return" { save_text(); returned_at = TRUE; }
";" { save_text(); returned_at = FALSE; }
#{WS}* { save_text(); startCpp(1); }
"??="{WS}* { save_text(); startCpp(1); }
. { save_text(); return_val |= returned_at; }
[ \r\t\f]+ save_text();
. {
save_text();
put_error();
fprintf(stderr, "bad character '%c'\n", yytext[0]);
}
%%
static void
startCpp(int level)
{
save_cpp = level;
in_cpp = TRUE;
BEGIN CPP1;
}
static void
finishCpp(void)
{
in_cpp = FALSE;
if (save_cpp)
BEGIN CURLY;
else
BEGIN INITIAL;
}
/*
* Skip over embedded __attribute/__attribute_ syntax.
*/
#if defined(apollo) || !OPT_LINTLIBRARY
static void
absorb_special(void)
{
int c;
int nest = 0;
while ((c = input()) > 0) {
if (c == '(')
nest++;
else if (c == ')') {
if (--nest <= 0)
break;
}
}
}
#endif
#if OPT_LINTLIBRARY
/*
* This recognizes some of the special attribute macros defined by gcc:
* noreturn
* format(printf,n,m)
* format(scanf,n,m)
* and uses that information to construct equivalent lint-library text.
* (It's a distinct piece of code from the 'absorb_special()' function to
* avoid spurious matches with non-gcc compilers).
*/
static void
gcc_attribute(void)
{
int c, num1, num2;
int nest = 0;
unsigned len = 0;
char bfr[BUFSIZ];
while ((c = LexInput()) > 0) {
if (len < sizeof(bfr) - 1 && !isspace(c))
bfr[len++] = (char) c;
if (c == '(')
nest++;
else if (c == ')') {
if (--nest <= 0)
break;
}
}
bfr[len] = '\0';
if (!strcmp(bfr, "((noreturn))")) {
exitlike_func = TRUE;
} else if (sscanf(bfr, "((format(printf,%d,%d)))", &num1, &num2) == 2) {
(void) sprintf(bfr, "PRINTFLIKE%d", varargs_num = num1);
varargs_str = xstrdup(bfr);
} else if (sscanf(bfr, "((format(scanf,%d,%d)))", &num1, &num2) == 2) {
(void) sprintf(bfr, "SCANFLIKE%d", varargs_num = num1);
varargs_str = xstrdup(bfr);
}
}
#endif
/* Decode the current token according to the type-of-name
*/
static int
type_of_name(char *name)
{
if (find_symbol(type_qualifiers, name) != NULL)
return T_TYPE_QUALIFIER;
else if (find_symbol(typedef_names, name) != NULL)
return T_TYPEDEF_NAME;
else if (find_symbol(define_names, name) != NULL)
return T_DEFINE_NAME;
else
return T_IDENTIFIER;
}
boolean
is_typedef_name(char *name)
{
return (boolean) (find_symbol(typedef_names, name) != NULL);
}
/* If the matched text contains any new line characters, then update the
* current line number.
*/
static void
update_line_num(void)
{
char *p = yytext;
while (*p != '\0') {
if (*p++ == '\n')
cur_file->line_num++;
}
}
/* Save the matched text in the temporary file.
*/
static void
save_text(void)
{
#if OPT_LINTLIBRARY
if (!in_cpp)
copy_typedef(yytext);
#endif
if (cur_file->convert) {
fputs(yytext, cur_file->tmp_file);
}
}
/* Record the current position in the temporary file and write the matched text
* to the file.
*/
static void
save_text_offset(void)
{
(void) strcpy(yylval.text.text, yytext);
#if OPT_LINTLIBRARY
copy_typedef(yytext);
#endif
if (cur_file->convert) {
yylval.text.begin = ftell(cur_file->tmp_file);
fputs(yytext, cur_file->tmp_file);
} else
yylval.text.begin = 0;
}
#if OPT_LINTLIBRARY
/* Decipher comments that are useful for lint (and making lint-libraries)
*/
static struct {
int varText;
int varargs;
int externs;
int preproz;
} cmtVal;
static int
decipher_comment(char *keyword, int len)
{
if (len != 0) {
int value;
keyword[len] = '\0';
/* these are recognized by some lint-programs */
if (!strcmp(keyword, "VARARGS")) {
cmtVal.varargs = -1;
} else if (sscanf(keyword, "VARARGS%d", &value) == 1) {
cmtVal.varargs = value;
} else if (!strcmp(keyword, "PRINTFLIKE")) {
cmtVal.varargs = 1;
cmtVal.varText = TRUE;
} else if (sscanf(keyword, "PRINTFLIKE%d", &value) == 1) {
cmtVal.varargs = value;
cmtVal.varText = TRUE;
} else if (!strcmp(keyword, "SCANFLIKE")) {
cmtVal.varargs = 2;
cmtVal.varText = TRUE;
} else if (sscanf(keyword, "SCANFLIKE%d", &value) == 1) {
cmtVal.varargs = value;
cmtVal.varText = TRUE;
/* these are extensions added to simplify library-generation */
} else if (!strcmp(keyword, "LINT_EXTERN")) {
cmtVal.externs = MAX_INC_DEPTH;
} else if (sscanf(keyword, "LINT_EXTERN%d", &value) == 1) {
cmtVal.externs = value;
} else if (!strcmp(keyword, "LINT_PREPRO")) {
cmtVal.preproz = -1; /* the whole comment */
} else if (sscanf(keyword, "LINT_PREPRO%d", &value) == 1) {
cmtVal.preproz = value;
} else if (!strcmp(keyword, "LINT_SHADOWED")) {
lint_shadowed = TRUE;
}
}
return 0;
}
#endif
static void
put_quoted(int c)
{
/* Modifying 'yytext[]' doesn't work well with FLEX, which simply
* maintains 'yytext' as a pointer into its input buffer. LEX copies
* characters into the 'yytext[]' array.
*/
#if defined(FLEX_SCANNER) || !defined(YYLMAX)
if (c != 0) {
static char temp[2];
temp[0] = (char) c;
/* save_text */
# if OPT_LINTLIBRARY
if (!in_cpp)
copy_typedef(temp);
# endif
if (cur_file->convert) {
fputs(temp, cur_file->tmp_file);
}
/* update_line_num */
if (c == '\n')
cur_file->line_num++;
}
#else /* this works fine on LEX (e.g., on SunOS 4.x) */
if ((c == 0) || (yyleng + 1 >= YYLMAX)) {
save_text();
update_line_num();
yyleng = 0;
}
if (c != 0) {
yytext[yyleng++] = c;
yytext[yyleng] = 0;
}
#endif /* LEX/FLEX */
}
/*
* Scan past the characters in a backslash sequence
*/
/* Scan past quoted string. Note that some strings may overflow 'yytext[]', so
* we don't try to eat them in the lexical rules.
*/
static void
get_quoted(void)
{
int delim = *yytext;
int c;
#if defined(FLEX_SCANNER) || !defined(YYLMAX)
put_quoted(delim);
#endif
while ((c = LexInput()) != 0) {
if (c == '\\') {
put_quoted(c);
if ((c = LexInput()) == 0)
break;
put_quoted(c);
} else {
put_quoted(c);
if (c == delim)
break;
if (c == '\n') { /* recover from unbalanced */
put_error();
fprintf(stderr, "unbalanced quote character '%c'\n", delim);
break;
}
}
}
put_quoted(0);
}
/* Scan to end of comment.
*/
static void
get_comment(void)
{
int c, lastc = '\0';
#if OPT_LINTLIBRARY
unsigned len = 0;
char keyword[BUFSIZ];
keyword[len] = '\0';
cmtVal.varText = 0;
cmtVal.varargs = 0;
cmtVal.externs = -1;
cmtVal.preproz = 0;
#endif
while ((c = LexInput()) != 0) {
if (cur_file->convert)
fputc(c, cur_file->tmp_file);
#if OPT_LINTLIBRARY
if (!(isalnum(c) || c == '_' || c == '$')) {
int flag = cmtVal.preproz;
len = (unsigned) decipher_comment(keyword, (int) len);
if (flag != cmtVal.preproz)
lastc = '\0';
} else if (len + 1 < sizeof(keyword)) {
keyword[len++] = (char) c;
}
#endif
switch (c) {
case '\n':
cur_file->line_num++;
#if OPT_LINTLIBRARY
if (cmtVal.preproz != 0 && lastc != '\0')
fputc(lastc, stdout);
if (cmtVal.preproz > 0) /* if negative, we pass everything */
cmtVal.preproz -= 1;
#endif
break;
case '/':
if (lastc == '*') {
if (cur_file->convert) {
if (func_params && cur_declarator) {
cur_declarator->begin_comment = cur_file->begin_comment;
cur_file->begin_comment = ftell(cur_file->tmp_file);
cur_declarator->end_comment = cur_file->begin_comment;
cur_declarator = NULL;
} else {
cur_file->end_comment = ftell(cur_file->tmp_file);
}
}
#if OPT_LINTLIBRARY
(void) decipher_comment(keyword, (int) len);
if (cmtVal.varargs != 0) {
if ((varargs_num = cmtVal.varargs) != 0
&& cmtVal.varText != 0) {
if (varargs_str != 0)
free(varargs_str);
varargs_str = xstrdup(keyword);
}
}
if (cmtVal.externs >= 0)
extern_in = (unsigned) cmtVal.externs;
if (cmtVal.preproz != 0)
fputc('\n', stdout);
#endif
return;
}
/* FALLTHRU */
default:
#if OPT_LINTLIBRARY
if (cmtVal.preproz != 0 && lastc != '\0')
fputc(lastc, stdout);
#endif
break;
}
lastc = c;
}
}
/* Scan rest of preprocessor directive. If copy is true, then store the text
* in temp_buf.
*/
static void
get_cpp_directive(int copy)
{
unsigned used = 0;
char c, lastc[4];
lastc[0] = lastc[1] = lastc[2] = lastc[3] = '\0';
if (copy) {
need_temp((size_t) 2);
*temp_buf = '\0';
}
while ((c = (char) LexInput()) != 0) {
if (cur_file->convert)
fputc(c, cur_file->tmp_file);
switch (c) {
case '\n':
cur_file->line_num++;
if (lastc[2] != '\\' && strcmp(lastc, "?\?/") != 0) {
finishCpp();
return;
}
break;
case '*':
if (lastc[2] == '/')
get_comment();
break;
}
lastc[0] = lastc[1];
lastc[1] = lastc[2];
lastc[2] = c;
if (copy) {
if (used + 2 >= temp_len)
need_temp(temp_len + MAX_TEXT_SIZE);
temp_buf[used++] = c;
temp_buf[used] = '\0';
}
}
}
/*
* Ensure that the filename buffer is large enough to hold yytext, e.g., if
* the sscanf gave the whole buffer.
*/
static void
parsing_file_name(unsigned need)
{
need += 2;
if (cur_file->len_file_name < need) {
cur_file->len_file_name += need;
cur_file->file_name = (char *) xrealloc(cur_file->file_name, cur_file->len_file_name);
}
cur_file->file_name[0] = 0;
}
/* Return a pointer to the current file name.
*/
char *
cur_file_name(void)
{
return cur_file->file_name;
}
/* Return the current line number.
*/
unsigned
cur_line_num(void)
{
return cur_file->line_num;
}
/* Return the current temporary output file.
*/
FILE *
cur_tmp_file(void)
{
return cur_file->tmp_file;
}
/* Set the modify flag for the current file.
*/
void
cur_file_changed(void)
{
cur_file->changed = TRUE;
}
/* Return the temporary file offset of beginning of the current comment.
*/
long
cur_begin_comment(void)
{
return cur_file->begin_comment;
}
/* Return the text of the current lexical token.
*/
char *
cur_text(void)
{
return yytext;
}
#if !HAVE_TMPFILE
/*
* tmpfile() - return a FILE* for a temporary file that will be
* removed automatically when the program exits.
*
* Not all systems have the ANSI tmpfile() function yet...
*
* David W. Sanderson (dws@cs.wisc.edu)
*
* note - this was in version 3.10 from 1993 - TD
*/
FILE *
tmpfile(void)
{
char *name;
char *tmpdir;
FILE *f;
if ((tmpdir = getenv("TMPDIR")) == (char *) 0) {
tmpdir = "/tmp";
}
name = xmalloc(strlen(tmpdir) + 20);
sprintf(name, "%s/TfXXXXXX", tmpdir);
call_mktemp(name);
if ((f = fopen(name, "w+")) != 0) {
if (unlink(name) == -1) {
fclose(f);
f = 0;
}
}
free(name);
return f;
}
#endif /* !HAVE_TMPFILE */
/* Push a file onto the include stack. The stream yyin must already
* point to the file.
*/
static void
include_file(char *name, /* file name */
int convert) /* if TRUE, convert function definitions */
{
if (++inc_depth >= (int) inc_limit) {
unsigned need = (inc_limit | 31) + 1;
#ifdef FLEX_SCANNER
buffer_stack = type_realloc(YY_BUFFER_STATE, buffer_stack, need);
#endif
inc_stack = type_realloc(IncludeStack, inc_stack, need);
while (inc_limit < need) {
#ifdef FLEX_SCANNER
buffer_stack[inc_limit] = 0;
#endif
memset(inc_stack + inc_limit, 0, sizeof(*inc_stack));
++inc_limit;
}
}
cur_file = inc_stack + inc_depth;
cur_file->file = yyin;
cur_file->base_name = xstrdup(name);
cur_file->len_file_name = strlen(name) + MAX_TEXT_SIZE;
cur_file->file_name = strcpy((char *) xmalloc(cur_file->len_file_name), name);
cur_file->line_num = 1;
cur_file->convert = (boolean) convert;
cur_file->changed = FALSE;
#ifdef FLEX_SCANNER
buffer_stack[inc_depth] = yy_create_buffer(yyin, YY_BUF_SIZE);
yy_switch_to_buffer(buffer_stack[inc_depth]);
#endif
if (convert) {
cur_file->begin_comment = cur_file->end_comment = 0;
cur_file->tmp_file = tmpfile();
if (cur_file->tmp_file == NULL) {
fprintf(stderr, "%s: cannot create temporary file\n", progname);
cur_file->convert = FALSE;
}
}
}
#define BLOCK_SIZE 2048
/* Copy converted C source from the temporary file to the output stream.
*/
static void
put_file(FILE *outf)
{
char block[BLOCK_SIZE];
long filesize;
size_t nread, count;
filesize = ftell(cur_file->tmp_file);
fseek(cur_file->tmp_file, 0L, 0);
while (filesize > 0) {
count = (filesize < BLOCK_SIZE) ? (size_t) filesize : BLOCK_SIZE;
nread = fread(block, sizeof(char), count, cur_file->tmp_file);
if (nread == 0)
break;
fwrite(block, sizeof(char), nread, outf);
filesize -= (long) nread;
}
}
/* Remove the top of the include stack.
*/
void
pop_file(int closed)
{
FILE *outf;
if (!closed && (yyin != stdin))
fclose(yyin);
if (cur_file->convert) {
if (yyin == stdin) {
put_file(stdout);
} else if (cur_file->changed) {
if ((outf = fopen(cur_file->base_name, "w")) != NULL) {
put_file(outf);
fclose(outf);
} else {
fprintf(stderr, "%s: cannot create file %s\n", progname,
cur_file->base_name);
}
}
fclose(cur_file->tmp_file);
}
free(cur_file->base_name);
free(cur_file->file_name);
#ifdef FLEX_SCANNER
yy_delete_buffer(YY_CURRENT_BUFFER);
#endif
if (--inc_depth >= 0) {
cur_file = inc_stack + inc_depth;
yyin = cur_file->file;
#ifdef FLEX_SCANNER
yy_switch_to_buffer(buffer_stack[inc_depth]);
#endif
}
}
/* Process include directive.
*/
static void
do_include(char *file_spec) /* path surrounded by "" or <> */
{
unsigned stdinc; /* 1 = path surrounded by <> */
char *file;
char *path;
char match, *s;
unsigned i;
unsigned n;
FILE *fp;
if (file_spec[0] == '"') {
match = '"';
stdinc = 0;
} else if (file_spec[0] == '<') {
match = '>';
stdinc = 1;
} else {
return;
}
s = (strchr) (file_spec + 1, match);
n = (s != NULL) ? (unsigned) (s - file_spec - 1) : 0;
file = xstrdup(file_spec + 1);
file[n] = '\0';
/* Do nothing if the file was already included. */
path = (char *) xmalloc(strlen(file) + 3);
sprintf(path, stdinc ? "<%s>" : "\"%s\"", file);
if (find_symbol(included_files, path) == NULL) {
new_symbol(included_files, path, NULL, DS_NONE);
for (i = (unsigned) (stdinc != 0); i < num_inc_dir; ++i) {
if (strlen(inc_dir[i]) == 0 || !strcmp(inc_dir[i], CURRENT_DIR)) {
strcpy(path, file);
} else {
path = (char *) xrealloc(path, strlen(file) +
strlen(inc_dir[i]) + 2);
sprintf(path, "%s/%s", inc_dir[i], file);
}
if ((fp = fopen(path, "r")) != NULL) {
yyin = fp;
include_file(path, func_style != FUNC_NONE && !stdinc);
free(file);
free(path);
return;
}
}
if (!quiet) {
put_error();
fprintf(stderr, "cannot read file %s\n", file_spec);
}
}
free(file);
free(path);
}
/* When the end of the current input file is reached, pop a
* nested include file.
*/
int
yywrap(void)
{
if (inc_depth > 0) {
pop_file(FALSE);
return 0;
} else {
return 1;
}
}
#ifdef NO_LEAKS
void
free_lexer(void)
{
if (inc_limit != 0) {
#ifdef FLEX_SCANNER
free(buffer_stack);
#endif
free(inc_stack);
}
}
#endif
cproto-4.7m/Makefile.in 0000644 0001751 0000144 00000010256 12546350401 013637 0 ustar tom users # $Id: Makefile.in,v 4.23 2015/07/06 00:51:13 tom Exp $
#
# UNIX template-makefile for C prototype generator
THIS = cproto
RELEASE = 4_7m
#### Start of system configuration section. ####
srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
CPP = @CPP@
LEX = @LEX@
YACC = @YACC@
LINT = @LINT@
CTAGS = @CTAGS@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
DEFINES =
EXTRA_CFLAGS = @EXTRA_CFLAGS@
CPPFLAGS = -I. -I$(srcdir) $(DEFINES) -DHAVE_CONFIG_H @CPPFLAGS@
CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS)
LIBS = @LIBS@ @LEXLIB@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
mandir = @mandir@
manext = 1
BINDIR = $(DESTDIR)$(bindir)
MANDIR = $(DESTDIR)$(mandir)/man$(manext)
x = @EXEEXT@
o = .@OBJEXT@
#### End of system configuration section. ####
SHELL = /bin/sh
@SET_MAKE@
PROG = $(THIS)$x
LDFLAGS = @LDFLAGS@
DOC_FILES = \
README \
CHANGES \
$(THIS).1
MAK_FILES = \
Makefile.in \
configure.in \
aclocal.m4 \
config_h.in
H_FILES = \
yyerror.c \
system.h \
$(THIS).h \
semantic.h \
symbol.h
C_FILES = \
$(THIS).c \
lintlibs.c \
semantic.c \
strkey.c \
symbol.c
AUX_FILES = \
lex.l \
grammar.y
JUNK = \
lex.yy.c \
y.tab.c
EXTRA_OBJS = @EXTRA_OBJS@
OBJECTS = $(THIS)$o lintlibs$o semantic$o strkey$o symbol$o y.tab$o \
$(EXTRA_OBJS)
SOURCES = $(DOC_FILES) $(MAK_FILES) $(H_FILES) $(C_FILES) $(AUX_FILES)
all : $(PROG) # $(THIS).man
install: all installdirs
$(INSTALL_PROGRAM) $(PROG) $(BINDIR)/$(PROG)
- $(INSTALL_DATA) $(srcdir)/$(THIS).1 $(MANDIR)/$(THIS).$(manext)
installdirs:
mkdir -p $(BINDIR)
- mkdir -p $(MANDIR)
uninstall:
- rm -f $(BINDIR)/$(PROG) $(MANDIR)/$(THIS).$(manext)
.c$o:
@RULE_CC@
@ECHO_CC@$(CC) -c $(CFLAGS) $(CPPFLAGS) $<
$(PROG) : $(OBJECTS)
@ECHO_LD@$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)
y.tab.c : grammar.y
$(YACC) $(srcdir)/grammar.y
lex.yy.c : lex.l
$(LEX) $(srcdir)/lex.l
mostlyclean ::
- rm -f core .nfs* *$o *.bak *.BAK *.out $(JUNK) default.h
clean :: mostlyclean
- rm -f $(PROG)
- cd $(srcdir)/testing && $(MAKE) $@
distclean :: clean
- rm -f config.log config.cache config.status config.h Makefile man2html.tmp
- rm -f .version .fname
- cd $(srcdir)/testing && $(MAKE) $@
realclean :: distclean
- rm -f tags
- cd $(srcdir)/testing && $(MAKE) $@
check: $(PROG)
cd $(srcdir)/testing && $(MAKE) run_test
# I keep my sources in RCS, and assign a symbolic release to the current patch
# level. The 'manifest' script knows how to build a list of files for a given
# revision -TD
MANIFEST:
manifest -rv$(RELEASE) \
$(THIS).man \
$(srcdir)/testing/case*.dcl \
$(srcdir)/testing/case*.bat
dist: MANIFEST
- rm -f .fname .files
echo '$(THIS)-$(RELEASE)' >.fname
cat MANIFEST | grep ' ' | egrep -v ' subdirectory$$' | sed -e 's/\ .*//' | uniq >.files
rm -rf `cat .fname`
TOP=`cat .fname`; mkdir $$TOP `cat .files | grep / | sed -e 's@/.*@@' | sed -e s@\^@$$TOP/@ | uniq`
for file in `cat .files`; do \
ln $(srcdir)/$$file `cat .fname`/$$file \
|| { echo copying $$file instead; cp $$file `cat .fname`/$$file; }; \
done
tar -cf - `cat .fname` | gzip >`cat .fname`.tgz
rm -rf `cat .fname` .fname .files
default.h: $(C_FILES) lex.yy.c
./$(PROG) -e -v -m -M ARGS -d $(DEFINES) $(C_FILES) grammar.y >$@
getopt.o : $(srcdir)/porting/getopt.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/porting/getopt.c
popen.o : $(srcdir)/porting/popen.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/porting/popen.c
lint: $(C_FILES) $(JUNK)
$(LINT) $(CPPFLAGS) $(C_FILES) y.tab.c >$@.out
llib: $(C_FILES) $(JUNK)
./$(PROG) -l $(CPPFLAGS) $(C_FILES) y.tab.c >$@.out
self: $(C_FILES) $(JUNK)
./$(PROG) $(CPPFLAGS) $(C_FILES) y.tab.c >$@.out
tags: $(H_FILES) $(C_FILES) $(AUX_FILES)
$(CTAGS) $(C_FILES) $(AUX_FILES) $(H_FILES)
depend:
makedepend -- $(CPPFLAGS) -- $(C_FILES) y.tab.c
# DO NOT DELETE THIS LINE -- make depend depends on it.
cproto$o : cproto.h config.h system.h
lintlibs$o : cproto.h config.h system.h semantic.h symbol.h
semantic$o : cproto.h config.h system.h semantic.h
strkey$o : cproto.h config.h system.h
symbol$o : cproto.h config.h system.h symbol.h
y.tab$o : cproto.h config.h system.h symbol.h semantic.h lex.yy.c yyerror.c
cproto-4.7m/lintlibs.c 0000644 0001751 0000144 00000035446 11510150323 013555 0 ustar tom users /* $Id: lintlibs.c,v 4.21 2011/01/02 19:24:03 tom Exp $
*
* C prototype/lint-library generator
* These routines implement the semantic actions for lint libraries executed by
* the yacc parser.
*/
#include
#include
#if OPT_LINTLIBRARY
unsigned in_include;
static SymbolTable *include_list;
static SymbolTable *declared_list;
static int in_typedef;
static int blank_lines; /* used to filter blank lines from typedefs */
static int implied_cnt; /* state-count associated with implied_buf */
static char *implied_buf;
static char quote_l = '"';
static char quote_r = '"';
/*
* Output a string to standard output, keeping track of the trailing newlines
* to make it simple to format with blank lines.
*/
void
put_string(FILE *outf, const char *s)
{
if (*s != '\0') {
fputs(s, outf);
if (outf == stdout) { /* ensure we aren't doing temp-file! */
while (*s != '\0') {
if (*s++ == '\n')
blank_lines++;
else
blank_lines = 0;
}
}
}
}
/*
* Output a single character
*/
void
put_char(FILE *outf, int c)
{
static char s[] = "?";
s[0] = (char) c;
put_string(outf, s);
}
/*
* Write a newline, taking care not to make a blank line
*/
void
put_newline(FILE *outf)
{
while (!blank_lines)
put_string(outf, "\n");
}
/*
* Make a blank line (limited to 2 successive newlines)
*/
void
put_blankline(FILE *outf)
{
while (blank_lines < 2)
put_string(outf, "\n");
}
/*
* Put a token, padded by a tab if it is short enough
*/
void
put_padded(FILE *outf, const char *s)
{
put_string(outf, s);
put_char(outf, (lintLibrary() && strlen(s) < 8) ? '\t' : ' ');
}
/*
* Format lint-library so that we put a blank line before each item that may
* take up multiple lines:
* 0) functions
* 1) typedefs (explicit and implied)
* as well as when transitioning to
* 2) variable declarations
*
* If the "-T" option is set, we skip a blank line around typedefs.
*/
void
fmt_library(int code)
{
if (lintLibrary() || types_out) {
static int save;
if (!lintLibrary() && code == 0)
code = 3;
if (code <= 1 || code != save)
put_blankline(stdout);
save = code;
}
}
/*
* conversion for names so test-diffs are less
* (patch: should use relpath)
*/
static char *
strip_name(char *s)
{
#ifdef vms
static char stripped[BUFSIZ];
auto int len = strlen(getwd(stripped));
if (strlen(s) > len
&& !strncmp(s, stripped, len))
s += len;
s = (vms2name(stripped, s));
#else
static char GccLeaf[] = "/gcc-lib/";
static char IncLeaf[] = "/include/";
char *t;
unsigned n;
size_t len;
int standard = FALSE;
for (n = 1; n < num_inc_dir; n++) {
len = strlen(inc_dir[n]);
if (!strncmp(inc_dir[n], s, len)
&& is_path_sep(s[len])) {
standard = TRUE;
s += len + 1;
quote_l = '<';
quote_r = '>';
break;
}
}
if (!standard) {
quote_l =
quote_r = '"';
if (*s == '.' && is_path_sep(s[1]))
s += 2;
else if ((t = strstr(s, GccLeaf)) != 0
&& (t = strstr(t, IncLeaf)) != 0) {
s = t + sizeof(IncLeaf) - 1;
quote_l = '<';
quote_r = '>';
}
}
#endif
return s;
}
#define CUR_FILE strip_name(cur_file_name())
static unsigned base_level;
static unsigned inc_depth = 0;
static char **inc_stack = 0;
static char *
get_inc_stack(unsigned n)
{
return (((int) n) < 0 || n >= inc_depth) ? 0 : inc_stack[n];
}
#ifdef DEBUG
static void
dump_stack(char *tag)
{
unsigned j;
printf("/* stack%s:%s", tag, cur_file_name());
for (j = 0; j <= in_include; j++)
printf("\n\t%d%s:%s", j,
j == base_level ? "*" : "",
get_inc_stack(j) ? get_inc_stack(j) : "?");
printf(" */\n");
}
#endif /* DEBUG */
static void
free_inc_stack(unsigned n)
{
if (get_inc_stack(n) != 0) {
free(inc_stack[n]);
inc_stack[n] = 0;
}
}
static void
make_inc_stack(unsigned n, char *s)
{
if (n != 0) {
unsigned need = (n | 31) + 1;
free_inc_stack(n);
if (n > inc_depth) {
inc_stack = type_realloc(char *, inc_stack, need);
while (inc_depth < need)
inc_stack[inc_depth++] = 0;
inc_depth = need;
}
inc_stack[n] = xstrdup(s);
}
}
/*
* Keep track of include-files so that we only include each once.
*/
static int
already_included(char *path)
{
if (!include_list)
include_list = new_symbol_table();
if (find_symbol(include_list, path) != NULL)
return TRUE;
new_symbol(include_list, path, NULL, DS_NONE);
return FALSE;
}
/*
* Keep track of variables that may have been implicitly declared via
* include-files so that we declare them only once in the lint library
* output.
*/
int
already_declared(char *name)
{
if (declared_list == 0)
declared_list = new_symbol_table();
if (find_symbol(declared_list, name) == 0) {
(void) new_symbol(declared_list, name, 0, 0);
return FALSE;
}
return TRUE;
}
/*
* Initialize state for 'track_in()'
*/
static int InitTracking;
void
begin_tracking(void)
{
InitTracking = FALSE;
}
static int
c_suffix(char *path)
{
char *last = path + strlen(path);
#ifdef vms
char *vers = strrchr(path, ';');
if (vers != 0)
last = vers;
#endif
return ((last - path) > 2 && !strcmp(last - 2, ".c"));
}
/*
* Keep track of "include files" that we always want to filter out (ignore).
*/
static int
ignored(char *path)
{
if (strcmp(path, "") == 0
|| strcmp(path, "") == 0)
return TRUE;
return FALSE;
}
static const char *
skip_dot(const char *a)
{
if (!strncmp(a, "./", (size_t) 2))
a += 2;
return a;
}
static int
same_file(const char *a, const char *b)
{
return !strcmp(skip_dot(a), skip_dot(b));
}
/*
* For lint-library, we want to keep track of what file we are in so that we
* can generate appropriate comments and include-statements.
*
* The main program 'cproto' is invoked with 'cpp' once for each C-file,
* relying on it to spit out "#" comments which identify the name and line
* number of each processed file. After the first '#' comment, all others
* refer to included files.
*/
void
track_in(void)
{
static char old_file[MAX_TEXT_SIZE]; /* from last call */
auto int show = lintLibrary();
if (!show && !do_tracking && !debug_trace)
return;
#ifdef DEBUG
printf("/* track_in: in_include=%d line_num=%d base_file=%s */\n",
in_include, cur_line_num(), base_file);
dump_stack("-before");
#endif /* DEBUG */
if (cur_line_num() == 0) { /* begin new (nested?) file */
if (!InitTracking) {
InitTracking = TRUE;
/* yacc may omit first cpp-line! */
in_include =
base_level = (unsigned) !same_file(cur_file_name(), base_file);
make_inc_stack(0, base_file);
} else if (same_file(cur_file_name(), base_file)) {
flush_varargs();
in_include = 0; /* reset level */
} else {
make_inc_stack(in_include, old_file);
if (in_include++ == 0) {
char *s = CUR_FILE;
if (show && !already_included(s) && !ignored(s)) {
fmt_library(4);
put_string(stdout, "#include ");
put_char(stdout, quote_l);
put_string(stdout, s);
put_char(stdout, quote_r);
put_newline(stdout);
}
if (debug_trace)
fprintf(stderr, "++ %s\n", cur_file_name());
}
make_inc_stack(in_include, cur_file_name());
}
(void) strcpy(old_file, cur_file_name());
} else if (same_file(cur_file_name(), base_file)) {
in_include = 0; /* kludgy bison! */
(void) strcpy(old_file, cur_file_name());
} else if (!same_file(old_file, cur_file_name())) { /* continue/unnest ? */
unsigned n;
int found;
char *s = cur_file_name();
#ifdef DEBUG
char temp[80];
#endif
flush_varargs();
for (n = in_include, found = FALSE; (int) n >= 0; n--) {
if (same_file(get_inc_stack(n), s)) {
found = TRUE;
in_include--;
break;
}
}
if (!found) {
/*
* There's two kinds of broken programs that can cause
* us to lose sync at this point: (1) programs such as
* yacc that don't reference the grammar file, instead
* referencing the generated file, and (2) broken
* preprocessors (such as on OSF/1) that neglect to
* report line #1 on headers that are rejected due to
* prior inclusion.
*
* If the source file's extension is ".h", we'll assume
* the latter case (i.e., just report it). The former
* case requires that we reset the stack.
*/
#ifdef DEBUG
sprintf(temp, "/* lost sync @%d: ", cur_line_num() + 1);
put_blankline(stdout);
put_string(stdout, temp);
put_string(stdout, s);
put_string(stdout, " */\n");
#endif
if (in_include == 1 && c_suffix(s)) {
/* yacc did it again! */
in_include = 0;
make_inc_stack(in_include, strcpy(base_file, s));
#ifdef DEBUG
put_string(stdout, "/* processed ");
put_string(stdout, s);
put_string(stdout, " */\n");
#endif
}
}
(void) strcpy(old_file, get_inc_stack(in_include));
}
#ifdef DEBUG
dump_stack("-after");
#endif /* DEBUG */
}
/*
* Copy/append to 'implied_buf[]'
*/
static void
add2implied_buf(const char *s, int append)
{
static size_t implied_len; /* current strlen(implied_buf) */
static size_t implied_max; /* maximum size of implied_buf */
if (!append)
implied_len = 0;
implied_len += strlen(s);
if (implied_buf == 0)
*(implied_buf = (char *) malloc(implied_max = BUFSIZ)) = '\0';
if (implied_max < implied_len + 2)
implied_buf = (char *) realloc(implied_buf, implied_max +=
implied_len + 2);
if (!append)
*implied_buf = '\0';
(void) strcat(implied_buf, s);
}
/*
* If the "-t" option is set (or if we are generating a lint-library), we
* intercept tokens which are part of a typedef, copying them to the output.
*
* The 'imply_typedef()' entrypoint is called from the grammar for the special
* cases of struct/union/enum when we expect to be getting curly-braces which
* define the structure. If no curly-braces are found by the end of the
* rule, we can discard the buffer.
*/
int
want_typedef(void)
{
if (lintLibrary()) {
if (in_include == 0)
return (TRUE);
} else if (types_out) {
return (TRUE);
}
return (FALSE);
}
void
begin_typedef(void)
{
if (want_typedef()) {
in_typedef = TRUE;
fmt_library(1);
copy_typedef("typedef");
}
}
void
copy_typedef(const char *s)
{
if (!strcmp(s, "/*")
|| *s == '#') ; /* ignore */
else if (in_typedef) {
if (*s == '\n')
put_newline(stdout);
else
put_string(stdout, s);
} else if (implied_cnt > 0) { /* "KEY ID {" ? */
add2implied_buf(s, TRUE);
if (!isspace(UCH(*s)))
implied_cnt--;
if ((implied_cnt == 2 || implied_cnt == 1)
&& !strcmp(s, "{")) {
implied_cnt = 9999;
}
}
}
void
end_typedef(void)
{
copy_typedef("\n");
in_typedef = FALSE;
(void) implied_typedef();
}
void
imply_typedef(const char *s)
{
if (!in_typedef && want_typedef()) {
add2implied_buf(s, FALSE);
implied_cnt = 3;
}
}
char *
implied_typedef(void)
{
if (implied_cnt > 0) {
implied_cnt = 0;
return (implied_buf);
}
return (0);
}
/*
* Indent lint-library stuff to make it readable
*/
void
indent(FILE *outf)
{
put_string(outf, "\n\t\t");
}
/* Test for the special case of an ellipsis-parameter when trying to make a
* lint-library
*/
int
lint_ellipsis(Parameter * p)
{
return (knrLintLibrary()
&& (!strcmp(p->declarator->name, ELLIPSIS)));
}
/*
* Reset the data used for "VARARGS" comment. Actually, reset almost any
* special attribute that's attached to a function, so we don't accidentally
* propagate it to the next function (or data) to be output.
*/
void
flush_varargs(void)
{
exitlike_func = FALSE;
varargs_num = 0;
if (varargs_str != 0) {
free(varargs_str);
varargs_str = 0;
}
}
/* If either we received a "VARARGS" comment in the lexical scanner, or if the
* parameter list contains an ellipsis, generate a corresponding "VARARGS"
* comment for lint-library output.
*/
void
ellipsis_varargs(Declarator * d)
{
int count;
Parameter *p;
fmt_library(0);
for (p = d->params.first, count = 0; p != 0; p = p->next, count++)
if (lint_ellipsis(p)) {
varargs_num = count;
break;
}
if (varargs_num != 0) {
put_string(stdout, "\t/* VARARGS");
if (varargs_num > 0) {
printf("%d", varargs_num);
if (varargs_str != 0) {
put_char(stdout, ' ');
put_string(stdout, varargs_str);
}
}
flush_varargs();
put_string(stdout, " */\n");
}
}
/* (Attempt to) create a parameter name for lint-library applications in which
* we are starting from a function prototype which has no explicit parameter
* name.
*/
char *
supply_parm(int count)
{
static char temp[80];
(void) sprintf(temp, "p%d", count);
while (is_typedef_name(temp) && (strlen(temp) < sizeof(temp) - 1))
(void) strcat(temp, "_");
return (temp);
}
/*
* (Attempt to) distinguish between declarators for functions and for
* function pointers.
*/
int
is_actual_func(Declarator * d)
{
if (lintLibrary() && (d->func_def != FUNC_NONE)) {
if (d->func_stack->text[0] == PAREN_L
&& d->func_stack->text[1] == '*') {
if (strstr(d->func_stack->text, "()") != 0)
return TRUE;
} else {
return TRUE;
}
}
return FALSE;
}
/*
* Output the body (or terminating semicolon) of a procedure
*/
void
put_body(
FILE *outf,
DeclSpec * decl_spec, /* declaration specifier */
Declarator * declarator)
{
const char *spec_text;
if (is_actual_func(declarator)) {
strcut(decl_spec->text, "static");
strcut(decl_spec->text, "extern");
indent(outf);
put_char(outf, CURL_L);
if (!*(spec_text = decl_spec->text))
spec_text = "void";
if (exitlike_func) {
put_string(outf, " for(;;); /* no return */ ");
} else if (!strcmp(spec_text, "void")
&& declarator->text[0] != '*'
&& declarator->func_stack->func_def == FUNC_NONE) {
put_string(outf, " /* void */ ");
} else {
put_string(outf, " return(*(");
if (declarator->func_stack->func_def == FUNC_NONE) {
put_string(outf, spec_text);
put_char(outf, ' ');
if (declarator->pointer) {
char *s = declarator->text;
while (*s++ == '*')
put_char(outf, '*');
}
put_char(outf, '*');
} else {
put_string(outf, spec_text);
put_string(outf, "(*)()");
}
put_string(outf, ")0); ");
}
put_char(outf, CURL_R);
} else {
if (proto_style == PROTO_LINTLIBRARY
|| proto_style == PROTO_ANSI_LLIB) {
/* SVR4 lint complains if we declare const data without an
* initializer.
*/
if (strkey(decl_spec->text, "const") != NULL
|| strkey(declarator->text, "const") != NULL) {
put_string(outf, " = {0}");
}
}
put_string(outf, ";");
}
put_newline(outf);
exitlike_func = FALSE;
}
#ifdef NO_LEAKS
void
free_lintlibs(void)
{
unsigned n;
if (implied_buf != 0)
free(implied_buf);
if (inc_stack != 0) {
for (n = 0; n < inc_depth; n++)
free_inc_stack(n);
free(inc_stack);
}
if (include_list != 0)
free_symbol_table(include_list);
if (declared_list != 0)
free_symbol_table(declared_list);
}
#endif
#endif /* OPT_LINTLIBRARY */
cproto-4.7m/trace.c 0000644 0001751 0000144 00000015124 11510150754 013032 0 ustar tom users /* $Id: trace.c,v 4.6 2011/01/02 19:28:44 tom Exp $
*
* Simple malloc debugging (for finding leaks)
*
* This is a cut-down version of a module I wrote originally for 'vile', it
* requires an ANSI compiler. Its main purpose is to allow tracing problems in
* a repeatable test, including malloc/free bugs -- T.Dickey
*/
#include /* interface of this module */
#if DOALLOC
#undef malloc
#undef realloc
#undef free
#endif /* DOALLOC */
#include
#if TIME_WITH_SYS_TIME
# include
# include
#else
# if HAVE_SYS_TIME_H
# include
# else
# include
# endif
#endif
#include
#define BEFORE 0 /* padding "before" allocated area */
#define AFTER 0 /* padding "after" allocated area */
#define BEFORE_PTR(ptr) (void *)((char *)(ptr) - BEFORE)
void
Where(char *file, int line)
{
fflush(stderr);
printf("%s @%d\n", file, line);
fflush(stdout);
Trace("%s @%d\n", file, line);
}
void
Trace(char *format,...)
{
static FILE *fp;
va_list ap;
if (!fp)
fp = fopen("Trace.out", "w");
if (!fp)
abort();
if (format != 0) {
va_start(ap, format);
vfprintf(fp, format, ap);
va_end(ap);
(void) fflush(fp);
} else {
(void) fclose(fp);
(void) fflush(stdout);
(void) fflush(stderr);
}
}
#define SECS(tv) (tv.tv_sec + (tv.tv_usec / 1.0e6))
void
Elapsed(char *msg)
{
#if HAVE_GETTIMEOFDAY
static struct timeval tv0, tv1;
static struct timezone tz0, tz1;
static int init;
if (!init++)
gettimeofday(&tv0, &tz0);
gettimeofday(&tv1, &tz1);
Trace("%10.6f %s\n", SECS(tv1) - SECS(tv0), msg);
tv0 = tv1;
#endif
}
#ifdef apollo
static int
contains(char *ref, char *tst)
{
size_t len = strlen(ref);
while (*tst) {
if (!strncmp(ref, tst++, len))
return TRUE;
}
return FALSE;
}
#endif /* apollo */
void
WalkBack(void)
{
#ifdef apollo
static char *first = "\"WalkBack\"", *last = "\"unix_$main\"";
auto FILE *pp;
auto char bfr[BUFSIZ];
auto int ok = FALSE;
static int count;
Trace("%s %d\n", first, ++count);
sprintf(bfr, "/com/tb %d", getpid());
if (!(pp = popen(bfr, "r")))
perror(bfr);
while (fgets(bfr, sizeof(bfr), pp)) {
if (ok && contains(last, bfr))
break;
else if (contains(first, bfr))
ok = TRUE;
else if (ok)
Trace("%s", bfr);
}
(void) fclose(pp);
#endif /* apollo */
}
static long count_alloc, count_freed;
void
fail_alloc(char *msg, char *ptr)
{
Trace("%s: %p\n", msg, ptr);
Trace("allocs %ld, frees %ld\n", count_alloc, count_freed);
WalkBack();
#ifdef NO_LEAKS
show_alloc();
#endif
Trace((char *) 0);
abort();
}
#if DOALLOC
#undef malloc
#undef realloc
#undef free
typedef struct {
long size; /* ...its size */
char *text; /* the actual segment */
int note; /* ...last value of 'count_alloc' */
} AREA;
static AREA area[DOALLOC];
static long maxAllocated, /* maximum # of bytes allocated */
nowAllocated, /* current # of bytes allocated */
nowPending, /* current end of 'area[]' table */
maxPending; /* maximum # of segments allocated */
static int
FindArea(char *ptr)
{
register int j;
for (j = 0; j < DOALLOC; j++)
if (area[j].text == ptr) {
if (j >= nowPending) {
nowPending = j + 1;
if (nowPending > maxPending)
maxPending = nowPending;
}
return j;
}
return -1;
}
static int
record_freed(char *ptr)
{
register int j;
if ((j = FindArea(ptr)) >= 0) {
nowAllocated -= area[j].size;
/*memset(ptr, 0xdf, area[j].size); -* poison */
area[j].size = 0;
area[j].text = 0;
area[j].note = count_freed;
if ((j + 1) == nowPending) {
register int k;
for (k = j; (k >= 0) && !area[k].size; k--)
nowPending = k;
}
}
return j;
}
static int
record_alloc(char *newp, char *oldp, unsigned len)
{
register int j;
if (newp == oldp) {
if ((j = FindArea(oldp)) >= 0) {
nowAllocated -= area[j].size;
area[j].size = len;
area[j].note = count_alloc;
} else
fail_alloc("could not find", oldp);
} else {
if (oldp != 0)
record_freed(oldp);
if ((j = FindArea((char *) 0)) >= 0) {
area[j].text = newp;
area[j].size = len;
area[j].note = count_alloc;
} else
fail_alloc("no room in table", newp);
}
nowAllocated += len;
if (nowAllocated > maxAllocated)
maxAllocated = nowAllocated;
return len;
}
#define OK_ALLOC(p,q,n) ((p != 0) && (record_alloc(p,q,n) >= 0))
#define OK_FREE(p) ((p != 0) && (record_freed(p) >= 0))
#else
#define OK_ALLOC(p,q,n) (p != 0)
#define OK_FREE(p) (p != 0)
#endif /* DOALLOC */
#ifdef DEBUG2
#define LOG_PTR(msg,num) Trace("%s %p\n", msg, num)
#define LOG_LEN(msg,num) Trace("%s %d\n", msg, num)
#else
#define LOG_PTR(msg,num)
#define LOG_LEN(msg,num)
#endif
/************************************************************************
* public entrypoints *
************************************************************************/
#if DOALLOC
void *
doalloc(void *oldp, unsigned amount)
{
char *newp;
if (oldp != 0)
oldp = BEFORE_PTR(oldp);
count_alloc += (oldp == 0);
#if 0
if ((count_alloc > 99914 && count_alloc < 99920)) {
Trace("doalloc #%d\n", count_alloc);
WalkBack();
}
#endif
LOG_LEN("allocate", amount);
LOG_PTR(" old = ", oldp);
amount += (BEFORE + AFTER); /* patch */
newp = (oldp != 0) ? realloc(oldp, amount) : malloc(amount);
if (!OK_ALLOC(newp, oldp, amount)) {
perror("doalloc");
fail_alloc("doalloc", oldp);
/*NOT REACHED */
}
LOG_PTR(" new = ", newp);
return (void *) (newp + BEFORE);
}
/*
* Entrypoint so we can validate pointers
*/
void
dofree(void *oldp)
{
oldp = BEFORE_PTR(oldp);
count_freed++;
LOG_PTR("dealloc ", oldp);
if (OK_FREE(oldp)) {
free(oldp);
return;
}
fail_alloc("free (not found)", oldp);
}
#endif
void
show_alloc(void)
{
#if DOALLOC
static char *format = ".. %-24.24s %10ld\n";
Trace("** allocator metrics:\n");
Trace(format, "allocs:", count_alloc);
Trace(format, "frees:", count_freed);
{
register int j, count = 0;
register long total = 0;
for (j = 0; j < nowPending; j++) {
if (area[j].text) {
if (count++ < 10)
Trace("...%d) %ld bytes in alloc #%d:%p\n",
j,
area[j].size,
area[j].note,
area[j].text);
total += area[j].size;
}
}
Trace(format, "total bytes allocated:", total);
Trace(format, "current bytes allocated:", nowAllocated);
Trace(format, "maximum bytes allocated:", maxAllocated);
Trace(format, "segment-table length:", nowPending);
Trace(format, "current # of segments:", (long) count);
Trace(format, "maximum # of segments:", maxPending);
}
#endif
}
cproto-4.7m/aclocal.m4 0000644 0001751 0000144 00000132156 12546347461 013452 0 ustar tom users dnl $Id: aclocal.m4,v 4.24 2015/07/06 00:43:29 tom Exp $
dnl
dnl Macros for cproto configure script
dnl ---------------------------------------------------------------------------
dnl Copyright (c) 1994-2014,2015 Thomas E. Dickey
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
dnl to deal in the Software without restriction, including without limitation
dnl the rights to use, copy, modify, merge, publish, distribute, distribute
dnl with modifications, sublicense, and/or sell copies of the Software, and to
dnl permit persons to whom the Software is furnished to do so, subject to the
dnl following conditions:
dnl
dnl The above copyright notice and this permission notice shall be included in
dnl all copies or substantial portions of the Software.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
dnl THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
dnl DEALINGS IN THE SOFTWARE.
dnl
dnl Except as contained in this notice, the name(s) of the above copyright
dnl holders shall not be used in advertising or otherwise to promote the sale,
dnl use or other dealings in this Software without prior written authorization.
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
dnl ------------------
dnl Conditionally generate script according to whether we're using a given autoconf.
dnl
dnl $1 = version to compare against
dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
dnl $3 = code to use if AC_ACVERSION is older than $1.
define([CF_ACVERSION_CHECK],
[
ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl
ifdef([m4_version_compare],
[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
[CF_ACVERSION_COMPARE(
AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
dnl --------------------
dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
dnl MAJOR2, MINOR2, TERNARY2,
dnl PRINTABLE2, not FOUND, FOUND)
define([CF_ACVERSION_COMPARE],
[ifelse(builtin([eval], [$2 < $5]), 1,
[ifelse([$8], , ,[$8])],
[ifelse([$9], , ,[$9])])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_CFLAGS version: 12 updated: 2015/04/12 15:39:00
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
dnl The second parameter if given makes this macro verbose.
dnl
dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
dnl confused by the quotes (which require backslashes to keep them usable).
AC_DEFUN([CF_ADD_CFLAGS],
[
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $1
do
case $cf_fix_cppflags in
(no)
case $cf_add_cflags in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
(*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
(yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
AC_SUBST(EXTRA_CPPFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
dnl --------------
dnl Allow user to disable a normally-on option.
AC_DEFUN([CF_ARG_DISABLE],
[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14
dnl -------------
dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
dnl values.
dnl
dnl Parameters:
dnl $1 = option name
dnl $2 = help-string
dnl $3 = action to perform if option is not default
dnl $4 = action if perform if option is default
dnl $5 = default option value (either 'yes' or 'no')
AC_DEFUN([CF_ARG_OPTION],
[AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
if test "$enableval" != "$5" ; then
ifelse([$3],,[ :]dnl
,[ $3]) ifelse([$4],,,[
else
$4])
fi],[enableval=$5 ifelse([$4],,,[
$4
])dnl
])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CC_ENV_FLAGS version: 2 updated: 2015/04/12 15:39:00
dnl ---------------
dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
dnl into CC. This will not help with broken scripts that wrap the compiler with
dnl options, but eliminates a more common category of user confusion.
AC_DEFUN([CF_CC_ENV_FLAGS],
[
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
AC_MSG_CHECKING(\$CC variable)
case "$CC" in
(*[[\ \ ]]-[[IUD]]*)
AC_MSG_RESULT(broken)
AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
# humor him...
cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
CF_ADD_CFLAGS($cf_flags)
;;
(*)
AC_MSG_RESULT(ok)
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03
dnl --------------
dnl Check if we're accidentally using a cache from a different machine.
dnl Derive the system name, as a check for reusing the autoconf cache.
dnl
dnl If we've packaged config.guess and config.sub, run that (since it does a
dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow
dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
dnl which is useful in cross-compiles.
dnl
dnl Note: we would use $ac_config_sub, but that is one of the places where
dnl autoconf 2.5x broke compatibility with autoconf 2.13
AC_DEFUN([CF_CHECK_CACHE],
[
if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
ifelse([$1],,[AC_CANONICAL_HOST],[$1])
system_name="$host_os"
else
system_name="`(uname -s -r) 2>/dev/null`"
if test -z "$system_name" ; then
system_name="`(hostname) 2>/dev/null`"
fi
fi
test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
test -z "$system_name" && system_name="$cf_cv_system_name"
test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
if test ".$system_name" != ".$cf_cv_system_name" ; then
AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
AC_MSG_ERROR("Please remove config.cache and try again.")
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35
dnl -----------------
dnl Check if the given compiler is really clang. clang's C driver defines
dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
dnl not ignore some gcc options.
dnl
dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
dnl the wrappers for gcc and g++ warnings.
dnl
dnl $1 = GCC (default) or GXX
dnl $2 = CLANG_COMPILER (default)
dnl $3 = CFLAGS (default) or CXXFLAGS
AC_DEFUN([CF_CLANG_COMPILER],[
ifelse([$2],,CLANG_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments"
AC_TRY_COMPILE([],[
#ifdef __clang__
#else
make an error
#endif
],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
],[])
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57
dnl ---------------
dnl You can always use "make -n" to see the actual options, but it's hard to
dnl pick out/analyze warning messages when the compile-line is long.
dnl
dnl Sets:
dnl ECHO_LT - symbol to control if libtool is verbose
dnl ECHO_LD - symbol to prefix "cc -o" lines
dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
dnl SHOW_CC - symbol to put before explicit "cc -c" lines
dnl ECHO_CC - symbol to put before any "cc" line
dnl
AC_DEFUN([CF_DISABLE_ECHO],[
AC_MSG_CHECKING(if you want to see long compiling messages)
CF_ARG_DISABLE(echo,
[ --disable-echo do not display "compiling" commands],
[
ECHO_LT='--silent'
ECHO_LD='@echo linking [$]@;'
RULE_CC='@echo compiling [$]<'
SHOW_CC='@echo compiling [$]@'
ECHO_CC='@'
],[
ECHO_LT=''
ECHO_LD=''
RULE_CC=''
SHOW_CC=''
ECHO_CC=''
])
AC_MSG_RESULT($enableval)
AC_SUBST(ECHO_LT)
AC_SUBST(ECHO_LD)
AC_SUBST(RULE_CC)
AC_SUBST(SHOW_CC)
AC_SUBST(ECHO_CC)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03
dnl ----------------
dnl Combine no-leak checks with the libraries or tools that are used for the
dnl checks.
AC_DEFUN([CF_DISABLE_LEAKS],[
AC_REQUIRE([CF_WITH_DMALLOC])
AC_REQUIRE([CF_WITH_DBMALLOC])
AC_REQUIRE([CF_WITH_VALGRIND])
AC_MSG_CHECKING(if you want to perform memory-leak testing)
AC_ARG_ENABLE(leaks,
[ --disable-leaks test: free permanent memory, analyze leaks],
[if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi],
: ${with_no_leaks:=no})
AC_MSG_RESULT($with_no_leaks)
if test "$with_no_leaks" = yes ; then
AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
dnl to documentation, unrecognized directives cause older compilers to barf.
AC_DEFUN([CF_GCC_ATTRIBUTES],
[
if test "$GCC" = yes
then
cat > conftest.i < conftest.$ac_ext <&AC_FD_CC
case $cf_attribute in
(printf)
cf_printf_attribute=yes
cat >conftest.h <conftest.h <conftest.h <>confdefs.h
case $cf_attribute in
(noreturn)
AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
;;
(printf)
cf_value='/* nothing */'
if test "$cf_printf_attribute" != no ; then
cf_value='__attribute__((format(printf,fmt,var)))'
AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.])
fi
AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
;;
(scanf)
cf_value='/* nothing */'
if test "$cf_scanf_attribute" != no ; then
cf_value='__attribute__((format(scanf,fmt,var)))'
AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.])
fi
AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
;;
(unused)
AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
;;
esac
fi
done
else
fgrep define conftest.i >>confdefs.h
fi
rm -rf conftest*
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33
dnl --------------
dnl Find version of gcc
AC_DEFUN([CF_GCC_VERSION],[
AC_REQUIRE([AC_PROG_CC])
GCC_VERSION=none
if test "$GCC" = yes ; then
AC_MSG_CHECKING(version of $CC)
GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
AC_MSG_RESULT($GCC_VERSION)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_WARNINGS version: 32 updated: 2015/04/12 15:39:00
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
dnl
dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
dnl -Wredundant-decls (system headers make this too noisy)
dnl -Wtraditional (combines too many unrelated messages, only a few useful)
dnl -Wwrite-strings (too noisy, but should review occasionally). This
dnl is enabled for ncurses using "--enable-const".
dnl -pedantic
dnl
dnl Parameter:
dnl $1 is an optional list of gcc warning flags that a particular
dnl application might want to use, e.g., "no-unused" for
dnl -Wno-unused
dnl Special:
dnl If $with_ext_const is "yes", add a check for -Wwrite-strings
dnl
AC_DEFUN([CF_GCC_WARNINGS],
[
AC_REQUIRE([CF_GCC_VERSION])
CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
cat > conftest.$ac_ext <],[
#ifndef _XOPEN_SOURCE
make an error
#endif],
[cf_cv_gnu_source=no],
[cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_TRY_COMPILE([#include ],[
#ifdef _XOPEN_SOURCE
make an error
#endif],
[cf_cv_gnu_source=no],
[cf_cv_gnu_source=yes])
CPPFLAGS="$cf_save"
])
])
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00
dnl -----------------
dnl Check if the given compiler is really the Intel compiler for Linux. It
dnl tries to imitate gcc, but does not return an error when it finds a mismatch
dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
dnl
dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
dnl the wrappers for gcc and g++ warnings.
dnl
dnl $1 = GCC (default) or GXX
dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
dnl $3 = CFLAGS (default) or CXXFLAGS
AC_DEFUN([CF_INTEL_COMPILER],[
AC_REQUIRE([AC_CANONICAL_HOST])
ifelse([$2],,INTEL_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
case $host_os in
(linux*|gnu*)
AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
AC_TRY_COMPILE([],[
#ifdef __INTEL_COMPILER
#else
make an error
#endif
],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
cf_save_CFLAGS="$cf_save_CFLAGS -we147"
],[])
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
;;
esac
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MAKE_DOCS version: 4 updated: 2015/07/04 21:43:03
dnl ------------
dnl $1 = name(s) to generate rules for
dnl $2 = suffix of corresponding manpages used as input.
dnl
dnl This works best if called at the end of configure.in, following CF_WITH_MAN2HTML
define([CF_MAKE_DOCS],[
test -z "$cf_make_docs" && cf_make_docs=0
cf_output=makefile
test -f "$cf_output" || cf_output=Makefile
if test "$cf_make_docs" = 0
then
cat >>$cf_output <[\$]@
${GROFF_NOTE}.ps.pdf :
${GROFF_NOTE} ps2pdf [\$]*.ps
${GROFF_NOTE}
${GROFF_NOTE}.$2.ps :
${GROFF_NOTE} [\$](SHELL) -c "tbl [\$]*.$2 | groff -man" >[\$]@
${GROFF_NOTE}
${GROFF_NOTE}.$2.txt :
${GROFF_NOTE} GROFF_NO_SGR=stupid [\$](SHELL) -c "tbl [\$]*.$2 | nroff -Tascii -man | col -bx" >[\$]@
${MAN2HTML_NOTE}.$2.html :
${MAN2HTML_NOTE} ./${MAN2HTML_TEMP} [\$]* $2 man >[\$]@
CF_EOF
cf_make_docs=1
fi
for cf_name in $1
do
cat >>$cf_output <conftest
if test -f CONFTEST ; then
cf_cv_mixedcase=no
else
cf_cv_mixedcase=yes
fi
rm -f conftest CONFTEST
fi
])
test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MKSTEMP version: 9 updated: 2012/10/03 04:34:49
dnl ----------
dnl Check for a working mkstemp. This creates two files, checks that they are
dnl successfully created and distinct (AmigaOS apparently fails on the last).
AC_DEFUN([CF_MKSTEMP],[
AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
rm -rf conftest*
AC_TRY_RUN([
#include
#include
#include
#include
#include
int main()
{
char *tmpl = "conftestXXXXXX";
char name[2][80];
int n;
int result = 0;
int fd;
struct stat sb;
umask(077);
for (n = 0; n < 2; ++n) {
strcpy(name[n], tmpl);
if ((fd = mkstemp(name[n])) >= 0) {
if (!strcmp(name[n], tmpl)
|| stat(name[n], &sb) != 0
|| (sb.st_mode & S_IFMT) != S_IFREG
|| (sb.st_mode & 077) != 0) {
result = 1;
}
close(fd);
}
}
if (result == 0
&& !strcmp(name[0], name[1]))
result = 1;
${cf_cv_main_return:-return}(result);
}
],[cf_cv_func_mkstemp=yes
],[cf_cv_func_mkstemp=no
],[cf_cv_func_mkstemp=maybe])
])
if test "x$cf_cv_func_mkstemp" = xmaybe ; then
AC_CHECK_FUNC(mkstemp)
fi
if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
AC_DEFINE(HAVE_MKSTEMP,1,[Define to 1 if mkstemp() is available and working.])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
dnl ----------
dnl Write a debug message to config.log, along with the line number in the
dnl configure script.
AC_DEFUN([CF_MSG_LOG],[
echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00
dnl ------------------
dnl see CF_WITH_NO_LEAKS
AC_DEFUN([CF_NO_LEAKS_OPTION],[
AC_MSG_CHECKING(if you want to use $1 for testing)
AC_ARG_WITH($1,
[$2],
[AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
$4
])
: ${with_cflags:=-g}
: ${with_no_leaks:=yes}
with_$1=yes],
[with_$1=])
AC_MSG_RESULT(${with_$1:-no})
case .$with_cflags in
(.*-g*)
case .$CFLAGS in
(.*-g*)
;;
(*)
CF_ADD_CFLAGS([-g])
;;
esac
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57
dnl --------------
dnl Check the argument to see that it looks like a pathname. Rewrite it if it
dnl begins with one of the prefix/exec_prefix variables, and then again if the
dnl result begins with 'NONE'. This is necessary to work around autoconf's
dnl delayed evaluation of those symbols.
AC_DEFUN([CF_PATH_SYNTAX],[
if test "x$prefix" != xNONE; then
cf_path_syntax="$prefix"
else
cf_path_syntax="$ac_default_prefix"
fi
case ".[$]$1" in
(.\[$]\(*\)*|.\'*\'*)
;;
(..|./*|.\\*)
;;
(.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
;;
(.\[$]{*prefix}*|.\[$]{*dir}*)
eval $1="[$]$1"
case ".[$]$1" in
(.NONE/*)
$1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
;;
esac
;;
(.no|.NONE/*)
$1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
;;
(*)
ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_POPEN_TEST version: 5 updated: 2014/06/04 18:37:28
dnl -------------
dnl Check to ensure that our prototype for 'popen()' doesn't conflict
dnl with the system's (this is a problem on AIX and CLIX).
dnl
AC_DEFUN([CF_POPEN_TEST],
[AC_MSG_CHECKING(for conflicting prototype for popen)
AC_CACHE_VAL(ac_cv_td_popen,
AC_TRY_LINK([
#include
#include "system.h"
#if defined(popen) || defined(pclose)
make an error
#else
extern int pclose (FILE *p);
extern FILE *popen (const char *c, const char *m);
#endif
],,
ac_cv_td_popen=no,
ac_cv_td_popen=yes))
AC_MSG_RESULT($ac_cv_td_popen)
if test $ac_cv_td_popen = yes; then
AC_DEFINE(HAVE_POPEN_PROTOTYPE,[1],[Conflicting popen prototype])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_POSIX_C_SOURCE version: 9 updated: 2015/04/12 15:39:00
dnl -----------------
dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
dnl
dnl POSIX.1-1990 _POSIX_SOURCE
dnl POSIX.1-1990 and _POSIX_SOURCE and
dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2
dnl Bindings Option
dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L
dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L
dnl X/Open 2000 _POSIX_C_SOURCE=200112L
dnl
dnl Parameters:
dnl $1 is the nominal value for _POSIX_C_SOURCE
AC_DEFUN([CF_POSIX_C_SOURCE],
[
cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
cf_save_CFLAGS="$CFLAGS"
cf_save_CPPFLAGS="$CPPFLAGS"
CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
CF_MSG_LOG(if the symbol is already defined go no further)
AC_TRY_COMPILE([#include ],[
#ifndef _POSIX_C_SOURCE
make an error
#endif],
[cf_cv_posix_c_source=no],
[cf_want_posix_source=no
case .$cf_POSIX_C_SOURCE in
(.[[12]]??*)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
;;
(.2)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
cf_want_posix_source=yes
;;
(.*)
cf_want_posix_source=yes
;;
esac
if test "$cf_want_posix_source" = yes ; then
AC_TRY_COMPILE([#include ],[
#ifdef _POSIX_SOURCE
make an error
#endif],[],
cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE")
fi
CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
CFLAGS="$cf_trim_CFLAGS"
CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
CF_MSG_LOG(if the second compile does not leave our definition intact error)
AC_TRY_COMPILE([#include ],[
#ifndef _POSIX_C_SOURCE
make an error
#endif],,
[cf_cv_posix_c_source=no])
CFLAGS="$cf_save_CFLAGS"
CPPFLAGS="$cf_save_CPPFLAGS"
])
])
if test "$cf_cv_posix_c_source" != no ; then
CFLAGS="$cf_trim_CFLAGS"
CPPFLAGS="$cf_trim_CPPFLAGS"
CF_ADD_CFLAGS($cf_cv_posix_c_source)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58
dnl ----------
dnl standard check for CC, plus followup sanity checks
dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
AC_DEFUN([CF_PROG_CC],[
ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
CF_GCC_VERSION
CF_ACVERSION_CHECK(2.52,
[AC_PROG_CC_STDC],
[CF_ANSI_CC_REQD])
CF_CC_ENV_FLAGS
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PROG_GROFF version: 2 updated: 2015/07/04 11:16:27
dnl -------------
dnl Check if groff is available, for cases (such as html output) where nroff
dnl is not enough.
AC_DEFUN([CF_PROG_GROFF],[
AC_PATH_PROG(GROFF_PATH,groff,no)
AC_PATH_PROG(NROFF_PATH,nroff,no)
if test "x$GROFF_PATH" = xno
then
NROFF_NOTE=
GROFF_NOTE="#"
else
NROFF_NOTE="#"
GROFF_NOTE=
fi
AC_SUBST(GROFF_NOTE)
AC_SUBST(NROFF_NOTE)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
dnl ------------
AC_DEFUN([CF_PROG_LINT],
[
AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint)
AC_SUBST(LINT_OPTS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
dnl ----------------
dnl Remove all -U and -D options that refer to the given symbol from a list
dnl of C compiler options. This works around the problem that not all
dnl compilers process -U and -D options from left-to-right, so a -U option
dnl cannot be used to cancel the effect of a preceding -D option.
dnl
dnl $1 = target (which could be the same as the source variable)
dnl $2 = source (including '$')
dnl $3 = symbol to remove
define([CF_REMOVE_DEFINE],
[
$1=`echo "$2" | \
sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \
-e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'`
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SIZE_T version: 5 updated: 2013/12/05 19:11:11
dnl ---------
dnl On both Ultrix and CLIX, I find size_t defined in
AC_DEFUN([CF_SIZE_T],
[
AC_MSG_CHECKING(for size_t in or )
AC_CACHE_VAL(cf_cv_type_size_t,[
AC_TRY_COMPILE([
#include
#ifdef STDC_HEADERS
#include
#include
#endif
#include ],
[size_t x],
[cf_cv_type_size_t=yes],
[cf_cv_type_size_t=no])
])
AC_MSG_RESULT($cf_cv_type_size_t)
test $cf_cv_type_size_t = no && AC_DEFINE(size_t, unsigned, [Define to type if size_t not declared])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50
dnl -------------------
dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
dnl can define it successfully.
AC_DEFUN([CF_TRY_XOPEN_SOURCE],[
AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
AC_TRY_COMPILE([
#include
#include
#include
],[
#ifndef _XOPEN_SOURCE
make an error
#endif],
[cf_cv_xopen_source=no],
[cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
AC_TRY_COMPILE([
#include
#include
#include
],[
#ifdef _XOPEN_SOURCE
make an error
#endif],
[cf_cv_xopen_source=no],
[cf_cv_xopen_source=$cf_XOPEN_SOURCE])
CPPFLAGS="$cf_save"
])
])
if test "$cf_cv_xopen_source" != no ; then
CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
CF_ADD_CFLAGS($cf_temp_xopen_source)
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
dnl --------
dnl Make an uppercase version of a variable
dnl $1=uppercase($2)
AC_DEFUN([CF_UPPER],
[
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
dnl ----------
dnl Use AC_VERBOSE w/o the warnings
AC_DEFUN([CF_VERBOSE],
[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
CF_MSG_LOG([$1])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
dnl ----------------
dnl Configure-option for dbmalloc. The optional parameter is used to override
dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
AC_DEFUN([CF_WITH_DBMALLOC],[
CF_NO_LEAKS_OPTION(dbmalloc,
[ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
[USE_DBMALLOC])
if test "$with_dbmalloc" = yes ; then
AC_CHECK_HEADER(dbmalloc.h,
[AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
dnl ---------------
dnl Configure-option for dmalloc. The optional parameter is used to override
dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
AC_DEFUN([CF_WITH_DMALLOC],[
CF_NO_LEAKS_OPTION(dmalloc,
[ --with-dmalloc test: use Gray Watson's dmalloc library],
[USE_DMALLOC])
if test "$with_dmalloc" = yes ; then
AC_CHECK_HEADER(dmalloc.h,
[AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_MAN2HTML version: 4 updated: 2015/05/03 19:10:48
dnl ----------------
dnl Check for man2html and groff. Optionally prefer man2html over groff.
dnl Generate a shell script which hides the differences between the two.
dnl
dnl We name that "man2html.tmp".
dnl
dnl The shell script can be removed later, e.g., using "make distclean".
AC_DEFUN([CF_WITH_MAN2HTML],[
AC_REQUIRE([CF_PROG_GROFF])
AC_MSG_CHECKING(for program to convert manpage to html)
AC_ARG_WITH(man2html,
[ --with-man2html=XXX use XXX rather than groff],
[cf_man2html=$withval],
[cf_man2html=$GROFF_PATH])
cf_with_groff=no
case $cf_man2html in
(yes)
AC_MSG_RESULT(man2html)
AC_PATH_PROG(cf_man2html,man2html,no)
;;
(no|groff|*/groff*)
cf_with_groff=yes
cf_man2html=$GROFF_PATH
AC_MSG_RESULT($cf_man2html)
;;
(*)
AC_MSG_RESULT($cf_man2html)
;;
esac
MAN2HTML_TEMP="man2html.tmp"
cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <conftest.in <conftest.out
cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`
cf_man2html_top=`expr $cf_man2html_1st - 2`
cf_man2html_bot=`wc -l conftest.out |sed -e 's/[[^0-9]]//g'`
cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top`
cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot"
AC_MSG_RESULT($cf_man2html_top_bot)
AC_MSG_CHECKING(for pagesize to use)
for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
cat >>conftest.in <conftest.out
cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`
test -z "$cf_man2html_page" && cf_man2html_page=99999
test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999
rm -rf conftest*
AC_MSG_RESULT($cf_man2html_page)
cat >>$MAN2HTML_TEMP < and other headers which use u_int / u_short types
cf_XOPEN_SOURCE=
CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
;;
(netbsd*)
cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
;;
(openbsd[[4-9]]*)
# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
cf_xopen_source="-D_BSD_SOURCE"
cf_XOPEN_SOURCE=600
;;
(openbsd*)
# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
;;
(osf[[45]]*)
cf_xopen_source="-D_OSF_SOURCE"
;;
(nto-qnx*)
cf_xopen_source="-D_QNX_SOURCE"
;;
(sco*)
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
(solaris2.*)
cf_xopen_source="-D__EXTENSIONS__"
cf_cv_xopen_source=broken
;;
(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
cf_XOPEN_SOURCE=
cf_POSIX_C_SOURCE=
;;
(*)
CF_TRY_XOPEN_SOURCE
CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
;;
esac
if test -n "$cf_xopen_source" ; then
CF_ADD_CFLAGS($cf_xopen_source,true)
fi
dnl In anything but the default case, we may have system-specific setting
dnl which is still not guaranteed to provide all of the entrypoints that
dnl _XOPEN_SOURCE would yield.
if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
AC_MSG_CHECKING(if _XOPEN_SOURCE really is set)
AC_TRY_COMPILE([#include ],[
#ifndef _XOPEN_SOURCE
make an error
#endif],
[cf_XOPEN_SOURCE_set=yes],
[cf_XOPEN_SOURCE_set=no])
AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
if test $cf_XOPEN_SOURCE_set = yes
then
AC_TRY_COMPILE([#include ],[
#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
make an error
#endif],
[cf_XOPEN_SOURCE_set_ok=yes],
[cf_XOPEN_SOURCE_set_ok=no])
if test $cf_XOPEN_SOURCE_set_ok = no
then
AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
fi
else
CF_TRY_XOPEN_SOURCE
fi
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_YACC_ERROR version: 7 updated: 2014/01/01 10:38:58
dnl -------------
dnl Test the supplied version of yacc to see which (if any) of the
dnl error-reporting enhancements will work.
dnl
dnl Also, test the preprocessor to see if it will handle non-C files.
dnl (gcc 2.5.8 doesn't).
dnl
AC_DEFUN([CF_YACC_ERROR],
[
rm -f yacctest.y
cat >yacctest.y <
#include
#include "yyerror.c"
static void yaccError(const char *s) { ${cf_cv_main_return:-return}(0); }
int yylex (void)
{ return 1; }
%}
%%
dummy
: /* empty */
| error '.'
;
%%
EOF
AC_MSG_CHECKING(if $CPP can handle only .c files)
$CPP yacctest.y >yacctest.out 2>/dev/null
if test ! -s yacctest.out
then
AC_DEFINE(CPP_DOES_ONLY_C_FILES)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
$YACC yacctest.y
rm -f yacctest.*
td_incl='#include "y.tab.c"'
for COND in BISON_HAS_YYTNAME YACC_HAS_YYTOKS YACC_HAS_YYTOKS_2 YACC_HAS_YYNAME
do
AC_MSG_CHECKING(for error-reporting with $COND)
AC_CACHE_VAL(ac_cv_$COND,
AC_TRY_LINK([
#define $COND 1
#define YYDEBUG 1
$td_incl],,
eval 'ac_cv_'$COND'=yes',
eval 'ac_cv_'$COND'=no'))
eval 'td_result=$ac_cv_'$COND
AC_MSG_RESULT($td_result)
if test $td_result = yes; then
AC_DEFINE_UNQUOTED($COND)
break
fi
done
rm -f y.tab.c
])dnl
cproto-4.7m/system.h 0000644 0001751 0000144 00000010371 11510150272 013257 0 ustar tom users /* $Id: system.h,v 4.13 2011/01/02 19:23:38 tom Exp $
*
* cproto configuration and system dependencies
*/
#ifndef SYSTEM_H
#define SYSTEM_H
#include
#include
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
/* Watcom C++ predefines __DOS__ when the target platform is MS-DOS */
/* Borland C++ for MS-DOS predefines __MSDOS__ */
#if defined(__DOS__) || defined(__MSDOS__)
#ifndef MSDOS
#define MSDOS
#endif
#endif
/* Watcom C++ predefines __OS2__ when the target platform is OS/2 */
#ifdef __OS2__
#ifndef OS2
#define OS2
#endif
#endif
/* Watcom C++ predefines __NT__ when the target platform is Windows NT */
#ifdef __NT__
#ifndef WIN32
#define WIN32
#endif
#endif
/* Turbo C preprocessor */
#ifdef __TURBOC__
#define YY_READ_BUF_SIZE 256 /* patch */
#define HAVE_TMPFILE 1
#define HAVE_GETOPT_H 1 /* use the one from porting-directory */
#include /* declares 'read()' for flex */
#endif
#ifdef TURBO_CPP
#define CPP "cpp -P-"
#endif
/* EMX C preprocessor */
#ifdef __EMX__
#ifndef CPP
#define CPP "cpp"
#endif
#endif
/* Watcom C preprocessor */
#ifdef __WATCOMC__
#ifndef CPP
#define CPP "wcl386 /p"
#endif
#define HAVE_POPEN_PROTOTYPE 1
#define popen _popen
#define pclose _pclose
#define HAVE_TMPFILE 1
#endif
/* Microsoft C preprocessor */
#ifdef M_I86
#ifndef CPP
#define CPP "cl /E /nologo"
#endif
#define HAVE_TMPFILE 1
#endif
/* Vax C */
#ifdef vms
#ifndef CPP
#define CPP "cc /preprocess_only=%s"
#endif
#define unlink remove
#define HAVE_TMPFILE 1
#define HAVE_GETOPT_H 1
#define USE_flex 1
#define CURRENT_DIR "[]"
#endif
/* Set configuration parameters for systems on which we cannot run autoconf.
* (Assumes Posix unless overridden).
*/
#ifndef HAVE_GETOPT_H
#define HAVE_GETOPT_H 0
#endif
#ifndef HAVE_LIBDBMALLOC
#define HAVE_LIBDBMALLOC 0
#endif
#ifndef HAVE_LIBDMALLOC
#define HAVE_LIBDMALLOC 0
#endif
#ifndef HAVE_STDLIB_H
#define HAVE_STDLIB_H 1
#endif
#ifndef HAVE_STRING_H
#define HAVE_STRING_H 1
#endif
#ifndef HAVE_STRSTR
#define HAVE_STRSTR 1
#endif
#ifndef HAVE_UNISTD_H
#define HAVE_UNISTD_H 0
#endif
#ifndef STDC_HEADERS
#define STDC_HEADERS 1
#endif
/* Default C preprocessor on UNIX systems */
#ifndef MSDOS
#ifndef CPP
#define CPP "/lib/cpp"
#endif
#endif
/* maximum include file nesting (for parsing externs) */
#ifndef MAX_INC_DEPTH
#define MAX_INC_DEPTH 999999
#endif
/* string denoting current-directory, for includes */
#ifndef CURRENT_DIR
#define CURRENT_DIR "."
#endif
/* maximum text buffer size (for tokens) */
#ifndef MAX_TEXT_SIZE
#define MAX_TEXT_SIZE 4096
#endif
#if HAVE_STDLIB_H
#include
#else
extern char *malloc (size_t n);
extern char *realloc (char *p, size_t n);
extern char *getenv (const char *v);
#endif
/* Declare argument for exit() function */
#ifdef vms
#include
#define EXIT_SUCCESS (STS$M_INHIB_MSG | STS$K_SUCCESS)
#define EXIT_FAILURE (STS$M_INHIB_MSG | STS$K_ERROR)
#else
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS (0)
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE (1)
#endif
#endif /* vms */
#if HAVE_UNISTD_H
#include
#endif
#if STDC_HEADERS || HAVE_STRING_H
# include
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
# if !STDC_HEADERS && HAVE_MEMORY_H
# include
# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
#else /* not STDC_HEADERS and not HAVE_STRING_H */
# include
# define strchr index
# define strrchr rindex
extern char *strstr (const char *s, const char *p);
/* memory.h and strings.h conflict on some systems. */
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
/*
* The DOALLOC symbol controls whether we compile in the simple memory tests
* in 'trace.c' (use dbmalloc for more rigorous testing).
*/
#ifdef DOALLOC
#include
#endif /* DOALLOC */
/*
* Lint libraries are useful only on systems that are likely to have lint.
* The OPT_LINTLIBRARY symbol controls whether we compile in the lint library
* support.
*/
#ifndef OPT_LINTLIBRARY
# define OPT_LINTLIBRARY 0
#endif
#if BISON_HAS_YYTNAME || YACC_HAS_YYTOKS || YACC_HAS_YYTOKS_2 || YACC_HAS_YYNAME
# define YYDEBUG 1
#endif
#if HAVE_LIBDMALLOC
#include /* Gray Watson's library */
#endif
#if HAVE_LIBDBMALLOC
#include /* Conor Cahill's library */
#endif
#endif /* SYSTEM_H */
cproto-4.7m/install-sh 0000755 0001751 0000144 00000015723 07762207755 013623 0 ustar tom users #! /bin/sh
#
# install - install a program, script, or datafile
#
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd=$cpprog
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "$0: no input file specified" >&2
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "$0: no destination specified" >&2
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d "$dst" ]
then
dst=$dst/`basename "$src"`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp=$pathcomp$1
shift
if [ ! -d "$pathcomp" ] ;
then
$mkdirprog "$pathcomp"
else
:
fi
pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename "$dst"`
else
dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename "$dst"`
else
:
fi
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
rmtmp=$dstdir/#rm.$$#
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name
$doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# Now remove or move aside any old file at destination location. We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons. In this case, the final cleanup
# might fail but the new file should still install successfully.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}
cproto-4.7m/semantic.h 0000644 0001751 0000144 00000003415 11510145747 013552 0 ustar tom users /* $Id: semantic.h,v 4.6 2011/01/02 19:03:03 tom Exp $
*
* Declarations of semantic action routines
*/
#ifdef __cplusplus
extern "C" {
#endif
#include
extern void new_decl_spec (
DeclSpec *decl_spec, const char *text, long offset, int flags);
extern void free_decl_spec (
DeclSpec *decl_spec);
extern void join_decl_specs (
DeclSpec *result, DeclSpec *a, DeclSpec *b);
extern void check_untagged (
DeclSpec *decl_spec);
extern Declarator *new_declarator (
const char *text, const char *name, long offset);
extern void free_declarator (
Declarator *d);
extern void new_decl_list (
DeclaratorList *decl_list, Declarator *declarator);
extern void free_decl_list (
DeclaratorList *decl_list);
extern void add_decl_list (
DeclaratorList *to, DeclaratorList *from, Declarator *declarator);
extern Parameter *new_parameter (
DeclSpec *decl_spec, Declarator *declarator);
extern void free_parameter (
Parameter *param);
extern void new_param_list (
ParameterList *param_list, Parameter *param);
extern void free_param_list (
ParameterList *param_list);
extern void add_param_list (
ParameterList *to, ParameterList *from, Parameter *param);
extern void new_ident_list (
ParameterList *param_list);
extern void add_ident_list (
ParameterList *to, ParameterList *from, const char *name);
extern void set_param_types (
ParameterList *params, DeclSpec *decl_spec, DeclaratorList *declarators);
extern void gen_declarations (
DeclSpec *decl_spec, DeclaratorList *decl_list);
extern void gen_prototype (
DeclSpec *decl_spec, Declarator *declarator);
extern void gen_func_declarator (
Declarator *declarator);
extern void gen_func_definition (
DeclSpec *decl_spec, Declarator *declarator);
#ifdef __cplusplus
}
#endif
cproto-4.7m/semantic.c 0000644 0001751 0000144 00000072764 11510147473 013560 0 ustar tom users /* $Id: semantic.c,v 4.15 2011/01/02 19:17:15 tom Exp $
*
* Semantic actions executed by the parser of the
* C function prototype generator.
*/
#include
#if OPT_LINTLIBRARY
#define putParameter(fp,p,f,n,c) put_parameter(fp, p, f, n, c)
#else
#define putParameter(fp,p,f,n,c) put_parameter(fp, p, c)
#endif
static void put_declarator(FILE *outf, Declarator * declarator, int commented);
/* Head function declarator in a prototype or function definition */
static Declarator *func_declarator;
/* Role of the function declarator
* FUNC_PROTO if it is the declarator in a function prototype.
* FUNC_DEF if it is the declarator in a function definition.
*/
static int where;
/* Output format to use */
static int format;
/* Function-parameter level, used to simplify logic that comments/suppresses
* function parameters in the output.
*/
static int nestedParams;
/* Initialize a new declaration specifier part.
*/
void
new_decl_spec(DeclSpec * decl_spec, const char *text, long offset, int flags)
{
#if OPT_LINTLIBRARY
if (lintLibrary()) {
if (!strcmp(text, "register"))
text = "";
}
#endif
decl_spec->text = xstrdup(text);
decl_spec->begin = offset;
decl_spec->flags = (unsigned short) flags;
}
/* Free storage used by a declaration specifier part.
*/
void
free_decl_spec(DeclSpec * decl_spec)
{
free(decl_spec->text);
}
/* Create a new string by joining two strings with a space between them.
* Return a pointer to the resultant string.
* If out of memory, output an error message and exit.
*/
static char *
concat_string(char *a, char *b)
{
char *result;
result = (char *) xmalloc(strlen(a) + strlen(b) + 2);
strcpy(result, a);
strcat(result, " ");
strcat(result, b);
return result;
}
#if OPT_LINTLIBRARY
/* concatenate w/o embedded blank */
static char *
glue_strings(char *a, char *b)
{
char *result;
result = (char *) xmalloc(strlen(a) + strlen(b) + 2);
strcpy(result, a);
strcat(result, b);
return result;
}
#endif
/* Append two declaration specifier parts together.
*/
void
join_decl_specs(DeclSpec * result, DeclSpec * a, DeclSpec * b)
{
result->text = concat_string(a->text, b->text);
result->flags = a->flags | b->flags;
result->begin = a->begin;
/* don't free the old text value - this is only used in one case where
* the 'a' parameter holds the same data as 'result' did.
*/
}
/* Output an error message if the declaration specifier is an untagged
* struct, union or enum.
*/
void
check_untagged(DeclSpec * decl_spec)
{
if (strstr(decl_spec->text, "struct {}") != NULL) {
put_error();
fputs("untagged struct declaration\n", stderr);
} else if (strstr(decl_spec->text, "union {}") != NULL) {
put_error();
fputs("untagged union declaration\n", stderr);
} else if (strstr(decl_spec->text, "enum {}") != NULL) {
put_error();
fputs("untagged enum declaration\n", stderr);
}
}
/* Allocate and initialize a declarator.
*/
Declarator *
new_declarator(const char *text, const char *name, long offset)
{
Declarator *d;
d = NEW(Declarator);
d->text = xstrdup(text);
d->name = xstrdup(name);
d->begin = offset;
d->begin_comment = d->end_comment = 0;
d->func_def = FUNC_NONE;
new_ident_list(&d->params);
d->head = d;
d->func_stack = NULL;
d->pointer = FALSE;
return d;
}
/* Free storage used by a declarator.
*/
void
free_declarator(Declarator * d)
{
free(d->text);
free(d->name);
free_param_list(&d->params);
if (d->func_stack != NULL)
free_declarator(d->func_stack);
free(d);
}
/* Initialize a declarator list and add the given declarator to it.
*/
void
new_decl_list(DeclaratorList * decl_list, Declarator * declarator)
{
decl_list->first = decl_list->last = declarator;
declarator->next = NULL;
}
/* Free storage used by the declarators in the declarator list.
*/
void
free_decl_list(DeclaratorList * decl_list)
{
Declarator *d, *next;
d = decl_list->first;
while (d != NULL) {
next = d->next;
free_declarator(d);
d = next;
}
}
/* Add the declarator to the declarator list.
*/
void
add_decl_list(DeclaratorList * to, DeclaratorList * from, Declarator * declarator)
{
to->first = from->first;
from->last->next = declarator;
to->last = declarator;
to->last->next = NULL;
}
/* Create a new parameter structure.
*/
Parameter *
new_parameter(DeclSpec * decl_spec, Declarator * declarator)
{
Parameter *param;
param = NEW(Parameter);
if (decl_spec == NULL) {
new_decl_spec(¶m->decl_spec, "", 0L, DS_NONE);
} else {
param->decl_spec = *decl_spec;
}
if (declarator == NULL) {
declarator = new_declarator("", "", 0L);
}
param->declarator = declarator;
param->comment = NULL;
return param;
}
/* Free the storage used by the parameter.
*/
void
free_parameter(Parameter * param)
{
free_decl_spec(¶m->decl_spec);
free_declarator(param->declarator);
if (param->comment != NULL)
free(param->comment);
free(param);
}
/* Return TRUE if the parameter is void.
*/
static boolean
is_void_parameter(Parameter * p)
{
return (boolean) ((p == NULL) ||
(strcmp(p->decl_spec.text, "void") == 0 &&
p->declarator->text[0] == '\0'));
}
/* Initialize a list of function parameters.
*/
void
new_param_list(ParameterList * param_list, Parameter * param)
{
param_list->first = param_list->last = param;
param->next = NULL;
param_list->begin_comment = param_list->end_comment = 0;
param_list->comment = NULL;
}
/* Free storage used by the elements in the function parameter list.
*/
void
free_param_list(ParameterList * param_list)
{
Parameter *p, *next;
p = param_list->first;
while (p != NULL) {
next = p->next;
free_parameter(p);
p = next;
}
if (param_list->comment != NULL)
free(param_list->comment);
}
/* Add the parameter to the function parameter list.
*/
void
add_param_list(ParameterList * to, ParameterList * from, Parameter * param)
{
to->first = from->first;
from->last->next = param;
to->last = param;
param->next = NULL;
}
/* Initialize an empty list of function parameter names.
*/
void
new_ident_list(ParameterList * param_list)
{
param_list->first = param_list->last = NULL;
param_list->begin_comment = param_list->end_comment = 0;
param_list->comment = NULL;
}
/* Add an item to the list of function parameter declarations but set only
* the parameter name field.
*/
void
add_ident_list(ParameterList * to, ParameterList * from, const char *name)
{
Parameter *p;
Declarator *declarator;
declarator = new_declarator(name, name, 0L);
p = new_parameter((DeclSpec *) 0, declarator);
to->first = from->first;
if (to->first == NULL) {
to->first = p;
} else {
from->last->next = p;
}
to->last = p;
p->next = NULL;
}
/* Search the list of parameters for a matching parameter name.
* Return a pointer to the matching parameter or NULL if not found.
*/
static Parameter *
search_parameter_list(ParameterList * params, char *name)
{
Parameter *p;
for (p = params->first; p != NULL; p = p->next) {
if (strcmp(p->declarator->name, name) == 0)
return p;
}
return (Parameter *) NULL;
}
/* For each name in the declarator list , set the declaration
* specifier part of the parameter in having the same name.
* This is also where we promote formal parameters. Parameters of type
* "char", "unsigned char", "short", or "unsigned short" are promoted to
* "int". Parameters of type "float" are promoted to "double".
*/
void
set_param_types(ParameterList * params, DeclSpec * decl_spec, DeclaratorList
* declarators)
{
Declarator *d;
Parameter *p;
const char *decl_spec_text;
for (d = declarators->first; d != NULL; d = d->next) {
/* Search the parameter list for a matching name. */
if ((p = search_parameter_list(params, d->name)) == NULL) {
put_error();
fprintf(stderr, "declared argument \"%s\" is missing\n", d->name);
} else {
decl_spec_text = decl_spec->text;
if (promote_param && strcmp(d->text, d->name) == 0) {
if (decl_spec->flags & (DS_CHAR | DS_SHORT))
decl_spec_text = "int";
else if (decl_spec->flags & DS_FLOAT)
decl_spec_text = "double";
}
free(p->decl_spec.text);
p->decl_spec.text = xstrdup(decl_spec_text);
free_declarator(p->declarator);
p->declarator = d;
}
}
}
/* Output a function parameter.
*/
static int
put_parameter(FILE *outf,
Parameter * p,
#if OPT_LINTLIBRARY
int name_only, /* nonzero if we only show the parameter name */
int count, /* index in parameter list if we haven't names */
#endif
int commented) /* comment-delimiters already from higher level */
{
const char *s2;
char *s;
char gap = ' ';
#if OPT_LINTLIBRARY
if (name_only) {
s = p->declarator->name;
if (lintLibrary()) {
while (*s == '*')
s++;
if (*s == '\0' && !is_void_parameter(p))
s = supply_parm(count);
}
put_string(outf, s); /* ... remainder of p->declarator.name */
return (TRUE);
}
#endif
s2 = p->decl_spec.text;
#if OPT_LINTLIBRARY
if (lintLibrary()) {
if (is_void_parameter(p))
return (FALSE);
indent(outf);
if (knrLintLibrary() && !*s2)
s2 = "int";
if (strlen(s2) < 8)
gap = '\t';
}
#endif
put_string(outf, s2);
#if OPT_LINTLIBRARY
if (lintLibrary()) {
char *t, *u;
s = p->declarator->text;
while (*s == '*')
s++;
if (*s == '\0') {
u = p->declarator->text;
p->declarator->text = glue_strings(u, supply_parm(count));
free(u);
} else if (p->declarator->name[0] == '\0') {
if ((t = strstr(s, "%s")) != 0) {
int parenthesized = FALSE;
Declarator *q;
free(p->declarator->name);
p->declarator->name = xstrdup(supply_parm(count));
for (q = p->declarator; q != 0; q = q->func_stack) {
if (q->func_def == FUNC_NONE) {
if (!strcmp(q->text, "(*)")) {
char temp[20];
sprintf(temp, "(*%s)", p->declarator->name);
free(q->text);
q->text = xstrdup(temp);
parenthesized = TRUE;
} else {
free(q->text);
q->text = xstrdup(p->declarator->name);
}
break;
}
}
if (!parenthesized) {
if (strchr(t, PAREN_L) != 0) { /* e.g., "*%s()" */
t = p->declarator->text;
u = (char *) xmalloc(strlen(t) + 3);
(void) sprintf(u, "(%s)", t);
p->declarator->text = u;
free(t);
}
}
} else { /* e.g., s is "[20]" for "char [20]" parameter */
/* ...or something like "* const *" */
while (*s != '\0' && *s != SQUARE_L)
s++;
u = xstrdup(s); /* the "[20]" */
*s = '\0';
if (s != p->declarator->text) {
s = glue_strings(p->declarator->text, supply_parm(count));
} else {
s = xstrdup(supply_parm(count));
}
t = p->declarator->text;
p->declarator->text = glue_strings(s, u);
free(u);
free(s);
free(t);
}
}
}
#endif
if (p->declarator->text[0] != '\0') {
if (strcmp(p->declarator->text, ELLIPSIS) == 0) {
put_string(outf, ELLIPSIS);
} else {
if (proto_style != PROTO_ABSTRACT || proto_comments
|| where != FUNC_PROTO
|| strcmp(p->declarator->text, p->declarator->name) != 0)
put_char(outf, gap);
put_declarator(outf, p->declarator, commented);
}
}
return (TRUE);
}
/* Output a parameter list.
*/
static void
put_param_list(FILE *outf, Declarator * declarator, int commented)
{
#if OPT_LINTLIBRARY
int count = 0;
#endif
Parameter *p;
int f;
int hide_it = (where == FUNC_PROTO) && (proto_style == PROTO_TRADITIONAL);
int do_cmt = proto_comments && hide_it;
p = declarator->params.first;
if (hide_it && !do_cmt) {
;
} else if (is_void_parameter(p)) {
if (do_cmt) {
if (!commented)
put_string(outf, COMMENT_BEGIN);
put_string(outf, "void");
if (!commented)
put_string(outf, COMMENT_END);
} else if (!hide_it)
#if OPT_LINTLIBRARY
if (!knrLintLibrary())
#endif
put_string(outf, "void");
} else {
f = (declarator == func_declarator) ? format : FMT_OTHER;
#if OPT_LINTLIBRARY
if (where == FUNC_PROTO
&& knrLintLibrary()
&& (func_declarator != declarator)) {
do_cmt = TRUE; /* patch: shouldn't have gotten here at all */
}
#endif
if (where == FUNC_DEF && declarator->params.comment != NULL)
put_string(outf, declarator->params.comment);
else if (do_cmt && !commented)
put_string(outf, COMMENT_BEGIN);
put_string(outf, fmt[f].first_param_prefix);
(void) putParameter(outf, p, knrLintLibrary(), ++count, commented);
while (p->next != NULL) {
#if OPT_LINTLIBRARY
if (lint_ellipsis(p->next))
break;
#endif
put_char(outf, ',');
if (where == FUNC_DEF && p->comment != NULL)
put_string(outf, p->comment);
p = p->next;
put_string(outf, fmt[f].middle_param_prefix);
(void) putParameter(outf, p, knrLintLibrary(), ++count, commented);
}
if (where == FUNC_DEF && p->comment != NULL)
put_string(outf, p->comment);
else if (do_cmt && !commented)
put_string(outf, COMMENT_END);
put_string(outf, fmt[f].last_param_suffix);
}
}
/* Output function parameters.
*/
static void
put_parameters(FILE *outf, Declarator * declarator, int commented)
{
Parameter *p;
nestedParams++;
if (where == FUNC_DEF && func_style == FUNC_TRADITIONAL) {
/* Output parameter name list for traditional function definition. */
p = declarator->params.first;
/* Output parameter name list only for head function declarator. */
if (!is_void_parameter(p) && declarator == func_declarator) {
put_string(outf, fmt[format].first_param_prefix);
put_string(outf, p->declarator->name);
p = p->next;
while (p != NULL && strcmp(p->declarator->text, ELLIPSIS) != 0) {
put_char(outf, ',');
put_string(outf, fmt[format].middle_param_prefix);
put_string(outf, p->declarator->name);
p = p->next;
}
put_string(outf, fmt[format].last_param_suffix);
}
} else {
/* Output parameter type list. */
if (where == FUNC_PROTO && proto_style == PROTO_TRADITIONAL &&
declarator == func_declarator) {
if (proto_comments) {
put_string(outf, COMMENT_BEGIN);
put_param_list(outf, declarator, TRUE);
put_string(outf, COMMENT_END);
}
} else if (func_style != FUNC_NONE || proto_style != PROTO_NONE) {
#if OPT_LINTLIBRARY
if (!knrLintLibrary() || nestedParams <= 1)
#endif
put_param_list(outf, declarator, commented);
}
}
nestedParams--;
}
/* Output a function declarator.
*/
static void
put_func_declarator(FILE *outf, Declarator * declarator, int commented)
{
char *s, *t, *decl_text;
int f;
int saveNest = nestedParams;
/* Output declarator text before function declarator place holder. */
if ((s = strstr(declarator->text, "%s")) == NULL)
return;
*s = '\0';
put_string(outf, declarator->text);
/* Substitute place holder with function declarator. */
if (declarator->func_stack->func_def == FUNC_NONE) {
decl_text = declarator->func_stack->text;
if (declarator->name[0] == '\0') {
put_string(outf, decl_text);
} else {
int star;
/* Output the declarator text before the declarator name. */
if ((t = strstr(decl_text, declarator->name)) == NULL)
return;
*t = '\0';
star = ((t != decl_text) && (t[-1] == '*'));
put_string(outf, decl_text);
*t = declarator->name[0];
/* Output the declarator prefix before the name. */
f = (declarator == func_declarator) ? format : FMT_OTHER;
if (strcmp(fmt[f].declarator_prefix, " ") != 0)
put_string(outf, fmt[f].declarator_prefix);
/* Output the declarator name. */
if (where == FUNC_PROTO && proto_style == PROTO_ABSTRACT &&
declarator != func_declarator) {
if (proto_comments) {
if (star)
put_char(outf, ' ');
put_string(outf, COMMENT_BEGIN);
put_string(outf, declarator->name);
put_string(outf, COMMENT_END);
}
} else {
put_string(outf, declarator->name);
}
/* Output the remaining declarator text. */
put_string(outf, t + strlen(declarator->name));
/* Output the declarator suffix. */
put_string(outf, fmt[f].declarator_suffix);
}
} else {
put_func_declarator(outf, declarator->func_stack, commented);
nestedParams = 2; /* e.g., "void (*signal(p1, p2))()" */
}
*s = '%';
s += 2;
/* Output declarator text up to but before parameters place holder. */
if ((t = strstr(s, "()")) == NULL)
return;
*t = '\0';
put_string(outf, s);
if (where == FUNC_PROTO
&& (func_declarator == declarator
|| func_declarator == declarator->head)
&& proto_macro) {
fprintf(outf, " %s(", macro_name);
}
/* Substitute place holder with function parameters. */
put_char(outf, *t++ = PAREN_L);
put_parameters(outf, declarator, commented);
put_string(outf, t);
if (where == FUNC_PROTO
&& (func_declarator == declarator
|| func_declarator == declarator->head)
&& proto_macro) {
put_char(outf, PAREN_R);
}
nestedParams = saveNest;
}
/* Output a declarator.
*/
static void
put_declarator(FILE *outf, Declarator * declarator, int commented)
{
char *s;
if (declarator->func_def == FUNC_NONE) {
if (where == FUNC_PROTO && proto_style == PROTO_ABSTRACT &&
declarator->name[0] != '\0') {
if ((s = strstr(declarator->text, declarator->name)) == NULL)
return;
*s = '\0';
if (proto_comments) {
fprintf(outf, "%s%s%s%s%s", declarator->text,
COMMENT_BEGIN, declarator->name, COMMENT_END,
s + strlen(declarator->name));
} else {
fprintf(outf, "%s%s", declarator->text,
s + strlen(declarator->name));
}
*s = declarator->name[0];
} else {
put_string(outf, declarator->text);
}
} else {
put_func_declarator(outf, declarator, commented);
}
}
/* Output a declaration specifier for an external declaration.
*/
static void
put_decl_spec(FILE *outf, DeclSpec * decl_spec)
{
/* An "extern func()" is legal, but we want to be explicit for lint libs */
#if OPT_LINTLIBRARY
if (decl_spec->text[0] == '\0') {
free(decl_spec->text);
decl_spec->text = xstrdup("int");
}
#endif
if (extern_out && !(decl_spec->flags & DS_STATIC) &&
strkey(decl_spec->text, "extern") == NULL)
put_padded(outf, "extern");
put_padded(outf, decl_spec->text);
}
/* Output the list of parameters in K&R style, for lint-library
*/
#if OPT_LINTLIBRARY
static void
put_llib_params(Declarator * declarator, int commented)
{
Parameter *p;
int count = 0;
nestedParams++;
p = (declarator->func_stack->func_def != FUNC_NONE)
? declarator->func_stack->params.first
: declarator->params.first;
while (p != 0) {
if (lint_ellipsis(p))
break;
if (putParameter(stdout, p, FALSE, ++count, commented))
putchar(';');
p = p->next;
}
nestedParams--;
}
#endif
/* Generate variable declarations.
*/
void
gen_declarations(DeclSpec * decl_spec, /* declaration specifier */
DeclaratorList * decl_list) /* list of declared variables */
{
Declarator *d;
int commented = FALSE;
int saveNest = nestedParams;
#if OPT_LINTLIBRARY
boolean defines = (boolean) (strchr(decl_spec->text, CURL_L) != 0);
int is_func;
/* special treatment for -l, -T options */
if ((!variables_out && types_out && defines) || (decl_list == 0)) {
strcut(decl_spec->text, "static");
strcut(decl_spec->text, "extern");
fmt_library((decl_list == 0) ? 1 : 2);
if (decl_spec->text[0] != '\0') {
put_string(stdout, decl_spec->text);
put_string(stdout, ";\n");
}
return;
}
#endif
if (!variables_out || (decl_spec->flags & (DS_EXTERN | DS_INLINE | DS_JUNK))) {
#if OPT_LINTLIBRARY
if (in_include >= extern_in) /* -x option not set? */
#endif
return;
#if OPT_LINTLIBRARY
strcut(decl_spec->text, "extern");
#endif
}
if (scope_out == SCOPE_EXTERN && (decl_spec->flags & DS_STATIC))
return;
if (scope_out == SCOPE_STATIC && !(decl_spec->flags & DS_STATIC))
return;
if (!inline_out && (decl_spec->flags & DS_INLINE))
return;
check_untagged(decl_spec);
func_declarator = NULL;
where = FUNC_OTHER;
format = FMT_OTHER;
nestedParams = 0;
for (d = decl_list->first; d != NULL; d = d->next) {
if (d->func_def == FUNC_NONE
|| d->head->func_stack->pointer
#if OPT_LINTLIBRARY
|| (in_include < extern_in)
#endif
) {
#if OPT_LINTLIBRARY
if (already_declared(d->name)) {
flush_varargs();
continue;
}
/*
* Try to distinguish function declarations from function pointer
* declarations, so that we don't unintentionally emit lint-library
* arguments for function pointers.
*/
is_func = is_actual_func(d);
if (is_func) {
ellipsis_varargs(d);
} else {
nestedParams = 2; /* disable params altogether */
if (types_out)
fmt_library(2);
}
if (lint_shadowed && lintLibrary())
printf("#undef %s\n", d->name);
#endif
put_string(stdout, fmt[FMT_PROTO].decl_spec_prefix);
put_decl_spec(stdout, decl_spec);
put_declarator(stdout, d, commented);
#if OPT_LINTLIBRARY
if (knrLintLibrary() && is_func)
put_llib_params(d, commented);
#endif
put_body(stdout, decl_spec, d);
nestedParams = saveNest;
}
#if OPT_LINTLIBRARY
flush_varargs();
#endif
}
exitlike_func = FALSE;
}
/* Return TRUE if the function uses varargs.
*/
static int
uses_varargs(Declarator * declarator)
{
Parameter *p;
return (p = declarator->params.first) != NULL
&& (p->next == NULL)
&& (!strcmp(p->declarator->name, "va_alist"));
}
/* If the parameter list is empty, then replace it with "void".
*/
static void
check_void_param(Declarator * declarator)
{
DeclSpec decl_spec;
Parameter *p;
if (declarator->params.first == NULL) {
new_decl_spec(&decl_spec, "void", 0L, DS_NONE);
p = new_parameter(&decl_spec, (Declarator *) 0);
new_param_list(&declarator->params, p);
}
}
/* If a parameter name appears in the parameter list of a traditional style
* function definition but is not declared in the parameter declarations,
* then assign it the default type "int".
*/
static void
set_param_decl_spec(Declarator * declarator)
{
Parameter *p;
for (p = declarator->params.first; p != NULL; p = p->next) {
if (p->decl_spec.text[0] == '\0' &&
strcmp(p->declarator->text, ELLIPSIS) != 0) {
free(p->decl_spec.text);
p->decl_spec.text = xstrdup("int");
}
}
}
/* Generate a function prototype.
*/
void
gen_prototype(DeclSpec * decl_spec, Declarator * declarator)
{
Parameter *p;
int commented = FALSE;
if (proto_style == PROTO_NONE || (decl_spec->flags & DS_JUNK))
return;
if (scope_out == SCOPE_EXTERN && (decl_spec->flags & DS_STATIC))
return;
if (scope_out == SCOPE_STATIC && !(decl_spec->flags & DS_STATIC))
return;
if (!inline_out && (decl_spec->flags & DS_INLINE))
return;
#if OPT_LINTLIBRARY
if ((decl_spec->flags & DS_INLINE)) {
if (in_include > extern_in) /* -x option not set? */
return;
}
#endif
/*
* Trim pathological keywords (which are legal, but unnecessary) from the
* function and its parameters.
*/
strcut(decl_spec->text, "extern");
for (p = declarator->params.first; p != NULL; p = p->next) {
strcut(p->decl_spec.text, "extern");
strcut(p->decl_spec.text, "auto");
}
#if OPT_LINTLIBRARY
if (lintLibrary())
ellipsis_varargs(declarator);
else if (types_out)
fmt_library(0);
#endif
func_declarator = declarator->head;
if (uses_varargs(func_declarator)) {
/* Generate a prototype for a function that uses varargs by replacing
* the "va_alist" parameter with an empty parameter list.
*/
free_param_list(&func_declarator->params);
func_declarator->params.first = NULL;
}
check_void_param(func_declarator);
set_param_decl_spec(func_declarator);
where = FUNC_PROTO;
format = FMT_PROTO;
nestedParams = 0;
#if OPT_LINTLIBRARY
if (lint_shadowed && lintLibrary())
printf("#undef %s\n", declarator->name);
#endif
put_string(stdout, fmt[format].decl_spec_prefix);
put_decl_spec(stdout, decl_spec);
put_func_declarator(stdout, declarator, commented);
#if OPT_LINTLIBRARY
if (knrLintLibrary())
put_llib_params(declarator, commented);
#endif
put_body(stdout, decl_spec, declarator);
}
/* Generate a declarator for a function pointer declarator or prototype.
*/
void
gen_func_declarator(Declarator * declarator)
{
/* Go to the beginning of the function declarator in the temporary
* file and overwrite it with the converted declarator.
*/
fseek(cur_tmp_file(), declarator->begin, 0);
func_declarator = NULL;
where = FUNC_DEF;
format = FMT_FUNC;
nestedParams = 0;
put_func_declarator(cur_tmp_file(), declarator, FALSE);
cur_file_changed();
}
/* Output parameter declarations for old style function definition.
*/
static void
put_param_decl(Declarator * declarator, int commented)
{
#if OPT_LINTLIBRARY
int count = 0;
#endif
Parameter *p;
p = declarator->params.first;
if (!is_void_parameter(p)) {
fputc('\n', cur_tmp_file());
(void) putParameter(cur_tmp_file(), p, knrLintLibrary(), ++count, commented);
fputc(';', cur_tmp_file());
if (p->comment != 0)
fputs(p->comment, cur_tmp_file());
p = p->next;
while (p != NULL && strcmp(p->declarator->text, ELLIPSIS) != 0) {
fputc('\n', cur_tmp_file());
(void) putParameter(cur_tmp_file(), p, knrLintLibrary(),
++count, commented);
fputc(';', cur_tmp_file());
if (p->comment != 0)
fputs(p->comment, cur_tmp_file());
p = p->next;
}
}
}
/* Generate a function definition head.
*/
void
gen_func_definition(DeclSpec * decl_spec, Declarator * declarator)
{
Parameter *p;
ParameterList *params;
char *comment = 0;
int n;
size_t comment_len;
long diff;
/* Do nothing if the function is already defined in the desired style
* or if the function uses varargs.
*/
func_declarator = declarator->head;
if (func_declarator->func_def == func_style ||
uses_varargs(func_declarator))
return;
/* Save the text between the function head and the function body.
* Read the temporary file from after the last ) or ; to the
* end of the file.
*/
if ((diff = (ftell(cur_tmp_file()) - cur_begin_comment())) > 0) {
comment_len = (size_t) diff;
*(comment = (char *) xmalloc(comment_len)) = '\0';
fseek(cur_tmp_file(), cur_begin_comment(), 0);
fread(comment, sizeof(char), comment_len, cur_tmp_file());
} else {
comment_len = 0;
}
format = FMT_FUNC;
nestedParams = 0;
if (func_declarator->func_def == FUNC_TRADITIONAL
|| func_declarator->func_def == FUNC_BOTH) {
/* Save the text before the parameter declarations. */
params = &func_declarator->params;
n = (int) (params->end_comment - params->begin_comment);
if (n > 0) {
*(params->comment = (char *) xmalloc((size_t) (n + 1))) = '\0';
fseek(cur_tmp_file(), params->begin_comment, 0);
fread(params->comment, sizeof(char), (size_t) n, cur_tmp_file());
params->comment[n] = '\0';
format = FMT_FUNC_COMMENT;
}
/* Get the parameter comments. */
for (p = func_declarator->params.first; p != NULL; p = p->next) {
n = (int) (p->declarator->end_comment - p->declarator->begin_comment);
if (n > 0) {
*(p->comment = (char *) xmalloc((size_t) n + 1)) = '\0';
fseek(cur_tmp_file(), p->declarator->begin_comment, 0);
fread(p->comment, sizeof(char), (size_t) n, cur_tmp_file());
p->comment[n] = '\0';
format = FMT_FUNC_COMMENT;
}
}
}
check_void_param(func_declarator);
set_param_decl_spec(func_declarator);
/* Go to the beginning of the function head in the temporary file
* and overwrite it with the converted function head.
*/
where = FUNC_DEF;
fseek(cur_tmp_file(), decl_spec->begin, 0);
if (func_style == FUNC_BOTH) {
char *cur_func;
size_t func_len;
/* Save the current function definition head. */
if ((diff = (cur_begin_comment() - decl_spec->begin)) > 0) {
func_len = (size_t) diff;
cur_func = (char *) xmalloc(func_len);
fread(cur_func, sizeof(char), func_len, cur_tmp_file());
} else {
cur_func = 0;
func_len = 0;
}
fseek(cur_tmp_file(), decl_spec->begin, 0);
fprintf(cur_tmp_file(), "%s\n\n", func_directive);
/* Output new style function definition head. */
if (func_declarator->func_def == FUNC_ANSI) {
if (cur_func != 0)
fwrite(cur_func, sizeof(char), func_len, cur_tmp_file());
} else {
fputs(fmt[format].decl_spec_prefix, cur_tmp_file());
fputs(decl_spec->text, cur_tmp_file());
fputc(' ', cur_tmp_file());
func_style = FUNC_ANSI;
put_func_declarator(cur_tmp_file(), declarator, FALSE);
}
fputs("\n#else\n\n", cur_tmp_file());
/* Output old style function definition head. */
if (func_declarator->func_def == FUNC_TRADITIONAL
|| func_declarator->func_def == FUNC_BOTH) {
if (cur_func != 0)
fwrite(cur_func, sizeof(char), func_len, cur_tmp_file());
} else {
fputs(fmt[format].decl_spec_prefix, cur_tmp_file());
fputs(decl_spec->text, cur_tmp_file());
fputc(' ', cur_tmp_file());
format = FMT_FUNC;
func_style = FUNC_TRADITIONAL;
put_func_declarator(cur_tmp_file(), declarator, FALSE);
put_param_decl(func_declarator, FALSE);
}
fputs("\n#endif", cur_tmp_file());
if (comment != 0 && *comment != '\n')
fputc('\n', cur_tmp_file());
func_style = FUNC_BOTH;
if (cur_func != 0)
free(cur_func);
} else {
/* Output declarator specifiers. */
fputs(fmt[format].decl_spec_prefix, cur_tmp_file());
fputs(decl_spec->text, cur_tmp_file());
fputc(' ', cur_tmp_file());
/* Output function declarator. */
put_func_declarator(cur_tmp_file(), declarator, FALSE);
if (func_style == FUNC_TRADITIONAL)
put_param_decl(func_declarator, FALSE);
}
/* Output text between function head and body. */
if (comment != 0) {
fwrite(comment, sizeof(char), comment_len, cur_tmp_file());
free(comment);
}
cur_file_changed();
}
cproto-4.7m/MANIFEST 0000644 0001751 0000144 00000014400 12546350415 012723 0 ustar tom users MANIFEST for cproto-4.7m, version v4_7m
--------------------------------------------------------------------------------
MANIFEST this file
AUTHORS authors
CHANGES summary of changes made to CPROTO
Makefile.in top-level makefile template
README overview of the CPROTO program
aclocal.m4 autoconf macros
config.guess configure utility script
config.sub configure utility script
config_h.in template for config.h
configure configure script
configure.in script for generating 'configure' via autoconf
cproto.1 man-page for CPROTO
cproto.c main program of CPROTO
cproto.h common datatypes and definitions for CPROTO
dump.c debug/trace
dump.h interface of dump.c
grammar.y yacc grammar for CPROTO
install-sh install-script
lex.l lex rules for CPROTO
lintlibs.c functions used for lint-library formatting
semantic.c functions to support yacc grammar (formatting and translation)
semantic.h interface definitions of semantic.c
strkey.c look for a keyword within a string
symbol.c symbol-table support for CPROTO
symbol.h interface definitions for symbol.c
system.h system-dependent definitions, coordinated with config.h
trace.c debugging support for CPROTO
trace.h header for trace.c, dump.c
yyerror.c enhanced error reporting support for yacc/bison
emx subdirectory
emx/Makefile makefile for gcc (EMX)
emx/README description of files in emx directory
msdos subdirectory
msdos/README description of files in msdos directory
msdos/borland.mak makefile for Borland C
msdos/micrsoft.lnk linker-file for Microsoft C
msdos/micrsoft.mak makefile for Microsoft C
msdos/turboc.mak makefile for TurboC
os2 subdirectory
os2/README description of files in os2 directory
os2/run_test.cmd run test-cases on OS/2
os2/watcom.mak makefile for watcom (OS/2)
package subdirectory
package/cproto.spec RPM build-script for cproto
package/debian subdirectory
package/debian/changelog debian build script
package/debian/compat debian build script
package/debian/control debian build script
package/debian/copyright debian build script
package/debian/docs debian build script
package/debian/rules debian build script
package/debian/source subdirectory
package/debian/source/format debian build script
package/debian subdirectory
package/debian/watch debian build script
porting subdirectory
porting/README description of files in CPROTO/PORTING
porting/getopt.c free version of getopt
porting/getopt.h header file for getopt
porting/popen.c fake popen/pclose
testing subdirectory
testing/README description of files in CPROTO/TESTING
testing/apollo.c template for apollo lint-library
testing/case01.ref test case reference: no options
testing/case02.ref test case reference: -f0
testing/case03.ref test case reference: -c -f1
testing/case04.ref test case reference: -c -f2
testing/case05.ref test case reference: -c -f3
testing/case06.ref test case reference: -c -f3 -v
testing/case07.ref test case reference: -c -f3 -v -e
testing/case08.ref test case reference: -c -f3 -v -e -m
testing/case09.ref test case reference: -c -f3 -v + template
testing/case10.ref test case reference: -T
testing/case11.ref test case reference: -l
testing/case12.ref test case reference: -s
testing/case13.ref test case reference: -l -s
testing/case14.ref test case reference: -l -x
testing/case15.ref test case reference: apollo lint library (sr10.3.5)
testing/case16.ref test case reference: -a
testing/case17.ref test case reference: -t
testing/case18.ref test case reference: -f1
testing/case19.ref test case reference: -f2
testing/case20.ref test case reference: -f3
testing/case21.ref test case reference: -f3 -v + template
testing/case22.ref test case reference: -l -a
testing/case23.ref test case reference: -i
testing/case24.ref test case reference: -i -s
testing/descrip.mms VAX MMS-script for CPROTO/TESTING directory
testing/linux.c include all linux files, for testing
testing/make_bat.sh script for making dos-scripts
testing/make_dcl.sh script to generate UNIX/VMS ".dcl" files
testing/makefile UNIX makefile for CPROTO/TESTING directory
testing/run_test.com VAX/VMS test script for CPROTO
testing/run_test.sh UNIX test-script for CPROTO
testing/run_test.txt template for test-scripts
testing/solaris.c template for lint-library on Solaris
testing/syntax.c odds & ends of syntax to use for testing
testing/test_dos.bat dos test script
testing/testunix.sh runs UNIX test scripts
testing/turboc.c test-case for TurboC include-files
vms subdirectory
vms/README description of files in vms directory
vms/descrip.mms makefile for vms
win32 subdirectory
win32/README description of files in win32 directory
win32/watcom.mak makefile for watcom
cproto-4.7m/cproto.1 0000644 0001751 0000144 00000021740 11417303274 013164 0 ustar tom users .\" $Id: cproto.1,v 4.9 2010/07/14 09:43:24 tom Exp $
.\"
.de EX \"Begin example
.ne 5
.if n .sp 1
.if t .sp .5
.nf
.in +5n
..
.de EE \"End example
.fi
.in -5n
.if n .sp 1
.if t .sp .5
..
.TH CPROTO 1 "July 2010"
.
.SH NAME
cproto \- generate C function prototypes and convert function definitions
.
.SH SYNOPSIS
.B cproto
[
.I option \fP...\fI
] [
.I file \fP...\fI
]
.
.SH DESCRIPTION
.B Cproto
generates function prototypes for
functions defined in the specified C source files to the standard output.
The function definitions may be in the old style or ANSI C style.
Optionally,
.B cproto
also outputs declarations for variables defined in the files.
If no
.I file
argument is given,
.B cproto
reads its input from the standard input.
.LP
By giving a command line option,
.B cproto
will also convert function definitions in the specified files from the
old style to the ANSI C style.
The original source files along with files specified by
.EX
#include "file"
.EE
directives appearing in the source code will be overwritten
with the converted code.
If no file names are given on the command line, then the program reads
the source code from the standard input and outputs the converted source
to the standard output.
.LP
If any comments appear in the parameter declarations for a function definition,
such as in the example,
.EX
main (argc, argv)
int argc; /* number of arguments */
char *argv[]; /* arguments */
{
}
.EE
then the converted function definition will have the form
.EX
int
main (
int argc, /* number of arguments */
char *argv[] /* arguments */
)
{
}
.EE
Otherwise, the converted function definition will look like
.EX
int
main (int argc, char *argv[])
{
}
.EE
.LP
.B Cproto
can optionally convert function definitions from the ANSI style to the old
style.
In this mode, the program also converts function declarators and prototypes
that appear outside function bodies.
This is not a complete ANSI C to old C conversion.
The program does not change anything within function bodies.
.LP
.B Cproto
can optionally generate source in lint\-library format.
This is useful in environments where the \fBlint\fR utility is
used to supplement prototype checking of your program.
.
.SH OPTIONS
.TP
.B \-e
Output the keyword
.B extern
in front of every generated prototype or declaration that has global scope.
.TP
.BI \-f " n"
Set the style of generated function prototypes where
.I n
is a number from 0 to 3.
For example, consider the function definition
.EX
main (argc, argv)
int argc;
char *argv[];
{
}
.EE
If the value is 0, then no prototypes are generated.
When set to 1, the output is:
.EX
int main(/*int argc, char *argv[]*/);
.EE
For a value of 2, the output has the form:
.EX
int main(int /*argc*/, char */*argv*/[]);
.EE
The default value is 3.
It produces the full function prototype:
.EX
int main(int argc, char *argv[]);
.EE
.TP
.B \-l
Generate text for a lint\-library (overrides the "\fB\-f\fR" option).
The output includes the comment
.EX
/* LINTLIBRARY */
.EE
Special comments LINT_EXTERN and LINT_PREPRO (a la "VARARGS")
respectively turn on the "\-x"
option and copy comment\-text to the output (for preprocessing in \fBlint\fR).
Use the comment
.EX
/* LINT_EXTERN2 */
.EE
to include externs defined in the first level of include\-files.
Use the comment
.EX
/* LINT_SHADOWED */
.EE
to cause
.B cproto
to put "#undef" directives before each lint library declaration
(i.e., to avoid conflicts with macros that happen to have to have
the same name as the functions, thus causing syntax errors).
.P
Note that these special comments
are not supported under VAX/VMS, since there is no
equivalent for the "\-C" option of cpp with VAX\-C.
.TP
.B \-c
The parameter comments in the prototypes generated by
the \-f1 and \-f2 options are omitted by default.
Use this option to enable the output of these comments.
.TP
.B \-m
Put a macro around the parameter list of every generated prototype.
For example:
.EX
int main P_((int argc, char *argv[]));
.EE
.TP
.BI \-M " name"
Set the name of the macro used to surround prototype parameter lists
when option \-m is selected.
The default is "P_".
.TP
.B \-d
Omit the definition of the prototype macro used by the \-m option.
.TP
.BI \-o " file"
Specify the name of the output file (default: standard output).
.TP
.BI \-O " file"
Specify the name of the error file (default: standard error).
.TP
.B \-p
Disable promotion of formal parameters in old style function definitions.
By default, parameters of type
.B char
or
.B short
in old style function definitions are promoted to type
.B int
in the function prototype or converted ANSI C function definition.
Parameters of type
.B float
get promoted to
.B double
as well.
.TP
.B \-q
Do not output any error messages when the program cannot read the
file specified in an
.I #include
directive.
.TP
.B \-s
By default,
.B cproto
only generates declarations for functions and variables having global scope.
This option will output
.B static
declarations as well.
.TP
.B \-S
Output only static declarations.
.TP
.B \-i
By default,
.B cproto
only generates declarations for functions and variables having global scope.
This option will output
.B inline
declarations as well.
.TP
.B \-T
Copy type definitions from each file.
(Definitions in included\-files are copied, unlike the "\-l" option).
.TP
.B \-v
Also output declarations for variables defined in the source.
.TP
.B \-x
This option causes procedures and variables which are declared "extern"
to be included in the output.
.TP
.BI \-X " level"
This option limits the include\-file level from which declarations are extracted
by examining the preprocessor output.
.TP
.B \-a
Convert function definitions from the old style to the ANSI C style.
.TP
.B \-t
Convert function definitions from the ANSI C style to the traditional style.
.TP
.B \-b
Rewrite function definition heads to include both old style and new style
declarations separated by a conditional compilation directive.
For example, the program can generate this function definition:
.EX
#ifdef ANSI_FUNC
int
main (int argc, char *argv[])
#else
int
main (argc, argv)
int argc;
char *argv[]
#endif
{
}
.EE
.TP
.BI \-B " directive"
Set the conditional compilation directive to output at the beginning of
function definitions generated by the \-b option.
The default is
.EX
#ifdef ANSI_FUNC
.EE
.LP
.nf
.BI \-P " template"
.BI \-F " template"
.BI \-C " template"
.fi
.in +5n
Set the output format for generated prototypes, function definitions,
and function definitions with parameter comments respectively.
The format is specified by a template in the form
.EX
" int f ( a, b )"
.EE
but you may replace each space in this string with any number of
whitespace characters.
For example, the option
.EX
\-F"int f(\\n\\ta,\\n\\tb\\n\\t)"
.EE
will produce
.EX
int main(
int argc,
char *argv[]
)
.EE
.TP
.BI \-D " name[=value]"
This option is passed through to the preprocessor and is used to define
symbols for use with conditionals such as
.I #ifdef.
.TP
.BI \-U " name"
This option is passed through to the preprocessor and is used to remove
any definitions of this symbol.
.TP
.BI \-I " directory"
This option is passed through to the preprocessor and is used to specify
a directory to search for files that are referenced with
.I #include.
.TP
.BI \-E " cpp"
Pipe the input files through the specified C preprocessor command
when generating prototypes.
By default, the program uses /lib/cpp.
.TP
.BI \-E " 0"
Do not run the C preprocessor.
.TP
.B \-V
Print version information.
.
.SH ENVIRONMENT
The environment variable CPROTO is scanned for
a list of options in the same format as the command line options.
Options given on the command line override any corresponding
environment option.
.
.SH BUGS
If an un\-tagged struct, union or enum declaration appears in
a generated function prototype or converted function definition,
the content of the declaration between the braces is empty.
.LP
The program does not pipe the source files through the C preprocessor when
it is converting function definitions.
Instead, it tries to handle preprocessor directives and macros itself
and can be confused by tricky macro expansions.
The conversion also discards some comments in the function definition
head.
.LP
The \-v option does not generate declarations for variables defined with the
.B extern
specifier.
This doesn't strictly conform to the C language standard but this rule
was implemented because include files commonly declare variables this way.
.LP
When the program encounters an error, it usually outputs the not very
descriptive message "syntax error".
(Your configuration may allow the extended error reporting in yyerror.c).
.LP
Options that take string arguments only interpret the following
character escape sequences:
.EX
\\n newline
\\s space
\\t tab
.EE
.LP
VARARGS comments don't get passed through on systems whose C preprocessors
don't support this (e.g., VAX/VMS, MS\-DOS).
.
.SH AUTHOR
.nf
Chin Huang
cthuang@vex.net
cthuang@interlog.com
.sp
Thomas Dickey
dickey@invisible\-island.net
modifications to support lint library, type\-copying, and port to VAX/VMS.
.fi
.
.SH "SEE ALSO"
cc(1),
cpp(1)
cproto-4.7m/yyerror.c 0000644 0001751 0000144 00000011324 11417305032 013442 0 ustar tom users /* $Id: yyerror.c,v 4.9 2010/07/14 09:57:46 tom Exp $
*
* This file is included into grammar.y to provide the 'yyerror()' function.
* If the yacc/bison parser is one that we know how to backtrack, we'll augment
* the "syntax error" message with information that shows what type of token we
* expected.
*/
#ifndef UCH
#define UCH(c) ((unsigned char)(c))
#endif
/* 'yyerror()' has to be a macro, since it must be expanded inline to subvert
* the internal state of 'yyparse()'.
*/
#if BISON_HAS_YYTNAME /* bison 1.22 */
#if !defined(YYFLAG)
#define YYFLAG YYPACT_NINF /* yabb (yet-another-bison-bug) */
#endif
#if YYDEBUG
/* this is better than defining YYERROR_VERBOSE */
#define yyerror(text) {\
register int n, c1, count = 0;\
yaccError(text);\
if (yypact[yystate] != YYFLAG) { \
for (c1 = 0; c1 < YYLAST; c1++) {\
n = yypact[yystate] + c1;\
if (n >= 0 && n < YYLAST\
&& yycheck[n] == c1 && yytname[c1] != 0)\
yaccExpected(yytname[c1], count++);\
}\
}\
yaccExpected("", -1);\
}
#endif
#endif /* BISON_HAS_YYTNAME */
#if YACC_HAS_YYTOKS_2
#undef YACC_HAS_YYTOKS
#define YACC_HAS_YYTOKS 1
#define YaccState yy_state
#endif
#if YACC_HAS_YYTOKS /* Solaris, Gould */
#if YYDEBUG
#ifndef YaccState
#define YaccState yystate /* sometimes 'yy_state' */
#endif
#define yyerror(text) {\
register int n, x, c1, y, count = 0;\
yaccError(text);\
if (((n = yypact[YaccState]) > YYFLAG) && (n < YYLAST)) {\
for (x = ((n > 0) ? n : 0); x < YYLAST; ++x) {\
c1 = x - n;\
if ((yychk[yyact[x]] == c1) && (c1 != YYERRCODE)) {\
if (isascii(UCH(c1))) {\
static char tmp[] = "'%'";\
tmp[1] = c1;\
yaccExpected(tmp, count++);\
} else {\
for (y = 0; yytoks[y].t_val >= 0; y++) {\
if (yytoks[y].t_val == c1) {\
yaccExpected(yytoks[y].t_name, count++);\
break;\
}\
}\
}\
}\
}\
}\
yaccExpected("", -1);\
}
#endif
#endif /* YACC_HAS_YYTOKS */
#if YACC_HAS_YYNAME /* Linux's yacc */
#if YYDEBUG
#define yyerror(text) {\
register int n, x, c1, count = 0;\
yaccError(text);\
if (((n = yysindex[yystate]) != 0) && (n < YYTABLESIZE)) {\
for (x = ((n > 0) ? n : 0); x < YYTABLESIZE; ++x) {\
c1 = x - n;\
if ((yycheck[x] == c1) && (c1 != YYERRCODE)) {\
yaccExpected(yyname[c1] ? yyname[c1] : "illegal symbol",\
count++);\
}\
}\
}\
yaccExpected("", -1);\
}
#endif
#endif /* YACC_HAS_YYNAME */
/*
* Any way we define it, 'yyerror()' is a real function (that we provide,
* rather than use the one from a library).
*/
static void yaccError(const char *);
#ifdef yyerror
static int
compar(const void *p1, const void *p2)
{
const char *a = *(const char *const *) p1;
const char *b = *(const char *const *) p2;
return strcmp(a, b);
}
#define MSGLEN 80
static void
yaccExpected(const char *s, int count)
{
static struct {
const char *actual, *name;
} tbl[] = {
{
"...", "T_ELLIPSIS"
},
{
"[]", "T_BRACKETS"
},
{
"{", "T_LBRACE"
},
{
"}", "T_MATCHRBRACE"
},
};
unsigned j;
int k, x;
unsigned n;
const char *t = s;
char *tt;
const char *tag;
char tmp[MSGLEN];
static unsigned have;
static unsigned used;
static char **vec;
if (count < 0) {
if (used != 0) {
if (used > 1)
qsort((char *) vec, used, sizeof(vec[0]), compar);
/* limit length of error message */
k = MSGLEN - (int) (strlen(vec[used - 1]) + 2);
for (j = 0; j < used; j++) {
tag = j ? " " : "Expected: ";
s = vec[j];
if (j != (used - 1)) {
x = (int) (strlen(s) + strlen(tag));
if (k <= 0)
continue;
else if ((k - x) <= 0)
s = "...";
k -= x;
}
fprintf(stderr, "%s%s", tag, s);
}
fprintf(stderr, "\n");
while (used-- != 0) {
free(vec[used]);
vec[used] = 0;
}
}
used = 0;
} else {
int found = FALSE;
strcpy(tmp, t);
if (!strncmp(t, "T_", 2)) {
for (j = 0; j < sizeof(tbl) / sizeof(tbl[0]); j++) {
if (!strcmp(t, tbl[j].name)) {
t = tbl[j].actual;
found = TRUE;
break;
}
}
if (!found) {
tt = strncpy(tmp, t + 2, sizeof(tmp) - 1);
for (k = 0; tt[k] != '\0'; k++) {
if (tt[k] == '_')
tt[k] = '-';
else if (isalpha(UCH(tt[k])) && isupper(UCH(tt[k])))
tt[k] = (char) tolower(UCH(tt[k]));
}
}
}
if ((unsigned) count >= have) {
have = (unsigned) (count + 10);
if (vec == 0) {
vec = (char **) malloc(have * sizeof(*vec));
} else {
vec = (char **) realloc(vec, have * sizeof(*vec));
}
for (n = used; n < have; n++)
vec[n] = 0;
}
if (vec[count] != 0) {
free(vec[count]);
}
vec[count] = xstrdup(found ? t : tmp);
used = (unsigned) (count + 1);
}
}
#else
#define yyerror(s) yaccError(s)
#endif /* yyerror */
cproto-4.7m/CHANGES 0000644 0001751 0000144 00000060614 12546347006 012577 0 ustar tom users -- $Id: CHANGES,v 4.42 2015/07/06 00:38:30 tom Exp $
2015/07/05 (4.7m)
- add --with-man2html option to configure script
- update config.guess, config.sub
2014/01/01 (4.7l)
- add "docs" rule to makefile.
- correct configure check for yyname vs yytname, broken by 4.7i changes
- update config.guess
2013/10/25 (4.7k)
- modify configure script, etc., to support cross-compiles, e.g., to MinGW.
- updated configure macros
- support --datarootdir option
- various portability fixes for CF_XOPEN_SOURCE
- add checks for clang
- improve macros for checking for standard C compiler
- modified macros to support third parameter of AC_DEFINE used by autoheader
- update config.guess, config.sub
2011/01/02 (4.7j)
- amend a check for function name to allow cases such as this:
int (foo)();
which is distinct from a function-pointer, e.g.,
int (*foo)();
- modified configure script to deprecate ${name-value} in favor of standard
${name:-value}.
- update config.guess, config.sub
2010/07/14 (4.7i)
- escape dashes used in manpage, to work with groff (patch by Kenneth
Pronovici)
- add RPM and Debian build scripts, for testing.
- add configure checks for ctags and lint program.
- fix strict compiler warnings, e.g., using const.
- support DESTDIR variable in makefile.
- drop mkdirs.sh, use "mkdir -p"
- several improvements to configure macros
- quoted ifelse() params
- distinguish Darwin 9 from previous releases
- ignore stderr in check for gcc version, to work with c89 wrapper.
- use consistent date and formatting in the CHANGES file, for processing
contributor's information using a script.
- update config.guess, config.sub
2009/09/03 (4.7h)
- updated configure macros CF_ADD_CFLAGS CF_GCC_ATTRIBUTES CF_GCC_WARNINGS
CF_XOPEN_SOURCE
- update config.guess, config.sub
2008/11/19 (4.7g)
- modify cpp command to redirect stderr to /dev/null if -q option is given,
for consistency with the non-cpp mode (report by Nicolas Limare,
Ubuntu #275248).
- add configure --disable-leaks option.
- use configure macro CF_XOPEN_SOURCE macro to make mkstemp() prototyped on
Linux.
- remove isascii() usage.
- code cleanup, to remove K&R relics.
- update config.guess, config.sub
2008/01/01 (4.7f)
- add symbol for __gnuc_va_list
- add some data for c99 syntax to test-cases, e.g., long long.
- review/fix some additional places where need_temp() call is needed.
- fix a reference to unallocated storage when reading from standard input
(Fedora #315061).
- minor updates to configure script macros
- update mkdirs.sh (for parallel makes)
- update config.guess, config.sub
- rename install.sh to install-sh
2005/12/08 (4.7e)
- eliminate some fixed limits on buffer sizes (prompted by FreeBSD port).
- eliminate fixed limit on include nesting.
- use configure check for mkstemp(), use that function in preference to
mktemp() if a working version is found.
- move strstr.c into strkey.c to avoid zero-length object
- improve configure check for gcc version, from ncurses.
- update config.guess, config.sub
2005/08/21 (4.7d)
- modified configure script and makefile to work with cygwin
- fix configure check for yacc errors broken by 4.7c changes.
- change fixed buf[] in grammar.y to an allocated buffer temp_buf[].
- eliminate fixed limit on number of -I options.
- improve parsing for "asm", adding GCC's __asm__ keyword and modifying
grammar to work with declarations such as
extern int __asm__ (mkstemp, (char *__template), mkstemp64);
- add config.guess, config.sub (needed for cross-compiling, etc).
- add configure check for Intel compiler.
- modify filename comparison for lint-library to ignore leading "./".
2004/03/25 (4.7c)
- fix a couple of places where valgrind reported a sscanf's result was not
always initialized.
- modify behavior of "-X" option so it does not cause preprocessor lines to
be written to the output. Preprocessor lines are needed for lint-library
text, but are inconsistent with other uses of cproto (patch by Kenneth
Pronovici).
- add configure option "--enable-llib", which allows one to configure cproto
without support for lint-library "llib" files. Since the "-X" option shares
the include-file tracking, this option can also be enabled (or disabled)
(discussion with Kenneth Pronovici, Bob Van der Poel).
- require an ANSI C compiler for building.
- updated configure script, using autoconf 2.52 + patch, along with macros from
vile/lynx/etc.
2004/03/09 (4.7b)
- added new -X option to limit the levels of include-files from which an
extern can come (Debian #235824).
- added new -i option to support inline function prototypes (Debian #228801,
patch by Kenneth Pronovici).
2003/04/05 (4.7a)
- add definition of YYFLAG, to enable the error-reporting code with bison 1.875
- add definition of YYSTYPE, to allow this to build with recent (aka "broken")
versions of bison (Debian #166140, Lukas Geyer ).
- add gcc-specific __builtin_va_arg keyword (Debian #175862, Kenneth Pronovici
).
- modify syntax.c to change token after "#endif" to a comment, thereby avoiding
deprecation warning from gcc 3.2, which would cause "make check" to show
unexpected results.
- resync with version 4.7 at http://cproto.sourceforge.net/
2003/01/05
- add gcc-specific __builtin_va_list keyword.
2002/02/25 (4.6e)
- correct length allocated for filename in include_file(), which was not big
enough if the $CPROTO environment variable was corrupted. From report by
, using sharefuzz:
http://www.atstake.com/research/tools/sharefuzz1.0.tar.gz
- update configure.in to generate config.h directly using autoconf patch from
http://invisible-island.net/autoconf/
- remove makefile rules that attempt to recreate the configure script. As
demonstrated in numerous packages, it always reflects poor design.
- remove makefile rules to make shar files (comp.sources.misc is long gone).
- stop using changequote(), workaround for bugs in autoconf 2.5x
2000/11/09 (4.7)
- Report source file and line number in error messages in gcc-style format.
2000/08/10 (4.6d)
- use newer versions of mkdirs.sh and install.sh
- regenerate configure script with autoconf 2.13
- restructure aclocal.m4
- modify Makefile.in to allow $(bindir) and $(mandir) to be altered
independently of $(prefix) and $(exec_prefix) (patch by Carsten Leonhardt
).
2000/07/08 (4.6c)
- add a clause to handle "__extension__" before extern declarations.
(report by Bob van der Poel )
1999/12/27 (4.6b)
- correct check for size of vec[] array in yaccExpected(), broken in 4.6a
changes.
(report by Wolfgang Wander)
1999/12/19
- add keywords "restrict", "_Bool", "_Complex", "_Imaginary" based on c9x
draft.
- add keywords "__restrict__" and "__restrict", for gcc.
(report by Wolfgang Wander )
1999/12/14 (4.6a)
- change vec[] array in yaccExpected() to be dynamically allocated. It was a
fixed-size (10 entries) array before. Also fix problem reported by Wolfgang
Wander , which is that if the array were empty, it was passed
to qsort() with a zero-size, causing a core dump.
- add to syntax.c & corresponding test-cases the typedef/identifier example.
1999/10/21
- allow identifiers to be the same as typedef names, handle this case:
typedef int badStyle;
void badFunc(int *badStyle) { }
(reported by Paul Haas )
1999/01/03
- add '__extension__' keyword
1998/01/21 (4.6)
- Since cproto is no longer being distributed on USENET in shar file format,
the patchlev.h and MANIFEST files have been removed.
The patchlevel number has been removed from the version number.
- Moved files out of the porting directory into separate platform specific
directories. The emx directory has files used to compile using EMX.
The os2 directory has files used to compile on OS/2 using Watcom C/C++.
The win32 directory has files to compile on Windows 95 and Windows NT
using Watcom C/C++.
- correct order of include-path to keep standard include (e.g., /usr/include)
at the end of the search list.
- modified lint-library include-stack recovery to work on OSF/1.
- supply default initializer for lint-library const data
- corrected reset of __attribute__((noreturn))
- added '__volatile', '__const__', '__inline' keywords to grammar to
accommodate gcc.
- modified configure script to add several development/debugging options (i.e.,
--with-trace, --with-dbmalloc, --with-dmalloc).
- modified ifdefs to avoid using predefined 'unix' (not defined on AIX or CLIX)
1996/04/15 (Patchlevel 5)
- corrected instance of fclose on a file pointer after pclose was done (found
with Electric Fence).
- corrected script make_bat.sh to prevent expansion of \n in argument-string.
- Modified handling of lint library option to allow generation of lint libraries
for ANSI compilers (set -a -l).
- corrected a missing 'void' in parameter list
- modified to allow compile/test with 'dmalloc' library in addition to
'dbmalloc'.
- corrected memory leak in yyerror.c, and allocation-size for cpp command.
- added keywords to work with gcc 2.7.0
- corrected unresolved references to flush_varargs() when OPT_LINTLIBRARY
is not defined
1995/08/24 (Patchlevel 4)
- Added -S option to only output static declarations.
- Fix: The configure script didn't replace @CFLAGS@, @CPPFLAGS@ and @LDFLAGS@
in the makefile generated from makefile.in.
- Fix: The -a option generated incorrect function definitions.
- update test-cases for the -f2 fix in patch 3.
- remove dependency on GNU-make from makefile.in
- corrected configuration script that tests whether yyerror can be extended
(had cached wrong flag, preventing some configurations from being
recognized).
- added calls for 'flush_varargs()' to correct situation in lint-library output
where VARARGS comments were not reset properly when a function
was skipped.
- improved the logic of 'strip_name()' (used to compute include-directives for
the lint-library option) so that it recognizes the conventional include
directory created by a GCC install.
1995/01/06 (Patchlevel 3)
- check for a special case in lint-library generation, i.e., prototype
arguments of the form "*()", which need more parentheses for SunOS's lint.
- modified configure.in, aclocal.m4, makefile.in to work with autoconf 2.1
(also added install.sh - note that "install-sh" is not an MS-DOS-compatible
filename).
- derive the program name from the argv[0] entry, in case it's installed
under a different name.
- Fix: The -f2 option generated incorrect prototypes for functions that
take a variable argument list.
- use 'sed' rather than 'flip' to apply trailing CR's to MS-DOS scripts.
1994/10/26 (Patchlevel 2)
- modified grammar to recognize C++ ref-variables (i.e., '&' as a prefix to
identifiers at the top lexical level). Lint libraries are formatted without
this '&', since lint doesn't grok C++. This corrects an error in cproto 4.0
which caused '&' characters to be suppressed altogether, e.g., when filtering
with the "-t" option.
- modified rules that generate MANIFEST to put auto-generated scripts there
also, if they've been created (e.g., cd testing; make scripts).
- modified makefile.in to have shar target for both GNU shar and Rick Salz's
cshar utility.
- use 'const' in yyerror.c, otherwise the error-reporting auto-configuration
does not work.
- don't use "#elif" preprocessor control; not all systems support it.
1994/10/25 (Patchlevel 1)
- Added testing scripts for MS-DOS and VMS.
- Added makefile for Borland C++ for OS/2.
- Fix: When the -a, -t or -b options were used, '&' characters were stripped
from the output files.
- Fix: The system.h file should define EXIT_SUCCESS and EXIT_FAILURE
regardless of the presence of .
1994/09/24 (Patchlevel 0, dickey)
- corrected two malloc-defects in lint library generation (one place where
generated parameter name was copied rather than allocated, and another memory
leak).
- corrected generation of lint library function body, to handle function
pointers.
- changed the implicit lint library function type from "" to "void", to avoid
special-cases in the function-body generation.
- added logic using 'NestedParams' to suppress prototype-arguments in lint
library function-pointer arguments.
- corrected lint-library function parameter derived from prototype "char [2]"
(parameter name wasn't supplied).
- added PRINTFLIKE and SCANFLIKE to the comments interpreted for the lint
library translation.
- modified "LINT_PREPRO" comment to pass-thru all comment text if no count is
given.
- added new comment keyword "LINT_SHADOWED" to generate "#undef symbol" before
each function template in lint libraries (useful for processing files that
define both macros and functions with the same names).
- interpret GCC's __attribute__ noreturn and format for lint-library text
(GCC 2.5.8 preprocessor passes these macros through, GCC 2.6 apparently does
not).
- treat carriage-return (^M) as whitespace where appropriate.
- added configuration-test to avoid conflict with prototype for 'popen()'
- added several function-pointer regression test-cases
Version 3
1994/08/31 (Patchlevel 9, dickey)
- use 'autoconf' to make a UNIX configure-script.
- recognize GCC extensions '__inline' and '__attribute__'
- added ifdef OPT_LINTLIBRARY to allow compiling without the lint library
code (saves about 4kb).
- corrected some logic that made incorrect commenting for options -c -f1
(e.g., "void (*Sigdisp(int sig, void (*func)(int sig)))(int sig)").
- corrected logic that macroizes (e.g., with P_) functions like 'Sigdisp'
(it wasn't doing anything about the trailing "(int sig)").
- corrected handling of K&R conversion of mixed-mode functions (K&R style
with prototypes in arguments) to avoid losing comments.
- modified logic for options -c -f2 so that cproto inserts a space before
the beginning of a comment when it immediately follows an '*'.
- enhanced error reporting with new module yyerror.c which (attempts to)
report the expected token type/name when a syntax error is encountered.
- modified the grammar.y file to try to recover from errors at the next
semicolon (as well as the next right curly bracket).
- modified to process lex/yacc files with gcc as C-preprocessor.
- Added option "-O" to force redirection of errors without shell operations
(useful for VAX/VMS and MS-DOS in particular).
- added "\s" as a synonym for space in the format options (-P, -F, -C)
- tested on Solaris with lex/yacc and flex 2.4.6 / bison 1.22
(SunOS explorer 5.3 Generic_101318-42 sun4m sparc; gcc 2.6.0)
- tested on SunOS 4.1.1 with lex/yacc and flex 2.4.6 / bison 1.22
(SunOS calvin 4.1.1 1 sun4c)
- tested on IRIX with lex/yacc
(IRIX dbs3 5.2 02282015 IP19 mips)
- tested on Linux 0.99.15 with lex/yacc and flex 2.4.6 / bison 1.22 / byacc 1.9
- tested on MS-DOS with flex 2.37 / byacc 1.9 (built with turboc.mak).
(Bison uses too much stack space).
- tested on VAX/VMS 6.1 with VAX-C 3.2 and flex 2.4.6 / bison 1.22.
- moved non-UNIX files into 'porting' subdirectory.
- added 'testing' subdirectory, for simple regression tests.
- tested for memory leaks with dbmalloc (on Linux).
1993/06/09 (Patchlevel 8, internal: dickey/cthuang)
- added files 'lintlibs.c' and 'strkey.c'
- Allow dollar signs in identifiers
- Defined FAIL, SUCCESS to use in 'exit()' calls (VMS is approximately the
reverse of UNIX).
- Added option "-o" to force redirection without shell operations (useful for
VAX/VMS in particular).
- Added options "-l" (lintlibrary format), "-T" (typedefs), "-x" (externs
in include-files).
- Added "-C" option to cpp-invocation (to support VARARGS-decoding for -l
option).
- Modified grammar.y so that if -T option is turned on, instances of untagged
struct, union or enum are shown with the contents of the curly braces.
- Modified lex.l so that it sets 'return_val' iff at least one return statement
within curly braces returns an expression. Use this to support -l option.
- Modified semantic.c (for -l option) to put tabs after short names for better
readability. Also (only -l option), put a blank line before function
definitions and typedefs.
- Corrected lex.l so that it recognizes preprocessor lines within curly braces.
- Modified 'gen_prototype()' to trim 'extern' and 'auto' keywords from the text
(so that 'extern' is emitted in this function only if the -e option is
specified). Do this to support -l option (and to correct normal usage, which
implies that -e option is needed to put an 'extern' before declaration).
- Corrected test in 'put_decl_spec()' by using 'strkey()' (which tests for a
name, not simply a substring).
- Modified semantic.c to use 'put_string()' and related procedures to simplify
pretty-printing of lint-library text (mainly to control blank lines). (See
'fmt_library()').
- linted some xmalloc calls using ALLOC macro.
1993/06/01 (Patchlevel 7, cthuang)
- Fix: The processing of string literals is now more robust.
- Removed the -f4 option which generated prototypes like
int main P_((int argc, char **argv));
Use the -m option now to put a guard macro around the prototype
parameter list. Use the -m option together with -f3 (which is the
default) to produce the same output as the old -f4 option. The option
to set the guard macro name is now -M.
- Comments in prototype parameter lists are now disabled by default.
Use the -c option now to output these comments.
- Can now process #include directives in which the file is specified with
a #define macro.
- Now does not convert function definitions that take the formal
parameter va_alist from .
- Now recognizes the GNU C modifiers __const and __inline__.
Patchlevel 6
- Fix: A function in lex.l exploited the ANSI C feature of concatenating
string literals. This prevented the module from being compiled with
pre-ANSI C compilers.
Patchlevel 5
- Fix: The -v option did not output declarations for function pointers.
- Fix: String literals continued over more than one line messed up the
line number count.
- Fix: The program generated incorrect prototypes for functions that
take a variable argument list using .
- Fix: When converting functions from the standard input, cproto
generated no output if no functions needed to be converted.
- Fix: Now does not output a warning if an untagged struct is found in a
typedef declaration.
- Added the -b option which rewrites function definition heads to
include both old style and new style declarations separated by a
conditional compilation directive. For example, the program can
generate
#ifdef ANSI_FUNC
int
main (int argc, char *argv[])
#else
int
main (argc, argv)
int argc;
char *argv[]
#endif
{
}
Added the -B option to set the preprocessor directive that appears at
the beginning of such definitions.
- Added the keyword "interrupt" to the set of type qualifiers when
compiled on a UNIX system.
- The MS-DOS version now recognizes the type modifiers introduced by
Microsoft C/C++ 7.00.
- Now recognizes ANSI C trigraphs (yuck!).
- Now use "#if __STDC__" instead of "#if defined(__STDC__)".
- GNU bison orders the y.tab.c sections differently than yacc, which
resulted in references to variables before they were declared. The
grammar specification was modified to also be compatible with bison.
Patchlevel 4
- Fix: A typedef name defined as a pointer to char, short or float was
incorrectly promoted if it was used to specify a formal parameter.
For example, for the definition
typedef char *caddr_t;
int strlen (s)
caddr_t s;
{
}
cproto generated the incorrect prototype
int strlen(int s);
- Added implementation of the ANSI function tmpfile() for systems that
don't have it.
- If compiled with Microsoft C, cproto preprocesses its input by running
the command "cl /E". To eliminate the error messages when the file
is included, the program now recognizes the specifier
_based(void).
Patchlevel 3
- Fix: The program didn't generate prototypes for functions defined with
the extern specifier.
- Fix: The -c option didn't output a space before parameter names in
generated prototypes.
- Added the -E option to specify a particular C preprocessor to run or
to stop the program from running the C preprocessor.
- Added the -q option to stop the program from outputting error messages
when it cannot read the file specified in an #include directive.
- Made the yacc specification compatible with UNIX SYSVR4 yacc.
Patchlevel 2
- Fix: The function definition conversion may produce a mangled function
definition if an #include directive appears before the function and
no comments appear between the directive and the function.
- Fix: The size of the buffer allocated for the C preprocessor command
string did not include enough space for options set in the environment
variable CPROTO.
- Replaced the -n option with -c which disables all comments in the
generated prototypes.
- Replaced the enum's with #define constants to accommodate C compilers
that don't like enumerators in constant expressions.
Patchlevel 1
- Fix: The program was calling ftell() on an invalid FILE pointer.
Patchlevel 0
- Added options to convert function definitions between the old style
and ANSI C style.
- Options can be specified from the environment variable CPROTO.
- The MS-DOS version recognizes more Microsoft C and Borland C++ type
modifiers (such as _cdecl, _far, _near).
- Fix: Formal parameters specified with typedef names were not promoted.
For example, for the definition
typedef unsigned short ushort;
void test (x)
ushort x;
{
}
cproto generated the incorrect prototype
void test(ushort x);
while the correct one is
void test(int x);
- Fix: Incorrect prototypes were generated for functions that returned
function pointers. For example, cproto generated an incorrect
prototype for the function definition
void (*signal(int x, void (*func)(int y)))(int z)
{
}
- Fix: Changed calls to memory allocation functions to abort the program
if they fail.
Version 2
Patchlevel 3
- Made cproto compatible with GNU flex.
- After compiling with the preprocessor symbol TURBO_CPP defined, on
MS-DOS systems, cproto will pipe its input through the Turbo C
preprocessor.
- Fix: Typedef names may now be omitted from typedef declarations.
For example, every C compiler I tried accepts
typedef int;
and some even give warnings when encountering this statement.
Patchlevel 2
- Cproto is now able to generate prototypes for functions defined in lex
and yacc source files named on the command line. Lex and yacc source
files are recognized by the .l or .y extension.
- Fix: The memory allocated to the typedef symbol table was not being
freed after scanning each source file.
- Fix: Failure to reset a variable during error recovery caused
segmentation faults.
Patchlevel 1
- Fix: Cproto incorrectly generated the parameter "int ..." in
prototypes of functions taking variable parameters.
- Fix: Function definitions can now be followed by an optional
semicolon. I found this feature in every C compiler I tried.
Patchlevel 0
- Added formal parameter promotion.
- Added prototype style that surrounds prototypes with a guard macro.
- Handles C++ style comment //.
- Nifty new way to set prototype output format.
- Got rid of the shell wrapper used to pipe the input through the C
preprocessor (cpp).
- For the port to MS-DOS, I modified cproto to run without cpp, but
since I didn't want to reimplement cpp, the program processes only the
#include and #define directives and ignores all others. Macro names
defined by the #define directive are treated like typedef names if
they appear in declaration specifiers.
Version 1
Patchlevel 3
- Fix: identical typedef names and struct tags should be allowed.
For example:
typedef struct egg_salad egg_salad;
struct egg_salad {
int mayo;
};
void dine(egg_salad l)
{
}
Patchlevel 2
- Fix: A typedef statement should allow a list of typedefs to be declared.
Example:
typedef int a, *b;
- Fix: When run with the -v option on this input, cproto did not output
a declaration for variable "b":
char *a="one"; char *b="two";
- The options were renamed. Added new options that change the output
format of the prototypes.
Patchlevel 1
- Fix: Incorrect prototypes were produced for functions that take
function pointer parameters or return a function pointer. For example,
cproto produced an erroneous prototype for this function definition:
void
(*signal (sig, func))()
int sig;
void (*func)();
{
/* stuff */
}
- The lexical analyser now uses LEX. It should still be compatible with
FLEX.
cproto-4.7m/msdos/ 0000755 0001751 0000144 00000000000 10346114277 012720 5 ustar tom users cproto-4.7m/msdos/README 0000644 0001751 0000144 00000000301 06461035674 013600 0 ustar tom users The files in this directory are used to build on MS-DOS.
turboc.mak makefile for Turbo C/C++ 3.0 for MS-DOS
borland.mak makefile for Borland C for MS-DOS
micrsoft.mak makefile for Microsoft C
cproto-4.7m/msdos/micrsoft.mak 0000644 0001751 0000144 00000003457 10346114277 015251 0 ustar tom users # $Id: micrsoft.mak,v 4.2 2005/12/08 20:34:07 tom Exp $
#
# Microsoft C makefile for C prototype generator
# tested with:
# nmake 1.11.
# cl 6.00ax.
# Define MSDOS for MS-DOS compatibility.
# Define TURBO_CPP to pipe the input through the Turbo C preprocessor.
DEFINES = -DMSDOS -DSTDC_HEADERS
MSC_TOP = d:\msc60ax
# names from MKS tools (ran out of memory in lex; used unix output)
Y_TAB = ytab
LEX_YY = lex_yy
LEX = lex
YACC = yacc
CC = cl
LINK = link
CFLAGS = -EM -AL $(DEFINES)
LIBS = $(MSC_TOP)\lib\setargv.obj
LDFLAGS = /F 1000
DIST1 = README CHANGES cproto.man
DIST2 = cproto.1 borland.mak micrsoft.mak makefile.in lex.l grammar.y
DIST3 = system.h cproto.h patchlev.h semantic.h symbol.h
DIST4 = cproto.c lintlibs.c popen.c semantic.c strkey.c symbol.c
OBJECTS = cproto.obj lintlibs.obj getopt.obj semantic.obj strkey.obj symbol.obj $(Y_TAB).obj popen.obj
all: cproto.exe
cproto.exe: $(OBJECTS) micrsoft.lnk
$(LINK) @micrsoft.lnk
micrsoft.lnk:
for %%i in ( *.obj ) do echo %%i + >>$@
echo >>$@
echo cproto.exe >>$@
echo >>$@
echo $(LIBS); >>$@
$(Y_TAB).obj: $(Y_TAB).c $(LEX_YY).c system.h cproto.h symbol.h semantic.h
$(CC) $(CFLAGS) -c $*.c
$(Y_TAB).c: grammar.y
$(YACC) grammar.y
$(LEX_YY).c: lex.l
$(LEX) lex.l
cproto.man: cproto.1
cawf -man $*.1 | bsfilt - >$*.man
clean:
erase *.obj
erase *.bak
erase *.log
erase $(LEX_YY).c
erase $(Y_TAB).c
erase micrsoft.lnk
erase cproto.exe
ci:
ci -u3 $(DIST2) $(DIST3)
ci -u3 $(DIST4)
shar:
shar $(DIST1) $(DIST2) >cproto.sh1
shar $(DIST3) $(DIST4) >cproto.sh2
# DO NOT DELETE THIS LINE -- make depend depends on it.
cproto.obj: system.h cproto.h
lintlibs.obj: system.h cproto.h symbol.h semantic.h
popen.obj: system.h cproto.h
semantic.obj: system.h cproto.h symbol.h semantic.h
strkey.obj: cproto.h system.h
symbol.obj: system.h cproto.h symbol.h
cproto-4.7m/msdos/turboc.mak 0000644 0001751 0000144 00000005032 10346114277 014710 0 ustar tom users # $Id: turboc.mak,v 4.3 2005/12/08 20:34:07 tom Exp $
#
# Turbo C/C++ makefile for C prototype generator
# (adapted from PRJ2MAK output)
.AUTODEPEND
# Define MSDOS for MS-DOS compatibility.
# Define TURBO_CPP to pipe the input through the Turbo C preprocessor.
DEFINES = MSDOS;TURBO_CPP
# There's no standard for the names produced by lex clones on MSDOS:
# FLEX produces LEXYY.C
# MKS LEX produces LEX_YY.C (I think)
#LEX = lex
#LEX_OUT=lex_yy
LEX = flex
LEX_OUT=lexyy
#YACC = yacc
YACC = byacc
#YACC = bison -o y_tab.c
# *Translator Definitions*
CC = tcc +cproto.cfg
MODEL = l
TLIB = tlib
TLINK = tlink
LIBPATH = C:\TC\LIB
LIBS = $(LIBPATH)\wildargs.obj
INCLUDEPATH = .;\tc\include
DOC_FILES = \
README \
CHANGES \
cproto.man \
cproto.1
MAK_FILES = \
makefile.in configure.in \
turboc.mak \
borland.mak \
micrsoft.mak
DIST2 = lex.l grammar.y
DIST3 = system.h cproto.h patchlev.h semantic.h symbol.h
DIST4 = cproto.c popen.c lintlibs.c semantic.c strkey.c symbol.c
OBJECTS = \
cproto.obj \
lintlibs.obj \
getopt.obj \
popen.obj \
semantic.obj \
strkey.obj \
symbol.obj \
y_tab.obj
all: cproto.exe
y_tab.obj : cproto.cfg \
y_tab.c $(LEX_OUT).c system.h cproto.h symbol.h semantic.h
$(CC) -w-rch -c {$*.c }
y_tab.c : grammar.y
$(YACC) grammar.y
$(LEX_OUT).c: lex.l
$(LEX) lex.l
cproto.man: cproto.1
cawf -man $*.1 | bsfilt - >$*.man
clean:
erase *.$$$
erase cproto.cfg
erase *.out
erase *.obj
erase *.bak
erase *.log
erase $(LEX_OUT).c
erase y_tab.c
erase cproto.exe
# *Implicit Rules*
.c.obj:
$(CC) -c {$< }
.cpp.obj:
$(CC) -c {$< }
# *Explicit Rules*
cproto.exe: cproto.cfg $(OBJECTS)
$(TLINK) /v/x/c/L$(LIBPATH) @&&|
c0$(MODEL).obj+
cproto.obj +
lintlibs.obj +
getopt.obj +
popen.obj +
semantic.obj +
strkey.obj +
symbol.obj +
y_tab.obj +
$(LIBS)
cproto
# no map file
emu.lib+
math$(MODEL).lib+
c$(MODEL).lib
|
# *Compiler Configuration File*
cproto.cfg: turboc.mak
copy &&|
-m$(MODEL)
-v
-vi-
-w-ret
-w-nci
-w-inl
-wpin
-wamb
-wamp
-w-par
-wasm
-wcln
-w-cpt
-wdef
-w-dup
-w-pia
-wsig
-wnod
-w-ill
-w-sus
-wstv
-wucp
-wuse
-w-ext
-w-ias
-w-ibc
-w-pre
-w-nst
-I$(INCLUDEPATH)
-L$(LIBPATH)
-D$(DEFINES);STDC_HEADERS=1;USE_$(LEX);YY_USE_PROTOS
| cproto.cfg
# DO NOT DELETE THIS LINE -- make depend depends on it.
cproto.obj : cproto.cfg system.h cproto.h symbol.h
lintlibs.obj : cproto.cfg system.h cproto.h symbol.h semantic.h
popen.obj : cproto.cfg system.h cproto.h
semantic.obj : cproto.cfg system.h cproto.h symbol.h semantic.h
strkey.obj : cproto.cfg cproto.h system.h
symbol.obj : cproto.cfg system.h cproto.h symbol.h
cproto-4.7m/msdos/borland.mak 0000644 0001751 0000144 00000002736 10346114277 015043 0 ustar tom users # $Id: borland.mak,v 4.2 2005/12/08 20:34:07 tom Exp $
#
# Borland C++ makefile for C prototype generator
# Define MSDOS for MS-DOS compatibility.
# Define TURBO_CPP to pipe the input through the Turbo C preprocessor.
DEFINES = -DMSDOS -DTURBO_CPP
LEX = lex
YACC = yacc
CC = bcc
CFLAGS = -mc $(DEFINES) -w-pin -w-pro
LIBS = \bc\lib\wildargs.obj
DIST1 = README CHANGES cproto.man
DIST2 = cproto.1 borland.mak micrsoft.mak makefile.in lex.l grammar.y
DIST3 = system.h cproto.h patchlev.h semantic.h symbol.h
DIST4 = cproto.c popen.c lintlibs.c semantic.c strkey.c symbol.c
OBJECTS = cproto.obj lintlibs.obj getopt.obj popen.obj semantic.obj strkey.obj symbol.obj y_tab.obj
all: cproto.exe
cproto.exe: $(OBJECTS)
$(CC) $(CFLAGS) -e$*.exe $(OBJECTS) $(LIBS)
y_tab.obj: y_tab.c lex_yy.c system.h cproto.h symbol.h semantic.h
$(CC) $(CFLAGS) -c $*.c
y_tab.c: grammar.y
$(YACC) grammar.y
lex_yy.c: lex.l
$(LEX) lex.l
cproto.man: cproto.1
cawf -man $*.1 | bsfilt - >$*.man
clean:
erase *.obj
erase *.bak
erase *.log
erase lex_yy.c
erase y_tab.c
erase cproto.exe
ci:
ci -u3 $(DIST2) $(DIST3)
ci -u3 $(DIST4)
shar:
shar $(DIST1) $(DIST2) >cproto.sh1
shar $(DIST3) $(DIST4) >cproto.sh2
# DO NOT DELETE THIS LINE -- make depend depends on it.
cproto.obj: system.h cproto.h symbol.h
lintlibs.obj: system.h cproto.h symbol.h semantic.h
popen.obj: system.h cproto.h
semantic.obj: system.h cproto.h symbol.h semantic.h
strkey.obj: cproto.h system.h
symbol.obj: system.h cproto.h symbol.h
cproto-4.7m/msdos/micrsoft.lnk 0000644 0001751 0000144 00000000242 06461035674 015260 0 ustar tom users CPROTO.OBJ +
LINTLIBS.OBJ +
GETOPT.OBJ +
SEMANTIC.OBJ +
STRKEY.OBJ +
SYMBOL.OBJ +
YTAB.OBJ +
POPEN.OBJ
cproto.exe
cproto.map
d:\msc60ax\lib\llibce.lib
;
cproto-4.7m/config.sub 0000755 0001751 0000144 00000106367 12521135144 013564 0 ustar tom users #! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2015 Free Software Foundation, Inc.
timestamp='2015-03-08'
# This file 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 3 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, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to .
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| e2k | epiphany \
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aros)
basic_machine=i386-pc
os=-aros
;;
asmjs)
basic_machine=asmjs-unknown
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tile*)
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* | -cloudabi* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
cproto-4.7m/configure 0000755 0001751 0000144 00000566646 12546350332 013527 0 ustar tom users #! /bin/sh
# From configure.in Revision: 4.17 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by Autoconf 2.52.20141204.
#
# 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}
ac_unique_file="cproto.c"
# 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'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${datarootdir}/info'
mandir='${datarootdir}/man'
# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=
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 ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$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 datarootdir 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.
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
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:851: 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:862: 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:870: 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:886: 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:890: 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:896: 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:898: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
{ echo "$as_me:900: 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:919: 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:921: 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
ac_main_return=return
case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway
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:942: PATH=\".;.\"; conftest.sh") >&5
(PATH=".;."; conftest.sh) 2>&5
ac_status=$?
echo "$as_me:945: \$? = $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 config.h:config_h.in"
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f $ac_dir/install.sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f $ac_dir/shtool; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
{ { echo "$as_me:973: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
{ (exit 1); exit 1; }; }
fi
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
{ { echo "$as_me:983: error: cannot run $ac_config_sub" >&5
echo "$as_me: error: cannot run $ac_config_sub" >&2;}
{ (exit 1); exit 1; }; }
echo "$as_me:987: checking build system type" >&5
echo $ECHO_N "checking build system type... $ECHO_C" >&6
if test "${ac_cv_build+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_build_alias=$build_alias
test -z "$ac_cv_build_alias" &&
ac_cv_build_alias=`$ac_config_guess`
test -z "$ac_cv_build_alias" &&
{ { echo "$as_me:996: error: cannot guess build type; you must specify one" >&5
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
{ (exit 1); exit 1; }; }
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
{ { echo "$as_me:1000: error: $ac_config_sub $ac_cv_build_alias failed." >&5
echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
{ (exit 1); exit 1; }; }
fi
echo "$as_me:1005: result: $ac_cv_build" >&5
echo "${ECHO_T}$ac_cv_build" >&6
build=$ac_cv_build
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
echo "$as_me:1013: checking host system type" >&5
echo $ECHO_N "checking host system type... $ECHO_C" >&6
if test "${ac_cv_host+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_host_alias=$host_alias
test -z "$ac_cv_host_alias" &&
ac_cv_host_alias=$ac_cv_build_alias
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
{ { echo "$as_me:1022: error: $ac_config_sub $ac_cv_host_alias failed" >&5
echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
echo "$as_me:1027: result: $ac_cv_host" >&5
echo "${ECHO_T}$ac_cv_host" >&6
host=$ac_cv_host
host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
system_name="$host_os"
else
system_name="`(uname -s -r) 2>/dev/null`"
if test -z "$system_name" ; then
system_name="`(hostname) 2>/dev/null`"
fi
fi
test -n "$system_name" &&
cat >>confdefs.h <&6
else
cf_cv_system_name="$system_name"
fi
test -z "$system_name" && system_name="$cf_cv_system_name"
test -n "$cf_cv_system_name" && echo "$as_me:1053: result: Configuring for $cf_cv_system_name" >&5
echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
if test ".$system_name" != ".$cf_cv_system_name" ; then
echo "$as_me:1057: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
{ { echo "$as_me:1059: error: \"Please remove config.cache and try again.\"" >&5
echo "$as_me: error: \"Please remove config.cache and try again.\"" >&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
ac_main_return=return
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:1073: 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:1088: found $ac_dir/$ac_word" >&5
break
done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
echo "$as_me:1096: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
echo "$as_me:1099: 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:1108: 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:1123: 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:1131: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
echo "$as_me:1134: 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:1147: 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:1162: found $ac_dir/$ac_word" >&5
break
done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
echo "$as_me:1170: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
echo "$as_me:1173: 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:1182: 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:1197: 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:1205: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
echo "$as_me:1208: 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:1221: 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:1241: 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:1263: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
echo "$as_me:1266: 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:1277: 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:1292: found $ac_dir/$ac_word" >&5
break
done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
echo "$as_me:1300: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
echo "$as_me:1303: 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:1316: 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:1331: 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:1339: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
echo "$as_me:1342: 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:1354: 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:1359:" \
"checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:1362: \"$ac_compiler --version &5\"") >&5
(eval $ac_compiler --version &5) 2>&5
ac_status=$?
echo "$as_me:1365: \$? = $ac_status" >&5
(exit $ac_status); }
{ (eval echo "$as_me:1367: \"$ac_compiler -v &5\"") >&5
(eval $ac_compiler -v &5) 2>&5
ac_status=$?
echo "$as_me:1370: \$? = $ac_status" >&5
(exit $ac_status); }
{ (eval echo "$as_me:1372: \"$ac_compiler -V &5\"") >&5
(eval $ac_compiler -V &5) 2>&5
ac_status=$?
echo "$as_me:1375: \$? = $ac_status" >&5
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
#line 1379 "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:1395: 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:1398: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
ac_status=$?
echo "$as_me:1401: \$? = $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 | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
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:1424: 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:1430: 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:1435: 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:1441: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:1444: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { echo "$as_me:1451: 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:1459: 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:1466: checking whether we are cross compiling" >&5
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
echo "$as_me:1468: result: $cross_compiling" >&5
echo "${ECHO_T}$cross_compiling" >&6
echo "$as_me:1471: checking for executable suffix" >&5
echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
if { (eval echo "$as_me:1473: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:1476: \$? = $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 | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
export ac_cv_exeext
break;;
* ) break;;
esac
done
else
{ { echo "$as_me:1492: 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:1498: 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:1504: 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 1510 "configure"
#include "confdefs.h"
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { (eval echo "$as_me:1522: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:1525: \$? = $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 | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
*) 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:1537: 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:1544: result: $ac_cv_objext" >&5
echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
echo "$as_me:1548: 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 1554 "configure"
#include "confdefs.h"
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:1569: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:1572: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:1575: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:1578: \$? = $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:1590: 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:1596: 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 1602 "configure"
#include "confdefs.h"
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:1614: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:1617: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:1620: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:1623: \$? = $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:1633: 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:1660: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:1663: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:1666: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:1669: \$? = $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 1681 "configure"
#include "confdefs.h"
#include
$ac_declaration
int
main ()
{
exit (42);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:1694: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:1697: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:1700: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:1703: \$? = $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 1713 "configure"
#include "confdefs.h"
$ac_declaration
int
main ()
{
exit (42);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:1725: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:1728: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:1731: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:1734: \$? = $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 -rf 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_main_return=return
GCC_VERSION=none
if test "$GCC" = yes ; then
echo "$as_me:1764: checking version of $CC" >&5
echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
echo "$as_me:1768: result: $GCC_VERSION" >&5
echo "${ECHO_T}$GCC_VERSION" >&6
fi
echo "$as_me:1772: checking for $CC option to accept ANSI C" >&5
echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
if test "${ac_cv_prog_cc_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
#line 1780 "configure"
#include "confdefs.h"
#include
#include
#include
#include
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
return 0;
}
_ACEOF
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX 10.20 and later -Ae
# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
if { (eval echo "$as_me:1829: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:1832: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:1835: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:1838: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_prog_cc_stdc=$ac_arg
break
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest.$ac_objext
done
rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC
fi
case "x$ac_cv_prog_cc_stdc" in
x|xno)
echo "$as_me:1855: result: none needed" >&5
echo "${ECHO_T}none needed" >&6 ;;
*)
echo "$as_me:1858: result: $ac_cv_prog_cc_stdc" >&5
echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
CC="$CC $ac_cv_prog_cc_stdc" ;;
esac
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
echo "$as_me:1866: checking \$CC variable" >&5
echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
case "$CC" in
(*[\ \ ]-[IUD]*)
echo "$as_me:1870: result: broken" >&5
echo "${ECHO_T}broken" >&6
{ echo "$as_me:1872: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
# humor him...
cf_flags=`echo "$CC" | sed -e 's/^[^ ]*[ ]//'`
CC=`echo "$CC" | sed -e 's/[ ].*//'`
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $cf_flags
do
case $cf_fix_cppflags in
(no)
case $cf_add_cflags in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
(*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
(yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
;;
(*)
echo "$as_me:1958: result: ok" >&5
echo "${ECHO_T}ok" >&6
;;
esac
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_main_return=return
echo "$as_me:1969: 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 1990 "configure"
#include "confdefs.h"
#include
Syntax error
_ACEOF
if { (eval echo "$as_me:1995: \"$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:2001: \$? = $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 2024 "configure"
#include "confdefs.h"
#include
_ACEOF
if { (eval echo "$as_me:2028: \"$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:2034: \$? = $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:2071: 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 2081 "configure"
#include "confdefs.h"
#include
Syntax error
_ACEOF
if { (eval echo "$as_me:2086: \"$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:2092: \$? = $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 2115 "configure"
#include "confdefs.h"
#include
_ACEOF
if { (eval echo "$as_me:2119: \"$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:2125: \$? = $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:2153: 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
ac_main_return=return
for ac_prog in reflex flex lex
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:2169: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_LEX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$LEX"; then
ac_cv_prog_LEX="$LEX" # 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_LEX="$ac_prog"
echo "$as_me:2184: found $ac_dir/$ac_word" >&5
break
done
fi
fi
LEX=$ac_cv_prog_LEX
if test -n "$LEX"; then
echo "$as_me:2192: result: $LEX" >&5
echo "${ECHO_T}$LEX" >&6
else
echo "$as_me:2195: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$LEX" && break
done
test -n "$LEX" || LEX=":"
if test -z "$LEXLIB"
then
echo "$as_me:2205: checking for yywrap in -lfl" >&5
echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
if test "${ac_cv_lib_fl_yywrap+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lfl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line 2213 "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 yywrap ();
int
main ()
{
yywrap ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:2232: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:2235: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:2238: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:2241: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_fl_yywrap=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_lib_fl_yywrap=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:2252: result: $ac_cv_lib_fl_yywrap" >&5
echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
if test $ac_cv_lib_fl_yywrap = yes; then
LEXLIB="-lfl"
else
echo "$as_me:2257: checking for yywrap in -ll" >&5
echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
if test "${ac_cv_lib_l_yywrap+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ll $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line 2265 "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 yywrap ();
int
main ()
{
yywrap ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:2284: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:2287: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:2290: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:2293: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_l_yywrap=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_lib_l_yywrap=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:2304: result: $ac_cv_lib_l_yywrap" >&5
echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
if test $ac_cv_lib_l_yywrap = yes; then
LEXLIB="-ll"
fi
fi
fi
if test "x$LEX" != "x:"; then
echo "$as_me:2315: checking lex output file root" >&5
echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
if test "${ac_cv_prog_lex_root+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# The minimal lex program is just a single line: %%. But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
echo '%%
%%' | $LEX
if test -f lex.yy.c; then
ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
ac_cv_prog_lex_root=lexyy
else
{ { echo "$as_me:2329: error: cannot find output from $LEX; giving up" >&5
echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
echo "$as_me:2334: result: $ac_cv_prog_lex_root" >&5
echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
echo "$as_me:2338: checking whether yytext is a pointer" >&5
echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations.
ac_cv_prog_lex_yytext_pointer=no
echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS=$LIBS
LIBS="$LIBS $LEXLIB"
cat >conftest.$ac_ext <<_ACEOF
`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:2354: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:2357: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:2360: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:2363: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_prog_lex_yytext_pointer=yes
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
LIBS=$ac_save_LIBS
rm -f "${LEX_OUTPUT_ROOT}.c"
fi
echo "$as_me:2375: result: $ac_cv_prog_lex_yytext_pointer" >&5
echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
if test $ac_cv_prog_lex_yytext_pointer = yes; then
cat >>confdefs.h <<\EOF
#define YYTEXT_POINTER 1
EOF
fi
fi
echo "$as_me:2386: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\EOF
all:
@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
echo "$as_me:2406: result: yes" >&5
echo "${ECHO_T}yes" >&6
SET_MAKE=
else
echo "$as_me:2410: result: no" >&5
echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
for ac_prog in 'bison -y' byacc
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:2419: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_YACC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$YACC"; then
ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog"
echo "$as_me:2434: found $ac_dir/$ac_word" >&5
break
done
fi
fi
YACC=$ac_cv_prog_YACC
if test -n "$YACC"; then
echo "$as_me:2442: result: $YACC" >&5
echo "${ECHO_T}$YACC" >&6
else
echo "$as_me:2445: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo "$as_me:2465: checking for a BSD compatible install" >&5
echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_save_IFS=$IFS; IFS=$ac_path_separator
for ac_dir in $PATH; do
IFS=$ac_save_IFS
# Account for people who put trailing slashes in PATH elements.
case $ac_dir/ in
/ | ./ | .// | /cC/* \
| /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
| /usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
if $as_executable_p "$ac_dir/$ac_prog"; then
if test $ac_prog = install &&
grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
break 2
fi
fi
done
;;
esac
done
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
INSTALL=$ac_install_sh
fi
fi
echo "$as_me:2514: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo "$as_me:2525: checking if filesystem supports mixed-case filenames" >&5
echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
if test "${cf_cv_mixedcase+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes ; then
case $target_alias in
(*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
cf_cv_mixedcase=no
;;
(*)
cf_cv_mixedcase=yes
;;
esac
else
rm -f conftest CONFTEST
echo test >conftest
if test -f CONFTEST ; then
cf_cv_mixedcase=no
else
cf_cv_mixedcase=yes
fi
rm -f conftest CONFTEST
fi
fi
echo "$as_me:2552: result: $cf_cv_mixedcase" >&5
echo "${ECHO_T}$cf_cv_mixedcase" >&6
test "$cf_cv_mixedcase" = yes &&
cat >>confdefs.h <<\EOF
#define MIXEDCASE_FILENAMES 1
EOF
for ac_prog in exctags ctags
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:2563: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CTAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CTAGS"; then
ac_cv_prog_CTAGS="$CTAGS" # 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_CTAGS="$ac_prog"
echo "$as_me:2578: found $ac_dir/$ac_word" >&5
break
done
fi
fi
CTAGS=$ac_cv_prog_CTAGS
if test -n "$CTAGS"; then
echo "$as_me:2586: result: $CTAGS" >&5
echo "${ECHO_T}$CTAGS" >&6
else
echo "$as_me:2589: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$CTAGS" && break
done
for ac_prog in exetags etags
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:2600: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ETAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$ETAGS"; then
ac_cv_prog_ETAGS="$ETAGS" # 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_ETAGS="$ac_prog"
echo "$as_me:2615: found $ac_dir/$ac_word" >&5
break
done
fi
fi
ETAGS=$ac_cv_prog_ETAGS
if test -n "$ETAGS"; then
echo "$as_me:2623: result: $ETAGS" >&5
echo "${ECHO_T}$ETAGS" >&6
else
echo "$as_me:2626: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$ETAGS" && break
done
# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
set dummy ${CTAGS:-ctags}; ac_word=$2
echo "$as_me:2635: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$MAKE_LOWER_TAGS"; then
ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # 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_MAKE_LOWER_TAGS="yes"
echo "$as_me:2650: found $ac_dir/$ac_word" >&5
break
done
test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
fi
fi
MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
if test -n "$MAKE_LOWER_TAGS"; then
echo "$as_me:2659: result: $MAKE_LOWER_TAGS" >&5
echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
else
echo "$as_me:2662: result: no" >&5
echo "${ECHO_T}no" >&6
fi
if test "$cf_cv_mixedcase" = yes ; then
# Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
set dummy ${ETAGS:-etags}; ac_word=$2
echo "$as_me:2669: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$MAKE_UPPER_TAGS"; then
ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # 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_MAKE_UPPER_TAGS="yes"
echo "$as_me:2684: found $ac_dir/$ac_word" >&5
break
done
test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
fi
fi
MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
if test -n "$MAKE_UPPER_TAGS"; then
echo "$as_me:2693: result: $MAKE_UPPER_TAGS" >&5
echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
else
echo "$as_me:2696: result: no" >&5
echo "${ECHO_T}no" >&6
fi
else
MAKE_UPPER_TAGS=no
fi
if test "$MAKE_UPPER_TAGS" = yes ; then
MAKE_UPPER_TAGS=
else
MAKE_UPPER_TAGS="#"
fi
if test "$MAKE_LOWER_TAGS" = yes ; then
MAKE_LOWER_TAGS=
else
MAKE_LOWER_TAGS="#"
fi
for ac_prog in tdlint lint alint splint lclint
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:2720: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_LINT+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$LINT"; then
ac_cv_prog_LINT="$LINT" # 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_LINT="$ac_prog"
echo "$as_me:2735: found $ac_dir/$ac_word" >&5
break
done
fi
fi
LINT=$ac_cv_prog_LINT
if test -n "$LINT"; then
echo "$as_me:2743: result: $LINT" >&5
echo "${ECHO_T}$LINT" >&6
else
echo "$as_me:2746: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$LINT" && break
done
cf_XOPEN_SOURCE=500
cf_POSIX_C_SOURCE=199506L
cf_xopen_source=
case $host_os in
(aix[4-7]*)
cf_xopen_source="-D_ALL_SOURCE"
;;
(cygwin|msys)
cf_XOPEN_SOURCE=600
;;
(darwin[0-8].*)
cf_xopen_source="-D_APPLE_C_SOURCE"
;;
(darwin*)
cf_xopen_source="-D_DARWIN_C_SOURCE"
cf_XOPEN_SOURCE=
;;
(freebsd*|dragonfly*)
# 5.x headers associate
# _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
# _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
cf_POSIX_C_SOURCE=200112L
cf_XOPEN_SOURCE=600
cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
;;
(hpux11*)
cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
;;
(hpux*)
cf_xopen_source="-D_HPUX_SOURCE"
;;
(irix[56].*)
cf_xopen_source="-D_SGI_SOURCE"
cf_XOPEN_SOURCE=
;;
(linux*|gnu*|mint*|k*bsd*-gnu)
echo "$as_me:2791: checking if we must define _GNU_SOURCE" >&5
echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
if test "${cf_cv_gnu_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line 2798 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifndef _XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:2813: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:2816: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:2819: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:2822: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_gnu_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
cat >conftest.$ac_ext <<_ACEOF
#line 2831 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifdef _XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:2846: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:2849: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:2852: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:2855: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_gnu_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_cv_gnu_source=yes
fi
rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:2870: result: $cf_cv_gnu_source" >&5
echo "${ECHO_T}$cf_cv_gnu_source" >&6
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
;;
(minix*)
cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
;;
(mirbsd*)
# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types
cf_XOPEN_SOURCE=
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
cf_save_CFLAGS="$CFLAGS"
cf_save_CPPFLAGS="$CPPFLAGS"
cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
echo "$as_me:2895: checking if we should define _POSIX_C_SOURCE" >&5
echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
if test "${cf_cv_posix_c_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
echo "${as_me:-configure}:2901: testing if the symbol is already defined go no further ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
#line 2904 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifndef _POSIX_C_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:2919: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:2922: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:2925: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:2928: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_posix_c_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_want_posix_source=no
case .$cf_POSIX_C_SOURCE in
(.[12]??*)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
;;
(.2)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
cf_want_posix_source=yes
;;
(.*)
cf_want_posix_source=yes
;;
esac
if test "$cf_want_posix_source" = yes ; then
cat >conftest.$ac_ext <<_ACEOF
#line 2949 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifdef _POSIX_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:2964: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:2967: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:2970: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:2973: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "${as_me:-configure}:2984: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
CFLAGS="$cf_trim_CFLAGS"
CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
echo "${as_me:-configure}:2989: testing if the second compile does not leave our definition intact error ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
#line 2992 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifndef _POSIX_C_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3007: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3010: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3013: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3016: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_cv_posix_c_source=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
CFLAGS="$cf_save_CFLAGS"
CPPFLAGS="$cf_save_CPPFLAGS"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:3032: result: $cf_cv_posix_c_source" >&5
echo "${ECHO_T}$cf_cv_posix_c_source" >&6
if test "$cf_cv_posix_c_source" != no ; then
CFLAGS="$cf_trim_CFLAGS"
CPPFLAGS="$cf_trim_CPPFLAGS"
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $cf_cv_posix_c_source
do
case $cf_fix_cppflags in
(no)
case $cf_add_cflags in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
(*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
(yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
fi
;;
(netbsd*)
cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
;;
(openbsd[4-9]*)
# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
cf_xopen_source="-D_BSD_SOURCE"
cf_XOPEN_SOURCE=600
;;
(openbsd*)
# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
;;
(osf[45]*)
cf_xopen_source="-D_OSF_SOURCE"
;;
(nto-qnx*)
cf_xopen_source="-D_QNX_SOURCE"
;;
(sco*)
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
(solaris2.*)
cf_xopen_source="-D__EXTENSIONS__"
cf_cv_xopen_source=broken
;;
(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
cf_XOPEN_SOURCE=
cf_POSIX_C_SOURCE=
;;
(*)
echo "$as_me:3150: checking if we should define _XOPEN_SOURCE" >&5
echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
if test "${cf_cv_xopen_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line 3157 "configure"
#include "confdefs.h"
#include
#include
#include
int
main ()
{
#ifndef _XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3176: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3179: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3182: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3185: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
cat >conftest.$ac_ext <<_ACEOF
#line 3194 "configure"
#include "confdefs.h"
#include
#include
#include
int
main ()
{
#ifdef _XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3213: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3216: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3219: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3222: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_cv_xopen_source=$cf_XOPEN_SOURCE
fi
rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:3237: result: $cf_cv_xopen_source" >&5
echo "${ECHO_T}$cf_cv_xopen_source" >&6
if test "$cf_cv_xopen_source" != no ; then
CFLAGS=`echo "$CFLAGS" | \
sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $cf_temp_xopen_source
do
case $cf_fix_cppflags in
(no)
case $cf_add_cflags in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
(*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
(yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
fi
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
cf_save_CFLAGS="$CFLAGS"
cf_save_CPPFLAGS="$CPPFLAGS"
cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
echo "$as_me:3345: checking if we should define _POSIX_C_SOURCE" >&5
echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
if test "${cf_cv_posix_c_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
echo "${as_me:-configure}:3351: testing if the symbol is already defined go no further ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
#line 3354 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifndef _POSIX_C_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3369: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3372: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3375: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3378: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_posix_c_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_want_posix_source=no
case .$cf_POSIX_C_SOURCE in
(.[12]??*)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
;;
(.2)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
cf_want_posix_source=yes
;;
(.*)
cf_want_posix_source=yes
;;
esac
if test "$cf_want_posix_source" = yes ; then
cat >conftest.$ac_ext <<_ACEOF
#line 3399 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifdef _POSIX_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3414: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3417: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3420: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3423: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "${as_me:-configure}:3434: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
CFLAGS="$cf_trim_CFLAGS"
CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
echo "${as_me:-configure}:3439: testing if the second compile does not leave our definition intact error ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
#line 3442 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifndef _POSIX_C_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3457: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3460: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3463: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3466: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_cv_posix_c_source=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
CFLAGS="$cf_save_CFLAGS"
CPPFLAGS="$cf_save_CPPFLAGS"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:3482: result: $cf_cv_posix_c_source" >&5
echo "${ECHO_T}$cf_cv_posix_c_source" >&6
if test "$cf_cv_posix_c_source" != no ; then
CFLAGS="$cf_trim_CFLAGS"
CPPFLAGS="$cf_trim_CPPFLAGS"
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $cf_cv_posix_c_source
do
case $cf_fix_cppflags in
(no)
case $cf_add_cflags in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
(*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
(yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
fi
;;
esac
if test -n "$cf_xopen_source" ; then
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $cf_xopen_source
do
case $cf_fix_cppflags in
(no)
case $cf_add_cflags in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
(*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
(yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
echo "${as_me:-configure}:3640: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
echo "${as_me:-configure}:3648: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
echo "${as_me:-configure}:3656: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
fi
if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
echo "$as_me:3664: checking if _XOPEN_SOURCE really is set" >&5
echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line 3667 "configure"
#include "confdefs.h"
#include
int
main ()
{
#ifndef _XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3682: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3685: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3688: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3691: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_XOPEN_SOURCE_set=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_XOPEN_SOURCE_set=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
echo "$as_me:3700: result: $cf_XOPEN_SOURCE_set" >&5
echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
if test $cf_XOPEN_SOURCE_set = yes
then
cat >conftest.$ac_ext <<_ACEOF
#line 3705 "configure"
#include "confdefs.h"
#include
int
main ()
{
#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3723: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3726: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3729: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_XOPEN_SOURCE_set_ok=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_XOPEN_SOURCE_set_ok=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
if test $cf_XOPEN_SOURCE_set_ok = no
then
{ echo "$as_me:3740: WARNING: _XOPEN_SOURCE is lower than requested" >&5
echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
fi
else
echo "$as_me:3745: checking if we should define _XOPEN_SOURCE" >&5
echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
if test "${cf_cv_xopen_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line 3752 "configure"
#include "confdefs.h"
#include
#include
#include
int
main ()
{
#ifndef _XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3771: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3774: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3777: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3780: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
cat >conftest.$ac_ext <<_ACEOF
#line 3789 "configure"
#include "confdefs.h"
#include
#include
#include
int
main ()
{
#ifdef _XOPEN_SOURCE
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:3808: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:3811: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:3814: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:3817: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_cv_xopen_source=$cf_XOPEN_SOURCE
fi
rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:3832: result: $cf_cv_xopen_source" >&5
echo "${ECHO_T}$cf_cv_xopen_source" >&6
if test "$cf_cv_xopen_source" != no ; then
CFLAGS=`echo "$CFLAGS" | \
sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $cf_temp_xopen_source
do
case $cf_fix_cppflags in
(no)
case $cf_add_cflags in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
(*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
(yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
fi
fi
fi
if ( test "$GCC" = yes || test "$GXX" = yes )
then
echo "$as_me:3932: checking if you want to check for gcc warnings" >&5
echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >&6
# Check whether --with-warnings or --without-warnings was given.
if test "${with_warnings+set}" = set; then
withval="$with_warnings"
cf_opt_with_warnings=$withval
else
cf_opt_with_warnings=no
fi;
echo "$as_me:3942: result: $cf_opt_with_warnings" >&5
echo "${ECHO_T}$cf_opt_with_warnings" >&6
if test "$cf_opt_with_warnings" != no ; then
if test "$GCC" = yes
then
cat > conftest.i <&5
echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
cat > conftest.$ac_ext <&5
case $cf_attribute in
(printf)
cf_printf_attribute=yes
cat >conftest.h <conftest.h <conftest.h <&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:4019: \$? = $ac_status" >&5
(exit $ac_status); }; then
test -n "$verbose" && echo "$as_me:4021: result: ... $cf_attribute" >&5
echo "${ECHO_T}... $cf_attribute" >&6
cat conftest.h >>confdefs.h
case $cf_attribute in
(noreturn)
cat >>confdefs.h <>confdefs.h <<\EOF
#define GCC_PRINTF 1
EOF
fi
cat >>confdefs.h <>confdefs.h <<\EOF
#define GCC_SCANF 1
EOF
fi
cat >>confdefs.h <>confdefs.h <>confdefs.h
fi
rm -rf conftest*
fi
INTEL_COMPILER=no
if test "$GCC" = yes ; then
case $host_os in
(linux*|gnu*)
echo "$as_me:4085: checking if this is really Intel C compiler" >&5
echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -no-gcc"
cat >conftest.$ac_ext <<_ACEOF
#line 4090 "configure"
#include "confdefs.h"
int
main ()
{
#ifdef __INTEL_COMPILER
#else
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:4107: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:4110: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:4113: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:4116: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
INTEL_COMPILER=yes
cf_save_CFLAGS="$cf_save_CFLAGS -we147"
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest.$ac_objext conftest.$ac_ext
CFLAGS="$cf_save_CFLAGS"
echo "$as_me:4127: result: $INTEL_COMPILER" >&5
echo "${ECHO_T}$INTEL_COMPILER" >&6
;;
esac
fi
CLANG_COMPILER=no
if test "$GCC" = yes ; then
echo "$as_me:4136: checking if this is really Clang C compiler" >&5
echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Qunused-arguments"
cat >conftest.$ac_ext <<_ACEOF
#line 4141 "configure"
#include "confdefs.h"
int
main ()
{
#ifdef __clang__
#else
make an error
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:4158: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:4161: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:4164: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:4167: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
CLANG_COMPILER=yes
cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest.$ac_objext conftest.$ac_ext
CFLAGS="$cf_save_CFLAGS"
echo "$as_me:4178: result: $CLANG_COMPILER" >&5
echo "${ECHO_T}$CLANG_COMPILER" >&6
fi
cat > conftest.$ac_ext <&5
echo "$as_me: checking for $CC warning options..." >&6;}
cf_save_CFLAGS="$CFLAGS"
EXTRA_CFLAGS="-Wall"
for cf_opt in \
wd1419 \
wd1683 \
wd1684 \
wd193 \
wd593 \
wd279 \
wd810 \
wd869 \
wd981
do
CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
if { (eval echo "$as_me:4216: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:4219: \$? = $ac_status" >&5
(exit $ac_status); }; then
test -n "$verbose" && echo "$as_me:4221: result: ... -$cf_opt" >&5
echo "${ECHO_T}... -$cf_opt" >&6
EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
fi
done
CFLAGS="$cf_save_CFLAGS"
elif test "$GCC" = yes
then
{ echo "$as_me:4230: checking for $CC warning options..." >&5
echo "$as_me: checking for $CC warning options..." >&6;}
cf_save_CFLAGS="$CFLAGS"
EXTRA_CFLAGS=
cf_warn_CONST=""
test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
for cf_opt in W Wall \
Wbad-function-cast \
Wcast-align \
Wcast-qual \
Wdeclaration-after-statement \
Wextra \
Winline \
Wmissing-declarations \
Wmissing-prototypes \
Wnested-externs \
Wpointer-arith \
Wshadow \
Wstrict-prototypes \
Wundef $cf_gcc_warnings $cf_warn_CONST
do
CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
if { (eval echo "$as_me:4254: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:4257: \$? = $ac_status" >&5
(exit $ac_status); }; then
test -n "$verbose" && echo "$as_me:4259: result: ... -$cf_opt" >&5
echo "${ECHO_T}... -$cf_opt" >&6
case $cf_opt in
(Wcast-qual)
CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
;;
(Winline)
case $GCC_VERSION in
([34].*)
test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
echo "${as_me:-configure}:4270: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
continue;;
esac
;;
(Wpointer-arith)
case $GCC_VERSION in
([12].*)
test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
echo "${as_me:-configure}:4280: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
continue;;
esac
;;
esac
EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
fi
done
CFLAGS="$cf_save_CFLAGS"
fi
rm -rf conftest*
fi
fi
echo "$as_me:4296: checking if you want to see long compiling messages" >&5
echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
# Check whether --enable-echo or --disable-echo was given.
if test "${enable_echo+set}" = set; then
enableval="$enable_echo"
test "$enableval" != no && enableval=yes
if test "$enableval" != "yes" ; then
ECHO_LT='--silent'
ECHO_LD='@echo linking $@;'
RULE_CC='@echo compiling $<'
SHOW_CC='@echo compiling $@'
ECHO_CC='@'
else
ECHO_LT=''
ECHO_LD=''
RULE_CC=''
SHOW_CC=''
ECHO_CC=''
fi
else
enableval=yes
ECHO_LT=''
ECHO_LD=''
RULE_CC=''
SHOW_CC=''
ECHO_CC=''
fi;
echo "$as_me:4330: result: $enableval" >&5
echo "${ECHO_T}$enableval" >&6
if test -n "$LINT" ; then
cf_have_lint=yes
else
cf_have_lint=no
fi
# Check whether --enable-llib or --disable-llib was given.
if test "${enable_llib+set}" = set; then
enableval="$enable_llib"
cf_enable_llib=$enableval
else
cf_enable_llib=$cf_have_lint
fi;
if test "$cf_enable_llib" = yes ; then
cat >>confdefs.h <<\EOF
#define OPT_LINTLIBRARY 1
EOF
fi
### extra things that we'll substitute in the makefile
echo "$as_me:4356: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
if test "${ac_cv_c_const+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line 4362 "configure"
#include "confdefs.h"
int
main ()
{
/* FIXME: Include the comments suggested by Paul. */
#ifndef __cplusplus
/* Ultrix mips cc rejects this. */
typedef int charset[2];
const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
const int *foo = &x[0];
++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
typedef const int *iptr;
iptr p = 0;
++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; };
struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
}
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:4420: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:4423: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:4426: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:4429: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_const=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_c_const=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:4439: result: $ac_cv_c_const" >&5
echo "${ECHO_T}$ac_cv_c_const" >&6
if test $ac_cv_c_const = no; then
cat >>confdefs.h <<\EOF
#define const
EOF
fi
echo "$as_me:4449: 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 4455 "configure"
#include "confdefs.h"
#include
#include
#include
#include
_ACEOF
if { (eval echo "$as_me:4463: \"$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:4469: \$? = $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 4491 "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 -rf 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 4509 "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 -rf 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 4530 "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))
$ac_main_return(2);
$ac_main_return (0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:4556: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:4559: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:4561: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:4564: \$? = $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:4577: 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
for ac_header in stdlib.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
echo "$as_me:4590: 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 4596 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:4600: \"$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:4606: \$? = $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:4625: 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 4644 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:4648: \"$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:4654: \$? = $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:4673: 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_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 4692 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below. */
#include